From 6be4b43a14e4ef29d3a5bf67ee5a8ea04ea167e2 Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Fri, 5 Aug 2022 09:24:14 +0100 Subject: [PATCH 1/8] Removing minor errors in code and javadoc Signed-off-by: Mandy Chessell --- .../KafkaOpenMetadataTopicConnector.java | 3 +- .../frameworks/auditlog/AuditLog.java | 6 +- .../connector/GlossaryExchangeService.java | 1 + .../InfrastructureIntegratorContext.java | 2 + .../auditlog/OMRSAuditLog.java | 82 +++++++++------- .../auditlog/OMRSAuditLogDestination.java | 7 +- .../auditlog/OMRSAuditLogRecordSeverity.java | 6 +- .../auditlog/OMRSAuditLogReportSeverity.java | 6 +- .../auditlog/OMRSAuditLogStoreReport.java | 1 + .../omrstopic/OMRSEventProcessingContext.java | 6 +- .../connectors/omrstopic/OMRSTopic.java | 8 +- .../omrstopic/OMRSTopicConnector.java | 12 +-- .../omrstopic/OMRSTopicListenerBase.java | 33 +++---- .../omrstopic/OMRSTopicListenerWrapper.java | 2 +- .../omrstopic/OMRSTopicProvider.java | 1 - .../OMRSTopicRepositoryEventListener.java | 2 - .../openmetadatatopic/IncomingEventState.java | 2 +- .../openmetadatatopic/OpenMetadataTopic.java | 2 +- .../OpenMetadataTopicConnector.java | 10 +- .../OpenMetadataTopicConsumerBase.java | 4 +- ...penMetadataTopicListenerConnectorBase.java | 2 +- .../OpenMetadataTopicSenderConnectorBase.java | 2 +- .../OpenMetadataArchiveBuilder.java | 2 +- .../OpenMetadataArchiveCache.java | 2 +- .../properties/OpenMetadataArchive.java | 2 +- .../OpenMetadataArchiveProperties.java | 1 + .../properties/OpenMetadataArchiveType.java | 6 +- .../OMRSAuditLogReportingComponent.java | 4 +- .../OMRSCohortRegistryStore.java | 4 +- .../properties/instances/Classification.java | 8 +- .../instances/ClassificationOrigin.java | 6 +- .../properties/instances/Differences.java | 11 +-- .../properties/instances/EntityDetail.java | 4 +- .../archiveutilities/OMRSArchiveBuilder.java | 71 +++++++------- .../archiveutilities/OMRSArchiveGUIDMap.java | 6 +- .../archiveutilities/OMRSArchiveHelper.java | 18 ++-- .../archiveutilities/OMRSArchiveWriter.java | 10 +- .../clients/AuditLogServicesClient.java | 30 +++--- .../MetadataCollectionServicesClient.java | 98 +++++++++---------- .../MetadataHighwayServicesClient.java | 12 +-- .../admin/OMRSConfigurationFactory.java | 2 +- .../admin/OMRSOperationalServices.java | 54 +++++----- .../archivemanager/OMRSArchiveManager.java | 1 + .../OMRSConnectionConsumer.java | 2 +- .../OMRSConnectorManager.java | 2 +- .../OMRSEnterpriseConnectorManager.java | 34 +++---- .../EnterpriseOMRSConnectorProvider.java | 18 ++-- .../EnterpriseOMRSRepositoryConnector.java | 14 +-- .../ClassificationAccumulator.java | 6 +- .../accumulators/EntitiesAccumulator.java | 12 +-- .../accumulators/EntityDetailAccumulator.java | 6 +- .../EntitySummaryAccumulator.java | 6 +- .../InstanceGraphAccumulator.java | 2 +- .../accumulators/QueryAccumulatorBase.java | 6 +- .../QueryInstanceAccumulatorBase.java | 2 +- .../RelationshipsAccumulator.java | 4 +- .../control/FederationControl.java | 2 +- .../control/FederationControlBase.java | 6 +- .../control/ParallelFederationControl.java | 3 +- .../control/SequentialFederationControl.java | 3 +- .../executors/AddEntityExecutor.java | 11 ++- .../executors/AddRelationshipExecutor.java | 13 +-- .../executors/ClassifyEntityExecutor.java | 21 ++-- .../FindEntitiesByClassificationExecutor.java | 10 +- .../FindEntitiesByPropertyExecutor.java | 6 +- .../FindEntitiesByPropertyValueExecutor.java | 4 +- .../executors/FindEntitiesExecutor.java | 6 +- .../FindRelationshipsByPropertyExecutor.java | 6 +- ...dRelationshipsByPropertyValueExecutor.java | 4 +- .../executors/FindRelationshipsExecutor.java | 6 +- .../executors/GetAllTypesExecutor.java | 2 +- .../executors/GetEntityDetailExecutor.java | 2 +- .../executors/GetEntityExecutor.java | 3 +- .../executors/GetEntitySummaryExecutor.java | 2 +- .../executors/GetRelationshipExecutor.java | 5 +- .../GetRelationshipsForEntityExecutor.java | 4 +- .../PageableRepositoryExecutorBase.java | 3 +- .../executors/PurgeEntityExecutor.java | 11 ++- .../executors/PurgeRelationshipExecutor.java | 11 ++- .../executors/RestoreEntityExecutor.java | 5 +- .../RestoreRelationshipExecutor.java | 5 +- .../VerifyAttributeTypeDefExecutor.java | 5 +- .../executors/VerifyTypeDefExecutor.java | 5 +- .../eventmanagement/OMRSEventListener.java | 15 +-- .../OMRSRegistryEventPublisher.java | 9 +- .../OMRSRepositoryEventBuilder.java | 8 +- .../OMRSRepositoryEventExchangeRule.java | 6 +- .../OMRSRepositoryEventManager.java | 40 ++++---- .../OMRSRepositoryEventPublisher.java | 7 +- .../localrepository/OMRSLocalRepository.java | 1 - .../LocalOMRSConnectorProvider.java | 12 +-- .../LocalOMRSInstanceEventProcessor.java | 23 ++--- .../LocalOMRSMetadataCollection.java | 79 +++++++-------- .../LocalOMRSRepositoryConnector.java | 17 ++-- .../OMRSInstanceRetrievalEventProcessor.java | 8 +- .../OMRSRepositoryContentValidator.java | 50 ++++------ .../metadatahighway/OMRSCohortManager.java | 4 +- .../OMRSMetadataHighwayManager.java | 18 ++-- .../cohortregistry/OMRSCohortRegistry.java | 26 ++--- .../rest/server/OMRSRESTExceptionHandler.java | 2 +- .../server/OMRSRepositoryRESTServices.java | 2 +- .../OMRSRepositoryServicesInstance.java | 12 +-- ...OMRSRepositoryServicesInstanceHandler.java | 4 +- 103 files changed, 572 insertions(+), 601 deletions(-) diff --git a/open-metadata-implementation/adapters/open-connectors/event-bus-connectors/open-metadata-topic-connectors/kafka-open-metadata-topic-connector/src/main/java/org/odpi/openmetadata/adapters/eventbus/topic/kafka/KafkaOpenMetadataTopicConnector.java b/open-metadata-implementation/adapters/open-connectors/event-bus-connectors/open-metadata-topic-connectors/kafka-open-metadata-topic-connector/src/main/java/org/odpi/openmetadata/adapters/eventbus/topic/kafka/KafkaOpenMetadataTopicConnector.java index 27696dbcac2..c3f1906faa8 100644 --- a/open-metadata-implementation/adapters/open-connectors/event-bus-connectors/open-metadata-topic-connectors/kafka-open-metadata-topic-connector/src/main/java/org/odpi/openmetadata/adapters/eventbus/topic/kafka/KafkaOpenMetadataTopicConnector.java +++ b/open-metadata-implementation/adapters/open-connectors/event-bus-connectors/open-metadata-topic-connectors/kafka-open-metadata-topic-connector/src/main/java/org/odpi/openmetadata/adapters/eventbus/topic/kafka/KafkaOpenMetadataTopicConnector.java @@ -242,7 +242,7 @@ private void initializeKafkaProperties(Map configurationPropert * * @throws RuntimeException which is handled in the calling code. */ - + @SuppressWarnings(value = "unchecked") private void copyProperties(Object propertiesObject, Properties target) { Map propertiesMap; @@ -256,6 +256,7 @@ private void copyProperties(Object propertiesObject, Properties target) } } + /** * Indicates that the connector is completely configured and can begin processing. * It creates two threads, one for sending (producer) and the other for receiving diff --git a/open-metadata-implementation/frameworks/audit-log-framework/src/main/java/org/odpi/openmetadata/frameworks/auditlog/AuditLog.java b/open-metadata-implementation/frameworks/audit-log-framework/src/main/java/org/odpi/openmetadata/frameworks/auditlog/AuditLog.java index ea5a9b23c3b..7d315a70df8 100644 --- a/open-metadata-implementation/frameworks/audit-log-framework/src/main/java/org/odpi/openmetadata/frameworks/auditlog/AuditLog.java +++ b/open-metadata-implementation/frameworks/audit-log-framework/src/main/java/org/odpi/openmetadata/frameworks/auditlog/AuditLog.java @@ -5,13 +5,11 @@ import org.odpi.openmetadata.frameworks.auditlog.messagesets.AuditLogMessageDefinition; import org.odpi.openmetadata.frameworks.auditlog.messagesets.AuditLogRecordSeverity; -import org.odpi.openmetadata.frameworks.auditlog.messagesets.MessageDefinition; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.PrintWriter; import java.io.StringWriter; -import java.text.MessageFormat; import java.util.*; /** @@ -22,8 +20,8 @@ public class AuditLog extends MessageFormatter { private static final Logger log = LoggerFactory.getLogger(AuditLog.class); - private AuditLogDestination destination; /* Initialized in the constructor */ - private AuditLogReportingComponent reportingComponent; /* Initialized in the constructor */ + private final AuditLogDestination destination; /* Initialized in the constructor */ + private final AuditLogReportingComponent reportingComponent; /* Initialized in the constructor */ protected List childAuditLogs = new ArrayList<>(); protected AuditLogActivity auditLogActivity = new AuditLogActivity(); diff --git a/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/GlossaryExchangeService.java b/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/GlossaryExchangeService.java index 05e3fc8b68c..c83f508d9cf 100644 --- a/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/GlossaryExchangeService.java +++ b/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/GlossaryExchangeService.java @@ -526,6 +526,7 @@ public GlossaryElement getGlossaryByGUID(String openMetadataGUID) throws Invalid /** * Create a new metadata element to represent a glossary category. * + * @param glossaryGUID unique identifier of anchor glossary * @param externalIdentifierProperties optional properties used to define an external identifier * @param glossaryCategoryProperties properties about the glossary category to store * diff --git a/open-metadata-implementation/integration-services/infrastructure-integrator/infrastructure-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/infrastructure/connector/InfrastructureIntegratorContext.java b/open-metadata-implementation/integration-services/infrastructure-integrator/infrastructure-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/infrastructure/connector/InfrastructureIntegratorContext.java index a475b0caa50..d6840e4d91d 100644 --- a/open-metadata-implementation/integration-services/infrastructure-integrator/infrastructure-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/infrastructure/connector/InfrastructureIntegratorContext.java +++ b/open-metadata-implementation/integration-services/infrastructure-integrator/infrastructure-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/infrastructure/connector/InfrastructureIntegratorContext.java @@ -2295,6 +2295,8 @@ public void clearDataFlow(String dataFlowGUID, * * @param dataSupplierGUID unique identifier of the data supplier * @param effectiveTime time when the hosting is effective + * @param startFrom paging start point + * @param pageSize maximum results that can be returned * * @return unique identifier and properties of the relationship * diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/auditlog/OMRSAuditLog.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/auditlog/OMRSAuditLog.java index d847b3d5517..4b215bcfc13 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/auditlog/OMRSAuditLog.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/auditlog/OMRSAuditLog.java @@ -34,8 +34,8 @@ */ public class OMRSAuditLog extends AuditLog { - private OMRSAuditLogDestination omrsDestination; /* Initialized in the constructor */ - private OMRSAuditLogReportingComponent omrsReportingComponent; /* Initialized in the constructor */ + private final OMRSAuditLogDestination omrsDestination; /* Initialized in the constructor */ + private final OMRSAuditLogReportingComponent omrsReportingComponent; /* Initialized in the constructor */ /** @@ -186,7 +186,7 @@ public void logException(String actionDescription, String additionalInformation, String systemAction, String userAction, - Throwable caughtException) + Exception caughtException) { this.storeLogRecord(actionDescription, logMessageId, @@ -218,59 +218,67 @@ private void storeLogRecord(String actionDescription, String additionalInformation, String systemAction, String userAction, - Throwable caughtException) + Exception caughtException) { - OMRSAuditLogRecord logRecord = new OMRSAuditLogRecord(); - - logRecord.setGUID(UUID.randomUUID().toString()); - logRecord.setTimeStamp(new Date()); + if (severity != null) + { + super.auditLogActivity.countRecord(severity.getOrdinal(), severity.getName()); + } if (omrsDestination != null) { + OMRSAuditLogRecord logRecord = new OMRSAuditLogRecord(); + + logRecord.setGUID(UUID.randomUUID().toString()); + logRecord.setTimeStamp(new Date()); + logRecord.setOriginatorProperties(omrsDestination.getOriginatorProperties()); logRecord.setOriginator(omrsDestination.getOriginator()); - } - logRecord.setOriginatorComponent(new AuditLogReportingComponent(omrsReportingComponent)); - logRecord.setReportingComponent(omrsReportingComponent); + logRecord.setOriginatorComponent(new AuditLogReportingComponent(omrsReportingComponent)); + logRecord.setReportingComponent(omrsReportingComponent); - logRecord.setActionDescription(actionDescription); - logRecord.setThreadId(Thread.currentThread().getId()); - logRecord.setThreadName(Thread.currentThread().getName()); + logRecord.setActionDescription(actionDescription); + logRecord.setThreadId(Thread.currentThread().getId()); + logRecord.setThreadName(Thread.currentThread().getName()); - logRecord.setSeverityCode(severity.getOrdinal()); - logRecord.setSeverity(severity.getName()); - super.auditLogActivity.countRecord(severity.getOrdinal(), severity.getName()); + if (severity != null) + { + logRecord.setSeverityCode(severity.getOrdinal()); + logRecord.setSeverity(severity.getName()); + } - logRecord.setMessageId(logMessageId); - logRecord.setMessageText(logMessage); - logRecord.setSystemAction(systemAction); - logRecord.setUserAction(userAction); + logRecord.setMessageId(logMessageId); + logRecord.setMessageText(logMessage); + logRecord.setSystemAction(systemAction); + logRecord.setUserAction(userAction); - List additionalInformationArray = null; + List additionalInformationArray = null; - if (additionalInformation != null) - { - additionalInformationArray = new ArrayList<>(); - additionalInformationArray.add(additionalInformation); - } + if (additionalInformation != null) + { + additionalInformationArray = new ArrayList<>(); + additionalInformationArray.add(additionalInformation); + } - logRecord.setAdditionalInformation(additionalInformationArray); + logRecord.setAdditionalInformation(additionalInformationArray); - if (caughtException != null) - { - logRecord.setExceptionClassName(caughtException.getClass().getName()); - logRecord.setExceptionMessage(caughtException.getMessage()); + if (caughtException != null) + { + logRecord.setExceptionClassName(caughtException.getClass().getName()); + logRecord.setExceptionMessage(caughtException.getMessage()); - StringWriter stackTrace = new StringWriter(); - caughtException.printStackTrace(new PrintWriter(stackTrace)); + StringWriter stackTrace = new StringWriter(); + caughtException.printStackTrace(new PrintWriter(stackTrace)); - logRecord.setExceptionStackTrace(stackTrace.toString()); - } + logRecord.setExceptionStackTrace(stackTrace.toString()); + } - omrsDestination.addLogRecord(logRecord); + omrsDestination.addLogRecord(logRecord); + } } + /** * Return a full report for the OMRS Audit log. * diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/auditlog/OMRSAuditLogDestination.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/auditlog/OMRSAuditLogDestination.java index cb6f13bffc6..3856318a995 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/auditlog/OMRSAuditLogDestination.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/auditlog/OMRSAuditLogDestination.java @@ -7,13 +7,10 @@ import org.odpi.openmetadata.frameworks.auditlog.AuditLogRecord; import org.odpi.openmetadata.repositoryservices.connectors.stores.auditlogstore.OMRSAuditLogRecord; import org.odpi.openmetadata.repositoryservices.connectors.stores.auditlogstore.OMRSAuditLogRecordOriginator; -import org.odpi.openmetadata.repositoryservices.connectors.stores.auditlogstore.OMRSAuditLogReportingComponent; import org.odpi.openmetadata.repositoryservices.connectors.stores.auditlogstore.OMRSAuditLogStore; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.PrintWriter; -import java.io.StringWriter; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -31,7 +28,7 @@ public class OMRSAuditLogDestination extends AuditLogDestination /** - * Initialize the static values used in all log records. These values help to pin-point the source of messages + * Initialize the static values used in all log records. These values help to pinpoint the source of messages * when audit log records from many servers are consolidated into centralized operational tooling. * * @param localServerName name of the local server @@ -72,7 +69,7 @@ public OMRSAuditLogDestination(String localServerName, /** - * Set up the local metadata collection Id. This is null if there is no local repository. + * Set up the local metadata collection id. This is null if there is no local repository. * * @param localMetadataCollectionId String unique identifier for the metadata collection */ diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/auditlog/OMRSAuditLogRecordSeverity.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/auditlog/OMRSAuditLogRecordSeverity.java index ecad74220c5..0cfde1cfa7c 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/auditlog/OMRSAuditLogRecordSeverity.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/auditlog/OMRSAuditLogRecordSeverity.java @@ -37,9 +37,9 @@ public enum OMRSAuditLogRecordSeverity implements AuditLogRecordSeverity ; - private int severityCode; - private String severityName; - private String severityDescription; + private final int severityCode; + private final String severityName; + private final String severityDescription; /** diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/auditlog/OMRSAuditLogReportSeverity.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/auditlog/OMRSAuditLogReportSeverity.java index d893e77b502..ec2bb0b22c6 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/auditlog/OMRSAuditLogReportSeverity.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/auditlog/OMRSAuditLogReportSeverity.java @@ -65,7 +65,7 @@ public int getOrdinal() /** - * Set up he numerical code for this enum. + * Set up the numerical code for this enum. * * @param ordinal identifier */ @@ -99,7 +99,7 @@ public void setName(String name) /** * Return the short description of the component. This is an English description. Natural language support for - * these values can be added to UIs using a resource bundle indexed with the component Id. This value is + * these values can be added to UIs using a resource bundle indexed with the component id. This value is * provided as a default if the resource bundle is not available. * * @return String description @@ -112,7 +112,7 @@ public String getDescription() /** * Set up the short description of the component. This is an English description. Natural language support for - * these values can be added to UIs using a resource bundle indexed with the component Id. This value is + * these values can be added to UIs using a resource bundle indexed with the component id. This value is * provided as a default if the resource bundle is not available. * * @param description String description diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/auditlog/OMRSAuditLogStoreReport.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/auditlog/OMRSAuditLogStoreReport.java index 91fd5135461..d7217129dc4 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/auditlog/OMRSAuditLogStoreReport.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/auditlog/OMRSAuditLogStoreReport.java @@ -49,6 +49,7 @@ public OMRSAuditLogStoreReport(OMRSAuditLogStoreReport template) { destinationName = template.getDestinationName(); supportedSeverities = template.getSupportedSeverities(); + implementationClass = template.getImplementationClass(); } } diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/omrstopic/OMRSEventProcessingContext.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/omrstopic/OMRSEventProcessingContext.java index d0cf5d66daa..f883cfe5851 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/omrstopic/OMRSEventProcessingContext.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/omrstopic/OMRSEventProcessingContext.java @@ -15,8 +15,8 @@ * directly by consumer implementations. * */ -public class OMRSEventProcessingContext { - +public class OMRSEventProcessingContext +{ /** * Registers a {@link Future} so that Egeria can keep track of asynchronous message * processing being done by consumers. Egeria will not mark a message as processed @@ -50,7 +50,7 @@ public static void addAsyncProcessingResult(OMRSFuture future) * the underlying messaging system. If a message is being reprocessed (eg due * to a server restart before the message was fully processed), the identifier * will be the same. The identifier should be different if content happens - * to be the same as the content of another message but they are actually different + * to be the same as the content of another message, but they are actually different * messages. * * @return the current message id diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/omrstopic/OMRSTopic.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/omrstopic/OMRSTopic.java index 4eb44283149..70caa1d823f 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/omrstopic/OMRSTopic.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/omrstopic/OMRSTopic.java @@ -15,7 +15,7 @@ public interface OMRSTopic { /** - * Setup the version of the protocol to use for events. + * Set up the version of the protocol to use for events. * * @param eventProtocolVersion version enum */ @@ -23,7 +23,7 @@ public interface OMRSTopic /** - * Register a listener object. This object will be supplied with all of the events + * Register a listener object. This object will be supplied with all the events * received on the topic. * * @param newListener object implementing the OMRSTopicListener interface @@ -33,7 +33,7 @@ public interface OMRSTopic /** - * Register a listener object. This object will be supplied with all of the events + * Register a listener object. This object will be supplied with all the events * received on the topic. * * @param newListener object implementing the OMRSTopicListener interface @@ -45,7 +45,7 @@ void registerListener(OMRSTopicListener newListener, /** - * Register a listener object. This object will be supplied with all of the events + * Register a listener object. This object will be supplied with all the events * received on the topic. * * @param newListener object implementing the OMRSTopicRepositoryEventListener interface diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/omrstopic/OMRSTopicConnector.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/omrstopic/OMRSTopicConnector.java index 42e15dd6585..997f6e94f28 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/omrstopic/OMRSTopicConnector.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/omrstopic/OMRSTopicConnector.java @@ -64,8 +64,8 @@ public class OMRSTopicConnector extends ConnectorBase implements OMRSTopic, private List embeddedConnectors = null; - private List internalTopicListeners = new ArrayList<>(); - private List eventBusConnectors = new ArrayList<>(); + private final List internalTopicListeners = new ArrayList<>(); + private final List eventBusConnectors = new ArrayList<>(); private String connectionName = OMRSAuditingComponent.OMRS_TOPIC_CONNECTOR.getComponentName(); private String topicName = ""; @@ -127,7 +127,7 @@ public ComponentDescription getConnectorComponentDescription() /** - * Setup the version of the protocol to use for events. + * Set up the version of the protocol to use for events. * * @param eventProtocolVersion version enum */ @@ -142,7 +142,7 @@ public void setEventProtocolLevel(OMRSEventProtocolVersion eventProtocolVersion) /** - * Register an OMRSTopicListener object. This object will be supplied with all of the OMRS events + * Register an OMRSTopicListener object. This object will be supplied with all the OMRS events * received on the topic. * * @param topicListener object implementing the OMRSTopicListener interface @@ -167,7 +167,7 @@ public void registerListener(OMRSTopicListener topicListener) /** - * Register a listener object. This object will be supplied with all of the events + * Register a listener object. This object will be supplied with all the events * received on the topic. * * @param topicListener object implementing the OMRSTopicListener interface @@ -195,7 +195,7 @@ public void registerListener(OMRSTopicListener topicListener, /** - * Register a listener object. This object will be supplied with all of the events + * Register a listener object. This object will be supplied with all the events * received on the topic. * * @param topicListener object implementing the OMRSTopicRepositoryEventListener interface diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/omrstopic/OMRSTopicListenerBase.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/omrstopic/OMRSTopicListenerBase.java index ffc8f4f32e2..f5f9cadd85c 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/omrstopic/OMRSTopicListenerBase.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/omrstopic/OMRSTopicListenerBase.java @@ -15,7 +15,7 @@ import java.util.List; /** - * OMRSTopicListenerBase provides a base class for a topic listener so it only needs to + * OMRSTopicListenerBase provides a base class for a topic listener, so it only needs to * override the methods for the events it cares about. */ public class OMRSTopicListenerBase implements OMRSTopicListener @@ -274,13 +274,13 @@ public void processRegistryEvent(OMRSRegistryEvent registryEvent) /* * New type of registry event that this server does not understand ignore it */ - log.debug("Unknown registry event: " + registryEvent.toString()); + log.debug("Unknown registry event: " + registryEvent); break; } } else { - log.debug("Ignored registry event: " + registryEvent.toString()); + log.debug("Ignored registry event: " + registryEvent); } } } @@ -966,7 +966,7 @@ protected void processUnRegistrationEvent(String sourceName, /** * There is more than one member of the open metadata repository cohort that is using the same metadata - * collection Id. This means that their metadata instances can be updated in more than one server and their + * collection id. This means that their metadata instances can be updated in more than one server and there * is a potential for data integrity issues. * * @param sourceName name of the source of the event. It may be the cohort name for incoming events or the @@ -1003,7 +1003,7 @@ protected void processConflictingCollectionIdEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param targetMetadataCollectionId Id for the repository with the bad remote connection. + * @param targetMetadataCollectionId id for the repository with the bad remote connection. * @param remoteConnection the Connection properties for the connector used to call the registering server. * @param errorMessage details of the error that occurs when the connection is used. */ @@ -1388,10 +1388,9 @@ public void processUndoneEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity with the new classification added. No guarantee this is all of the classifications. + * @param entity details of the entity with the new classification added. No guarantee this is all the classifications. * @param classification new classification */ - @SuppressWarnings(value = "deprecation") public void processClassifiedEntityEvent(String sourceName, String originatorMetadataCollectionId, String originatorServerName, @@ -1424,7 +1423,7 @@ public void processClassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity with the new classification added. No guarantee this is all of the classifications. + * @param entity details of the entity with the new classification added. No guarantee this is all the classifications. * @param classification new classification */ @SuppressWarnings(value = "unused") @@ -1475,10 +1474,9 @@ public void processClassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity after the classification has been removed. No guarantee this is all of the classifications. + * @param entity details of the entity after the classification has been removed. No guarantee this is all the classifications. * @param originalClassification classification that was removed */ - @SuppressWarnings(value = {"deprecation", "unused"}) public void processDeclassifiedEntityEvent(String sourceName, String originatorMetadataCollectionId, String originatorServerName, @@ -1511,7 +1509,7 @@ public void processDeclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity after the classification has been removed. No guarantee this is all of the classifications. + * @param entity details of the entity after the classification has been removed. No guarantee this is all the classifications. * @param originalClassification classification that was removed */ @SuppressWarnings(value = "unused") @@ -1562,11 +1560,10 @@ public void processDeclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity after the classification has been changed. No guarantee this is all of the classifications. + * @param entity details of the entity after the classification has been changed. No guarantee this is all the classifications. * @param originalClassification classification that was removed * @param classification new classification */ - @SuppressWarnings(value = "deprecation") public void processReclassifiedEntityEvent(String sourceName, String originatorMetadataCollectionId, String originatorServerName, @@ -1600,7 +1597,7 @@ public void processReclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity after the classification has been changed. No guarantee this is all of the classifications. + * @param entity details of the entity after the classification has been changed. No guarantee this is all the classifications. * @param originalClassification classification that was removed * @param classification new classification */ @@ -1644,7 +1641,7 @@ public void processReclassifiedEntityEvent(String sourceName, /** - * An existing entity has been deleted. This is a soft delete. This means it is still in the repository + * An existing entity has been deleted. This is a soft delete. This means it is still in the repository, * but it is no longer returned on queries. *

* All relationships to the entity are also soft-deleted and will no longer be usable. These deleted relationships @@ -1782,7 +1779,7 @@ public void processReIdentifiedEntityEvent(String sourceName, /** - * An existing entity has had its type changed. Typically this action is taken to move an entity's + * An existing entity has had its type changed. Typically, this action is taken to move an entity's * type to either a super type (so the subtype can be deleted) or a new subtype (so additional properties can be * added.) However, the type can be changed to any compatible type. * @@ -1962,7 +1959,7 @@ public void processUndoneRelationshipEvent(String sourceName, /** - * An existing relationship has been deleted. This is a soft delete. This means it is still in the repository + * An existing relationship has been deleted. This is a soft delete. This means it is still in the repository, * but it is no longer returned on queries. *

* Details of the TypeDef are included with the relationship's unique id (guid) to ensure the right @@ -2093,7 +2090,7 @@ public void processReIdentifiedRelationshipEvent(String sourceName, /** - * An existing relationship has had its type changed. Typically this action is taken to move a relationship's + * An existing relationship has had its type changed. Typically, this action is taken to move a relationship's * type to either a super type (so the subtype can be deleted) or a new subtype (so additional properties can be * added.) However, the type can be changed to any compatible type. * diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/omrstopic/OMRSTopicListenerWrapper.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/omrstopic/OMRSTopicListenerWrapper.java index 3d1e86f853a..9eed1335b17 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/omrstopic/OMRSTopicListenerWrapper.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/omrstopic/OMRSTopicListenerWrapper.java @@ -23,7 +23,7 @@ public class OMRSTopicListenerWrapper implements OMRSTopicListener private OMRSTopicListener fullListener; private OMRSTopicRepositoryEventListener repositoryListener; - private AuditLog auditLog; + private final AuditLog auditLog; private String serviceName = ""; diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/omrstopic/OMRSTopicProvider.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/omrstopic/OMRSTopicProvider.java index 3f2760193f5..d50f8c1c44a 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/omrstopic/OMRSTopicProvider.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/omrstopic/OMRSTopicProvider.java @@ -21,6 +21,5 @@ public OMRSTopicProvider() super.setConnectorClassName(connectorClass.getName()); super.setConnectorComponentDescription(OMRSAuditingComponent.OMRS_TOPIC_CONNECTOR); - } } diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/omrstopic/OMRSTopicRepositoryEventListener.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/omrstopic/OMRSTopicRepositoryEventListener.java index 481743c1359..1757b1f23cb 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/omrstopic/OMRSTopicRepositoryEventListener.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/omrstopic/OMRSTopicRepositoryEventListener.java @@ -2,9 +2,7 @@ /* Copyright Contributors to the ODPi Egeria project. */ package org.odpi.openmetadata.repositoryservices.connectors.omrstopic; - import org.odpi.openmetadata.repositoryservices.events.OMRSInstanceEvent; -import org.odpi.openmetadata.repositoryservices.events.OMRSRegistryEvent; import org.odpi.openmetadata.repositoryservices.events.OMRSTypeDefEvent; /** diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/openmetadatatopic/IncomingEventState.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/openmetadatatopic/IncomingEventState.java index 80f6949b240..99078809fdd 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/openmetadatatopic/IncomingEventState.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/openmetadatatopic/IncomingEventState.java @@ -15,5 +15,5 @@ public enum IncomingEventState /** * The event has been distributed to all topic listeners. */ - DISTRIBUTED_TO_ALL_TOPIC_LISTENERS; + DISTRIBUTED_TO_ALL_TOPIC_LISTENERS } \ No newline at end of file diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/openmetadatatopic/OpenMetadataTopic.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/openmetadatatopic/OpenMetadataTopic.java index 3076372af80..52c404cf2ca 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/openmetadatatopic/OpenMetadataTopic.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/openmetadatatopic/OpenMetadataTopic.java @@ -13,7 +13,7 @@ public interface OpenMetadataTopic { /** - * Register a listener object. This object will be supplied with all of the events + * Register a listener object. This object will be supplied with all the events * received on the topic. * * @param newListener object implementing the listener interface diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/openmetadatatopic/OpenMetadataTopicConnector.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/openmetadatatopic/OpenMetadataTopicConnector.java index 927eb65bd0d..2feabe0422d 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/openmetadatatopic/OpenMetadataTopicConnector.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/openmetadatatopic/OpenMetadataTopicConnector.java @@ -47,10 +47,10 @@ public abstract class OpenMetadataTopicConnector extends ConnectorBase implement private volatile boolean keepRunning = false; - private List topicListeners = new ArrayList<>(); - private String listenerThreadName = defaultThreadName; - private String topicName = defaultTopicName; - private int sleepTime = 100; + private final List topicListeners = new ArrayList<>(); + private String listenerThreadName = defaultThreadName; + private String topicName = defaultTopicName; + private int sleepTime = 100; protected AuditLog auditLog = null; @@ -218,7 +218,7 @@ protected List checkForEvents() /** - * Register a listener object. This object will be supplied with all of the events received on the topic. + * Register a listener object. This object will be supplied with all the events received on the topic. * * @param topicListener object implementing the OMRSTopicListener interface * @return topic name diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/openmetadatatopic/OpenMetadataTopicConsumerBase.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/openmetadatatopic/OpenMetadataTopicConsumerBase.java index 1c6ef6dea96..4a6b97b1385 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/openmetadatatopic/OpenMetadataTopicConsumerBase.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/openmetadatatopic/OpenMetadataTopicConsumerBase.java @@ -51,7 +51,7 @@ public void initializeEmbeddedConnectors(List embeddedConnectors) OpenMetadataTopicConnector eventBusConnector = (OpenMetadataTopicConnector)embeddedConnector; /* - * Save the event bus connector so it can be started and disconnected when appropriate. + * Save the event bus connector, so it can be started and disconnected when appropriate. */ eventBusConnectors.add(eventBusConnector); } @@ -157,7 +157,7 @@ public void disconnect() throws ConnectorCheckedException super.disconnect(); /* - * Each of the event bus connectors need to be disconnected so they stop receiving inbound events. + * Each of the event bus connectors need to be disconnected, so they stop receiving inbound events. */ for (OpenMetadataTopicConnector eventBusConnector : eventBusConnectors) { diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/openmetadatatopic/OpenMetadataTopicListenerConnectorBase.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/openmetadatatopic/OpenMetadataTopicListenerConnectorBase.java index e83cd1b5b16..2215e58baa4 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/openmetadatatopic/OpenMetadataTopicListenerConnectorBase.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/openmetadatatopic/OpenMetadataTopicListenerConnectorBase.java @@ -88,7 +88,7 @@ public void disconnect() throws ConnectorCheckedException super.disconnect(); /* - * Each of the event bus connectors need to be disconnected so they stop receiving inbound events. + * Each of the event bus connectors need to be disconnected, so they stop receiving inbound events. */ for (OpenMetadataTopicConnector eventBusConnector : eventBusConnectors) { diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/openmetadatatopic/OpenMetadataTopicSenderConnectorBase.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/openmetadatatopic/OpenMetadataTopicSenderConnectorBase.java index b0285176af0..2ad62d9c4a2 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/openmetadatatopic/OpenMetadataTopicSenderConnectorBase.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/openmetadatatopic/OpenMetadataTopicSenderConnectorBase.java @@ -18,7 +18,7 @@ public class OpenMetadataTopicSenderConnectorBase extends OpenMetadataTopicConsu * * @param event event as a string * @throws InvalidParameterException the event is null - * @throws ConnectorCheckedException there is a problem with the embedded event bus connector(s)./ + * @throws ConnectorCheckedException there is a problem with the embedded event bus connector(s). */ protected void sendEvent(String event) throws InvalidParameterException, ConnectorCheckedException diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/archivestore/OpenMetadataArchiveBuilder.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/archivestore/OpenMetadataArchiveBuilder.java index 66a2ab138c2..248112c3ac2 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/archivestore/OpenMetadataArchiveBuilder.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/archivestore/OpenMetadataArchiveBuilder.java @@ -24,7 +24,7 @@ * OpenMetadataArchiveBuilder defines the interface for an open metadata archive store connector that is able * to manage individual elements of the open metadata archive. It is an optional interface for an open metadata * archive store connector. For connectors where this interface is not implemented, the OMRS provides - * the OMRSArchiveBuilder utility that manages the content of an archive in memory so it can be passed + * the OMRSArchiveBuilder utility that manages the content of an archive in memory, so it can be passed * to the open metadata archive store connector as a single structure */ public interface OpenMetadataArchiveBuilder diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/archivestore/OpenMetadataArchiveCache.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/archivestore/OpenMetadataArchiveCache.java index 9c1f29af1de..c644f599f10 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/archivestore/OpenMetadataArchiveCache.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/archivestore/OpenMetadataArchiveCache.java @@ -29,7 +29,7 @@ public interface OpenMetadataArchiveCache /** * Once the content of the archive has been added to the archive builder, an archive object can be retrieved. * - * @return open metadata archive object with all of the supplied content in it. + * @return open metadata archive object with all the supplied content in it. */ OpenMetadataArchive getOpenMetadataArchive(); } diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/archivestore/properties/OpenMetadataArchive.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/archivestore/properties/OpenMetadataArchive.java index 1f445e14840..701a5a05830 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/archivestore/properties/OpenMetadataArchive.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/archivestore/properties/OpenMetadataArchive.java @@ -12,7 +12,7 @@ import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; /** - * OpenMetadataArchive defines the structure of the properties inside of an open metadata archive. + * OpenMetadataArchive defines the structure of the properties in an open metadata archive. * There are 3 sections: *

    *
  • diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/archivestore/properties/OpenMetadataArchiveProperties.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/archivestore/properties/OpenMetadataArchiveProperties.java index a026c8a5dc8..2d523556f2f 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/archivestore/properties/OpenMetadataArchiveProperties.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/archivestore/properties/OpenMetadataArchiveProperties.java @@ -100,6 +100,7 @@ public OpenMetadataArchiveProperties(OpenMetadataArchiveProperties template) archiveName = template.getArchiveName(); archiveDescription = template.getArchiveDescription(); archiveType = template.getArchiveType(); + archiveVersion = template.getArchiveVersion(); originatorName = template.getOriginatorName(); originatorOrganization = template.getOriginatorOrganization(); originatorLicense = template.getOriginatorLicense(); diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/archivestore/properties/OpenMetadataArchiveType.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/archivestore/properties/OpenMetadataArchiveType.java index 3dbc0a6d847..2fed9e1a468 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/archivestore/properties/OpenMetadataArchiveType.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/archivestore/properties/OpenMetadataArchiveType.java @@ -30,9 +30,9 @@ public enum OpenMetadataArchiveType implements Serializable private static final long serialVersionUID = 1L; - private int archiveTypeCode; - private String archiveTypeName; - private String archiveTypeDescription; + private final int archiveTypeCode; + private final String archiveTypeName; + private final String archiveTypeDescription; /** diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/auditlogstore/OMRSAuditLogReportingComponent.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/auditlogstore/OMRSAuditLogReportingComponent.java index bab708b9804..80ebfe6d2d1 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/auditlogstore/OMRSAuditLogReportingComponent.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/auditlogstore/OMRSAuditLogReportingComponent.java @@ -109,7 +109,7 @@ public String getComponentName() /** * Return the short description of the component. This is an English description. Natural language support for - * these values can be added to UIs using a resource bundle indexed with the component Id. This value is + * these values can be added to UIs using a resource bundle indexed with the component id. This value is * provided as a default if the resource bundle is not available. * * @return String description @@ -121,7 +121,7 @@ public String getComponentType() /** - * URL link to the wiki page that describes this component. This provides more information to the log reader + * URL to the wiki page that describes this component. This provides more information to the log reader * on the operation of the component. * * @return String URL diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/cohortregistrystore/OMRSCohortRegistryStore.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/cohortregistrystore/OMRSCohortRegistryStore.java index 8c9500382f9..29b1b9a6162 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/cohortregistrystore/OMRSCohortRegistryStore.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/cohortregistrystore/OMRSCohortRegistryStore.java @@ -60,7 +60,7 @@ public interface OMRSCohortRegistryStore /** - * Return a list of all of the remote metadata repositories registered in the metadata repository cohort. + * Return a list of all the remote metadata repositories registered in the metadata repository cohort. * * @return List of member registrations for remote servers/repositories */ @@ -69,7 +69,7 @@ public interface OMRSCohortRegistryStore /** * Return the registration information for a specific metadata repository, identified by its repository's - * metadata collection Id. If the metadata collection Id is not recognized then null is returned. + * metadata collection id. If the metadata collection id is not recognized then null is returned. * * @param metadataCollectionId unique identifier for the repository's metadata collection. * @return MemberRegistration object containing details of the remote metadata repository. diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/instances/Classification.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/instances/Classification.java index 6f35da8c9ce..65ff874ec55 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/instances/Classification.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/instances/Classification.java @@ -41,7 +41,7 @@ private String validateName(String name) { /* * Throw an exception if the classification's name is null because that does not make sense. - * The constructors do not catch this exception so it is received by the creator of the classification + * The constructors do not catch this exception, so it is received by the creator of the classification * object. */ if (name == null || name.equals("")) @@ -49,7 +49,7 @@ private String validateName(String name) final String methodName = "validateName"; /* - * Build and throw exception. This should not happen and it is likely to be a problem in the + * Build and throw exception. This should not happen, and it is likely to be a problem in the * repository connector. */ throw new OMRSRuntimeException(OMRSErrorCode.NULL_CLASSIFICATION_PROPERTY_NAME.getMessageDefinition(), @@ -191,7 +191,7 @@ public void setClassificationOrigin(ClassificationOrigin classificationOrigin) /** - * Return the guid of the entity where a propagate classification came from. + * Return the guid of the entity where the propagated classification came from. * * @return unique identifier of the classification's origin */ @@ -202,7 +202,7 @@ public String getClassificationOriginGUID() /** - * Set up the guid of the entity where a propagate classification came from. + * Set up the guid of the entity where the propagated classification came from. * * @param classificationOriginGUID unique identifier of the classification's origin */ diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/instances/ClassificationOrigin.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/instances/ClassificationOrigin.java index 4641cd4023f..03d3ee49427 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/instances/ClassificationOrigin.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/instances/ClassificationOrigin.java @@ -31,9 +31,9 @@ public enum ClassificationOrigin implements Serializable private static final long serialVersionUID = 1L; - private int ordinal; - private String name; - private String description; + private final int ordinal; + private final String name; + private final String description; /** diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/instances/Differences.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/instances/Differences.java index e2d932bf090..b057b2d2da8 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/instances/Differences.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/instances/Differences.java @@ -175,7 +175,7 @@ else if (left.equals(right)) } else { - // Otherwise they are both non-null, and they are not equal + // Otherwise, they are both non-null, and they are not equal addDiffering(name, new ValuePair(left, right)); } } @@ -221,11 +221,10 @@ protected void addDiffering(String name, ValuePair valuePair) differing.put(name, valuePair); } - class ValuePair + static class ValuePair { - - private Object left; - private Object right; + private final Object left; + private final Object right; ValuePair(Object left, Object right) { @@ -242,7 +241,5 @@ Object getRight() { return right; } - } - } diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/instances/EntityDetail.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/instances/EntityDetail.java index 27be6751f03..c702f553299 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/instances/EntityDetail.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/instances/EntityDetail.java @@ -12,7 +12,7 @@ import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; /** - * EntityDetail stores all of the type-specific properties for the entity. These properties can be + * EntityDetail stores all the type-specific properties for the entity. These properties can be * requested in an InstanceProperties object on request. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @@ -50,7 +50,7 @@ public EntityDetail(EntityDetail templateElement) /** - * Return a copy of all of the properties for this entity. Null means no properties exist. + * Return a copy of all the properties for this entity. Null means no properties exist. * * @return InstanceProperties */ diff --git a/open-metadata-implementation/repository-services/repository-services-archive-utilities/src/main/java/org/odpi/openmetadata/repositoryservices/archiveutilities/OMRSArchiveBuilder.java b/open-metadata-implementation/repository-services/repository-services-archive-utilities/src/main/java/org/odpi/openmetadata/repositoryservices/archiveutilities/OMRSArchiveBuilder.java index 4681cc05e7f..437e00ae6fe 100644 --- a/open-metadata-implementation/repository-services/repository-services-archive-utilities/src/main/java/org/odpi/openmetadata/repositoryservices/archiveutilities/OMRSArchiveBuilder.java +++ b/open-metadata-implementation/repository-services/repository-services-archive-utilities/src/main/java/org/odpi/openmetadata/repositoryservices/archiveutilities/OMRSArchiveBuilder.java @@ -4,7 +4,6 @@ import org.odpi.openmetadata.repositoryservices.connectors.stores.archivestore.OpenMetadataArchiveBuilder; import org.odpi.openmetadata.repositoryservices.connectors.stores.archivestore.OpenMetadataArchiveCache; -import org.odpi.openmetadata.repositoryservices.connectors.stores.archivestore.OpenMetadataArchiveStore; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.ClassificationEntityExtension; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.utilities.OMRSRepositoryPropertiesUtilities; import org.slf4j.Logger; @@ -34,28 +33,28 @@ public class OMRSArchiveBuilder implements OpenMetadataArchiveBuilder, OpenMetad * The maps accumulate content from both dependent archives and the new archive being built. * The lists contain only the new content, and will ultimately be used when assembling the archive. */ - private Map primitiveDefMap = new HashMap<>(); - private List primitiveDefList = new ArrayList<>(); - private Map enumDefMap = new HashMap<>(); - private List enumDefList = new ArrayList<>(); - private Map collectionDefMap = new HashMap<>(); - private List collectionDefList = new ArrayList<>(); - private Map classificationDefMap = new HashMap<>(); - private List classificationDefList = new ArrayList<>(); - private Map entityDefMap = new HashMap<>(); - private List entityDefList = new ArrayList<>(); - private Map relationshipDefMap = new HashMap<>(); - private List relationshipDefList = new ArrayList<>(); - private List typeDefPatchList = new ArrayList<>(); - private Map entityDetailMap = new HashMap<>(); - private List entityDetailList = new ArrayList<>(); - private Map relationshipMap = new HashMap<>(); - private List relationshipList = new ArrayList<>(); - private Map classificationMap = new HashMap<>(); - private List classificationList = new ArrayList<>(); - private Map guidMap = new HashMap<>(); - private Map nameMap = new HashMap<>(); - private Map> entityAttributeMap = new HashMap<>(); + private final Map primitiveDefMap = new HashMap<>(); + private final List primitiveDefList = new ArrayList<>(); + private final Map enumDefMap = new HashMap<>(); + private final List enumDefList = new ArrayList<>(); + private final Map collectionDefMap = new HashMap<>(); + private final List collectionDefList = new ArrayList<>(); + private final Map classificationDefMap = new HashMap<>(); + private final List classificationDefList = new ArrayList<>(); + private final Map entityDefMap = new HashMap<>(); + private final List entityDefList = new ArrayList<>(); + private final Map relationshipDefMap = new HashMap<>(); + private final List relationshipDefList = new ArrayList<>(); + private final List typeDefPatchList = new ArrayList<>(); + private final Map entityDetailMap = new HashMap<>(); + private final List entityDetailList = new ArrayList<>(); + private final Map relationshipMap = new HashMap<>(); + private final List relationshipList = new ArrayList<>(); + private final Map classificationMap = new HashMap<>(); + private final List classificationList = new ArrayList<>(); + private final Map guidMap = new HashMap<>(); + private final Map nameMap = new HashMap<>(); + private final Map> entityAttributeMap = new HashMap<>(); private static final Logger log = LoggerFactory.getLogger(OMRSArchiveBuilder.class); @@ -457,7 +456,7 @@ public void addPrimitiveDef(PrimitiveDef primitiveDef) if (primitiveDef != null) { - log.debug("Adding PrimitiveDef: " + primitiveDef.toString()); + log.debug("Adding PrimitiveDef: " + primitiveDef); this.checkForBlanksInTypeName(primitiveDef.getName()); PrimitiveDef duplicateElement = primitiveDefMap.put(primitiveDef.getName(), primitiveDef); @@ -547,7 +546,7 @@ public void addCollectionDef(CollectionDef collectionDef) if (collectionDef != null) { - log.debug("Adding CollectionDef: " + collectionDef.toString()); + log.debug("Adding CollectionDef: " + collectionDef); this.checkForBlanksInTypeName(collectionDef.getName()); @@ -638,7 +637,7 @@ public void addEnumDef(EnumDef enumDef) if (enumDef != null) { - log.debug("Adding EnumDef: " + enumDef.toString()); + log.debug("Adding EnumDef: " + enumDef); this.checkForBlanksInTypeName(enumDef.getName()); @@ -729,7 +728,7 @@ public void addClassificationDef(ClassificationDef classificationDef) if (classificationDef != null) { - log.debug("Adding ClassificationDef: " + classificationDef.toString()); + log.debug("Adding ClassificationDef: " + classificationDef); this.checkForBlanksInTypeName(classificationDef.getName()); @@ -805,7 +804,7 @@ public void addEntityDef(EntityDef entityDef) if (entityDef != null) { - log.debug("Adding EntityDef: " + entityDef.toString()); + log.debug("Adding EntityDef: " + entityDef); this.checkForBlanksInTypeName(entityDef.getName()); @@ -988,7 +987,7 @@ public void addRelationshipDef(RelationshipDef relationshipDef) if (relationshipDef != null) { - log.debug("Adding RelationshipDef: " + relationshipDef.toString()); + log.debug("Adding RelationshipDef: " + relationshipDef); this.checkForBlanksInTypeName(relationshipDef.getName()); RelationshipDef duplicateElement = relationshipDefMap.put(relationshipDef.getName(), relationshipDef); @@ -1274,7 +1273,7 @@ public void addTypeDefPatch(TypeDefPatch typeDefPatch) { if (typeDefPatch != null) { - log.debug("Adding TypeDefPatch: " + typeDefPatch.toString()); + log.debug("Adding TypeDefPatch: " + typeDefPatch); this.checkForBlanksInTypeName(typeDefPatch.getTypeDefName()); @@ -1318,7 +1317,7 @@ public void addEntity(EntityDetail entity) if (entity != null) { - log.debug("Adding Entity: " + entity.toString()); + log.debug("Adding Entity: " + entity); EntityDetail duplicateElement = entityDetailMap.put(entity.getGUID(), entity); @@ -1397,7 +1396,7 @@ public void addRelationship(Relationship relationship) if (relationship != null) { - log.debug("Adding Relationship: " + relationship.toString()); + log.debug("Adding Relationship: " + relationship); Relationship duplicateElement = relationshipMap.put(relationship.getGUID(), relationship); @@ -1477,7 +1476,7 @@ public void addClassification(ClassificationEntityExtension classification) if (classification != null) { - log.debug("Adding Classification: " + classification.toString()); + log.debug("Adding Classification: " + classification); String classificationId = classification.getEntityToClassify().getGUID() + ":" + classification.getClassification().getName(); @@ -1536,10 +1535,8 @@ public ClassificationEntityExtension getClassification(String entityGUID, */ @Override public ClassificationEntityExtension queryClassification(String entityGUID, - String classificationName) + String classificationName) { - final String methodName = "getClassification"; - String identifier = entityGUID + ":" + classificationName; return classificationMap.get(identifier); @@ -1623,7 +1620,7 @@ public OpenMetadataArchive getOpenMetadataArchive() /* - * Finally set up the instance store + * Finally, set up the instance store */ List entities = new ArrayList<>(); List relationships = new ArrayList<>(); diff --git a/open-metadata-implementation/repository-services/repository-services-archive-utilities/src/main/java/org/odpi/openmetadata/repositoryservices/archiveutilities/OMRSArchiveGUIDMap.java b/open-metadata-implementation/repository-services/repository-services-archive-utilities/src/main/java/org/odpi/openmetadata/repositoryservices/archiveutilities/OMRSArchiveGUIDMap.java index 07df3de2c6d..7bd00fa0278 100644 --- a/open-metadata-implementation/repository-services/repository-services-archive-utilities/src/main/java/org/odpi/openmetadata/repositoryservices/archiveutilities/OMRSArchiveGUIDMap.java +++ b/open-metadata-implementation/repository-services/repository-services-archive-utilities/src/main/java/org/odpi/openmetadata/repositoryservices/archiveutilities/OMRSArchiveGUIDMap.java @@ -21,7 +21,7 @@ public class OMRSArchiveGUIDMap { private static final Logger log = LoggerFactory.getLogger(OMRSArchiveGUIDMap.class); - private String guidMapFileName; + private final String guidMapFileName; private Map idToGUIDMap; @@ -81,7 +81,7 @@ public void setGUID(String id, String guid) * If no GUID exists, a new one is created and returned * * @param id id of element - * @return guid mapped to Id + * @return guid mapped to id */ public String getGUID(String id) { @@ -102,7 +102,7 @@ public String getGUID(String id) * Retrieve the guid for an element based on its id. * * @param id id of element - * @return guid mapped to Id + * @return guid mapped to id */ public String queryGUID(String id) { diff --git a/open-metadata-implementation/repository-services/repository-services-archive-utilities/src/main/java/org/odpi/openmetadata/repositoryservices/archiveutilities/OMRSArchiveHelper.java b/open-metadata-implementation/repository-services/repository-services-archive-utilities/src/main/java/org/odpi/openmetadata/repositoryservices/archiveutilities/OMRSArchiveHelper.java index efdae2b01f1..c454fb3ceb3 100644 --- a/open-metadata-implementation/repository-services/repository-services-archive-utilities/src/main/java/org/odpi/openmetadata/repositoryservices/archiveutilities/OMRSArchiveHelper.java +++ b/open-metadata-implementation/repository-services/repository-services-archive-utilities/src/main/java/org/odpi/openmetadata/repositoryservices/archiveutilities/OMRSArchiveHelper.java @@ -15,15 +15,15 @@ */ public class OMRSArchiveHelper extends OMRSRepositoryPropertiesUtilities { - private OpenMetadataArchiveBuilder archiveBuilder; - private String archiveGUID; - private String archiveName; - private String originatorName; - private Date creationDate; - private long versionNumber; - private String versionName; - private InstanceProvenanceType instanceProvenanceType = InstanceProvenanceType.CONTENT_PACK; - private String license = null; + private final OpenMetadataArchiveBuilder archiveBuilder; + private final String archiveGUID; + private String archiveName; + private final String originatorName; + private final Date creationDate; + private final long versionNumber; + private final String versionName; + private InstanceProvenanceType instanceProvenanceType = InstanceProvenanceType.CONTENT_PACK; + private String license = null; /** diff --git a/open-metadata-implementation/repository-services/repository-services-archive-utilities/src/main/java/org/odpi/openmetadata/repositoryservices/archiveutilities/OMRSArchiveWriter.java b/open-metadata-implementation/repository-services/repository-services-archive-utilities/src/main/java/org/odpi/openmetadata/repositoryservices/archiveutilities/OMRSArchiveWriter.java index a598169aac5..9db6c92b68a 100644 --- a/open-metadata-implementation/repository-services/repository-services-archive-utilities/src/main/java/org/odpi/openmetadata/repositoryservices/archiveutilities/OMRSArchiveWriter.java +++ b/open-metadata-implementation/repository-services/repository-services-archive-utilities/src/main/java/org/odpi/openmetadata/repositoryservices/archiveutilities/OMRSArchiveWriter.java @@ -34,7 +34,7 @@ public OMRSArchiveWriter() /** - * Return the connection for a open metadata archive file. + * Return the connection for an open metadata archive file. * * @param fileName name of the archive file * @return OCF Connection used to create the file-based open metadata archive @@ -56,7 +56,7 @@ protected Connection getOpenMetadataArchiveFileConnection(String fileName) /** * Return the connector type for the requested connector provider. This is best used for connector providers that - * can return their own connector type. Otherwise it makes one up. + * can return their own connector type. Otherwise, it makes one up. * * @param connectorProviderClassName name of the connector provider class * @return ConnectorType bean @@ -168,7 +168,7 @@ private OpenMetadataArchiveStore getOpenMetadataArchive(Connection connection, catch (Exception error) { log.error("Unexpected exception occurred: " + error.getMessage()); - log.error("Exception: " + error.toString()); + log.error("Exception: " + error); } return openMetadataArchiveStore; @@ -176,7 +176,7 @@ private OpenMetadataArchiveStore getOpenMetadataArchive(Connection connection, /** - * Generates and writes out an open metadata archive containing all of the open metadata types. + * Generates and writes out an open metadata archive containing all the open metadata types. * * @param outputFileName name of file to write archive to * @param openMetadataArchive archive content @@ -193,7 +193,7 @@ protected void writeOpenMetadataArchive(String outputFileName, /** - * Generates and writes out an open metadata archive containing all of the open metadata types. + * Generates and writes out an open metadata archive containing all the open metadata types. * * @param outputFileName name of file to write archive to * @param openMetadataArchive archive content diff --git a/open-metadata-implementation/repository-services/repository-services-client/src/main/java/org/odpi/openmetadata/repositoryservices/clients/AuditLogServicesClient.java b/open-metadata-implementation/repository-services/repository-services-client/src/main/java/org/odpi/openmetadata/repositoryservices/clients/AuditLogServicesClient.java index 5b5afacd1ce..160fd70b42d 100644 --- a/open-metadata-implementation/repository-services/repository-services-client/src/main/java/org/odpi/openmetadata/repositoryservices/clients/AuditLogServicesClient.java +++ b/open-metadata-implementation/repository-services/repository-services-client/src/main/java/org/odpi/openmetadata/repositoryservices/clients/AuditLogServicesClient.java @@ -9,22 +9,14 @@ import org.odpi.openmetadata.frameworks.auditlog.AuditLoggingComponent; import org.odpi.openmetadata.frameworks.auditlog.ComponentDescription; import org.odpi.openmetadata.repositoryservices.auditlog.OMRSAuditLogReport; -import org.odpi.openmetadata.repositoryservices.auditlog.OMRSAuditingComponent; -import org.odpi.openmetadata.repositoryservices.connectors.stores.cohortregistrystore.properties.MemberRegistration; import org.odpi.openmetadata.repositoryservices.ffdc.OMRSErrorCode; import org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException; import org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidRelationshipException; import org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException; import org.odpi.openmetadata.repositoryservices.ffdc.exception.UserNotAuthorizedException; -import org.odpi.openmetadata.repositoryservices.properties.CohortDescription; -import org.odpi.openmetadata.repositoryservices.rest.properties.AttributeTypeDefResponse; import org.odpi.openmetadata.repositoryservices.rest.properties.AuditLogReportResponse; -import org.odpi.openmetadata.repositoryservices.rest.properties.CohortListResponse; -import org.odpi.openmetadata.repositoryservices.rest.properties.CohortMembershipListResponse; -import org.odpi.openmetadata.repositoryservices.rest.properties.CohortMembershipResponse; import org.odpi.openmetadata.repositoryservices.rest.properties.OMRSAPIResponse; -import java.util.List; import java.util.Map; /** @@ -46,15 +38,15 @@ public class AuditLogServicesClient implements AuditLoggingComponent static final private String rootServiceNameInURL = "/servers/{0}/open-metadata/repository-services"; static final private String userIdInURL = "/users/{1}"; - private String localServerUserId = null; - private String localServerPassword = null; + private final String localServerUserId = null; + private final String localServerPassword = null; - private String restURLRoot; /* Initialized in constructor */ + private final String restURLRoot; /* Initialized in constructor */ - private RESTClientConnector restClient; /* Initialized in constructor */ - private String serverName; /* Initialized in constructor */ + private final RESTClientConnector restClient; /* Initialized in constructor */ + private final String serverName; /* Initialized in constructor */ - private InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); + private final InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); protected AuditLog auditLog = null; @@ -286,7 +278,7 @@ private RESTClientConnector getRESTClientConnector(String serverName, * Issue a GET REST call that returns a AuditLogReportResponse object. * * @param methodName name of the method being called - * @param operationSpecificURL template of the URL for the REST API call with place-holders for the parameters + * @param operationSpecificURL template of the URL for the REST API call, with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return AttributeTypeDefListResponse * @throws RepositoryErrorException something went wrong with the REST call stack. TODO @@ -308,7 +300,7 @@ private AuditLogReportResponse callAuditLogReportGetRESTCall(String methodNam * @param class name * @param methodName name of the method being called * @param returnClass class name of response object - * @param operationSpecificURL template of the URL for the REST API call with place-holders for the parameters + * @param operationSpecificURL template of the URL for the REST API call, with place-holders for the parameters * @return TypeDefResponse * @throws RepositoryErrorException something went wrong with the REST call stack. */ @@ -326,7 +318,7 @@ private T callGetRESTCall(String methodName, * @param class name * @param methodName name of the method being called * @param returnClass class name of response object - * @param operationSpecificURL template of the URL for the REST API call with place-holders for the parameters + * @param operationSpecificURL template of the URL for the REST API call, with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return TypeDefResponse * @throws RepositoryErrorException something went wrong with the REST call stack. @@ -360,7 +352,7 @@ private T callGetRESTCall(String methodName, * @param class name * @param methodName name of the method being called * @param returnClass class name of response object - * @param operationSpecificURL template of the URL for the REST API call with place-holders for the parameters + * @param operationSpecificURL template of the URL for the REST API call, with place-holders for the parameters * @param request request body object * @param params a list of parameters that are slotted into the url template * @return VoidResponse @@ -556,7 +548,7 @@ private void detectAndThrowRepositoryErrorException(String methodName, else if (restResult.getExceptionClassName() != null) { /* - * All of the other expected exceptions have been processed so default exception to RepositoryErrorException + * All the other expected exceptions have been processed so default exception to RepositoryErrorException */ throw new RepositoryErrorException(restResult.getRelatedHTTPCode(), this.getClass().getName(), diff --git a/open-metadata-implementation/repository-services/repository-services-client/src/main/java/org/odpi/openmetadata/repositoryservices/clients/MetadataCollectionServicesClient.java b/open-metadata-implementation/repository-services/repository-services-client/src/main/java/org/odpi/openmetadata/repositoryservices/clients/MetadataCollectionServicesClient.java index 7f5994eb242..a783a3802ab 100644 --- a/open-metadata-implementation/repository-services/repository-services-client/src/main/java/org/odpi/openmetadata/repositoryservices/clients/MetadataCollectionServicesClient.java +++ b/open-metadata-implementation/repository-services/repository-services-client/src/main/java/org/odpi/openmetadata/repositoryservices/clients/MetadataCollectionServicesClient.java @@ -43,13 +43,13 @@ public abstract class MetadataCollectionServicesClient implements AuditLoggingCo static final private String rootServiceNameInURL = "/open-metadata/repository-services"; static final private String userIdInURL = "/users/{0}"; - private String localServerUserId = null; - private String localServerPassword = null; + private final String localServerUserId = null; + private final String localServerPassword = null; - protected String restURLRoot; /* Initialized in constructor */ - private String serviceURLMarker; /* Initialized in constructor */ - protected RESTClientConnector restClient; /* Initialized in constructor */ - protected String repositoryName; /* Initialized in constructor */ + protected String restURLRoot; /* Initialized in constructor */ + private final String serviceURLMarker; /* Initialized in constructor */ + protected RESTClientConnector restClient; /* Initialized in constructor */ + protected String repositoryName; /* Initialized in constructor */ protected InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); @@ -336,7 +336,7 @@ public TypeDefGallery findTypesByName(String userId, /** - * Returns all of the TypeDefs for a specific category. + * Returns all the TypeDefs for a specific category. * * @param userId unique identifier for requesting user. * @param category enum value for the category of TypeDef to return. @@ -367,7 +367,7 @@ public List findTypeDefsByCategory(String userId, /** - * Returns all of the AttributeTypeDefs for a specific category. + * Returns all the AttributeTypeDefs for a specific category. * * @param userId unique identifier for requesting user. * @param category enum value for the category of an AttributeTypeDef to return. @@ -435,7 +435,7 @@ public List findTypeDefsByProperty(String userId, * @param standard name of the standard null means any. * @param organization name of the organization null means any. * @param identifier identifier of the element in the standard null means any. - * @return TypeDefs list each entry in the list contains a typedef. This is is a structure + * @return TypeDefs list each entry in the list contains a typedef. This is a structure * describing the TypeDef's category and properties. * @throws InvalidParameterException all attributes of the external id are null. * @throws RepositoryErrorException there is a problem communicating with the metadata repository. @@ -472,7 +472,7 @@ public List findTypesByExternalID(String userId, * * @param userId unique identifier for requesting user. * @param searchCriteria String search criteria. - * @return TypeDefs list each entry in the list contains a typedef. This is is a structure + * @return TypeDefs list each entry in the list contains a typedef. This is a structure * describing the TypeDef's category and properties. * @throws InvalidParameterException the searchCriteria is null. * @throws RepositoryErrorException there is a problem communicating with the metadata repository. @@ -907,7 +907,7 @@ public TypeDef updateTypeDef(String userId, * @throws RepositoryErrorException there is a problem communicating with the metadata repository where * the metadata collection is stored. * @throws TypeDefNotKnownException the requested TypeDef is not found in the metadata collection. - * @throws TypeDefInUseException the TypeDef can not be deleted because there are instances of this type in the + * @throws TypeDefInUseException the TypeDef can not be deleted because there are instances of this type in * the metadata collection. These instances need to be purged before the * TypeDef can be deleted. * @throws FunctionNotSupportedException the repository does not support this call. @@ -954,7 +954,7 @@ public void deleteTypeDef(String userId, * @throws RepositoryErrorException there is a problem communicating with the metadata repository where * the metadata collection is stored. * @throws TypeDefNotKnownException the requested AttributeTypeDef is not found in the metadata collection. - * @throws TypeDefInUseException the AttributeTypeDef can not be deleted because there are instances of this type in the + * @throws TypeDefInUseException the AttributeTypeDef can not be deleted because there are instances of this type in * the metadata collection. These instances need to be purged before the * AttributeTypeDef can be deleted. * @throws FunctionNotSupportedException the repository does not support this call. @@ -1644,7 +1644,7 @@ public List findEntitiesByProperty(String userI * * @param userId unique identifier for requesting user. * @param entityTypeGUID unique identifier for the type of entity requested. Null means any type of entity - * (but could be slow so not recommended. + * (but could be slow so not recommended). * @param classificationName name of the classification, note a null is not valid. * @param matchClassificationProperties list of classification properties used to narrow the search (where any String * property's value should be defined as a Java regular expression, even if it @@ -2353,7 +2353,7 @@ public List findRelationshipsByPropertyValue(String /** - * Return all of the relationships and intermediate entities that connect the startEntity with the endEntity. + * Return all the relationships and intermediate entities that connect the startEntity with the endEntity. * * @param userId unique identifier for requesting user. * @param startEntityGUID The entity that is used to anchor the query. @@ -2703,7 +2703,7 @@ public EntityDetail addEntity(String userId, /** * Save a new entity that is sourced from an external technology. The external * technology is identified by a GUID and a name. These can be recorded in a - * Software Server Capability (guid and qualifiedName respectively. + * Software Server Capability (guid and qualifiedName respectively). * The new entity is assigned a new GUID and put * in the requested state. The new entity is returned. * @@ -2940,9 +2940,9 @@ public EntityDetail undoEntityUpdate(String userId, /** - * Delete an entity. The entity is soft deleted. This means it is still in the graph but it is no longer returned + * Delete an entity. The entity is soft-deleted. This means it is still in the graph, but it is no longer returned * on queries. All relationships to the entity are also soft-deleted and will no longer be usable. - * To completely eliminate the entity from the graph requires a call to the purgeEntity() method after the delete call. + * To completely eliminate the entity from the graph requires a call to the purgeEntity() method after the call to delete(). * The restoreEntity() method will switch an entity back to Active status to restore the entity to normal use. * * @param userId unique identifier for requesting user. @@ -3370,7 +3370,7 @@ public Relationship addRelationship(String userId, /** * Save a new relationship that is sourced from an external technology. The external * technology is identified by a GUID and a name. These can be recorded in a - * Software Server Capability (guid and qualifiedName respectively. + * Software Server Capability (guid and qualifiedName respectively). * The new relationship is assigned a new GUID and put * in the requested state. The new relationship is returned. * @@ -3577,7 +3577,7 @@ public Relationship undoRelationshipUpdate(String userId, /** * Delete a specific relationship. This is a soft-delete which means the relationship's status is updated to - * DELETED and it is no longer available for queries. To remove the relationship permanently from the + * DELETED, and it is no longer available for queries. To remove the relationship permanently from the * metadata collection, use purgeRelationship(). * * @param userId unique identifier for requesting user. @@ -3772,7 +3772,7 @@ public EntityDetail reIdentifyEntity(String userId, /** - * Change the type of an existing entity. Typically this action is taken to move an entity's + * Change an existing entity's type. Typically, this action is taken to move an entity's * type to either a super type (so the subtype can be deleted) or a new subtype (so additional properties can be * added.) However, the type can be changed to any compatible type and the properties adjusted. * @@ -3958,7 +3958,7 @@ public Relationship reIdentifyRelationship(String userId, /** - * Change the type of an existing relationship. Typically this action is taken to move a relationship's + * Change an existing relationship's type. Typically, this action is taken to move a relationship's * type to either a super type (so the subtype can be deleted) or a new subtype (so additional properties can be * added.) However, the type can be changed to any compatible type. * @@ -4152,7 +4152,7 @@ public void saveEntityReferenceCopy(String userId, * * @param userId unique identifier for requesting user. * @param entityGUID unique identifier of the entity with classifications to retrieve - * @return list of all of the classifications for this entity that are homed in this repository + * @return list of all the classifications for this entity that are homed in this repository * @throws InvalidParameterException the entity is null. * @throws RepositoryErrorException there is a problem communicating with the metadata repository where * the metadata collection is stored. @@ -4192,7 +4192,7 @@ public List getHomeClassifications(String userId, * @param userId unique identifier for requesting user. * @param entityGUID unique identifier of the entity with classifications to retrieve * @param asOfTime the time used to determine which version of the entity that is desired. - * @return list of all of the classifications for this entity that are homed in this repository + * @return list of all the classifications for this entity that are homed in this repository * @throws InvalidParameterException the entity is null. * @throws RepositoryErrorException there is a problem communicating with the metadata repository where * the metadata collection is stored. @@ -4290,7 +4290,7 @@ public void deleteEntityReferenceCopy(String userId, * * This method is called when a remote repository calls the variant of purgeEntity that * passes the EntityDetail object. This is typically used if purge is called without a previous soft-delete. - * However it may also be used to purge after a soft-delete. + * However, it may also be used to purge after a soft-delete. * * @param userId unique identifier for requesting server. * @param entity details of the entity to purge. @@ -4727,7 +4727,7 @@ public void deleteRelationshipReferenceCopy(String userId, /** * This method is called when a remote repository calls the variant of purgeRelationship that * passes the relationship object. This is typically used if purge is called without a previous soft-delete. - * However it may also be used to purge after a soft-delete. + * However, it may also be used to purge after a soft-delete. * * Remove the reference copy of the relationship from the local repository. This method can be used to * remove reference copies from the local cohort, repositories that have left the cohort, @@ -5021,7 +5021,7 @@ private RESTClientConnector getRESTClientConnector(String serverName, * Issue a POST REST call that returns a AttributeTypeDefListResponse object. * * @param methodName name of the method being called - * @param operationSpecificURL template of the URL for the REST API call with place-holders for the parameters + * @param operationSpecificURL template of the URL for the REST API call, with place-holders for the parameters * @param requestBody request body for REST Call * @param params a list of parameters that are slotted into the url template * @return AttributeTypeDefListResponse @@ -5044,7 +5044,7 @@ private AttributeTypeDefListResponse callAttributeTypeDefListPostRESTCall(String * Issue a GET REST call that returns a AttributeTypeDefResponse object. * * @param methodName name of the method being called - * @param operationSpecificURL template of the URL for the REST API call with place-holders for the parameters + * @param operationSpecificURL template of the URL for the REST API call, with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return AttributeTypeDefResponse * @throws RepositoryErrorException something went wrong with the REST call stack. @@ -5064,7 +5064,7 @@ private AttributeTypeDefResponse callAttributeTypeDefGetRESTCall(String metho * Issue a POST REST call that returns a AttributeTypeDefResponse object. * * @param methodName name of the method being called - * @param operationSpecificURL template of the URL for the REST API call with place-holders for the parameters + * @param operationSpecificURL template of the URL for the REST API call, with place-holders for the parameters * @param requestBody request body object * @param params a list of parameters that are slotted into the url template * @return AttributeTypeDefResponse @@ -5087,7 +5087,7 @@ private AttributeTypeDefResponse callAttributeTypeDefPostRESTCall(String meth * Issue a POST REST call that returns a BooleanResponse object. * * @param methodName name of the method being called - * @param operationSpecificURL template of the URL for the REST API call with place-holders for the parameters + * @param operationSpecificURL template of the URL for the REST API call, with place-holders for the parameters * @param requestBody request body object * @param params a list of parameters that are slotted into the url template * @return BooleanResponse @@ -5110,7 +5110,7 @@ private BooleanResponse callBooleanPostRESTCall(String methodName, * Issue a GET REST call that returns a EntityDetailResponse object. * * @param methodName name of the method being called - * @param operationSpecificURL template of the URL for the REST API call with place-holders for the parameters + * @param operationSpecificURL template of the URL for the REST API call, with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return EntityDetailResponse * @throws RepositoryErrorException something went wrong with the REST call stack. @@ -5130,7 +5130,7 @@ private EntityDetailResponse callEntityDetailGetRESTCall(String methodName, * Issue a POST REST call that returns a EntityDetailResponse object. * * @param methodName name of the method being called - * @param operationSpecificURL template of the URL for the REST API call with place-holders for the parameters + * @param operationSpecificURL template of the URL for the REST API call, with place-holders for the parameters * @param requestBody request body object * @param params a list of parameters that are slotted into the url template * @return EntityDetailResponse @@ -5153,7 +5153,7 @@ private EntityDetailResponse callEntityDetailPostRESTCall(String methodName, * Issue a GET REST call that returns a ClassificationListResponse object. * * @param methodName name of the method being called - * @param operationSpecificURL template of the URL for the REST API call with place-holders for the parameters + * @param operationSpecificURL template of the URL for the REST API call, with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return EntityDetailResponse * @throws RepositoryErrorException something went wrong with the REST call stack. @@ -5173,7 +5173,7 @@ private ClassificationListResponse callClassificationListGetRESTCall(String m * Issue a POST REST call that returns a ClassificationListResponse object. * * @param methodName name of the method being called - * @param operationSpecificURL template of the URL for the REST API call with place-holders for the parameters + * @param operationSpecificURL template of the URL for the REST API call, with place-holders for the parameters * @param requestBody request body object * @param params a list of parameters that are slotted into the url template * @return EntityDetailResponse @@ -5196,7 +5196,7 @@ private ClassificationListResponse callClassificationListPostRESTCall(String * Issue a GET REST call that returns a EntitySummaryResponse object. * * @param methodName name of the method being called - * @param operationSpecificURL template of the URL for the REST API call with place-holders for the parameters + * @param operationSpecificURL template of the URL for the REST API call, with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return EntitySummaryResponse * @throws RepositoryErrorException something went wrong with the REST call stack. @@ -5216,7 +5216,7 @@ private EntitySummaryResponse callEntitySummaryGetRESTCall(String methodName, * Issue a GET REST call that returns a RelationshipResponse object. * * @param methodName name of the method being called - * @param operationSpecificURL template of the URL for the REST API call with place-holders for the parameters + * @param operationSpecificURL template of the URL for the REST API call, with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return RelationshipResponse * @throws RepositoryErrorException something went wrong with the REST call stack. @@ -5236,7 +5236,7 @@ private RelationshipResponse callRelationshipGetRESTCall(String methodName, * Issue a POST REST call that returns a EntityListResponse object. * * @param methodName name of the method being called - * @param operationSpecificURL template of the URL for the REST API call with place-holders for the parameters + * @param operationSpecificURL template of the URL for the REST API call, with place-holders for the parameters * @param requestBody request body object * @param params a list of parameters that are slotted into the url template * @return EntityListResponse @@ -5260,7 +5260,7 @@ private EntityListResponse callEntityListPostRESTCall(String methodName, * Issue a POST REST call that returns a RelationshipListResponse object. * * @param methodName name of the method being called - * @param operationSpecificURL template of the URL for the REST API call with place-holders for the parameters + * @param operationSpecificURL template of the URL for the REST API call, with place-holders for the parameters * @param requestBody request body object * @param params a list of parameters that are slotted into the url template * @return RelationshipListResponse @@ -5283,7 +5283,7 @@ private RelationshipListResponse callRelationshipListPostRESTCall(String meth * Issue a POST REST call that returns a RelationshipResponse object. * * @param methodName name of the method being called - * @param operationSpecificURL template of the URL for the REST API call with place-holders for the parameters + * @param operationSpecificURL template of the URL for the REST API call, with place-holders for the parameters * @param requestBody request body object * @param params a list of parameters that are slotted into the url template * @return RelationshipResponse @@ -5305,7 +5305,7 @@ private RelationshipResponse callRelationshipPostRESTCall(String methodName, * Issue a GET REST call that returns a InstanceGraphResponse object. * * @param methodName name of the method being called - * @param operationSpecificURL template of the URL for the REST API call with place-holders for the parameters + * @param operationSpecificURL template of the URL for the REST API call, with place-holders for the parameters * @param requestBody request body object * @param params a list of parameters that are slotted into the url template * @return InstanceGraphResponse @@ -5328,7 +5328,7 @@ private InstanceGraphResponse callInstanceGraphPostRESTCall(String methodName * Issue a GET REST call that returns a TypeDefGalleryResponse object. * * @param methodName name of the method being called - * @param operationSpecificURL template of the URL for the REST API call with place-holders for the parameters + * @param operationSpecificURL template of the URL for the REST API call, with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return TypeDefGalleryResponseObject * @throws RepositoryErrorException something went wrong with the REST call stack. @@ -5348,7 +5348,7 @@ private TypeDefGalleryResponse callTypeDefGalleryGetRESTCall(String methodNam * Issue a GET REST call that returns a TypeDefListResponse object. * * @param methodName name of the method being called - * @param operationSpecificURL template of the URL for the REST API call with place-holders for the parameters + * @param operationSpecificURL template of the URL for the REST API call, with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return TypeDefListResponse * @throws RepositoryErrorException something went wrong with the REST call stack. @@ -5368,7 +5368,7 @@ private TypeDefListResponse callTypeDefListGetRESTCall(String methodName, * Issue a POST REST call that returns a TypeDefListResponse object. * * @param methodName name of the method being called - * @param operationSpecificURL template of the URL for the REST API call with place-holders for the parameters + * @param operationSpecificURL template of the URL for the REST API call, with place-holders for the parameters * @param requestBody request body * @param params a list of parameters that are slotted into the url template * @return TypeDefListResponse @@ -5391,7 +5391,7 @@ private TypeDefListResponse callTypeDefListPostRESTCall(String methodName, * Issue a GET REST call that returns a TypeDefResponse object. * * @param methodName name of the method being called - * @param operationSpecificURL template of the URL for the REST API call with place-holders for the parameters + * @param operationSpecificURL template of the URL for the REST API call, with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return TypeDefResponse * @throws RepositoryErrorException something went wrong with the REST call stack. @@ -5411,7 +5411,7 @@ private TypeDefResponse callTypeDefGetRESTCall(String methodName, * Issue a POST REST call that returns a TypeDefResponse object. * * @param methodName name of the method being called - * @param operationSpecificURL template of the URL for the REST API call with place-holders for the parameters + * @param operationSpecificURL template of the URL for the REST API call, with place-holders for the parameters * @param requestBody request body object * @param params a list of parameters that are slotted into the url template * @return TypeDefResponse @@ -5434,7 +5434,7 @@ private TypeDefResponse callTypeDefPostRESTCall(String methodName, * Issue a POST REST call that returns a VoidResponse object. * * @param methodName name of the method being called - * @param operationSpecificURL template of the URL for the REST API call with place-holders for the parameters + * @param operationSpecificURL template of the URL for the REST API call, with place-holders for the parameters * @param requestBody request body object * @param params a list of parameters that are slotted into the url template * @return VoidResponse @@ -5459,7 +5459,7 @@ private VoidResponse callVoidPostRESTCall(String methodName, * @param class name * @param methodName name of the method being called * @param returnClass class name of response object - * @param operationSpecificURL template of the URL for the REST API call with place-holders for the parameters + * @param operationSpecificURL template of the URL for the REST API call, with place-holders for the parameters * @return TypeDefResponse * @throws RepositoryErrorException something went wrong with the REST call stack. */ @@ -5477,7 +5477,7 @@ private T callGetRESTCall(String methodName, * @param class name * @param methodName name of the method being called * @param returnClass class name of response object - * @param operationSpecificURL template of the URL for the REST API call with place-holders for the parameters + * @param operationSpecificURL template of the URL for the REST API call, with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return TypeDefResponse * @throws RepositoryErrorException something went wrong with the REST call stack. @@ -5511,7 +5511,7 @@ private T callGetRESTCall(String methodName, * @param class name * @param methodName name of the method being called * @param returnClass class name of response object - * @param operationSpecificURL template of the URL for the REST API call with place-holders for the parameters + * @param operationSpecificURL template of the URL for the REST API call, with place-holders for the parameters * @param request request body object * @param params a list of parameters that are slotted into the url template * @return VoidResponse @@ -6388,7 +6388,7 @@ protected void detectAndThrowRepositoryErrorException(String methodName else if (restResult.getExceptionClassName() != null) { /* - * All of the other expected exceptions have been processed so default exception to RepositoryErrorException + * All the other expected exceptions have been processed so default exception to RepositoryErrorException */ throw new RepositoryErrorException(restResult.getRelatedHTTPCode(), this.getClass().getName(), diff --git a/open-metadata-implementation/repository-services/repository-services-client/src/main/java/org/odpi/openmetadata/repositoryservices/clients/MetadataHighwayServicesClient.java b/open-metadata-implementation/repository-services/repository-services-client/src/main/java/org/odpi/openmetadata/repositoryservices/clients/MetadataHighwayServicesClient.java index b666aeef88a..ccf64823bfe 100644 --- a/open-metadata-implementation/repository-services/repository-services-client/src/main/java/org/odpi/openmetadata/repositoryservices/clients/MetadataHighwayServicesClient.java +++ b/open-metadata-implementation/repository-services/repository-services-client/src/main/java/org/odpi/openmetadata/repositoryservices/clients/MetadataHighwayServicesClient.java @@ -35,15 +35,15 @@ public class MetadataHighwayServicesClient implements AuditLoggingComponent static final private String rootServiceNameInURL = "/servers/{0}/open-metadata/repository-services"; static final private String userIdInURL = "/users/{1}"; - private String localServerUserId = null; - private String localServerPassword = null; + private final String localServerUserId = null; + private final String localServerPassword = null; - private String restURLRoot; /* Initialized in constructor */ + private final String restURLRoot; /* Initialized in constructor */ - private RESTClientConnector restClient; /* Initialized in constructor */ - private String serverName; /* Initialized in constructor */ + private final RESTClientConnector restClient; /* Initialized in constructor */ + private final String serverName; /* Initialized in constructor */ - private InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); + private final InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); protected AuditLog auditLog = null; diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/admin/OMRSConfigurationFactory.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/admin/OMRSConfigurationFactory.java index d6e03695976..2ee54bcd187 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/admin/OMRSConfigurationFactory.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/admin/OMRSConfigurationFactory.java @@ -27,7 +27,7 @@ public class OMRSConfigurationFactory private static final String defaultCohortName = "defaultCohort"; - private ConnectorConfigurationFactory connectorConfigurationFactory = new ConnectorConfigurationFactory(); + private final ConnectorConfigurationFactory connectorConfigurationFactory = new ConnectorConfigurationFactory(); /** diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/admin/OMRSOperationalServices.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/admin/OMRSOperationalServices.java index ff036323e58..2790fe8e8fe 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/admin/OMRSOperationalServices.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/admin/OMRSOperationalServices.java @@ -70,14 +70,14 @@ public class OMRSOperationalServices */ private static final Logger log = LoggerFactory.getLogger(OMRSOperationalServices.class); - private String localServerName; /* Initialized in constructor */ - private String localServerType; /* Initialized in constructor */ - private String localMetadataCollectionName; /* Initialized in constructor */ - private String localOrganizationName; /* Initialized in constructor */ - private String localServerUserId; /* Initialized in constructor */ - private String localServerPassword; /* Initialized in constructor */ - private String localServerURL; /* Initialized in constructor */ - private int maxPageSize; /* Initialized in constructor */ + private final String localServerName; /* Initialized in constructor */ + private final String localServerType; /* Initialized in constructor */ + private String localMetadataCollectionName; /* Initialized in constructor */ + private final String localOrganizationName; /* Initialized in constructor */ + private final String localServerUserId; /* Initialized in constructor */ + private final String localServerPassword; /* Initialized in constructor */ + private final String localServerURL; /* Initialized in constructor */ + private final int maxPageSize; /* Initialized in constructor */ private String localMetadataCollectionId = null; @@ -313,7 +313,7 @@ public void initializeCohortMember(RepositoryServicesConfig repositoryServicesCo /* * Log that the OMRS is starting. There is another Audit log message logged at the end of this method - * to confirm that all of the pieces started successfully. + * to confirm that all the pieces started successfully. */ auditLog.logMessage(actionDescription, OMRSAuditCode.OMRS_INITIALIZING.getMessageDefinition()); @@ -340,9 +340,9 @@ public void initializeCohortMember(RepositoryServicesConfig repositoryServicesCo * Begin with the enterprise repository services. They are always needed since the * Open Metadata Access Services (OMAS) is dependent on them. There are 2 modes of operation: local only * and enterprise access. Enterprise access provide an enterprise view of metadata - * across all of the open metadata repository cohorts that this server connects to. + * across all the open metadata repository cohorts that this server connects to. * If EnterpriseAccessConfig is null, the enterprise repository services run in local only mode. - * Otherwise the supplied configuration properties enable it to be configured for enterprise access. + * Otherwise, the supplied configuration properties enable it to be configured for enterprise access. * * The connector manager manages the list of connectors to metadata repositories that the enterprise * repository services will use. The OMRS Topic is used to publish events from these repositories to support the @@ -486,7 +486,7 @@ public void initializeCohortMember(RepositoryServicesConfig repositoryServicesCo } /* - * Set up the OMRS REST Services with the local repository so it is able to process incoming REST + * Set up the OMRS REST Services with the local repository, so it is able to process incoming REST * calls. */ OMRSRepositoryRESTServices.setServerRepositories(localServerName, @@ -582,13 +582,13 @@ private void initializeSimpleServer(RepositoryServicesConfig repositoryServicesC /* * Log that the OMRS is starting. There is another Audit log message logged at the end of this method - * to confirm that all of the pieces started successfully. + * to confirm that all the pieces started successfully. */ auditLog.logMessage(actionDescription, OMRSAuditCode.OMRS_INITIALIZING.getMessageDefinition()); /* - * Set up the OMRS REST Services with the local repository so it is able to process incoming REST calls. + * Set up the OMRS REST Services with the local repository, so it is able to process incoming REST calls. */ OMRSRepositoryRESTServices.setServerRepositories(localServerName, auditLog, @@ -628,7 +628,7 @@ private OMRSTopicConnector initializeEnterpriseOMRSTopicConnector(EnterpriseAcc enterpriseOMRSTopicConnector = getTopicConnector("Enterprise Access", enterpriseOMRSTopicConnection); /* - * This connector is started by admin services when all of the Access Services have been started and have registered their listeners. + * This connector is started by admin services when all the Access Services have been started and have registered their listeners. */ } } @@ -946,7 +946,7 @@ public boolean disconnect(boolean permanent) { /* * Log that the OMRS is disconnecting. There is another Audit log message logged at the end of this method - * to confirm that all of the pieces disconnected successfully. + * to confirm that all the pieces disconnected successfully. */ final String actionDescription = "Disconnect Repository Operational Services"; auditLog.logMessage(actionDescription, OMRSAuditCode.OMRS_DISCONNECTING.getMessageDefinition()); @@ -1065,7 +1065,7 @@ private OMRSAuditLogStore getAuditLogStore(Connection auditLogStoreConnection) { String methodName = "getAuditLogStore"; - log.debug("Unable to create audit log store connector: " + error.toString()); + log.debug("Unable to create audit log store connector: " + error); throw new OMRSConfigErrorException(OMRSErrorCode.NULL_AUDIT_LOG_STORE.getMessageDefinition(localServerName), this.getClass().getName(), @@ -1093,15 +1093,13 @@ private OMRSTopicConnector getTopicConnector(String sourceName, ConnectorBroker connectorBroker = new ConnectorBroker(auditLog); Connector connector = connectorBroker.getConnector(topicConnection); - OMRSTopicConnector topicConnector = (OMRSTopicConnector)connector; - - return topicConnector; + return (OMRSTopicConnector)connector; } catch (Exception error) { String methodName = "getTopicConnector"; - log.debug("Unable to create topic connector: " + error.toString()); + log.debug("Unable to create topic connector: " + error); auditLog.logMessage(methodName, OMRSAuditCode.BAD_TOPIC_CONNECTION.getMessageDefinition(sourceName, error.getClass().getName(), error.getMessage())); @@ -1130,9 +1128,7 @@ private OpenMetadataArchiveStoreConnector getOpenMetadataArchiveStore(Connectio ConnectorBroker connectorBroker = new ConnectorBroker(auditLog); Connector connector = connectorBroker.getConnector(openMetadataArchiveStoreConnection); - OpenMetadataArchiveStoreConnector archiveStoreConnector = (OpenMetadataArchiveStoreConnector)connector; - - return archiveStoreConnector; + return (OpenMetadataArchiveStoreConnector)connector; } catch (Exception error) { @@ -1140,7 +1136,7 @@ private OpenMetadataArchiveStoreConnector getOpenMetadataArchiveStore(Connectio if (log.isDebugEnabled()) { - log.debug("Unable to create open metadata archive connector: " + error.toString()); + log.debug("Unable to create open metadata archive connector: " + error); } /* @@ -1158,7 +1154,7 @@ private OpenMetadataArchiveStoreConnector getOpenMetadataArchiveStore(Connectio /** * The local repository may need an event mapper to convert its proprietary events to OMRS Events. - * An event mapper is implemented as an OMRSRepositoryEventMapper Connector and it is initialized through the + * An event mapper is implemented as an OMRSRepositoryEventMapper Connector, and it is initialized through the * OCF Connector Broker using an OCF connection. * * @param localRepositoryEventMapperConnection connection to the local repository's event mapper. @@ -1184,15 +1180,13 @@ private OMRSRepositoryEventMapperConnector getLocalRepositoryEventMapper(Connect ConnectorBroker connectorBroker = new ConnectorBroker(auditLog); Connector connector = connectorBroker.getConnector(localRepositoryEventMapperConnection); - OMRSRepositoryEventMapperConnector eventMapperConnector = (OMRSRepositoryEventMapperConnector)connector; - - return eventMapperConnector; + return (OMRSRepositoryEventMapperConnector)connector; } catch (Exception error) { String methodName = "getLocalRepositoryEventMapper"; - log.debug("Unable to create local repository event mapper connector: " + error.toString()); + log.debug("Unable to create local repository event mapper connector: " + error); /* * Throw runtime exception to indicate that the local repository's event mapper is not available. diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/archivemanager/OMRSArchiveManager.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/archivemanager/OMRSArchiveManager.java index 443b0dc05dc..7428f5ce55d 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/archivemanager/OMRSArchiveManager.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/archivemanager/OMRSArchiveManager.java @@ -90,6 +90,7 @@ public void close() * the local Content Manager and TypeDef Processor but the local Instance Processor is only available * if the local server has a metadata repository defined. * + * @param localMetadataCollectionId unique identifier of the local repository * @param repositoryContentManager typeDef processor for the local repository * @param instanceProcessor instance processor for the local repository */ diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/connectormanager/OMRSConnectionConsumer.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/connectormanager/OMRSConnectionConsumer.java index 2f1141afd8a..c65561809bb 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/connectormanager/OMRSConnectionConsumer.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/connectormanager/OMRSConnectionConsumer.java @@ -8,7 +8,7 @@ /** * OMRSConnectionConsumer provides the interfaces for a connection consumer. This is a component that needs to - * maintain a current list of connections to all of the repositories in the open metadata repository cohort. + * maintain a current list of connections to all the repositories in the open metadata repository cohort. */ public interface OMRSConnectionConsumer { diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/connectormanager/OMRSConnectorManager.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/connectormanager/OMRSConnectorManager.java index 46a0b8ffd98..d05b4a640a8 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/connectormanager/OMRSConnectorManager.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/connectormanager/OMRSConnectorManager.java @@ -17,7 +17,7 @@ public interface OMRSConnectorManager * * @param connectorConsumer OMRSConnectorConsumer interested in details of the connectors to * all repositories registered in the metadata repository cluster. - * @return String identifier for the connectorConsumer used for the unregister call. + * @return String identifier for the connectorConsumer used for the call to unregister(). */ String registerConnectorConsumer(OMRSConnectorConsumer connectorConsumer); diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/connectormanager/OMRSEnterpriseConnectorManager.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/connectormanager/OMRSEnterpriseConnectorManager.java index 8f37ea8962a..5a151e5b772 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/connectormanager/OMRSEnterpriseConnectorManager.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/connectormanager/OMRSEnterpriseConnectorManager.java @@ -25,7 +25,7 @@ import java.util.UUID; /** - * OMRSEnterpriseConnectorManager provides the connectors for all of the repositories in the connected metadata + * OMRSEnterpriseConnectorManager provides the connectors for all the repositories in the connected metadata * repository cohorts to each of the registered connector consumers. It supports: *
      *
    • @@ -73,17 +73,17 @@ public class OMRSEnterpriseConnectorManager implements OMRSConnectionConsumer, O private static final Logger log = LoggerFactory.getLogger(OMRSEnterpriseConnectorManager.class); - private boolean enterpriseAccessEnabled; - private int maxPageSize; + private final boolean enterpriseAccessEnabled; + private final int maxPageSize; + private final OMRSRepositoryContentManager repositoryContentManager; + private final List registeredRemoteConnectors = new ArrayList<>(); + private final List registeredConnectorConsumers = new ArrayList<>(); + private final AuditLog auditLog; + private final String localServerUserId; + private final String localServerPassword; private String localMetadataCollectionId = null; private LocalOMRSRepositoryConnector localRepositoryConnector = null; - private OMRSRepositoryContentManager repositoryContentManager; - private List registeredRemoteConnectors = new ArrayList<>(); - private List registeredConnectorConsumers = new ArrayList<>(); - private AuditLog auditLog; - private String localServerUserId; - private String localServerPassword; /** * Constructor for the enterprise connector manager. @@ -177,7 +177,7 @@ public void setLocalConnector(String localMetadataCollecti { /* - * Connector is ok so save along with the metadata collection Id. + * Connector is ok so save along with the metadata collection id. */ this.localRepositoryConnector = localRepositoryConnector; this.localMetadataCollectionId = localMetadataCollectionId; @@ -298,7 +298,7 @@ else if (registeredConnector.checkSameConnection(cohortName, } /* - * Don't need the connector any more - only created it to check that the connection was valid. + * Don't need the connector anymore - only created it to check that the connection was valid. */ remoteConnector.disconnect(); @@ -316,7 +316,7 @@ else if (registeredConnector.checkSameConnection(cohortName, /* - * Connector is ok so save the connection and metadata collection Id. + * Connector is ok so save the connection and metadata collection id. */ if (registeredConnector == null) { @@ -479,7 +479,7 @@ public synchronized void removeRemoteConnection(String cohortName, /** - * Remove all of the remote connections for the requested open metadata repository cohort. + * Remove all the remote connections for the requested open metadata repository cohort. * Care must be taken to only remove the remote connectors from the registered connector consumers if the * remote connection is only registered with this cohort. * @@ -523,7 +523,7 @@ public synchronized void removeCohort(String cohortName) * * @param connectorConsumer OMRSConnectorConsumer interested in details of the connectors to * all repositories registered in the metadata repository cluster. - * @return String identifier for the connectorConsumer used for the unregister call. + * @return String identifier for the connectorConsumer used for the call to unregister. */ public synchronized String registerConnectorConsumer(OMRSConnectorConsumer connectorConsumer) { @@ -582,7 +582,7 @@ public synchronized String registerConnectorConsumer(OMRSConnectorConsumer conne /** - * Unregister a connector consumer from the connector manager so it is no longer informed of + * Unregister a connector consumer from the connector manager, so it is no longer informed of * changes to the metadata repository cluster. * * @param connectorConsumerId String identifier of the connector consumer returned on the @@ -611,14 +611,14 @@ public synchronized void unregisterConnectorConsumer(String connectorConsumerI /** * Private method to convert a Connection into an OMRS repository connector using the OCF ConnectorBroker. * The OCF ConnectorBroker is needed because the implementation of the OMRS connector is unknown and - * may have come from a third party. Thus the official OCF protocol is followed to create the connector. + * may have come from a third party. Thus, the official OCF protocol is followed to create the connector. * Any failure to create the connector is returned as an exception. * * @param connection Connection properties * @param serverName name of the server for this connection. * @param serverType type of the remote server. * @param owningOrganizationName name of the organization the owns the remote server. - * @param metadataCollectionId metadata collection Id for this repository + * @param metadataCollectionId metadata collection id for this repository * @param metadataCollectionName metadata collection name for this repository * @return OMRSRepositoryConnector for the connection */ diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/EnterpriseOMRSConnectorProvider.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/EnterpriseOMRSConnectorProvider.java index 143b75ce78a..e8f712431a8 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/EnterpriseOMRSConnectorProvider.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/EnterpriseOMRSConnectorProvider.java @@ -34,15 +34,15 @@ public class EnterpriseOMRSConnectorProvider extends OMRSRepositoryConnectorProv { private static final Logger log = LoggerFactory.getLogger(EnterpriseOMRSConnectorProvider.class); - private OMRSConnectorManager connectorManager; - private OMRSRepositoryContentManager repositoryContentManager; - private String localServerName; - private String localServerType; - private OMRSAuditLog auditLog; - private String owningOrganizationName; - private String enterpriseMetadataCollectionId; - private String enterpriseMetadataCollectionName; - private String localMetadataCollectionId; + private final OMRSConnectorManager connectorManager; + private final OMRSRepositoryContentManager repositoryContentManager; + private final String localServerName; + private final String localServerType; + private final OMRSAuditLog auditLog; + private final String owningOrganizationName; + private final String enterpriseMetadataCollectionId; + private final String enterpriseMetadataCollectionName; + private final String localMetadataCollectionId; diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/EnterpriseOMRSRepositoryConnector.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/EnterpriseOMRSRepositoryConnector.java index a27338e2d7b..0e248960719 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/EnterpriseOMRSRepositoryConnector.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/EnterpriseOMRSRepositoryConnector.java @@ -37,7 +37,7 @@ */ public class EnterpriseOMRSRepositoryConnector extends OMRSRepositoryConnector implements OMRSConnectorConsumer { - private OMRSConnectorManager connectorManager; + private final OMRSConnectorManager connectorManager; private String connectorConsumerId; private LocalOMRSRepositoryConnector localConnector = null; @@ -63,7 +63,7 @@ public class EnterpriseOMRSRepositoryConnector extends OMRSRepositoryConnector i /** - * Set up the unique Id for this metadata collection. + * Set up the unique id for this metadata collection. * * @param metadataCollectionId String unique Id */ @@ -85,7 +85,7 @@ public void setMetadataCollectionId(String metadataCollectionId) } /** - * Set the unique Id of the metadata collection that is collocated with the Enterprise Metadata Collection + * Set the unique id of the metadata collection that is collocated with the Enterprise Metadata Collection * * @param localMetadataCollectionId String unique Id */ @@ -411,7 +411,7 @@ else if (remoteMetadataCollectionId.equals(instance.getReplicatedBy())) } /** - * Return the federated connector for a metadata collection Id + * Return the federated connector for a metadata collection id * * @param metadataCollectionId unique id for the metadata collection * @return federated connector or null @@ -442,7 +442,7 @@ private FederatedConnector getFederatedConnector(String metadataCollectionId) * Returns the list of repository connectors that the EnterpriseOMRSRepositoryConnector is federating queries across. * * This method is used by this connector's metadata collection object on each request it processes. This - * means it always has the most up to date list of connectors to work with. + * means it always has the most up-to-date list of connectors to work with. * * @param methodName name of method making the request (used for logging) * @return OMRSRepositoryConnector List @@ -615,8 +615,8 @@ public synchronized void removeRemoteConnector(String metadataCollectionId) /** - * The OMRS is about to shutdown. - * Call disconnect on all registered remote connectors and stop calling them. + * The OMRS is about to shut down. + * Call disconnect() on all registered remote connectors and stop calling them. * There is no need to disconnect the local connector - that is handled by the EnterpriseConnectorManager */ @Override diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/ClassificationAccumulator.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/ClassificationAccumulator.java index 50fd53df788..b559773794d 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/ClassificationAccumulator.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/ClassificationAccumulator.java @@ -15,7 +15,7 @@ * ClassificationAccumulator accumulates and validates an entity received from a collection of open metadata * repositories. It removes duplicates from the list by choosing the latest entity details object. * - * This class may be called simultaneously from many different threads so it must be thread-safe. + * This class may be called simultaneously from multiple threads, so it must be thread-safe. */ public abstract class ClassificationAccumulator extends MaintenanceAccumulator { @@ -25,7 +25,7 @@ public abstract class ClassificationAccumulator extends MaintenanceAccumulator /** - * Construct a entity accumulator. Its base class manages the common variables needed to + * Construct an entity accumulator. Its base class manages the common variables needed to * control the execution of requests across all members of the cohort(s). * * @param auditLog audit log provides destination for log messages @@ -89,7 +89,7 @@ public synchronized List getContributingMetadataCollections() /** - * Save the best classifications from all of the repositories. + * Save the best classifications from all the repositories. * * @param retrievedClassifications classifications from a repository */ diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/EntitiesAccumulator.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/EntitiesAccumulator.java index 562fe959cdb..f78b7586264 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/EntitiesAccumulator.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/EntitiesAccumulator.java @@ -19,7 +19,7 @@ * EntitiesAccumulator accumulates and validates entities received from a collection of open metadata * repositories. It removes duplicates from the list by choosing the latest entity details object. * - * This class may be called simultaneously from many different threads so it must be thread-safe. + * This class may be called simultaneously from different threads, so it must be thread-safe. */ public class EntitiesAccumulator extends QueryInstanceAccumulatorBase { @@ -32,10 +32,10 @@ public class EntitiesAccumulator extends QueryInstanceAccumulatorBase /** - * Construct a entity accumulator. Its base class manages the common variables needed to + * Construct an entity accumulator. Its base class manages the common variables needed to * control the execution of requests across all members of the cohort(s). * - * @param localMetadataCollectionId collection Id of local repository - null means no local repository + * @param localMetadataCollectionId collection id of local repository - null means no local repository * @param auditLog audit log provides destination for log messages * @param repositoryValidator validator provides common validation routines */ @@ -134,7 +134,7 @@ public synchronized void addEntities(List entities, /** - * Add a list of classifications to the accumulator. These are extracted from the retrieved entities or they are separately + * Add a list of classifications to the accumulator. These are extracted from the retrieved entities, or they are separately * retrieved from metadata collections that only have an entity proxy with * classifications connected to it that are uniquely stored in the metadata collection. * @@ -238,8 +238,8 @@ public List getResultsForAugmentation() /** - * Extract the results - this will the a unique list of entities selected from the instances - * supplied to this accumulator. It should be called once all of the executors have completed processing + * Extract the results - this will be a unique list of entities selected from the instances + * supplied to this accumulator. It should be called once all the executors have completed processing * their request(s). * * @param repositoryConnector enterprise connector diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/EntityDetailAccumulator.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/EntityDetailAccumulator.java index 9158ef4114e..561dbc19715 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/EntityDetailAccumulator.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/EntityDetailAccumulator.java @@ -13,7 +13,7 @@ * ClassificationAccumulator accumulates and validates an entity received from a collection of open metadata * repositories. It removes duplicates from the list by choosing the latest entity details object. * - * This class may be called simultaneously from many different threads so it must be thread-safe. + * This class may be called simultaneously from different threads, so it must be thread-safe. */ public class EntityDetailAccumulator extends ClassificationAccumulator { @@ -21,7 +21,7 @@ public class EntityDetailAccumulator extends ClassificationAccumulator /** - * Construct a entity accumulator. Its base class manages the common variables needed to + * Construct an entity accumulator. Its base class manages the common variables needed to * control the execution of requests across all members of the cohort(s). * * @param auditLog audit log provides destination for log messages @@ -96,7 +96,7 @@ public List getResultsForAugmentation() /** - * Extract the resulting entity and accumulated classifications. It should be called once all of the executors have completed processing + * Extract the resulting entity and accumulated classifications. It should be called once all the executors have completed processing * their request(s). * * @return list of entities diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/EntitySummaryAccumulator.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/EntitySummaryAccumulator.java index 0f5b08d6dcd..7d29129960e 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/EntitySummaryAccumulator.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/EntitySummaryAccumulator.java @@ -14,7 +14,7 @@ * ClassificationAccumulator accumulates and validates an entity received from a collection of open metadata * repositories. It removes duplicates from the list by choosing the latest entity details object. * - * This class may be called simultaneously from many different threads so it must be thread-safe. + * This class may be called simultaneously from different threads, so it must be thread-safe. */ public class EntitySummaryAccumulator extends ClassificationAccumulator { @@ -22,7 +22,7 @@ public class EntitySummaryAccumulator extends ClassificationAccumulator /** - * Construct a entity accumulator. Its base class manages the common variables needed to + * Construct an entity accumulator. Its base class manages the common variables needed to * control the execution of requests across all members of the cohort(s). * * @param auditLog audit log provides destination for log messages @@ -97,7 +97,7 @@ public List getResultsForAugmentation() /** - * Extract the resulting entity and accumulated classifications. It should be called once all of the executors have completed processing + * Extract the resulting entity and accumulated classifications. It should be called once all the executors have completed processing * their request(s). * * @return list of entities diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/InstanceGraphAccumulator.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/InstanceGraphAccumulator.java index a5e3f04ae3c..0c4431ec6d7 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/InstanceGraphAccumulator.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/InstanceGraphAccumulator.java @@ -16,7 +16,7 @@ public class InstanceGraphAccumulator extends QueryAccumulatorBase * Construct a query accumulator. This base class manages the common variables needed to * control the execution of requests across all members of the cohort(s). * - * @param localMetadataCollectionId collection Id of local repository - null means no local repository + * @param localMetadataCollectionId collection id of local repository - null means no local repository * @param auditLog audit log provides destination for log messages * @param repositoryValidator validator provides common validation routines */ diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/QueryAccumulatorBase.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/QueryAccumulatorBase.java index 433ec7ca306..e277902fdf9 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/QueryAccumulatorBase.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/QueryAccumulatorBase.java @@ -19,9 +19,9 @@ public class QueryAccumulatorBase extends ExceptionAccumulatorBase protected String localMetadataCollectionId; protected OMRSRepositoryValidator repositoryValidator; - private int responsesRequired = 0; - private Map resultsContributed = new HashMap<>(); - private boolean resultsReturned = false; + private int responsesRequired = 0; + private final Map resultsContributed = new HashMap<>(); + private boolean resultsReturned = false; /** diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/QueryInstanceAccumulatorBase.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/QueryInstanceAccumulatorBase.java index 83241ba2e0a..db432cf1551 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/QueryInstanceAccumulatorBase.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/QueryInstanceAccumulatorBase.java @@ -21,7 +21,7 @@ public class QueryInstanceAccumulatorBase extends QueryAccumulatorBase * Construct a query accumulator. This base class manages the common variables needed to * control the execution of requests across all members of the cohort(s). * - * @param localMetadataCollectionId collection Id of local repository - null means no local repository + * @param localMetadataCollectionId collection id of local repository - null means no local repository * @param auditLog audit log provides destination for log messages * @param repositoryValidator validator provides common validation routines */ diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/RelationshipsAccumulator.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/RelationshipsAccumulator.java index 14d8c254acd..035dd2990a1 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/RelationshipsAccumulator.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/RelationshipsAccumulator.java @@ -16,7 +16,7 @@ * RelationshipsAccumulator accumulates and validates relationships received from a collection of open metadata * repositories. It removes duplicates from the list by choosing the latest version. * - * This class may be called simultaneously from many different threads so it must be thread-safe. + * This class may be called simultaneously from different threads so it must be thread-safe. */ public class RelationshipsAccumulator extends QueryInstanceAccumulatorBase { @@ -27,7 +27,7 @@ public class RelationshipsAccumulator extends QueryInstanceAccumulatorBase * Construct a relationship accumulator. Its base class manages the common variables needed to * control the execution of requests across all members of the cohort(s). * - * @param localMetadataCollectionId collection Id of local repository - null means no local repository + * @param localMetadataCollectionId collection id of local repository - null means no local repository * @param auditLog audit log provides destination for log messages * @param repositoryValidator validator provides common validation routines */ diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/control/FederationControl.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/control/FederationControl.java index e7ebdb81dd1..ba4af8c91c4 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/control/FederationControl.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/control/FederationControl.java @@ -15,7 +15,7 @@ * executor object that is able to issue the appropriate query and handle the response. * * The federation control class calls the executor repeatedly, passing in the metadata collection - * until the executor tells it to stop or it runs out of registered repositories. + * until the executor tells it to stop, or it runs out of registered repositories. * * The caller (enterprise connector) then requests the response from the executor. */ diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/control/FederationControlBase.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/control/FederationControlBase.java index 2372b43d97e..51173521adb 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/control/FederationControlBase.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/control/FederationControlBase.java @@ -21,7 +21,7 @@ * executor object that is able to issue the appropriate query and handle the response. * * The federation control class calls the executor repeatedly, passing in the metadata collection - * until the executor tells it to stop or it runs out of registered repositories. + * until the executor tells it to stop, or it runs out of registered repositories. * * The caller (enterprise connector) then requests the response from the executor. */ @@ -66,7 +66,7 @@ public FederationControlBase(String userId, /** * Verify that a cohort member's metadata collection is not null. * - * @param cohortConnector + * @param cohortConnector connector to remote repository * @param cohortMetadataCollection metadata collection * @param methodName name of method * @return metadata collection id @@ -82,7 +82,7 @@ String validateMetadataCollection(OMRSRepositoryConnector cohortConnector, if (cohortMetadataCollection == null) { /* - * A problem in the set up of the metadata collection list. Repository connectors implemented + * A problem in the setup of the metadata collection list. Repository connectors implemented * with no metadata collection are tested for in the OMRSEnterpriseConnectorManager so something * else has gone wrong. */ diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/control/ParallelFederationControl.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/control/ParallelFederationControl.java index eaaa7aa27db..10d66a0806a 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/control/ParallelFederationControl.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/control/ParallelFederationControl.java @@ -3,7 +3,6 @@ package org.odpi.openmetadata.repositoryservices.enterprise.repositoryconnector.control; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; -import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.OMRSMetadataCollection; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryConnector; import org.odpi.openmetadata.repositoryservices.enterprise.repositoryconnector.executors.RepositoryExecutor; import org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException; @@ -16,7 +15,7 @@ public class ParallelFederationControl extends FederationControlBase { // todo at this point the parallel federation control uses the sequential federation control since the worker threads are not implemented. - private SequentialFederationControl sequentialFederationControl; + private final SequentialFederationControl sequentialFederationControl; /** * Constructor for a federated query diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/control/SequentialFederationControl.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/control/SequentialFederationControl.java index dca74560e50..4b39d7249e9 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/control/SequentialFederationControl.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/control/SequentialFederationControl.java @@ -8,7 +8,6 @@ import org.odpi.openmetadata.repositoryservices.enterprise.repositoryconnector.executors.RepositoryExecutor; import org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException; -import java.util.Iterator; import java.util.List; /** @@ -61,7 +60,7 @@ public void executeCommand(RepositoryExecutor executor) throws RepositoryErrorEx if (executor.issueRequestToRepository(metadataCollectionId, metadataCollection)) { /* - * The executor returns true if it has all of the results it needs. + * The executor returns true if it has all the results it needs. * If it returns false it means it needs more info from another repository. */ break; diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/AddEntityExecutor.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/AddEntityExecutor.java index cbdc153be9c..ddad1c09ded 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/AddEntityExecutor.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/AddEntityExecutor.java @@ -19,11 +19,12 @@ */ public class AddEntityExecutor extends RepositoryExecutorBase { - private String entityTypeGUID; - private InstanceProperties initialProperties; - private List initialClassifications; - private InstanceStatus initialStatus; - private MaintenanceAccumulator accumulator; + private final String entityTypeGUID; + private final InstanceProperties initialProperties; + private final List initialClassifications; + private final InstanceStatus initialStatus; + private final MaintenanceAccumulator accumulator; + private String externalSourceGUID = null; private String externalSourceName = null; private EntityDetail newEntity = null; diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/AddRelationshipExecutor.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/AddRelationshipExecutor.java index b3ed1aa1c2f..bac08903726 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/AddRelationshipExecutor.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/AddRelationshipExecutor.java @@ -20,13 +20,14 @@ */ public class AddRelationshipExecutor extends RepositoryExecutorBase { - private MaintenanceAccumulator accumulator; + private final MaintenanceAccumulator accumulator; + + private final String relationshipTypeGUID; + private final InstanceProperties initialProperties; + private final EntityProxy entityOneProxy; + private final EntityProxy entityTwoProxy; + private final InstanceStatus initialStatus; - private String relationshipTypeGUID; - private InstanceProperties initialProperties; - private EntityProxy entityOneProxy; - private EntityProxy entityTwoProxy; - private InstanceStatus initialStatus; private String externalSourceGUID = null; private String externalSourceName = null; private Relationship newRelationship = null; diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/ClassifyEntityExecutor.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/ClassifyEntityExecutor.java index 100c101fb57..33b37b73d12 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/ClassifyEntityExecutor.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/ClassifyEntityExecutor.java @@ -15,7 +15,7 @@ /** * RestoreEntityExecutor provides the executor for the restoreEntity method. - * This is a tricky request because the entity has been deleted so it is + * This is a tricky request because the entity has been deleted, so it is * not retrievable until restored. Also, this is an optional function * so the repository where the entity has its home may not support restore. * @@ -24,15 +24,15 @@ */ public class ClassifyEntityExecutor extends RepositoryExecutorBase { - private MaintenanceAccumulator accumulator; - private String entityGUID; - private EntityProxy entityProxy; - private String classificationName; - private String externalSourceGUID; - private String externalSourceName; - private ClassificationOrigin classificationOrigin; - private String classificationOriginGUID; - private InstanceProperties classificationProperties; + private final MaintenanceAccumulator accumulator; + private final String entityGUID; + private final EntityProxy entityProxy; + private final String classificationName; + private final String externalSourceGUID; + private final String externalSourceName; + private final ClassificationOrigin classificationOrigin; + private final String classificationOriginGUID; + private final InstanceProperties classificationProperties; private EntityDetail updatedEntity = null; private Classification addedClassification = null; @@ -43,6 +43,7 @@ public class ClassifyEntityExecutor extends RepositoryExecutorBase * * @param userId unique identifier for requesting user * @param entityGUID unique identifier (guid) for the entity + * @param entityProxy entity proxy to anchor classification * @param classificationName String name for the classification * @param externalSourceGUID unique identifier (guid) for the external source * @param externalSourceName unique name for the external source diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/FindEntitiesByClassificationExecutor.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/FindEntitiesByClassificationExecutor.java index ac755d42b93..ad7402d9ae9 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/FindEntitiesByClassificationExecutor.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/FindEntitiesByClassificationExecutor.java @@ -22,9 +22,9 @@ */ public class FindEntitiesByClassificationExecutor extends PageableEntityRepositoryExecutorBase { - private String classificationName; - private InstanceProperties matchClassificationProperties; - private MatchCriteria matchCriteria; + private final String classificationName; + private final InstanceProperties matchClassificationProperties; + private final MatchCriteria matchCriteria; /** * Create the executor. The parameters provide the parameters for issuing the requests and @@ -32,7 +32,7 @@ public class FindEntitiesByClassificationExecutor extends PageableEntityReposito * * @param userId unique identifier for requesting user. * @param entityTypeGUID unique identifier for the type of entity requested. Null means any type of entity - * (but could be slow so not recommended. + * (but could be slow so not recommended). * @param classificationName name of the classification, note a null is not valid. * @param matchClassificationProperties Optional list of entity properties to match (contains wildcards). * @param matchCriteria Enum defining how the match properties should be matched to the classifications in the repository. @@ -91,7 +91,7 @@ public FindEntitiesByClassificationExecutor(String userId, * * @param userId unique identifier for requesting user. * @param entityTypeGUID unique identifier for the type of entity requested. Null means any type of entity - * (but could be slow so not recommended. + * (but could be slow so not recommended). * @param classificationName name of the classification, note a null is not valid. * @param matchClassificationProperties Optional list of entity properties to match (contains wildcards). * @param matchCriteria Enum defining how the match properties should be matched to the classifications in the repository. diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/FindEntitiesByPropertyExecutor.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/FindEntitiesByPropertyExecutor.java index 4ddf39c9014..ca9067ba479 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/FindEntitiesByPropertyExecutor.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/FindEntitiesByPropertyExecutor.java @@ -22,9 +22,9 @@ */ public class FindEntitiesByPropertyExecutor extends PageableEntityRepositoryExecutorBase { - private InstanceProperties matchProperties; - private MatchCriteria matchCriteria; - private List limitResultsByClassification; + private final InstanceProperties matchProperties; + private final MatchCriteria matchCriteria; + private final List limitResultsByClassification; /** diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/FindEntitiesByPropertyValueExecutor.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/FindEntitiesByPropertyValueExecutor.java index ecd151ac22d..372eb6589b7 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/FindEntitiesByPropertyValueExecutor.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/FindEntitiesByPropertyValueExecutor.java @@ -20,8 +20,8 @@ */ public class FindEntitiesByPropertyValueExecutor extends PageableEntityRepositoryExecutorBase { - private String searchCriteria; - private List limitResultsByClassification; + private final String searchCriteria; + private final List limitResultsByClassification; /** diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/FindEntitiesExecutor.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/FindEntitiesExecutor.java index 34270f7e71d..da766906bd8 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/FindEntitiesExecutor.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/FindEntitiesExecutor.java @@ -22,9 +22,9 @@ */ public class FindEntitiesExecutor extends PageableEntityRepositoryExecutorBase { - private SearchProperties matchProperties; - private SearchClassifications matchClassifications; - private List instanceSubtypeGUIDs; + private final SearchProperties matchProperties; + private final SearchClassifications matchClassifications; + private final List instanceSubtypeGUIDs; /** * Create the executor. The parameters provide the parameters for issuing the requests and diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/FindRelationshipsByPropertyExecutor.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/FindRelationshipsByPropertyExecutor.java index 3347f17ed9f..08bbf6a1d7b 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/FindRelationshipsByPropertyExecutor.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/FindRelationshipsByPropertyExecutor.java @@ -24,10 +24,10 @@ */ public class FindRelationshipsByPropertyExecutor extends PageableRepositoryExecutorBase { - private InstanceProperties matchProperties; - private MatchCriteria matchCriteria; + private final InstanceProperties matchProperties; + private final MatchCriteria matchCriteria; - private RelationshipsAccumulator accumulator; + private final RelationshipsAccumulator accumulator; /** diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/FindRelationshipsByPropertyValueExecutor.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/FindRelationshipsByPropertyValueExecutor.java index 984d0b88c1d..7e46a3e4815 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/FindRelationshipsByPropertyValueExecutor.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/FindRelationshipsByPropertyValueExecutor.java @@ -22,9 +22,9 @@ */ public class FindRelationshipsByPropertyValueExecutor extends PageableRepositoryExecutorBase { - private String searchCriteria; + private final String searchCriteria; - private RelationshipsAccumulator accumulator; + private final RelationshipsAccumulator accumulator; /** diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/FindRelationshipsExecutor.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/FindRelationshipsExecutor.java index 84e77b2b3c5..4b374cae879 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/FindRelationshipsExecutor.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/FindRelationshipsExecutor.java @@ -23,10 +23,10 @@ */ public class FindRelationshipsExecutor extends PageableRepositoryExecutorBase { - private SearchProperties matchProperties; - private List instanceSubtypeGUIDs; + private final SearchProperties matchProperties; + private final List instanceSubtypeGUIDs; - private RelationshipsAccumulator accumulator; + private final RelationshipsAccumulator accumulator; /** * Create the executor. The parameters provide the parameters for issuing the requests and diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/GetAllTypesExecutor.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/GetAllTypesExecutor.java index 7ce6400bde0..238cf16380c 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/GetAllTypesExecutor.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/GetAllTypesExecutor.java @@ -17,7 +17,7 @@ */ public class GetAllTypesExecutor extends CloneableRepositoryExecutorBase { - private TypesAccumulator accumulator; + private final TypesAccumulator accumulator; /** * Simple public constructor diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/GetEntityDetailExecutor.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/GetEntityDetailExecutor.java index 1eb1e20c880..a5805f1f6d9 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/GetEntityDetailExecutor.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/GetEntityDetailExecutor.java @@ -30,7 +30,7 @@ public class GetEntityDetailExecutor extends GetEntityExecutor private boolean allExceptions = true; private Date asOfTime = null; - private EntityDetailAccumulator accumulator; + private final EntityDetailAccumulator accumulator; /** diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/GetEntityExecutor.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/GetEntityExecutor.java index 75357aa3e45..10201025942 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/GetEntityExecutor.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/GetEntityExecutor.java @@ -16,7 +16,8 @@ */ public abstract class GetEntityExecutor extends RepositoryExecutorBase { - private ClassificationAccumulator accumulator; + private final ClassificationAccumulator accumulator; + protected String entityGUID; diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/GetEntitySummaryExecutor.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/GetEntitySummaryExecutor.java index 6fc22cfa405..73b08e86c65 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/GetEntitySummaryExecutor.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/GetEntitySummaryExecutor.java @@ -16,7 +16,7 @@ */ public class GetEntitySummaryExecutor extends GetEntityExecutor { - private EntitySummaryAccumulator accumulator; + private final EntitySummaryAccumulator accumulator; /** diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/GetRelationshipExecutor.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/GetRelationshipExecutor.java index 3d8cbdf616d..4a169db992b 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/GetRelationshipExecutor.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/GetRelationshipExecutor.java @@ -16,8 +16,9 @@ */ public class GetRelationshipExecutor extends RepositoryExecutorBase { - private MaintenanceAccumulator accumulator; - private String relationshipGUID; + private final MaintenanceAccumulator accumulator; + private final String relationshipGUID; + private boolean allExceptions = true; private Date asOfTime = null; private Relationship retrievedRelationship = null; diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/GetRelationshipsForEntityExecutor.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/GetRelationshipsForEntityExecutor.java index 8a61f17ef9f..358384b8aa9 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/GetRelationshipsForEntityExecutor.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/GetRelationshipsForEntityExecutor.java @@ -22,8 +22,8 @@ */ public class GetRelationshipsForEntityExecutor extends PageableRepositoryExecutorBase { - private String entityGUID; - private RelationshipsAccumulator accumulator; + private final String entityGUID; + private final RelationshipsAccumulator accumulator; /** diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/PageableRepositoryExecutorBase.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/PageableRepositoryExecutorBase.java index acb1c7dba2a..29d2902c701 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/PageableRepositoryExecutorBase.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/PageableRepositoryExecutorBase.java @@ -17,6 +17,8 @@ */ abstract class PageableRepositoryExecutorBase extends CloneableRepositoryExecutorBase { + private final QueryInstanceAccumulatorBase queryInstanceAccumulator; + int startingElement; int pageSize; @@ -26,7 +28,6 @@ abstract class PageableRepositoryExecutorBase extends CloneableRepositoryExecuto SequencingOrder sequencingOrder; Date asOfTime; - private QueryInstanceAccumulatorBase queryInstanceAccumulator; /** * Create the executor. The parameters provide the parameters for issuing the requests and diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/PurgeEntityExecutor.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/PurgeEntityExecutor.java index 93c5f497cec..156f5c908f7 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/PurgeEntityExecutor.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/PurgeEntityExecutor.java @@ -10,7 +10,7 @@ /** * PurgeEntityExecutor provides the executor for the purgeEntity method. - * This is a tricky request because the entity has been deleted so it is + * This is a tricky request because the entity has been deleted, so it is * not retrievable until restored. * * The only possible approach is to step through the repositories hoping that one @@ -18,10 +18,11 @@ */ public class PurgeEntityExecutor extends RepositoryExecutorBase { - private MaintenanceAccumulator accumulator; - private String entityGUID; - private String typeDefGUID; - private String typeDefName; + private final MaintenanceAccumulator accumulator; + private final String entityGUID; + private final String typeDefGUID; + private final String typeDefName; + private boolean entityDeleted = false; diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/PurgeRelationshipExecutor.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/PurgeRelationshipExecutor.java index 86850e2b850..5277ff2012d 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/PurgeRelationshipExecutor.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/PurgeRelationshipExecutor.java @@ -10,7 +10,7 @@ /** * PurgeRelationshipExecutor provides the executor for the purgeRelationship method. - * This is a tricky request because the relationship has been deleted so it is + * This is a tricky request because the relationship has been deleted, so it is * not retrievable until restored. * * The only possible approach is to step through the repositories hoping that one @@ -18,10 +18,11 @@ */ public class PurgeRelationshipExecutor extends RepositoryExecutorBase { - private MaintenanceAccumulator accumulator; - private String relationshipGUID; - private String typeDefGUID; - private String typeDefName; + private final MaintenanceAccumulator accumulator; + private final String relationshipGUID; + private final String typeDefGUID; + private final String typeDefName; + private boolean relationshipDeleted = false; diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/RestoreEntityExecutor.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/RestoreEntityExecutor.java index 1dfc501253a..d5fe0990f4e 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/RestoreEntityExecutor.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/RestoreEntityExecutor.java @@ -20,8 +20,9 @@ */ public class RestoreEntityExecutor extends RepositoryExecutorBase { - private MaintenanceAccumulator accumulator; - private String entityGUID; + private final MaintenanceAccumulator accumulator; + private final String entityGUID; + private EntityDetail restoredEntity = null; diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/RestoreRelationshipExecutor.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/RestoreRelationshipExecutor.java index 580be9eec3c..d53bcf55cf0 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/RestoreRelationshipExecutor.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/RestoreRelationshipExecutor.java @@ -20,8 +20,9 @@ */ public class RestoreRelationshipExecutor extends RepositoryExecutorBase { - private MaintenanceAccumulator accumulator; - private String relationshipGUID; + private final MaintenanceAccumulator accumulator; + private final String relationshipGUID; + private Relationship restoredRelationship = null; diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/VerifyAttributeTypeDefExecutor.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/VerifyAttributeTypeDefExecutor.java index 30dfab5d17e..457823f6b9c 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/VerifyAttributeTypeDefExecutor.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/VerifyAttributeTypeDefExecutor.java @@ -15,8 +15,9 @@ */ public class VerifyAttributeTypeDefExecutor extends RepositoryExecutorBase { - private MaintenanceAccumulator accumulator; - private AttributeTypeDef attributeTypeDef; + private final MaintenanceAccumulator accumulator; + private final AttributeTypeDef attributeTypeDef; + private boolean result = false; private boolean resultSet = false; diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/VerifyTypeDefExecutor.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/VerifyTypeDefExecutor.java index c1c5a804b46..95bfcda434c 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/VerifyTypeDefExecutor.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/executors/VerifyTypeDefExecutor.java @@ -16,8 +16,9 @@ */ public class VerifyTypeDefExecutor extends RepositoryExecutorBase { - private TypeDef typeDef; - private MaintenanceAccumulator accumulator; + private final TypeDef typeDef; + private final MaintenanceAccumulator accumulator; + private boolean result = false; private boolean resultSet = false; diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/eventmanagement/OMRSEventListener.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/eventmanagement/OMRSEventListener.java index 5b4b6b18acd..027b62c0568 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/eventmanagement/OMRSEventListener.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/eventmanagement/OMRSEventListener.java @@ -24,17 +24,18 @@ */ public class OMRSEventListener implements OMRSTopicListener { - private String cohortName; - private String localMetadataCollectionId; + private final String cohortName; + private final String localMetadataCollectionId; + private OpenMetadataEventsSecurity securityVerifier; /* * There is an event processor for each category of event. The OMRSEventListener passes appropriate events to these * objects depending on the settings of its configuration. */ - private OMRSRegistryEventProcessor registryEventProcessor; - private OMRSTypeDefEventProcessorInterface typeDefEventProcessor; - private OMRSInstanceEventProcessorInterface instanceEventProcessor; + private final OMRSRegistryEventProcessor registryEventProcessor; + private final OMRSTypeDefEventProcessorInterface typeDefEventProcessor; + private final OMRSInstanceEventProcessorInterface instanceEventProcessor; private static final Logger log = LoggerFactory.getLogger(OMRSEventListener.class); @@ -190,13 +191,13 @@ else if (registryEventProcessor == null) /* * New type of registry event that this server does not understand ignore it */ - log.debug("Unknown registry event: " + registryEvent.toString()); + log.debug("Unknown registry event: " + registryEvent); break; } } else { - log.debug("Ignored registry event: " + registryEvent.toString()); + log.debug("Ignored registry event: " + registryEvent); } } } diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/eventmanagement/OMRSRegistryEventPublisher.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/eventmanagement/OMRSRegistryEventPublisher.java index 913f88ceec4..df4aac3b923 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/eventmanagement/OMRSRegistryEventPublisher.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/eventmanagement/OMRSRegistryEventPublisher.java @@ -21,12 +21,11 @@ */ public class OMRSRegistryEventPublisher extends OMRSRegistryEventProcessor { - private AuditLog auditLog; - private static final Logger log = LoggerFactory.getLogger(OMRSRegistryEventPublisher.class); - private String publisherName; - private List omrsTopicConnectors; + private final String publisherName; + private final List omrsTopicConnectors; + private final AuditLog auditLog; /** @@ -100,7 +99,7 @@ private boolean sendRegistryEvent(OMRSRegistryEvent registryEvent) { auditLog.logException(actionDescription, OMRSAuditCode.SEND_REGISTRY_EVENT_ERROR.getMessageDefinition(publisherName), - "registryEvent : " + registryEvent.toString(), + "registryEvent : " + registryEvent, error); log.debug("Exception: " + error + "; Registry Event: " + registryEvent); diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/eventmanagement/OMRSRepositoryEventBuilder.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/eventmanagement/OMRSRepositoryEventBuilder.java index a1ac028c5b8..e8a93f58f58 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/eventmanagement/OMRSRepositoryEventBuilder.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/eventmanagement/OMRSRepositoryEventBuilder.java @@ -783,7 +783,7 @@ public void processReclassifiedEntityEvent(String sourceName, /** * An existing entity has been deleted. This is a soft delete. This means it is still in the repository - * but it is no longer returned on queries. + * but, it is no longer returned on queries. * * All relationships to the entity are also soft-deleted and will no longer be usable. These deleted relationships * will be notified through separate events. @@ -1014,7 +1014,7 @@ public void processReIdentifiedEntityEvent(String sourceName, /** - * An existing entity has had its type changed. Typically this action is taken to move an entity's + * An existing entity has had its type changed. Typically, this action is taken to move an entity's * type to either a super type (so the subtype can be deleted) or a new subtype (so additional properties can be * added.) However, the type can be changed to any compatible type. * @@ -1283,7 +1283,7 @@ public void processUndoneRelationshipEvent(String sourceName, /** * An existing relationship has been deleted. This is a soft delete. This means it is still in the repository - * but it is no longer returned on queries. + * but, it is no longer returned on queries. * * @param sourceName name of the source of the event. It may be the cohort name for incoming events or the * local repository, or event mapper name. @@ -1507,7 +1507,7 @@ public void processReIdentifiedRelationshipEvent(String sourceName, /** - * An existing relationship has had its type changed. Typically this action is taken to move a relationship's + * An existing relationship has had its type changed. Typically, this action is taken to move a relationship's * type to either a super type (so the subtype can be deleted) or a new subtype (so additional properties can be * added.) However, the type can be changed to any compatible type. * diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/eventmanagement/OMRSRepositoryEventExchangeRule.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/eventmanagement/OMRSRepositoryEventExchangeRule.java index 1819e940e23..426aecb63b1 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/eventmanagement/OMRSRepositoryEventExchangeRule.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/eventmanagement/OMRSRepositoryEventExchangeRule.java @@ -18,12 +18,12 @@ */ public class OMRSRepositoryEventExchangeRule { - private OpenMetadataExchangeRule exchangeRule; - private List selectedTypesToProcess = new ArrayList<>(); + private final OpenMetadataExchangeRule exchangeRule; + private final List selectedTypesToProcess = new ArrayList<>(); /** - * Constructor provides all of the objects used in the event exchange decision. + * Constructor provides all the objects used in the event exchange decision. * * @param exchangeRule enum detailing the types of events to process. * @param selectedTypesToProcess supplementary list to support selective processing of events. diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/eventmanagement/OMRSRepositoryEventManager.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/eventmanagement/OMRSRepositoryEventManager.java index 8444fdbe83b..77a73e8b511 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/eventmanagement/OMRSRepositoryEventManager.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/eventmanagement/OMRSRepositoryEventManager.java @@ -31,19 +31,20 @@ */ public class OMRSRepositoryEventManager extends OMRSRepositoryEventBuilder { + private final List typeDefEventBuffer = new ArrayList<>(); + private final List instanceEventBuffer = new ArrayList<>(); + private final List typeDefEventConsumers = new ArrayList<>(); + private final List instanceEventConsumers = new ArrayList<>(); + private final OMRSRepositoryContentValidator repositoryValidator; /* set in constructor */ + private final OMRSRepositoryEventExchangeRule exchangeRule; /* set in constructor */ + private boolean isActive = false; - private List typeDefEventBuffer = new ArrayList<>(); - private List instanceEventBuffer = new ArrayList<>(); - private List typeDefEventConsumers = new ArrayList<>(); - private List instanceEventConsumers = new ArrayList<>(); - private OMRSRepositoryContentValidator repositoryValidator; /* set in constructor */ - private OMRSRepositoryEventExchangeRule exchangeRule; /* set in constructor */ /* * The audit log provides a verifiable record of the open metadata archives that have been loaded into * the open metadata repository. The Logger is for standard debug. */ - private AuditLog auditLog; + private final AuditLog auditLog; private static final Logger log = LoggerFactory.getLogger(OMRSRepositoryEventManager.class); @@ -155,8 +156,7 @@ public void registerRepositoryEventProcessor(OMRSRepositoryEventProcessor reposi /** - * Indicate that all of the event processors are registered and it is ready to - * process events. + * Indicate that all the event processors are registered and they are ready to process events. */ public void start() { @@ -177,7 +177,7 @@ public void start() /* * This sends out the buffered events. There is a possibility that * new events may be interlaced, or go ahead of the buffered events. - * However the receiver should be able to handle this since event buses + * However, the receiver should be able to handle this since event buses * do not necessarily guarantee delivery order is the same as the sending * order. */ @@ -186,8 +186,8 @@ public void start() /** - * Send out all of the buffered events, beginning with the TypeDef events and - * then the instance events. Typically the TypeDef events should cover all of the + * Send out all the buffered events, beginning with the TypeDef events and + * then the instance events. Typically, the TypeDef events should cover all the * TypeDefs that were added during start up. These events help to ensure there is * consistency in the types used in the cohort. *

      @@ -232,7 +232,7 @@ private void drainEventBuffers() InternalOMRSEventProcessingContext.getInstance().setCurrentMessageId(event.getMessageId()); this.distributeInstanceEvent(event.getEvent()); //Now that the buffered event has been distributed, we need to update the Future - //that the OpenMetadataTopicConnector is monitoring the reflect the state of + //that the OpenMetadataTopicConnector is monitoring to reflect the state of //any asynchronous event processing that is taking place for this event. //That future is recorded in the BufferedInstanceEvent. @@ -715,7 +715,7 @@ public void processReclassifiedEntityEvent(String sourceName, /** - * An existing entity has been deleted. This is a soft delete. This means it is still in the repository + * An existing entity has been deleted. This is a soft delete. This means it is still in the repository, * but it is no longer returned on queries. * * All relationships to the entity are also soft-deleted and will no longer be usable. These deleted relationships @@ -856,7 +856,7 @@ public void processPurgedEntityEvent(String sourceName, /** - * An existing entity has been deleted. This is a soft delete. This means it is still in the repository + * An existing entity has been deleted. This is a soft delete. This means it is still in the repository, * but it is no longer returned on queries. * * All relationships to the entity are also deleted and purged and will no longer be usable. These deleted relationships @@ -927,7 +927,7 @@ public void processReIdentifiedEntityEvent(String sourceName, /** - * An existing entity has had its type changed. Typically this action is taken to move an entity's + * An existing entity has had its type changed. Typically, this action is taken to move an entity's * type to either a super type (so the subtype can be deleted) or a new subtype (so additional properties can be * added.) However, the type can be changed to any compatible type. * @@ -1171,7 +1171,7 @@ public void processUndoneRelationshipEvent(String sourceName, /** - * An existing relationship has been deleted. This is a soft delete. This means it is still in the repository + * An existing relationship has been deleted. This is a soft delete. This means it is still in the repository, * but it is no longer returned on queries. * * @param sourceName name of the source of the event. It may be the cohort name for incoming events or the @@ -1309,7 +1309,7 @@ public void processPurgedRelationshipEvent(String sourceName, /** - * An existing relationship has been deleted. This is a soft delete. This means it is still in the repository + * An existing relationship has been deleted. This is a soft delete. This means it is still in the repository, * but it is no longer returned on queries. * * @param sourceName name of the source of the event. It may be the cohort name for incoming events or the @@ -1377,7 +1377,7 @@ public void processReIdentifiedRelationshipEvent(String sourceName, /** - * An existing relationship has had its type changed. Typically this action is taken to move a relationship's + * An existing relationship has had its type changed. Typically, this action is taken to move a relationship's * type to either a super type (so the subtype can be deleted) or a new subtype (so additional properties can be * added.) However, the type can be changed to any compatible type. * @@ -1592,7 +1592,7 @@ public void processInstanceBatchEvent(String sourceName, /** * A remote repository has detected two metadata instances with the same identifier (guid). One of these instances - * has its home in the repository and the other is located in a metadata collection owned by another + * has its home in the repository and the other one is located in a metadata collection owned by another * repository in the cohort. This is a serious error because it could lead to corruption of the metadata collection. * When this occurs, all repositories in the cohort delete their reference copies of the metadata instances and * at least one of the instances has its GUID changed in its respective home repository. The updated instance(s) diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/eventmanagement/OMRSRepositoryEventPublisher.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/eventmanagement/OMRSRepositoryEventPublisher.java index 7289e7d2c84..133bc7dd21b 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/eventmanagement/OMRSRepositoryEventPublisher.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/eventmanagement/OMRSRepositoryEventPublisher.java @@ -24,9 +24,10 @@ public class OMRSRepositoryEventPublisher extends OMRSRepositoryEventBuilder private static final Logger log = LoggerFactory.getLogger(OMRSRepositoryEventPublisher.class); private OpenMetadataEventsSecurity securityVerifier = new OMRSMetadataDefaultEventsSecurity(); - private List typesTopicConnectors; - private List instancesTopicConnectors; - private AuditLog auditLog; + + private final List typesTopicConnectors; + private final List instancesTopicConnectors; + private final AuditLog auditLog; /** diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/OMRSLocalRepository.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/OMRSLocalRepository.java index eb93b638a8c..3b044ac60d6 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/OMRSLocalRepository.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/OMRSLocalRepository.java @@ -4,7 +4,6 @@ import org.odpi.openmetadata.frameworks.connectors.properties.beans.Connection; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSMetadataCollectionManager; -import org.odpi.openmetadata.repositoryservices.events.OMRSInstanceEventProcessor; import org.odpi.openmetadata.repositoryservices.events.OMRSTypeDefEventProcessor; import org.odpi.openmetadata.repositoryservices.eventmanagement.OMRSRepositoryEventManager; import org.odpi.openmetadata.repositoryservices.localrepository.repositoryconnector.LocalOMRSInstanceEventProcessor; diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/repositoryconnector/LocalOMRSConnectorProvider.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/repositoryconnector/LocalOMRSConnectorProvider.java index 637121bbddb..d4c9e2d8f60 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/repositoryconnector/LocalOMRSConnectorProvider.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/repositoryconnector/LocalOMRSConnectorProvider.java @@ -39,8 +39,8 @@ public class LocalOMRSConnectorProvider extends ConnectorProvider private OMRSRepositoryContentManager repositoryContentManager = null; private OMRSRepositoryEventExchangeRule saveExchangeRule = null; private LocalOMRSRepositoryConnector localRepositoryConnector = null; - private ConnectorTypeProperties connectorTypeProperties = null; - private ConnectorType connectorType = null; + private final ConnectorTypeProperties connectorTypeProperties = null; + private final ConnectorType connectorType = null; private AuditLog auditLog = null; @@ -49,7 +49,7 @@ public class LocalOMRSConnectorProvider extends ConnectorProvider * provides the configuration information about the local server that is used to set up the * local repository connector. * - * @param localMetadataCollectionId metadata collection Id for the local repository + * @param localMetadataCollectionId metadata collection id for the local repository * @param localRepositoryRemoteConnection connection object for creating a remote connector to this repository. * @param realEventMapper optional event mapper for local repository * @param outboundRepositoryEventManager event manager to call for outbound events. @@ -79,7 +79,7 @@ public LocalOMRSConnectorProvider(String localMetada * provides the configuration information about the local server that is used to set up the * local repository connector. * - * @param localMetadataCollectionId metadata collection Id for the local repository + * @param localMetadataCollectionId metadata collection id for the local repository * @param localRepositoryMode style of operation to perform * @param localRepositoryRemoteConnection connection object for creating a remote connector to this repository. * @param realEventMapper optional event mapper for local repository @@ -145,7 +145,7 @@ public ConnectorType getConnectorType() /** * Creates a new instance of a connector based on the information in the supplied connection. * - * @param realLocalConnection connection that should have all of the properties needed by the Connector Provider + * @param realLocalConnection connection that should have all the properties needed by the Connector Provider * to create a connector instance. * @return Connector instance of the LocalOMRSRepositoryConnector wrapping the real local connector. * @throws ConnectionCheckedException if there are missing or invalid properties in the connection @@ -170,7 +170,7 @@ public synchronized Connector getConnector(Connection realLocalConnection) throw /** * Creates a new instance of a connector based on the information in the supplied connection. * - * @param realLocalConnection connection that should have all of the properties needed by the Connector Provider + * @param realLocalConnection connection that should have all the properties needed by the Connector Provider * to create a connector instance. * @return Connector instance of the LocalOMRSRepositoryConnector wrapping the real local connector. * @throws ConnectionCheckedException if there are missing or invalid properties in the connection diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/repositoryconnector/LocalOMRSInstanceEventProcessor.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/repositoryconnector/LocalOMRSInstanceEventProcessor.java index 165a5b6e6b5..bee27741622 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/repositoryconnector/LocalOMRSInstanceEventProcessor.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/repositoryconnector/LocalOMRSInstanceEventProcessor.java @@ -36,25 +36,26 @@ */ public class LocalOMRSInstanceEventProcessor extends OMRSInstanceEventProcessor implements OMRSInstanceRetrievalEventProcessor { - final private static String localOMRSInstanceEventProcessorName = "Local Repository Inbound Instance Events"; + private final static String localOMRSInstanceEventProcessorName = "Local Repository Inbound Instance Events"; - final private static MessageFormatter messageFormatter = new MessageFormatter(); + private final static MessageFormatter messageFormatter = new MessageFormatter(); + + private final String localMetadataCollectionId; + private final String localServerName; + private final OMRSRepositoryConnector localRepositoryConnector; + private final OMRSRepositoryHelper repositoryHelper; + private final OMRSRepositoryValidator repositoryValidator; + private final OMRSRepositoryEventExchangeRule saveExchangeRule; + private final boolean produceRefreshEvents; + private final OMRSRepositoryEventProcessor outboundRepositoryEventProcessor; - private String localMetadataCollectionId; - private String localServerName; - private OMRSRepositoryConnector localRepositoryConnector; - private OMRSRepositoryHelper repositoryHelper; - private OMRSRepositoryValidator repositoryValidator; - private OMRSRepositoryEventExchangeRule saveExchangeRule; private OMRSMetadataCollection localMetadataCollection = null; - private boolean produceRefreshEvents; - private OMRSRepositoryEventProcessor outboundRepositoryEventProcessor; /* * The audit log provides a verifiable record of the open metadata archives that have been loaded into * the open metadata repository. The Logger is for standard debug. */ - private AuditLog auditLog; + private final AuditLog auditLog; private static final Logger log = LoggerFactory.getLogger(LocalOMRSInstanceEventProcessor.class); diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/repositoryconnector/LocalOMRSMetadataCollection.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/repositoryconnector/LocalOMRSMetadataCollection.java index 87073fb8d16..2d8eab239f1 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/repositoryconnector/LocalOMRSMetadataCollection.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/repositoryconnector/LocalOMRSMetadataCollection.java @@ -30,13 +30,13 @@ */ public class LocalOMRSMetadataCollection extends OMRSMetadataCollectionBase { - private OMRSMetadataCollection realMetadataCollection; - private String localServerName; - private String localServerType; - private String localOrganizationName; - private boolean produceEventsForRealConnector; - private OMRSRepositoryEventManager outboundRepositoryEventProcessor; - private OMRSTypeDefManager localTypeDefManager; + private final OMRSMetadataCollection realMetadataCollection; + private final String localServerName; + private final String localServerType; + private final String localOrganizationName; + private final boolean produceEventsForRealConnector; + private final OMRSRepositoryEventManager outboundRepositoryEventProcessor; + private final OMRSTypeDefManager localTypeDefManager; /* * The security verifier is initialized with a null security verifier. @@ -58,7 +58,7 @@ public class LocalOMRSMetadataCollection extends OMRSMetadataCollectionBase * @param localOrganizationName name of the organization that owns the local server. * @param realMetadataCollection metadata collection of the real local connector. * @param outboundRepositoryEventProcessor outbound event processor - * (may be null if a repository event mapper is deployed). + * (maybe null if a repository event mapper is deployed). * @param produceEventsForRealConnector flag indicating whether the local connector should handle the outbound * events for the real connector * @param typeDefManager manager of in-memory cache of type definitions (TypeDefs). @@ -83,7 +83,7 @@ public class LocalOMRSMetadataCollection extends OMRSMetadataCollectionBase /* * Save the metadata collection object for the real repository. This is the metadata collection that - * does all of the work. LocalOMRSMetadataCollection is just a wrapper for managing repository events + * does all the work. LocalOMRSMetadataCollection is just a wrapper for managing repository events * and debug and audit logging. */ if (realMetadataCollection == null) @@ -317,7 +317,7 @@ public TypeDefGallery findTypesByName(String userId, /** - * Returns all of the TypeDefs for a specific category. + * Returns all the TypeDefs for a specific category. * * @param userId unique identifier for requesting user. * @param category enum value for the category of TypeDef to return. @@ -341,7 +341,7 @@ public List findTypeDefsByCategory(String userId, super.typeDefCategoryParameterValidation(userId, category, categoryParameterName, methodName); /* - * Perform operation and filter out all of the types that the user is not allowed to see. + * Perform operation and filter out all the types that the user is not allowed to see. */ return this.securityVerifyTypeDefList(userId, realMetadataCollection.findTypeDefsByCategory(userId, category)); @@ -349,7 +349,7 @@ public List findTypeDefsByCategory(String userId, /** - * Returns all of the AttributeTypeDefs for a specific category. + * Returns all the AttributeTypeDefs for a specific category. * * @param userId unique identifier for requesting user. * @param category enum value for the category of an AttributeTypeDef to return. @@ -418,7 +418,7 @@ public List findTypeDefsByProperty(String userId, * @param standard name of the standard null means any. * @param organization name of the organization null means any. * @param identifier identifier of the element in the standard null means any. - * @return TypeDefs list each entry in the list contains a typedef. This is is a structure + * @return TypeDefs list each entry in the list contains a typedef. This is a structure * describing the TypeDef's category and properties. * @throws InvalidParameterException all attributes of the external id are null. * @throws RepositoryErrorException there is a problem communicating with the metadata repository. @@ -451,7 +451,7 @@ public List findTypesByExternalID(String userId, * * @param userId unique identifier for requesting user. * @param searchCriteria String search criteria. - * @return TypeDefs list each entry in the list contains a typedef. This is is a structure + * @return TypeDefs list each entry in the list contains a typedef. This is a structure * describing the TypeDef's category and properties. * @throws InvalidParameterException the searchCriteria is null. * @throws RepositoryErrorException there is a problem communicating with the metadata repository. @@ -974,7 +974,7 @@ public TypeDef updateTypeDef(String userId, * @throws RepositoryErrorException there is a problem communicating with the metadata repository where * the metadata collection is stored. * @throws TypeDefNotKnownException the requested TypeDef is not found in the metadata collection. - * @throws TypeDefInUseException the TypeDef can not be deleted because there are instances of this type in the + * @throws TypeDefInUseException the TypeDef can not be deleted because there are instances of this type in * the metadata collection. These instances need to be purged before the * TypeDef can be deleted. * @throws FunctionNotSupportedException the repository does not support this call. @@ -1054,7 +1054,7 @@ public void deleteTypeDef(String userId, * @throws RepositoryErrorException there is a problem communicating with the metadata repository where * the metadata collection is stored. * @throws TypeDefNotKnownException the requested AttributeTypeDef is not found in the metadata collection. - * @throws TypeDefInUseException the AttributeTypeDef can not be deleted because there are instances of this type in the + * @throws TypeDefInUseException the AttributeTypeDef can not be deleted because there are instances of this type in * the metadata collection. These instances need to be purged before the * AttributeTypeDef can be deleted. * @throws FunctionNotSupportedException the repository does not support this call. @@ -2197,7 +2197,7 @@ public List findEntities(String userId, * * @param userId unique identifier for requesting user. * @param entityTypeGUID unique identifier for the type of entity requested. Null means any type of entity - * (but could be slow so not recommended. + * (but could be slow so not recommended). * @param classificationName name of the classification, note a null is not valid. * @param matchClassificationProperties list of classification properties used to narrow the search (where any String * property's value should be defined as a Java regular expression, even if it @@ -2801,7 +2801,7 @@ public List findRelationshipsByPropertyValue(String /** - * Return all of the relationships and intermediate entities that connect the startEntity with the endEntity. + * Return all the relationships and intermediate entities that connect the startEntity with the endEntity. * * @param userId unique identifier for requesting user. * @param startEntityGUID The entity that is used to anchor the query. @@ -3131,7 +3131,7 @@ public EntityDetail addEntity(String userId, /** * Save a new entity that is sourced from an external technology. The external * technology is identified by a GUID and a name. These can be recorded in a - * Software Server Capability (guid and qualifiedName respectively. + * Software Server Capability (guid and qualifiedName respectively). * The new entity is assigned a new GUID and put * in the requested state. The new entity is returned. * @@ -3305,7 +3305,7 @@ private EntityDetail validateEntityCanBeUpdated(String userId, * that if the entity originated externally, this repository is the replicator * if the entity is from the outside the cohort but not replicated here this method will throw InvalidParameterException * - * if something really ugly happens this method will throw RepositoryErrorException but not in any of the above scenarios + * if something really unexpected happens this method will throw RepositoryErrorException but not in any of the above scenarios */ EntityDetail entityDetail = this.validateEntityIsNotProxy(userId, entityGUID, methodName); @@ -3452,7 +3452,7 @@ private EntityDetail validateEntityCanBeRehomed(String userId, * that if the entity originated externally, this repository is NOT already the replicator * if the entity is from the outside the cohort and replicated here this method will throw InvalidParameterException * - * if something really ugly happens this method will throw RepositoryErrorException but not in any of the above scenarios + * if something really unexpected happens this method will throw RepositoryErrorException but not in any of the above scenarios */ EntityDetail entityDetail = this.validateEntityIsNotProxy(userId, entityGUID, methodName); @@ -3489,7 +3489,7 @@ private EntityDetail validateEntityCanBeRehomedByRepository(String ent * Any other combination suggests that this is NOT a reference copy (of either an instance from the local cohort or * an external entity) and consequently cannot be rehomed. * - * If not rehomable throw an InvalidParameterException. + * If not "rehomable" throw an InvalidParameterException. */ /* @@ -3596,7 +3596,7 @@ private Relationship validateRelationshipCanBeUpdated(String userId, * that if the relationship originated externally, this repository is the replicator * if the relationship is from the outside the cohort but not replicated here this method will throw InvalidParameterException * - * if something really ugly happens this method will throw RepositoryErrorException but not in any of the above scenarios + * if something really unexpected happens this method will throw RepositoryErrorException but not in any of the above scenarios */ Relationship relationship; @@ -3643,7 +3643,7 @@ private Relationship validateRelationshipCanBeUpdated(String userId, * that if the relationship originated externally, this repository is the replicator * if the relationship is from the outside the cohort but not replicated here this method will throw InvalidParameterException * - * if something really ugly happens this method will throw RepositoryErrorException but not in any of the above scenarios + * if something really unexpected happens this method will throw RepositoryErrorException but not in any of the above scenarios */ @@ -3709,7 +3709,7 @@ else if (relationship.getInstanceProvenanceType() == InstanceProvenanceType.EXTE } /* - * There is a logic error as the caller has requested update or delete of an relationship and this + * There is a logic error as the caller has requested update or delete of a relationship and this * repository does not have the right to perform the requested operation. */ String parameterName = "relationshipGUID"; @@ -3769,7 +3769,7 @@ private Relationship validateRelationshipCanBeRehomed(String userId, * that if the relationship originated externally, this repository is NOT already the replicator * if the relationship is from the outside the cohort and replicated here this method will throw InvalidParameterException * - * if something really ugly happens this method will throw RepositoryErrorException but not in any of the above scenarios + * if something really unexpected happens this method will throw RepositoryErrorException but not in any of the above scenarios */ return this.validateRelationshipCanBeRehomedByRepository(relationshipGUID, @@ -3830,13 +3830,6 @@ private Relationship validateRelationshipCanBeRehomedByRepository(String updateAllowed = true; } break; - - default: - /* - * For any other instance provenance value do not allow update - */ - updateAllowed = false; - break; } if (updateAllowed) @@ -3868,7 +3861,7 @@ private Relationship validateRelationshipCanBeRehomedByRepository(String else { /* - * There is a logic error as the caller has requested update of an relationship but the + * There is a logic error as the caller has requested update of a relationship but the * relationship cannot be found. */ throw new RelationshipNotKnownException(OMRSErrorCode.NULL_INSTANCE.getMessageDefinition(repositoryName, @@ -4111,10 +4104,10 @@ public EntityDetail undoEntityUpdate(String userId, /** - * Delete an entity. The entity is soft deleted. This means it is still in the graph but it is no longer returned + * Delete an entity. The entity is soft-deleted. This means it is still in the graph, but it is no longer returned * on queries. All homed relationships to the entity are also soft-deleted and will no longer be usable, while any * reference copy relationships to the entity will be purged (and will no longer be accessible in this repository). - * To completely eliminate the entity from the graph requires a call to the purgeEntity() method after the delete call. + * To completely eliminate the entity from the graph requires a call to the purgeEntity() method after the delete() call. * The restoreEntity() method will switch an entity back to Active status to restore the entity to normal use; however, * this will not restore any of the relationships that were soft-deleted as part of the original deleteEntity() call. * @@ -5231,7 +5224,7 @@ public Relationship addRelationship(String userId, /** * Save a new relationship that is sourced from an external technology. The external * technology is identified by a GUID and a name. These can be recorded in a - * Software Server Capability (guid and qualifiedName respectively. + * Software Server Capability (guid and qualifiedName respectively). * The new relationship is assigned a new GUID and put * in the requested state. The new relationship is returned. * @@ -5582,7 +5575,7 @@ public Relationship undoRelationshipUpdate(String userId, /** * Delete a specific relationship. This is a soft-delete which means the relationship's status is updated to - * DELETED and it is no longer available for queries. To remove the relationship permanently from the + * DELETED, and it is no longer available for queries. To remove the relationship permanently from the * metadata collection, use purgeRelationship(). * * @param userId unique identifier for requesting user. @@ -5935,7 +5928,7 @@ public EntityDetail reIdentifyEntity(String userId, /** - * Change the type of an existing entity. Typically this action is taken to move an entity's + * Change the type an existing entity. Typically, this action is taken to move an entity's * type to either a super type (so the subtype can be deleted) or a new subtype (so additional properties can be * added.) However, the type can be changed to any compatible type and the properties adjusted. * @@ -6258,7 +6251,7 @@ public Relationship reIdentifyRelationship(String userId, /** - * Change the type of an existing relationship. Typically this action is taken to move a relationship's + * Change the type of the existing relationship. Typically, this action is taken to move a relationship's * type to either a super type (so the subtype can be deleted) or a new subtype (so additional properties can be * added.) However, the type can be changed to any compatible type. * @@ -6547,7 +6540,7 @@ public void saveEntityReferenceCopy(String userId, * * @param userId unique identifier for requesting user. * @param entityGUID unique identifier of the entity with classifications to retrieve - * @return list of all of the classifications for this entity that are homed in this repository + * @return list of all the classifications for this entity that are homed in this repository * @throws InvalidParameterException the entity is null. * @throws RepositoryErrorException there is a problem communicating with the metadata repository where * the metadata collection is stored. @@ -6591,7 +6584,7 @@ public List getHomeClassifications(String userId, * @param userId unique identifier for requesting user. * @param entityGUID unique identifier of the entity with classifications to retrieve * @param asOfTime the time used to determine which version of the entity that is desired. - * @return list of all of the classifications for this entity that are homed in this repository + * @return list of all the classifications for this entity that are homed in this repository * @throws InvalidParameterException the entity is null. * @throws RepositoryErrorException there is a problem communicating with the metadata repository where * the metadata collection is stored. @@ -7393,7 +7386,7 @@ public void saveInstanceReferenceCopies(String userId, FunctionNotSupportedException { /* - * It is necessary to filter out all of the instances that should not be saved before passing the + * It is necessary to filter out all the instances that should not be saved before passing the * instances to the real connector. The validated instances are packed back into an instance graph to * pass on the batch so that the real repository connector can benefit from the batch. */ diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/repositoryconnector/LocalOMRSRepositoryConnector.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/repositoryconnector/LocalOMRSRepositoryConnector.java index 80d6e37e85b..4b72a0e5d22 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/repositoryconnector/LocalOMRSRepositoryConnector.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/repositoryconnector/LocalOMRSRepositoryConnector.java @@ -37,15 +37,16 @@ public class LocalOMRSRepositoryConnector extends OMRSRepositoryConnector implem * The repository content manager is the TypeDefManager for the Local OMRS Metadata Collection, * and the incoming TypeDef Event Processor for the Archive Manager and EventListener */ - private OMRSTypeDefManager typeDefManager; - private OMRSTypeDefEventProcessor incomingTypeDefEventProcessor; + private final OMRSTypeDefManager typeDefManager; + private final OMRSTypeDefEventProcessor incomingTypeDefEventProcessor; + private final OMRSRepositoryEventManager outboundRepositoryEventManager; + private final OMRSRepositoryEventExchangeRule saveExchangeRule; + private final OMRSRepositoryConnector realLocalConnector; + private final OMRSRepositoryEventMapperConnector realEventMapper; + private LocalOMRSInstanceEventProcessor incomingInstanceEventProcessor = null; private OMRSInstanceRetrievalEventProcessor instanceRetrievalEventProcessor = null; - private OMRSRepositoryEventManager outboundRepositoryEventManager; - private OMRSRepositoryEventExchangeRule saveExchangeRule; - private OMRSRepositoryConnector realLocalConnector; - private OMRSRepositoryEventMapperConnector realEventMapper; - private boolean produceEventsForRealConnector = true; + private boolean produceEventsForRealConnector = true; /** @@ -356,7 +357,7 @@ public void setAuditLog(OMRSAuditLog auditLog) /** - * Set up the unique Id for this metadata collection. + * Set up the unique id for this metadata collection. * * @param metadataCollectionId String unique Id */ diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/repositoryconnector/OMRSInstanceRetrievalEventProcessor.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/repositoryconnector/OMRSInstanceRetrievalEventProcessor.java index eb823941b2f..8a1b0587b92 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/repositoryconnector/OMRSInstanceRetrievalEventProcessor.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/repositoryconnector/OMRSInstanceRetrievalEventProcessor.java @@ -6,8 +6,6 @@ import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntitySummary; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship; -import java.util.List; - /** * OMRSInstanceRetrievalEventProcessor defines the interface used by the Enterprise OMRS Repository Connector @@ -16,7 +14,7 @@ public interface OMRSInstanceRetrievalEventProcessor { /** - * Pass an entity that has been retrieved from a remote open metadata repository so it can be validated and + * Pass an entity that has been retrieved from a remote open metadata repository, so it can be validated and * (if the rules permit) cached in the local repository. * * @param sourceName name of the source of this event. @@ -29,7 +27,7 @@ void processRetrievedEntitySummary(String sourceName, /** - * Pass an entity that has been retrieved from a remote open metadata repository so it can be validated and + * Pass an entity that has been retrieved from a remote open metadata repository, so it can be validated and * (if the rules permit) cached in the local repository. * * @param sourceName name of the source of this event. @@ -42,7 +40,7 @@ void processRetrievedEntityDetail(String sourceName, /** - * Pass a relationship that has been retrieved from a remote open metadata repository so it can be validated and + * Pass a relationship that has been retrieved from a remote open metadata repository, so it can be validated and * (if the rules permit) cached in the local repository. * * @param sourceName name of the source of this event. diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/repositorycontentmanager/OMRSRepositoryContentValidator.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/repositorycontentmanager/OMRSRepositoryContentValidator.java index cfc2a067507..3b2e84c36d0 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/repositorycontentmanager/OMRSRepositoryContentValidator.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/repositorycontentmanager/OMRSRepositoryContentValidator.java @@ -30,7 +30,7 @@ public class OMRSRepositoryContentValidator implements OMRSRepositoryValidator { private static final Logger log = LoggerFactory.getLogger(OMRSRepositoryContentValidator.class); - private OMRSRepositoryContentManager repositoryContentManager; + private final OMRSRepositoryContentManager repositoryContentManager; private enum MatchOption { @@ -607,7 +607,7 @@ public boolean validInstanceId(String sourceName, /** - * Validate that the supplied user Id is not null. + * Validate that the supplied user id is not null. * * @param sourceName name of source of request. * @param userId userId passed on call to this metadata collection. @@ -1077,7 +1077,7 @@ public void validateTypeDef(String sourceName, * @param parameterName name of the parameter that passed the typeDef. * @param typeDef unique identifier for a type or an instance passed on the request * @param methodName method receiving the call - * @throws TypeDefNotKnownException no recognized typeDef provided + * @throws TypeDefNotKnownException typeDef provided not recognized */ @Override public void validateKnownTypeDef(String sourceName, @@ -1457,7 +1457,7 @@ public void validateHomeMetadataGUID(String sourceName, /** - * Validate that a home metadata collection identifier in an classification is not null. + * Validate that a home metadata collection identifier in a classification is not null. * * @param sourceName source of the request (used for logging) * @param classification classification to test. @@ -2093,7 +2093,7 @@ public void validateSearchClassifications(String sourceName, * Validate that the properties for a metadata instance match its TypeDef. * * @param sourceName source of the request (used for logging) - * @param parameterName name of the properties parameter. + * @param parameterName name of the "properties" parameter. * @param typeDef type information to validate against. * @param properties proposed properties for instance. * @param methodName method receiving the call. @@ -2150,7 +2150,7 @@ public void validatePropertiesForType(String sourceName, /* * Need to step through each of the proposed properties and validate that the name and value are - * present and they match the typeDef + * present, and they match the typeDef */ Iterator propertyList = properties.getPropertyNames(); @@ -2299,7 +2299,7 @@ else if (propertyDefinitionType == AttributeTypeDefCategory.UNKNOWN_DEF) * Validate that the properties for a metadata instance match its TypeDef * * @param sourceName source of the request (used for logging) - * @param parameterName name of the properties parameter. + * @param parameterName name of the "properties" parameter. * @param typeDefSummary type information to validate against. * @param properties proposed properties * @param methodName method receiving the call @@ -2341,7 +2341,7 @@ public void validatePropertiesForType(String sourceName, * Validate that the properties for a metadata instance match its TypeDef * * @param sourceName source of the request (used for logging) - * @param parameterName name of the properties parameter. + * @param parameterName name of the "properties" parameter. * @param typeDef type information to validate against. * @param properties proposed properties * @param methodName method receiving the call @@ -2398,13 +2398,10 @@ public boolean verifyInstanceType(String sourceName, if (entityType != null) { - if (repositoryContentManager.isTypeOfByGUID(sourceName, + return (repositoryContentManager.isTypeOfByGUID(sourceName, entityType.getTypeDefGUID(), entityType.getTypeDefName(), - instanceTypeGUID)) - { - return true; - } + instanceTypeGUID)); } } } @@ -2787,7 +2784,7 @@ public void validateNewStatus(String sourceName, /** - * Verify that an instance is not already deleted since the repository is processing a delete request + * Verify that an instance is not already deleted since the repository is processing a delete request, * and it does not want to look stupid. * * @param sourceName source of the request (used for logging) @@ -3021,7 +3018,7 @@ public void validateEntityCanBeRehomed(String sourceName, * The caller can rehome the entity provided: * The entity originates from the local cohort and is NOT locally mastered * OR - * The entity has instanceProvenanceType set to external and replicatedBy is NOT the local metadataColelctionId. + * The entity has instanceProvenanceType set to external and replicatedBy is NOT the local metadataCollectionId. * Any other combination suggests that this is NOT a reference copy (of either an instance from the local cohort or * an external entity) and consequently cannot be rehomed. * @@ -3051,13 +3048,6 @@ public void validateEntityCanBeRehomed(String sourceName, updateAllowed = true; } break; - - default: - /* - * For any other instance provenance value do not allow update - */ - updateAllowed = false; - break; } if (!updateAllowed) @@ -3172,7 +3162,7 @@ public void validateRelationshipCanBeUpdated(String sourceName, * The caller can update the relationship provided: * The relationship is locally mastered * OR - * The relationship has instanceProvenanceType set to external and replicatedBy is set to the local metadataColelctionId. + * The relationship has instanceProvenanceType set to external and replicatedBy is set to the local metadataCollectionId. * Any other combination suggest that this is either a reference copy of an instance from the local cohort or a reference * copy of an external relationship (and something else is responsible for replication). * @@ -3250,7 +3240,7 @@ public void validateRelationshipCanBeRehomed(String sourceName, * The caller can rehome the relationship provided: * The relationship originates from the local cohort and is NOT locally mastered * OR - * The relationship has instanceProvenanceType set to external and replicatedBy is NOT the local metadataColelctionId. + * The relationship has instanceProvenanceType set to external and replicatedBy is NOT the local metadataCollectionId. * Any other combination suggests that this is NOT a reference copy (of either an instance from the local cohort or * an external relationship) and consequently cannot be rehomed. * @@ -3281,12 +3271,6 @@ public void validateRelationshipCanBeRehomed(String sourceName, } break; - default: - /* - * For any other instance provenance value do not allow update - */ - updateAllowed = false; - break; } if (!updateAllowed) @@ -4662,7 +4646,7 @@ public boolean verifyInstancePropertiesMatchPropertyValue(String so /** * Throw a logic error exception if this object does not have a repository content manager. - * This would occur if if is being used in an environment where the OMRS has not been properly + * This would occur if it is being used in an environment where the OMRS has not been properly * initialized. * * @param methodName name of calling method. @@ -4759,7 +4743,7 @@ public boolean isATypeOf(String sourceName, /** - * Validate that either zero or one entities were returned from a find request. This is typically when searching + * Validate that either zero or one entity were returned from a find request. This is typically when searching * for entities of a specific type using one of its unique properties. * * @param findResults list of entities returned from the search. @@ -4789,7 +4773,7 @@ public void validateAtMostOneEntityResult(List findResults, /** - * Validate that either zero or one relationships were returned from a find request. This is typically when searching + * Validate that either zero or one relationship were returned from a find request. This is typically when searching * for relationships of a specific type where the cardinality is set to AT_MOST_ONE in the RelationshipEndCardinality. * * @param findResults list of relationships returned from the search. diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/metadatahighway/OMRSCohortManager.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/metadatahighway/OMRSCohortManager.java index 7b956b49074..eea5d969123 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/metadatahighway/OMRSCohortManager.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/metadatahighway/OMRSCohortManager.java @@ -50,7 +50,7 @@ public class OMRSCohortManager private String localMetadataCollectionId = null; private OMRSRepositoryEventPublisher outboundRepositoryEventPublisher = null; - private AuditLog auditLog; + private final AuditLog auditLog; private static final Logger log = LoggerFactory.getLogger(OMRSCohortManager.class); @@ -313,7 +313,7 @@ public void setSecurityVerifier(OpenMetadataEventsSecurity securityVerifier) } /* - * Start the cohort's event manager so it is able to pass events. + * Start the cohort's event manager, so it is able to pass events. */ if (this.cohortRepositoryEventManager != null) { diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/metadatahighway/OMRSMetadataHighwayManager.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/metadatahighway/OMRSMetadataHighwayManager.java index 1a95590e317..2f8e2193edc 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/metadatahighway/OMRSMetadataHighwayManager.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/metadatahighway/OMRSMetadataHighwayManager.java @@ -36,15 +36,15 @@ */ public class OMRSMetadataHighwayManager { - private List cohortManagers = new ArrayList<>(); - private String localServerName; /* set in constructor */ - private String localServerType; /* set in constructor */ - private String localOrganizationName; /* set in constructor */ - private OMRSLocalRepository localRepository; /* set in constructor */ - private OMRSRepositoryContentManager localRepositoryContentManager; /* set in constructor */ - private OMRSConnectionConsumer enterpriseAccessConnectionConsumer; /* set in constructor */ - private OMRSTopicConnector enterpriseAccessTopicConnector; /* set in constructor */ - private AuditLog auditLog; + private final List cohortManagers = new ArrayList<>(); + private final String localServerName; /* set in constructor */ + private final String localServerType; /* set in constructor */ + private final String localOrganizationName; /* set in constructor */ + private final OMRSLocalRepository localRepository; /* set in constructor */ + private final OMRSRepositoryContentManager localRepositoryContentManager; /* set in constructor */ + private final OMRSConnectionConsumer enterpriseAccessConnectionConsumer; /* set in constructor */ + private final OMRSTopicConnector enterpriseAccessTopicConnector; /* set in constructor */ + private final AuditLog auditLog; private static final Logger log = LoggerFactory.getLogger(OMRSMetadataHighwayManager.class); diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/metadatahighway/cohortregistry/OMRSCohortRegistry.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/metadatahighway/cohortregistry/OMRSCohortRegistry.java index 16a54026807..71281d41847 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/metadatahighway/cohortregistry/OMRSCohortRegistry.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/metadatahighway/cohortregistry/OMRSCohortRegistry.java @@ -76,7 +76,7 @@ public class OMRSCohortRegistry extends OMRSRegistryEventProcessor * The audit log provides a verifiable record of the membership of the open metadata repository cohort and the * metadata exchange activity they are involved in. The Logger is for standard debug. */ - private AuditLog auditLog; + private final AuditLog auditLog; /** @@ -122,12 +122,12 @@ private void validateLocalMetadataCollectionId(String configuredLocal { /* * There is a stored local metadata collection id which is going to be used. There is a consistency check - * to ensure this stored local Id is the same as the configured local metadata collection id. + * to ensure this stored local id is the same as the configured local metadata collection id. * * If it is not the same, the administrator has changed the configured value after the server * registered with the cohort. The message on the audit log explains that the new value will be - * ignored until the local repository is un-registered with the old metadata collection id and then it - * can be registered with the new metadata collection Id. + * ignored until the local repository is un-registered with the old metadata collection id, and then it + * can be registered with the new metadata collection id. */ if (!storedLocalMetadataCollectionId.equals(configuredLocalMetadataCollectionId)) @@ -147,7 +147,7 @@ private void validateLocalMetadataCollectionId(String configuredLocal /* * The configured value is different from the value used to register with this cohort. * This is a situation that could potentially damage the metadata integrity across the cohort. - * Hence the exception. + * Hence, the exception. */ throw new OMRSConfigErrorException(OMRSErrorCode.INVALID_LOCAL_METADATA_COLLECTION_ID.getMessageDefinition(cohortName, localServerName, @@ -217,7 +217,7 @@ public void initialize(String cohortName, this.outboundRegistryEventProcessor = registryEventProcessor; /* - * Verify that the configured local metadata collection Id matches the one stored in the registry store. + * Verify that the configured local metadata collection id matches the one stored in the registry store. * This will throw an exception if there are unresolvable differences. */ this.validateLocalMetadataCollectionId(localMetadataCollectionId); @@ -227,7 +227,7 @@ public void initialize(String cohortName, /* * Save the connection consumer. This component needs details of the current connections it should use * to contact various members of the cluster (including the local server). It needs an initial - * upload of the members's connections and then ongoing notifications for any changes in the membership. + * upload of the member's connections and then ongoing notifications for any changes in the membership. */ this.connectionConsumer = connectionConsumer; @@ -275,7 +275,7 @@ public synchronized void connectToCohort() /* - * Fill in the local registration with details from the this server. Any value from the local repository + * Fill in the local registration with details from this server. Any value from the local repository * can change except the localMetadataCollectionId and this value has already been validated. */ localRegistration.setMetadataCollectionId(localMetadataCollectionId); @@ -287,7 +287,7 @@ public synchronized void connectToCohort() /* - * If the local metadata collection Id is null it means there is no local repository. No registration + * If the local metadata collection id is null it means there is no local repository. No registration * is required. If there is a local repository, a registration request is sent when first connecting * and a re-registration request is sent on subsequent restarts. */ @@ -360,7 +360,7 @@ public synchronized void connectToCohort() } /* - * Finally request that the other members of the cohort send this server their details in case something has + * Finally, request that the other members of the cohort send this server their details in case something has * changed. These are processed asynchronously and update the connection consumer as required. */ this.requestRegistrationRefreshFromCohort(localRegistration); @@ -496,7 +496,7 @@ private void reRegisterLocalRepositoryWithCohort(MemberRegistration localRegis * Alternatively, it may not have a local repository and so can not trigger the reRegistration events * with its own registration events. * - * @param localRegistration information needed to sent the refresh request + * @param localRegistration information needed to send the refresh request */ private void requestRegistrationRefreshFromCohort(MemberRegistration localRegistration) { @@ -906,7 +906,7 @@ public synchronized boolean processUnRegistrationEvent(String sourceName, /** * There is more than one member of the open metadata repository cohort that is using the same metadata - * collection Id. This means that their metadata instances can be updated in more than one server and their + * collection id. This means that their metadata instances can be updated in more than one server and there * is a potential for data integrity issues. * * @param sourceName name of the source of the event. It may be the cohort name for incoming events or the @@ -960,7 +960,7 @@ public synchronized void processConflictingCollectionIdEvent(String sourceNa * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param targetMetadataCollectionId Id for the repository with the bad remote connection. + * @param targetMetadataCollectionId id for the repository with the bad remote connection. * @param remoteRepositoryConnection the Connection properties for the connector used to call the registering server. * @param errorMessage details of the error that occurs when the connection is used. */ diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/rest/server/OMRSRESTExceptionHandler.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/rest/server/OMRSRESTExceptionHandler.java index 2f5596df4e5..c3ac0e20a56 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/rest/server/OMRSRESTExceptionHandler.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/rest/server/OMRSRESTExceptionHandler.java @@ -26,7 +26,7 @@ class OMRSRESTExceptionHandler { private static final MessageFormatter messageFormatter = new MessageFormatter(); - private OMRSRepositoryServicesInstanceHandler instanceHandler; + private final OMRSRepositoryServicesInstanceHandler instanceHandler; private static final Logger log = LoggerFactory.getLogger(OMRSRESTExceptionHandler.class); diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/rest/server/OMRSRepositoryRESTServices.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/rest/server/OMRSRepositoryRESTServices.java index ec0c51ff48c..51ee245681e 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/rest/server/OMRSRepositoryRESTServices.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/rest/server/OMRSRepositoryRESTServices.java @@ -96,7 +96,7 @@ public class OMRSRepositoryRESTServices { private static final String serviceName = CommonServicesDescription.REPOSITORY_SERVICES.getServiceName(); private static final Logger log = LoggerFactory.getLogger(OMRSRepositoryRESTServices.class); - private static OMRSRepositoryServicesInstanceHandler instanceHandler = new OMRSRepositoryServicesInstanceHandler(serviceName); + private static final OMRSRepositoryServicesInstanceHandler instanceHandler = new OMRSRepositoryServicesInstanceHandler(serviceName); private static final String anonymousUserId = "anon"; // TODO add to config private static final MessageFormatter messageFormatter = new MessageFormatter(); diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/rest/services/OMRSRepositoryServicesInstance.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/rest/services/OMRSRepositoryServicesInstance.java index f29eae59039..d6c5609484e 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/rest/services/OMRSRepositoryServicesInstance.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/rest/services/OMRSRepositoryServicesInstance.java @@ -16,13 +16,13 @@ */ public class OMRSRepositoryServicesInstance extends OMAGServerServiceInstance { - private OMRSAuditLog masterAuditLog; + private final OMRSAuditLog masterAuditLog; private OMRSMetadataCollection localMetadataCollection; private OMRSMetadataCollection enterpriseMetadataCollection; - private Connection remoteEnterpriseOMRSTopicConnection; - private OMRSMetadataHighwayManager metadataHighwayManager; - private String localServerURL; - private AuditLog auditLog; + private final Connection remoteEnterpriseOMRSTopicConnection; + private final OMRSMetadataHighwayManager metadataHighwayManager; + private final String localServerURL; + private final AuditLog auditLog; /** @@ -140,7 +140,7 @@ public OMRSMetadataCollection getEnterpriseMetadataCollection() /** * Return the connection to the remote enterprise topic connection. This may be null, but if it is enabled in the - * servers configuration, this call is ued to return the configured connection object to a remote client so it can listen for + * server's configuration, this call is ued to return the configured connection object to a remote client, so it can listen for * enterprise topic events. * * @return connection or null diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/rest/services/OMRSRepositoryServicesInstanceHandler.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/rest/services/OMRSRepositoryServicesInstanceHandler.java index 1f92d5dfd8b..17ebead6cc5 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/rest/services/OMRSRepositoryServicesInstanceHandler.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/rest/services/OMRSRepositoryServicesInstanceHandler.java @@ -11,7 +11,7 @@ /** * OMRSRepositoryServicesInstanceHandler provides the mapping for inbound REST requests to the appropriate instances - * for the requested server. The map is maintained in a static so it is scoped to the class loader. + * for the requested server. The map is maintained in a static, so it is scoped to the class loader. * * Instances of this class call the synchronized static methods to work with the map. */ @@ -66,7 +66,7 @@ public OMRSRepositoryServicesInstance getInstance(String userId, /** - * Return the audit log or null (if the instance is not available. + * Return the audit log or null (if the instance is not available). * * @param userId calling user * @param serverName requested server From 68f725973729ae89e361a652c9981f2ab6b6c5d7 Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Mon, 15 Aug 2022 09:31:40 +0100 Subject: [PATCH 2/8] Add extensions for sustainability Signed-off-by: Mandy Chessell --- .../converter/DatabaseConverter.java | 4 +- .../converter/GlossaryTermConverter.java | 4 +- .../converter/SchemaConverter.java | 2 +- .../AnalyticsMetadataConverter.java | 2 +- .../converters/AssetConverter.java | 2 +- .../converters/SchemaTypeConverter.java | 2 +- .../SoftwareServerCapabilityConverter.java | 4 +- .../assetcatalog/handlers/CommonHandler.java | 2 +- .../api/AssetConsumerTaggingInterface.java | 2 +- .../elements/ElementVersions.java | 2 +- .../ffdc/AssetConsumerErrorCode.java | 2 +- .../assetconsumer/client/AssetConsumer.java | 2 +- .../converters/AssetConverter.java | 4 +- .../converters/CommentConverter.java | 4 +- .../converters/ElementHeaderConverter.java | 4 +- .../converters/InformalTagConverter.java | 4 +- .../converters/LikeConverter.java | 4 +- .../converters/MeaningConverter.java | 4 +- .../converters/RatingConverter.java | 4 +- .../AssetConsumerOMRSTopicListener.java | 12 +- .../server/spring/AssetConsumerResource.java | 2 +- .../events/AssetManagerOutTopicEvent.java | 2 +- .../metadataelements/ElementVersions.java | 2 +- .../client/ValidValuesExchangeClient.java | 2 +- .../converters/AssetConverter.java | 4 +- .../converters/AssetManagerConverter.java | 4 +- .../converters/ConnectorTypeConverter.java | 4 +- .../converters/ElementHeaderConverter.java | 4 +- .../converters/ElementStubConverter.java | 4 +- .../converters/EndpointConverter.java | 4 +- .../ExternalIdentifierConverter.java | 4 +- .../ExternalReferenceConverter.java | 4 +- .../ExternalReferenceLinkConverter.java | 4 +- .../converters/GlossaryCategoryConverter.java | 4 +- .../converters/GlossaryConverter.java | 4 +- .../converters/GlossaryTermConverter.java | 4 +- .../GovernanceActionProcessConverter.java | 4 +- .../GovernanceActionTypeConverter.java | 4 +- .../converters/PortConverter.java | 4 +- .../converters/ProcessConverter.java | 4 +- .../AssetManagerOMRSTopicListener.java | 12 +- .../api/AssetClassificationInterface.java | 2 +- .../api/AssetOnboardingValidValues.java | 8 +- .../assetowner/ffdc/AssetOwnerErrorCode.java | 4 +- .../metadataelements/ElementVersions.java | 2 +- .../metadataelements/ValidValueElement.java | 69 +- .../client/ValidValuesAssetOwner.java | 18 +- .../assetowner/converters/AssetConverter.java | 4 +- .../converters/ConnectorTypeConverter.java | 4 +- .../converters/DataFileConverter.java | 4 +- .../converters/ElementHeaderConverter.java | 4 +- .../converters/EndpointConverter.java | 4 +- .../converters/FileFolderConverter.java | 4 +- .../converters/FileSystemConverter.java | 4 +- .../converters/ReferenceableConverter.java | 4 +- .../converters/ValidValueConverter.java | 120 +- .../outtopic/AssetOwnerOMRSTopicListener.java | 12 +- .../server/ValidValuesRESTServices.java | 6 + .../spring/ValidValuesOnboardingResource.java | 17 +- .../api/CollectionManagementInterface.java | 2 +- .../api/CommunityManagementInterface.java | 260 +- .../api/LocationManagementInterface.java | 391 ++- .../api/OrganizationManagementInterface.java | 134 +- .../RelatedElementsManagementInterface.java | 363 +++ .../api/SecurityGroupInterface.java | 2 +- .../metadataelements/ActorProfileElement.java | 31 +- .../metadataelements/CollectionElement.java | 32 +- .../metadataelements/CommentElement.java | 55 +- .../metadataelements/CommunityElement.java | 38 +- .../metadataelements/ElementVersions.java | 2 +- .../metadataelements/LocationElement.java | 38 +- .../metadataelements/PersonRoleElement.java | 29 +- .../metadataelements/PersonalRoleElement.java | 38 +- .../ProfileLocationElement.java | 149 ++ .../metadataelements/RelatedElement.java | 173 ++ .../metadataelements/RelationshipElement.java | 199 ++ .../metadataelements/ResourceElement.java | 32 +- .../SecurityGroupElement.java | 32 +- .../metadataelements/ToDoElement.java | 41 +- .../metadataelements/UserIdentityElement.java | 32 +- .../AdjacentLocationProperties.java | 57 + .../properties/AppointmentProperties.java | 3 +- .../properties/AssetLocationProperties.java | 57 + .../properties/AssignmentScopeProperties.java | 152 ++ .../properties/ClassificationProperties.java | 199 ++ .../properties/CollectionStatus.java | 16 +- .../CommunityMembershipProperties.java | 127 + .../properties/ContactMethodProperties.java | 103 +- .../DigitalLocationProperties.java} | 29 +- .../FixedLocationProperties.java} | 29 +- .../properties/LocationProperties.java | 32 +- .../properties/NestedLocationProperties.java | 57 + .../properties/PersonRoleProperties.java | 5 +- .../properties/PersonalProfileProperties.java | 23 + .../properties/PersonalRoleProperties.java | 91 +- .../properties/ProfileLocationProperties.java | 129 + .../properties/ProjectProperties.java | 38 +- .../properties/RelationshipProperties.java | 203 ++ .../properties/ResourceListProperties.java | 150 ++ .../SecureLocationProperties.java} | 33 +- .../properties/StakeholderProperties.java | 127 + .../properties/TeamProfileProperties.java | 23 + .../properties/TemplateProperties.java | 33 +- .../properties/UserIdentityProperties.java | 41 +- .../rest/ActorProfileListResponse.java | 2 +- .../rest/ActorProfileRequestBody.java | 3 +- .../rest/AppointmentRequestBody.java | 2 +- .../rest/ClassificationRequestBody.java | 129 + .../rest/CommunityListResponse.java} | 48 +- .../rest/CommunityResponse.java} | 46 +- .../rest/ContactMethodRequestBody.java | 2 +- .../rest/EffectiveDatesRequestBody.java | 4 +- ...dy.java => ExternalSourceRequestBody.java} | 12 +- ...esponse.java => LocationListResponse.java} | 36 +- .../rest/PersonRoleListResponse.java | 2 +- .../rest/PersonRoleRequestBody.java | 2 +- .../rest/PersonalProfileListResponse.java | 2 +- .../rest/ProfileIdentityRequestBody.java | 5 +- .../rest/ReferenceableRequestBody.java | 129 + .../rest/RelatedElementListResponse.java | 148 ++ .../rest/RelationshipElementResponse.java | 139 + .../rest/RelationshipElementsResponse.java | 150 ++ .../rest/RelationshipRequestBody.java | 129 + .../rest/TeamPlayerRequestBody.java | 2 +- .../rest/TemplateRequestBody.java | 165 ++ .../rest/UserIdentityListResponse.java | 2 +- .../rest/UserIdentityRequestBody.java | 2 +- .../client/CommunityManagement.java | 539 ++++ .../client/CommunityProfileBaseClient.java | 1162 +++++++++ .../client/CommunityProfileEventClient.java | 10 +- .../client/LocationManagement.java | 844 +++--- .../client/MetadataSourceClient.java | 10 +- .../client/MyProfileManagement.java | 8 +- .../client/OrganizationManagement.java | 223 +- .../client/PersonalProfileManagement.java | 39 +- .../client/SecurityGroupManagement.java | 12 +- .../client/UserIdentityManagement.java | 12 +- .../rest/CommunityProfileRESTClient.java | 245 +- .../converters/ActorProfileConverter.java | 37 +- .../converters/CollectionConverter.java | 16 +- .../converters/CommentConverter.java | 23 +- .../converters/CommunityConverter.java | 16 +- .../CommunityProfileOMASConverter.java | 54 + .../converters/ContactMethodConverter.java | 8 +- .../ExternalReferenceConverter.java | 4 +- .../converters/InformalTagConverter.java | 4 +- .../converters/LikeConverter.java | 4 +- .../converters/LocationConverter.java | 15 +- .../converters/MetadataSourceConverter.java | 4 +- .../converters/NoteLogHeaderConverter.java | 2 +- .../converters/PersonRoleConverter.java | 89 +- .../converters/PersonalProfileConverter.java | 14 +- .../converters/PersonalRoleConverter.java | 20 +- .../ProjectCollectionMemberConverter.java | 4 +- .../converters/RatingConverter.java | 4 +- .../converters/RelatedElementConverter.java | 156 ++ .../converters/ResourceConverter.java | 16 +- .../converters/SecurityGroupConverter.java | 30 + .../converters/ToDoConverter.java | 16 +- .../converters/UserIdentityConverter.java | 16 +- .../CommunityProfileInstanceHandler.java | 61 + .../CommunityProfileServicesInstance.java | 95 +- .../server/CommunityRESTServices.java | 884 +++++++ .../server/LocationRESTServices.java | 1388 +++++++--- .../server/OrganizationRESTServices.java | 330 ++- .../server/PersonalProfileRESTServices.java | 5 +- .../server/RelatedElementRESTServices.java | 1160 +++++++++ .../server/UserIdentityRESTServices.java | 10 +- .../spring/CommunityProfileResource.java | 2 +- .../server/spring/CommunityResource.java | 326 +++ .../spring/LocationManagementResource.java | 412 ++- .../server/spring/MyProfileResource.java | 2 +- .../server/spring/OrganizationResource.java | 147 +- .../spring/PersonalProfileResource.java | 2 +- .../spring/RelatedElementsResource.java | 461 ++++ .../server/spring/SecurityGroupResource.java | 2 +- .../server/spring/UserIdentityResource.java | 10 +- .../converters/ConnectorTypeConverter.java | 4 +- .../metadataelements/ElementVersions.java | 2 +- .../client/DatabaseManagerClient.java | 12 +- .../datamanager/converters/APIConverter.java | 4 +- .../converters/ConnectorTypeConverter.java | 4 +- .../converters/DataFileConverter.java | 4 +- .../converters/DatabaseConverter.java | 4 +- .../converters/DatabaseManagerConverter.java | 4 +- .../converters/DatabaseSchemaConverter.java | 4 +- .../converters/ElementStubConverter.java | 4 +- .../converters/EndpointConverter.java | 4 +- .../converters/FileFolderConverter.java | 4 +- .../converters/FileSystemConverter.java | 4 +- .../datamanager/converters/FormConverter.java | 4 +- .../converters/QueryConverter.java | 2 +- .../converters/ReportConverter.java | 4 +- .../converters/TopicConverter.java | 4 +- .../converters/ValidValueSetConverter.java | 4 +- .../DataManagerOMRSTopicListener.java | 12 +- .../metadataelements/ElementVersions.java | 2 +- .../api/ManageValidValues.java | 16 +- .../metadataelements/ElementVersions.java | 2 +- .../metadataelements/ValidValueElement.java | 65 +- .../properties/LocationProperties.java | 36 +- .../ReferenceValueAssignmentProperties.java | 65 +- .../properties/TemplateProperties.java | 33 +- .../ValidValuesMappingProperties.java | 66 +- .../client/ValidValuesManager.java | 18 +- .../converters/ConnectorTypeConverter.java | 4 +- .../converters/ElementHeaderConverter.java | 4 +- .../converters/EndpointConverter.java | 4 +- .../converters/LocationConverter.java | 5 +- .../ReferenceDataAssetConverter.java | 4 +- ...nceValueAssignmentDefinitionConverter.java | 4 +- ...ReferenceValueAssignmentItemConverter.java | 4 +- ...ValidValueAssignmentConsumerConverter.java | 2 +- ...lidValueAssignmentDefinitionConverter.java | 2 +- .../converters/ValidValueConverter.java | 17 +- .../ValidValueImplAssetConverter.java | 2 +- .../ValidValueImplDefinitionConverter.java | 2 +- .../ValidValueMappingConverter.java | 4 +- .../DigitalArchitectureOMRSTopicListener.java | 12 +- .../server/LocationRESTServices.java | 3 + .../server/ValidValuesRESTServices.java | 36 +- .../server/spring/ValidValuesResource.java | 13 +- .../DiscoveryEnginePropertiesConverter.java | 4 +- .../server/DiscoveryEngineRESTServices.java | 2 +- .../DiscoveryMetadataStoreResource.java | 2 +- .../api/GovernanceProcessingInterface.java | 2 +- .../api/MetadataElementInterface.java | 2 +- .../ffdc/GovernanceEngineAuditCode.java | 2 +- .../metadataelements/ElementVersions.java | 2 +- .../client/GovernanceActionProcessClient.java | 2 +- .../client/GovernanceEngineClient.java | 2 +- .../GovernanceActionProcessConverter.java | 4 +- .../GovernanceActionTypeConverter.java | 4 +- .../converters/GovernanceEngineConverter.java | 4 +- .../converters/MetadataElementConverter.java | 4 +- .../converters/RelatedElementConverter.java | 2 +- .../handlers/MetadataElementHandler.java | 2 +- .../GovernanceEngineOMRSTopicListener.java | 12 +- .../server/GovernanceEngineRESTServices.java | 2 +- .../spring/GovernanceEngineOMASResource.java | 4 +- .../api/CertificationManagementInterface.java | 6 +- .../api/ExternalReferencesInterface.java | 8 +- .../api/GovernanceDefinitionsInterface.java | 2 +- .../api/GovernanceDomainInterface.java | 38 +- .../api/GovernanceMetricsInterface.java | 2 +- .../api/GovernanceProgramReviewInterface.java | 2 +- .../api/GovernanceRolesInterface.java | 8 +- .../api/GovernanceZonesInterface.java | 2 +- .../api/RightsManagementInterface.java | 4 +- .../ffdc/GovernanceProgramErrorCode.java | 2 +- .../metadataelements/ElementVersions.java | 2 +- .../GovernanceDomainSetElement.java | 1 - .../PersonalProfileUniverse.java | 173 -- .../properties/ContactMethodProperties.java | 237 +- .../properties/GovernanceRoleProperties.java | 1 + .../properties/GovernanceZoneProperties.java | 30 +- .../properties/PersonRoleProperties.java | 42 +- .../properties/SubjectAreaProperties.java | 42 +- .../properties/UserIdentityProperties.java | 43 +- .../GovernanceProgramOMASAPIRequestBody.java | 1 - .../GovernanceProgramOMASAPIResponse.java | 2 - .../PersonalProfileValidatorRequestBody.java | 120 - .../client/CertificationManager.java | 16 +- .../client/ExternalReferenceManager.java | 20 +- .../GovernanceClassificationLevelManager.java | 12 +- .../client/GovernanceDefinitionManager.java | 14 +- .../client/GovernanceDomainManager.java | 155 +- .../client/GovernanceMetricsManager.java | 12 +- .../GovernanceProgramReviewManager.java | 12 +- .../client/GovernanceRoleManager.java | 28 +- .../client/GovernanceZoneManager.java | 14 +- .../client/RightsManager.java | 16 +- .../client/SubjectAreaManager.java | 23 +- .../client/package-info.java | 2 +- .../rest/GovernanceProgramRESTClient.java | 77 +- .../converters/AssetConverter.java | 4 +- .../converters/ElementStubConverter.java | 4 +- .../ExternalReferenceConverter.java | 4 +- .../GovernanceDefinitionConverter.java | 2 +- .../converters/GovernanceDomainConverter.java | 126 + .../GovernanceDomainSetConverter.java | 104 + .../converters/GovernanceRoleConverter.java | 5 +- .../converters/GovernanceZoneConverter.java | 5 +- .../converters/ProfileConverter.java | 18 +- .../converters/SubjectAreaConverter.java | 5 +- .../server/GovernanceDomainRESTServices.java | 1117 ++++++++ .../GovernanceProgramInstanceHandler.java | 58 + .../GovernanceProgramServicesInstance.java | 70 +- .../server/GovernanceRolesRESTServices.java | 6 +- .../server/GovernanceZoneRESTServices.java | 2 + .../server/SubjectAreaRESTServices.java | 2 + .../spring/GovernanceDomainsResource.java | 488 ++++ .../spring/GovernanceRolesResource.java | 8 +- .../spring/GovernanceZonesResource.java | 4 +- .../server/spring/SubjectAreaResource.java | 4 +- .../api/ConnectionsManagerInterface.java | 2 +- .../events/ITInfrastructureOutTopicEvent.java | 2 +- .../metadataelements/ElementVersions.java | 2 +- .../properties/ContactMethodProperties.java | 103 +- .../properties/UserIdentityProperties.java | 41 +- .../converters/AssetConverter.java | 4 +- .../converters/ConnectorTypeConverter.java | 4 +- .../converters/ContactMethodConverter.java | 9 +- .../converters/ElementHeaderConverter.java | 4 +- .../converters/ElementStubConverter.java | 4 +- .../converters/EndpointConverter.java | 4 +- .../converters/ITProfileConverter.java | 9 +- .../converters/PortConverter.java | 4 +- .../converters/ProcessConverter.java | 4 +- .../converters/RelatedAssetConverter.java | 2 +- .../SoftwareCapabilityConverter.java | 2 +- .../converters/UserIdentityConverter.java | 5 +- .../ITInfrastructureOMRSTopicListener.java | 12 +- .../server/ITProfileRESTServices.java | 17 +- .../events/SecurityManagerOutTopicEvent.java | 2 +- .../metadataelements/ActorProfileElement.java | 37 +- .../metadataelements/ElementVersions.java | 2 +- .../ProfileLocationElement.java | 148 ++ .../properties/ContactMethodProperties.java | 103 +- .../properties/PersonRoleProperties.java | 3 +- .../properties/PersonalRoleProperties.java | 90 +- .../properties/ProfileLocationProperties.java | 120 + .../properties/UserIdentityProperties.java | 41 +- .../converters/ActorProfileConverter.java | 35 +- .../converters/ContactMethodConverter.java | 8 +- .../converters/ElementHeaderConverter.java | 4 +- .../converters/PersonRoleConverter.java | 4 +- .../converters/SecurityManagerConverter.java | 4 +- .../converters/UserIdentityConverter.java | 5 +- .../SecurityManagerOMRSTopicListener.java | 12 +- .../server/SecurityManagerRESTServices.java | 2 + .../metadataelements/ElementVersions.java | 2 +- .../converters/ElementHeaderConverter.java | 4 +- .../converters/ElementStubConverter.java | 4 +- .../StewardshipActionOMRSTopicListener.java | 12 +- .../properties/objects/project/Project.java | 8 + .../handlers/SubjectAreaProjectHandler.java | 4 +- .../DynamicArchiveService.java | 4 +- .../DynamicArchiverConnectorsAuditCode.java | 2 +- .../InMemoryOpenMetadataTopicConnector.java | 2 +- .../kafka/KafkaOpenMetadataEventConsumer.java | 2 +- .../kafka/KafkaOpenMetadataEventProducer.java | 2 +- .../GovernanceActionConnectorsAuditCode.java | 2 +- .../DataFilesMonitorIntegrationConnector.java | 2 +- .../KafkaMonitorIntegrationConnector.java | 2 +- .../OpenAPIMonitorIntegrationConnector.java | 4 +- .../OpenAPIIntegrationConnectorAuditCode.java | 2 +- .../file/FileBasedRegistryStoreConnector.java | 4 +- .../GraphOMRSMetadataCollection.java | 2 +- .../GraphOMRSMetadataStore.java | 12 +- .../InMemoryOMRSMetadataCollection.java | 2 +- .../InMemoryOMRSMetadataStore.java | 4 +- .../OMRSRESTMetadataCollection.java | 10 +- .../ffdc/OMAGAdminAuditCode.java | 20 +- .../client/EngineHostConfigurationClient.java | 2 +- .../IntegrationDaemonConfigurationClient.java | 2 +- ...tadataAccessServerConfigurationClient.java | 2 +- .../client/ViewServerConfigurationClient.java | 2 +- .../OMAGConformanceSuiteConfigServices.java | 2 +- .../OMAGServerAdminForAccessServices.java | 2 +- .../OMAGServerAdminForEngineServices.java | 2 +- ...OMAGServerAdminForIntegrationServices.java | 2 +- .../OMAGServerAdminForViewServices.java | 4 +- .../OMAGServerOperationalServices.java | 2 +- .../spring/ConfigEngineServicesResource.java | 2 +- .../ConfigIntegrationServicesResource.java | 2 +- .../spring/OperationalServicesResource.java | 2 +- .../ffdc/OMAGCommonErrorCode.java | 7 +- .../ffdc/RESTExceptionHandler.java | 22 +- .../exceptions/CheckedExceptionBaseTest.java | 2 +- .../generichandlers/ActorProfileHandler.java | 237 +- .../generichandlers/CollectionBuilder.java | 2 +- .../generichandlers/CollectionHandler.java | 1 + .../generichandlers/CommunityBuilder.java | 144 ++ .../generichandlers/CommunityHandler.java | 681 +++++ .../ContactDetailsBuilder.java | 30 +- .../ContactDetailsHandler.java | 10 +- .../GovernanceDomainHandler.java | 90 +- .../GovernanceZoneBuilder.java | 12 +- .../GovernanceZoneHandler.java | 45 +- .../generichandlers/LocationBuilder.java | 13 + .../generichandlers/LocationHandler.java | 597 ++++- .../OpenMetadataAPIGenericConverter.java | 185 +- .../OpenMetadataAPIGenericHandler.java | 2 + .../OpenMetadataAPIMapper.java | 148 +- .../generichandlers/PersonRoleBuilder.java | 52 +- .../generichandlers/PersonRoleHandler.java | 246 +- .../generichandlers/ProjectBuilder.java | 120 +- .../generichandlers/ProjectHandler.java | 1361 ++++++++++ .../generichandlers/ReferenceableHandler.java | 1093 +++++++- .../generichandlers/SearchKeywordHandler.java | 2 +- .../generichandlers/SubjectAreaBuilder.java | 12 +- .../generichandlers/SubjectAreaHandler.java | 48 +- .../generichandlers/UserIdentityBuilder.java | 14 + .../generichandlers/UserIdentityHandler.java | 40 +- .../generichandlers/ValidValuesHandler.java | 121 +- .../properties/package-info.java | 2 +- .../client/ConnectedAssetProperties.java | 2 +- .../ConnectedAssetRelatedAssetProperties.java | 2 +- .../server/OCFMetadataRESTServices.java | 22 +- .../converters/CertificationConverter.java | 2 +- .../server/converters/CommentConverter.java | 2 +- .../converters/InformalTagConverter.java | 2 +- .../server/converters/LicenseConverter.java | 2 +- .../server/converters/LikeConverter.java | 2 +- .../server/converters/RatingConverter.java | 2 +- .../converters/RelatedAssetConverter.java | 2 +- .../RepositoryHandlerErrorCode.java | 2 +- .../ffdc/AssetAnalysisAuditCode.java | 8 +- .../ffdc/GovernanceActionAuditCode.java | 2 +- .../context/OpenMetadataStoreClient.java | 2 +- .../RepositoryGovernanceContext.java | 6 +- .../ffdc/RepositoryGovernanceAuditCode.java | 8 +- .../RepositoryGovernanceServiceContext.java | 8 +- .../AuditLogMessageDefinition.java | 2 +- .../ExceptionMessageDefinition.java | 2 +- .../messagesets/MessageDefinition.java | 2 +- .../GovernanceActionContext.java | 2 +- .../GovernanceActionServiceConnector.java | 2 +- .../governanceaction/GovernanceContext.java | 6 +- .../governanceaction/OpenMetadataClient.java | 6 +- .../governanceaction/OpenMetadataStore.java | 2 +- .../ProvisioningGovernanceContext.java | 6 +- .../RemediationGovernanceContext.java | 2 +- .../properties/ElementControlHeader.java | 6 +- .../search/SequencingOrder.java | 2 +- .../frameworks/connectors/Connector.java | 4 +- .../frameworks/connectors/ConnectorBase.java | 2 +- .../connectors/ConnectorBroker.java | 2 +- .../connectors/ConnectorProvider.java | 4 +- .../connectors/ConnectorProviderBase.java | 4 +- .../connectors/ffdc/OCFErrorCode.java | 2 +- .../properties/AssetCertification.java | 6 +- .../connectors/properties/AssetComment.java | 6 +- .../properties/AssetComplexSchemaType.java | 2 +- .../properties/AssetDescriptor.java | 6 +- .../connectors/properties/AssetDetail.java | 2 +- .../properties/AssetElementHeader.java | 2 +- .../properties/AssetEnumSchemaType.java | 2 +- .../properties/AssetExternalIdentifier.java | 6 +- .../properties/AssetExternalReference.java | 6 +- .../properties/AssetExternalSchemaType.java | 2 +- .../properties/AssetInformalTag.java | 2 +- .../connectors/properties/AssetLicense.java | 6 +- .../properties/AssetLiteralSchemaType.java | 2 +- .../connectors/properties/AssetLocation.java | 6 +- .../properties/AssetMapSchemaType.java | 2 +- .../connectors/properties/AssetMeaning.java | 6 +- .../connectors/properties/AssetNote.java | 2 +- .../properties/AssetPrimitiveSchemaType.java | 2 +- .../connectors/properties/AssetRating.java | 6 +- .../properties/AssetReferenceable.java | 6 +- .../properties/AssetSchemaAttribute.java | 10 +- .../AssetSchemaAttributeRelationship.java | 6 +- .../properties/AssetSchemaElement.java | 2 +- .../properties/AssetSchemaTypeChoice.java | 2 +- .../properties/AssetSecurityTags.java | 6 +- .../properties/AssetSimpleSchemaType.java | 2 +- .../properties/ConnectedAssetProperties.java | 4 +- .../properties/ConnectionProperties.java | 2 +- .../EmbeddedConnectionProperties.java | 6 +- .../properties/EndpointProperties.java | 4 +- .../properties/RelatedAssetProperties.java | 4 +- .../VirtualConnectionProperties.java | 2 +- .../connectors/properties/beans/Endpoint.java | 2 +- ...tionCheckedExceptionConnectorProvider.java | 2 +- ...ctorCheckedExceptionConnectorProvider.java | 2 +- .../MockEmptyConnectorProvider.java | 2 +- .../MockRuntimeExceptionConnector.java | 2 +- ...MockRuntimeExceptionConnectorProvider.java | 2 +- .../properties/TestAssetFeedback.java | 2 +- .../properties/TestAssetUniverse.java | 2 +- .../properties/ElementControlHeader.java | 6 +- .../discovery/properties/PropertyBase.java | 6 +- .../SuspectDuplicateAnnotation.java | 16 +- .../connectors/DataEngineConnectorBase.java | 2 +- .../ffdc/EngineHostServicesAuditCode.java | 10 +- .../admin/GovernanceServiceHandler.java | 2 +- .../GovernanceEngineOutTopicListener.java | 2 +- .../server/EngineHostInstance.java | 6 +- .../server/EngineHostInstanceHandler.java | 6 +- .../IntegrationDaemonServicesAuditCode.java | 6 +- .../handlers/IntegrationServiceHandler.java | 6 +- .../server/IntegrationDaemonInstance.java | 4 +- .../IntegrationDaemonInstanceHandler.java | 2 +- .../IntegrationDaemonOperationalServices.java | 2 +- .../server/IntegrationDaemonRESTServices.java | 2 +- .../OrganizationIntegratorContext.java | 140 +- .../auditlog/OMRSAuditLog.java | 2 +- ...OMRSDynamicTypeMetadataCollectionBase.java | 4 +- .../OMRSFixedTypeMetadataCollectionBase.java | 2 +- .../OMRSMetadataCollection.java | 10 +- .../OMRSMetadataCollectionBase.java | 16 +- .../properties/HistorySequencingOrder.java | 2 +- .../properties/RepositoryElementHeader.java | 6 +- .../properties/SequencingOrder.java | 2 +- .../properties/instances/InstanceGraph.java | 2 +- .../properties/instances/InstanceType.java | 2 +- .../typedefs/TypeDefElementHeader.java | 2 +- .../OMRSRepositoryConnector.java | 2 +- .../OMRSRepositoryHelper.java | 8 +- .../OMRSRepositoryEventProcessor.java | 6 +- .../OMRSRepositoryPropertiesHelper.java | 4 +- .../OMRSRepositoryPropertiesUtilities.java | 8 +- .../events/OMRSInstanceEventProcessor.java | 18 +- ...EventProcessorClassificationExtension.java | 6 +- .../OMRSInstanceEventProcessorInterface.java | 6 +- .../events/future/CompoundFuture.java | 2 +- .../ffdc/OMRSAuditCode.java | 8 +- .../ffdc/OMRSErrorCode.java | 4 +- .../properties/RelationshipCreateRequest.java | 2 +- .../MetadataHighwayServicesClient.java | 2 +- .../archivemanager/OMRSArchiveManager.java | 2 +- .../OMRSConnectionConsumer.java | 2 +- .../OMRSConnectorConsumer.java | 2 +- .../EnterpriseOMRSConnectorProvider.java | 2 +- .../EnterpriseOMRSMetadataCollection.java | 14 +- .../EnterpriseOMRSRepositoryConnector.java | 2 +- .../ExceptionAccumulatorBase.java | 2 +- .../RelationshipsAccumulator.java | 2 +- .../accumulators/TypesAccumulator.java | 2 +- .../LocalOMRSInstanceEventProcessor.java | 14 +- .../server/OMRSRepositoryRESTServices.java | 12 +- .../EnterpriseRepositoryServicesResource.java | 8 +- .../LocalRepositoryServicesResource.java | 12 +- .../SimpleCatalogArchiveHelper.java | 2282 ++++++++++++++++- .../opentypes/OpenMetadataTypesArchive.java | 622 ++++- .../OpenMetadataTypesArchive1_2.java | 2 +- .../OpenMetadataTypesArchive2_10.java | 2 +- .../CreateCSVFileAssetSample.java | 11 +- .../GovernanceLeadershipSample.java | 34 +- .../CreateSubjectAreasSample.java | 23 +- .../SubjectAreaSampleDefinitions.java | 25 +- .../CreateGovernanceZoneSample.java | 40 +- .../SimpleDataCatalogArchiveBuilder.java | 2 +- .../validvalues/CreateValidValuesSetTest.java | 5 +- .../fvt/definitions/CreateDefinitionTest.java | 233 +- 537 files changed, 25282 insertions(+), 3196 deletions(-) create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/RelatedElementsManagementInterface.java create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/ProfileLocationElement.java create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/RelatedElement.java create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/RelationshipElement.java create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/AdjacentLocationProperties.java create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/AssetLocationProperties.java create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/AssignmentScopeProperties.java create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ClassificationProperties.java create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/CommunityMembershipProperties.java rename open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/{rest/DigitalLocationRequestBody.java => properties/DigitalLocationProperties.java} (71%) rename open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/{rest/FixedLocationRequestBody.java => properties/FixedLocationProperties.java} (81%) create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/NestedLocationProperties.java create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ProfileLocationProperties.java create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/RelationshipProperties.java create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ResourceListProperties.java rename open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/{rest/SecureLocationRequestBody.java => properties/SecureLocationProperties.java} (72%) create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/StakeholderProperties.java create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ClassificationRequestBody.java rename open-metadata-implementation/access-services/{governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/rest/PersonalProfileListResponse.java => community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/CommunityListResponse.java} (65%) rename open-metadata-implementation/access-services/{governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/rest/PersonalProfileResponse.java => community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/CommunityResponse.java} (65%) rename open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/{MetadataSourceRequestBody.java => ExternalSourceRequestBody.java} (91%) rename open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/{LocationsResponse.java => LocationListResponse.java} (77%) create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ReferenceableRequestBody.java create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/RelatedElementListResponse.java create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/RelationshipElementResponse.java create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/RelationshipElementsResponse.java create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/RelationshipRequestBody.java create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/TemplateRequestBody.java create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityManagement.java create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityProfileBaseClient.java create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/RelatedElementConverter.java create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/CommunityRESTServices.java create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/RelatedElementRESTServices.java create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/CommunityResource.java create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/RelatedElementsResource.java delete mode 100644 open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/metadataelements/PersonalProfileUniverse.java delete mode 100644 open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/rest/PersonalProfileValidatorRequestBody.java create mode 100644 open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/GovernanceDomainConverter.java create mode 100644 open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/GovernanceDomainSetConverter.java create mode 100644 open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/GovernanceDomainRESTServices.java create mode 100644 open-metadata-implementation/access-services/governance-program/governance-program-spring/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/spring/GovernanceDomainsResource.java create mode 100644 open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/metadataelements/ProfileLocationElement.java create mode 100644 open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/ProfileLocationProperties.java create mode 100644 open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/CommunityBuilder.java create mode 100644 open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/CommunityHandler.java create mode 100644 open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ProjectHandler.java diff --git a/open-metadata-implementation/access-services/analytics-modeling/analytics-modeling-server/src/main/java/org/odpi/openmetadata/accessservices/analyticsmodeling/converter/DatabaseConverter.java b/open-metadata-implementation/access-services/analytics-modeling/analytics-modeling-server/src/main/java/org/odpi/openmetadata/accessservices/analyticsmodeling/converter/DatabaseConverter.java index 44d1e9dd910..6dfdbbd0745 100644 --- a/open-metadata-implementation/access-services/analytics-modeling/analytics-modeling-server/src/main/java/org/odpi/openmetadata/accessservices/analyticsmodeling/converter/DatabaseConverter.java +++ b/open-metadata-implementation/access-services/analytics-modeling/analytics-modeling-server/src/main/java/org/odpi/openmetadata/accessservices/analyticsmodeling/converter/DatabaseConverter.java @@ -32,7 +32,7 @@ public DatabaseConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity. * * @param beanClass name of the class to create @@ -63,7 +63,7 @@ public Database getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/analytics-modeling/analytics-modeling-server/src/main/java/org/odpi/openmetadata/accessservices/analyticsmodeling/converter/GlossaryTermConverter.java b/open-metadata-implementation/access-services/analytics-modeling/analytics-modeling-server/src/main/java/org/odpi/openmetadata/accessservices/analyticsmodeling/converter/GlossaryTermConverter.java index 34b1e83d5a5..f4585a35a59 100644 --- a/open-metadata-implementation/access-services/analytics-modeling/analytics-modeling-server/src/main/java/org/odpi/openmetadata/accessservices/analyticsmodeling/converter/GlossaryTermConverter.java +++ b/open-metadata-implementation/access-services/analytics-modeling/analytics-modeling-server/src/main/java/org/odpi/openmetadata/accessservices/analyticsmodeling/converter/GlossaryTermConverter.java @@ -32,7 +32,7 @@ public GlossaryTermConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity. * * @param beanClass name of the class to create @@ -63,7 +63,7 @@ public GlossaryTerm getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/analytics-modeling/analytics-modeling-server/src/main/java/org/odpi/openmetadata/accessservices/analyticsmodeling/converter/SchemaConverter.java b/open-metadata-implementation/access-services/analytics-modeling/analytics-modeling-server/src/main/java/org/odpi/openmetadata/accessservices/analyticsmodeling/converter/SchemaConverter.java index 3d87fc37281..76462ccfb41 100644 --- a/open-metadata-implementation/access-services/analytics-modeling/analytics-modeling-server/src/main/java/org/odpi/openmetadata/accessservices/analyticsmodeling/converter/SchemaConverter.java +++ b/open-metadata-implementation/access-services/analytics-modeling/analytics-modeling-server/src/main/java/org/odpi/openmetadata/accessservices/analyticsmodeling/converter/SchemaConverter.java @@ -63,7 +63,7 @@ public Schema getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/analytics-modeling/analytics-modeling-server/src/main/java/org/odpi/openmetadata/accessservices/analyticsmodeling/synchronization/converters/AnalyticsMetadataConverter.java b/open-metadata-implementation/access-services/analytics-modeling/analytics-modeling-server/src/main/java/org/odpi/openmetadata/accessservices/analyticsmodeling/synchronization/converters/AnalyticsMetadataConverter.java index 2cc32f6cc4d..931de52141c 100644 --- a/open-metadata-implementation/access-services/analytics-modeling/analytics-modeling-server/src/main/java/org/odpi/openmetadata/accessservices/analyticsmodeling/synchronization/converters/AnalyticsMetadataConverter.java +++ b/open-metadata-implementation/access-services/analytics-modeling/analytics-modeling-server/src/main/java/org/odpi/openmetadata/accessservices/analyticsmodeling/synchronization/converters/AnalyticsMetadataConverter.java @@ -42,7 +42,7 @@ public AnalyticsMetadata getNewBean(EntityDetail entity, String methodName) thro } /** - * Using the supplied entity, return a new instance of the bean. This is used for beans that have + * Using the supplied entity, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/analytics-modeling/analytics-modeling-server/src/main/java/org/odpi/openmetadata/accessservices/analyticsmodeling/synchronization/converters/AssetConverter.java b/open-metadata-implementation/access-services/analytics-modeling/analytics-modeling-server/src/main/java/org/odpi/openmetadata/accessservices/analyticsmodeling/synchronization/converters/AssetConverter.java index 627005510f7..423e80d6d1f 100644 --- a/open-metadata-implementation/access-services/analytics-modeling/analytics-modeling-server/src/main/java/org/odpi/openmetadata/accessservices/analyticsmodeling/synchronization/converters/AssetConverter.java +++ b/open-metadata-implementation/access-services/analytics-modeling/analytics-modeling-server/src/main/java/org/odpi/openmetadata/accessservices/analyticsmodeling/synchronization/converters/AssetConverter.java @@ -27,7 +27,7 @@ public AssetConverter(OMRSRepositoryHelper repositoryHelper, String serviceName, } /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/analytics-modeling/analytics-modeling-server/src/main/java/org/odpi/openmetadata/accessservices/analyticsmodeling/synchronization/converters/SchemaTypeConverter.java b/open-metadata-implementation/access-services/analytics-modeling/analytics-modeling-server/src/main/java/org/odpi/openmetadata/accessservices/analyticsmodeling/synchronization/converters/SchemaTypeConverter.java index 5f5162612a3..a1409679ffd 100644 --- a/open-metadata-implementation/access-services/analytics-modeling/analytics-modeling-server/src/main/java/org/odpi/openmetadata/accessservices/analyticsmodeling/synchronization/converters/SchemaTypeConverter.java +++ b/open-metadata-implementation/access-services/analytics-modeling/analytics-modeling-server/src/main/java/org/odpi/openmetadata/accessservices/analyticsmodeling/synchronization/converters/SchemaTypeConverter.java @@ -18,7 +18,7 @@ public SchemaTypeConverter(OMRSRepositoryHelper repositoryHelper, String service } /** - * Using the supplied entity, return a new instance of the bean. This is used for beans that have + * Using the supplied entity, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/analytics-modeling/analytics-modeling-server/src/main/java/org/odpi/openmetadata/accessservices/analyticsmodeling/synchronization/converters/SoftwareServerCapabilityConverter.java b/open-metadata-implementation/access-services/analytics-modeling/analytics-modeling-server/src/main/java/org/odpi/openmetadata/accessservices/analyticsmodeling/synchronization/converters/SoftwareServerCapabilityConverter.java index 5a44ce15c0e..de41359b74a 100644 --- a/open-metadata-implementation/access-services/analytics-modeling/analytics-modeling-server/src/main/java/org/odpi/openmetadata/accessservices/analyticsmodeling/synchronization/converters/SoftwareServerCapabilityConverter.java +++ b/open-metadata-implementation/access-services/analytics-modeling/analytics-modeling-server/src/main/java/org/odpi/openmetadata/accessservices/analyticsmodeling/synchronization/converters/SoftwareServerCapabilityConverter.java @@ -34,7 +34,7 @@ public SoftwareServerCapabilityConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity. * * @param beanClass name of the class to create @@ -66,7 +66,7 @@ public SoftwareServerCapability getNewBean(Class b /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/asset-catalog/asset-catalog-server/src/main/java/org/odpi/openmetadata/accessservices/assetcatalog/handlers/CommonHandler.java b/open-metadata-implementation/access-services/asset-catalog/asset-catalog-server/src/main/java/org/odpi/openmetadata/accessservices/assetcatalog/handlers/CommonHandler.java index 3cdd7dc6548..4b3d1b4bc69 100644 --- a/open-metadata-implementation/access-services/asset-catalog/asset-catalog-server/src/main/java/org/odpi/openmetadata/accessservices/assetcatalog/handlers/CommonHandler.java +++ b/open-metadata-implementation/access-services/asset-catalog/asset-catalog-server/src/main/java/org/odpi/openmetadata/accessservices/assetcatalog/handlers/CommonHandler.java @@ -76,7 +76,7 @@ OMRSMetadataCollection getOMRSMetadataCollection() { } /** - * Returns a list containing the type and all of the sub-types of the provided type + * Returns a list containing the type and all the sub-types of the provided type * * @param userId user identifier that issues the call * @param typeDefName the type definition name diff --git a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/api/AssetConsumerTaggingInterface.java b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/api/AssetConsumerTaggingInterface.java index a4ce3bc6e19..d4813dcd687 100644 --- a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/api/AssetConsumerTaggingInterface.java +++ b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/api/AssetConsumerTaggingInterface.java @@ -76,7 +76,7 @@ void updateTagDescription(String userId, /** * Removes a tag from the repository. - * A private tag can be deleted by its creator and all of the references are lost; + * A private tag can be deleted by its creator and all the references are lost; * a public tag can be deleted by anyone, but only if it is not attached to any referenceable. * * @param userId userId of user making request. diff --git a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/elements/ElementVersions.java b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/elements/ElementVersions.java index 737848fd14a..36f32c89ffd 100644 --- a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/elements/ElementVersions.java +++ b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/elements/ElementVersions.java @@ -17,7 +17,7 @@ /** * ElementVersions provides the version information for the element plus details of the creation time and last - * update time. Finally it lists all of the users that have made changes to this element. + * update time. Finally it lists all the users that have made changes to this element. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/ffdc/AssetConsumerErrorCode.java b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/ffdc/AssetConsumerErrorCode.java index 51c68f7788d..2d5be3adfb7 100644 --- a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/ffdc/AssetConsumerErrorCode.java +++ b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/ffdc/AssetConsumerErrorCode.java @@ -43,7 +43,7 @@ public enum AssetConsumerErrorCode implements ExceptionMessageSet PROXY_CONNECTION_FOUND(404, "OMAS-ASSET-CONSUMER-404-006", "Only an entity proxy for requested connection {0} is found in the open metadata server {1}, error message was: {2}", "The system is unable to populate the requested connection object because the object stored is only a stub from a relationship.", - "Check that the connection name is correct. Check that all of the servers in the cohort are running. Retry the request when the " + + "Check that the connection name is correct. Check that all the servers in the cohort are running. Retry the request when the " + "connection is available in the cohort."), ASSET_NOT_FOUND(404, "OMAS-ASSET-CONSUMER-404-007", "A connected asset is not found for connection {0}", diff --git a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-client/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/client/AssetConsumer.java b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-client/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/client/AssetConsumer.java index 3cffc380abe..46e3f86d833 100644 --- a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-client/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/client/AssetConsumer.java +++ b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-client/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/client/AssetConsumer.java @@ -1310,7 +1310,7 @@ public void updateTagDescription(String userId, /** * Removes a tag from the repository. - * A private tag can be deleted by its creator and all of the references are lost; + * A private tag can be deleted by its creator and all the references are lost; * a public tag can be deleted by anyone, but only if it is not attached to any referenceable. * * @param userId userId of user making request. diff --git a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/converters/AssetConverter.java b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/converters/AssetConverter.java index 447782568e7..6985fcff0ea 100644 --- a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/converters/AssetConverter.java +++ b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/converters/AssetConverter.java @@ -37,7 +37,7 @@ public AssetConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity. * * @param beanClass name of the class to create @@ -138,7 +138,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/converters/CommentConverter.java b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/converters/CommentConverter.java index 62a6b4fa98f..3362f551be0 100644 --- a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/converters/CommentConverter.java +++ b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/converters/CommentConverter.java @@ -37,7 +37,7 @@ public CommentConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -117,7 +117,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/converters/ElementHeaderConverter.java b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/converters/ElementHeaderConverter.java index ccdb3178254..51669363509 100644 --- a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/converters/ElementHeaderConverter.java +++ b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/converters/ElementHeaderConverter.java @@ -33,7 +33,7 @@ public ElementHeaderConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -79,7 +79,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/converters/InformalTagConverter.java b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/converters/InformalTagConverter.java index 7c17646810a..8d2d30c6fa1 100644 --- a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/converters/InformalTagConverter.java +++ b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/converters/InformalTagConverter.java @@ -36,7 +36,7 @@ public InformalTagConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -107,7 +107,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/converters/LikeConverter.java b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/converters/LikeConverter.java index 67e5f461c13..785bb3dad9c 100644 --- a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/converters/LikeConverter.java +++ b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/converters/LikeConverter.java @@ -34,7 +34,7 @@ public LikeConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -97,7 +97,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/converters/MeaningConverter.java b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/converters/MeaningConverter.java index 09aac1948f8..7cb1aa99351 100644 --- a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/converters/MeaningConverter.java +++ b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/converters/MeaningConverter.java @@ -39,7 +39,7 @@ public MeaningConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -108,7 +108,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/converters/RatingConverter.java b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/converters/RatingConverter.java index d8f7c079e09..e79e79c590e 100644 --- a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/converters/RatingConverter.java +++ b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/converters/RatingConverter.java @@ -37,7 +37,7 @@ public RatingConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -107,7 +107,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/outtopic/AssetConsumerOMRSTopicListener.java b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/outtopic/AssetConsumerOMRSTopicListener.java index 0a74e8c78a6..762f8470e96 100644 --- a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/outtopic/AssetConsumerOMRSTopicListener.java +++ b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/outtopic/AssetConsumerOMRSTopicListener.java @@ -145,7 +145,7 @@ public void processUpdatedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entityProxy details of the entityProxy with the new classification added. No guarantee this is all of the classifications. + * @param entityProxy details of the entityProxy with the new classification added. No guarantee this is all the classifications. * @param classification new classification */ @Override @@ -184,7 +184,7 @@ public void processClassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity with the new classification added. No guarantee this is all of the classifications. + * @param entity details of the entity with the new classification added. No guarantee this is all the classifications. * @param classification new classification */ @Override @@ -261,7 +261,7 @@ public void processClassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entityProxy details of the entityProxy after the classification has been removed. No guarantee this is all of the classifications. + * @param entityProxy details of the entityProxy after the classification has been removed. No guarantee this is all the classifications. * @param originalClassification classification that was removed */ @Override @@ -300,7 +300,7 @@ public void processDeclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity after the classification has been removed. No guarantee this is all of the classifications. + * @param entity details of the entity after the classification has been removed. No guarantee this is all the classifications. * @param originalClassification classification that was removed */ @Override @@ -377,7 +377,7 @@ public void processDeclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entityProxy details of the entityProxy after the classification has been changed. No guarantee this is all of the classifications. + * @param entityProxy details of the entityProxy after the classification has been changed. No guarantee this is all the classifications. * @param originalClassification classification that was removed * @param classification new classification */ @@ -418,7 +418,7 @@ public void processReclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity after the classification has been changed. No guarantee this is all of the classifications. + * @param entity details of the entity after the classification has been changed. No guarantee this is all the classifications. * @param originalClassification classification that was removed * @param classification new classification */ diff --git a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-spring/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/server/spring/AssetConsumerResource.java b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-spring/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/server/spring/AssetConsumerResource.java index 8c2e8d31451..50d0ee67741 100644 --- a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-spring/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/server/spring/AssetConsumerResource.java +++ b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-spring/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/server/spring/AssetConsumerResource.java @@ -264,7 +264,7 @@ public GUIDResponse createTag(@PathVariable String serverName, /** - * Removes a tag from the repository. All of the relationships to referenceables are lost. + * Removes a tag from the repository. all the relationships to referenceables are lost. * * @param serverName name of the server instances for this request * @param userId String - userId of user making request. diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/events/AssetManagerOutTopicEvent.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/events/AssetManagerOutTopicEvent.java index 93b27f191f7..8ee21b2584c 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/events/AssetManagerOutTopicEvent.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/events/AssetManagerOutTopicEvent.java @@ -15,7 +15,7 @@ /** * AssetManagerOutTopicEvent provides the structure of the Asset Manager OMAS's OutTopic events. The values for elements and their classifications * come from the events. They are not guaranteed to be current. If the latest values are required, the element should be queried from the repository - * using its GUID. The event values are useful if the third party catalog needs to maintain an exact record of all of the versions. + * using its GUID. The event values are useful if the third party catalog needs to maintain an exact record of all the versions. */ @JsonAutoDetect(getterVisibility = PUBLIC_ONLY, setterVisibility = PUBLIC_ONLY, fieldVisibility = NONE) @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/metadataelements/ElementVersions.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/metadataelements/ElementVersions.java index 3263662ff8b..562d44ad3c1 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/metadataelements/ElementVersions.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/metadataelements/ElementVersions.java @@ -17,7 +17,7 @@ /** * ElementVersions provides the version information for the element plus details of the creation time and last - * update time. Finally it lists all of the users that have made changes to this element. + * update time. Finally it lists all the users that have made changes to this element. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/ValidValuesExchangeClient.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/ValidValuesExchangeClient.java index 8502ba2d848..a61b29d8424 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/ValidValuesExchangeClient.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/ValidValuesExchangeClient.java @@ -20,7 +20,7 @@ /** * ValidValuesExchangeClient provides the API operations to create and maintain lists of valid * value definitions grouped into a valid value set. Both valid value definitions and valid value sets have - * the same attributes and so inherit from ValidValue where all of the attributes are defined. + * the same attributes and so inherit from ValidValue where all the attributes are defined. * * A set is just grouping of valid values. Valid value definitions and set can be nested many times in other * valid value sets. diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/AssetConverter.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/AssetConverter.java index 327a840c128..9178fc32cc8 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/AssetConverter.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/AssetConverter.java @@ -37,7 +37,7 @@ public AssetConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -104,7 +104,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/AssetManagerConverter.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/AssetManagerConverter.java index 047af9e7e89..c3354401d9a 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/AssetManagerConverter.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/AssetManagerConverter.java @@ -35,7 +35,7 @@ public AssetManagerConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -105,7 +105,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/ConnectorTypeConverter.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/ConnectorTypeConverter.java index fb459c08677..333a539b3c0 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/ConnectorTypeConverter.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/ConnectorTypeConverter.java @@ -35,7 +35,7 @@ public ConnectorTypeConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -115,7 +115,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/ElementHeaderConverter.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/ElementHeaderConverter.java index fcf170d1120..519f0494348 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/ElementHeaderConverter.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/ElementHeaderConverter.java @@ -34,7 +34,7 @@ public ElementHeaderConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -172,7 +172,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/ElementStubConverter.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/ElementStubConverter.java index 2a725efa0fa..e6e8c19e70a 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/ElementStubConverter.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/ElementStubConverter.java @@ -37,7 +37,7 @@ public ElementStubConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entityProxy and that of a connected relationship. * * @param beanClass name of the class to create @@ -77,7 +77,7 @@ private B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an relationship and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/EndpointConverter.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/EndpointConverter.java index 53c80b1608a..9805822b7ad 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/EndpointConverter.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/EndpointConverter.java @@ -35,7 +35,7 @@ public EndpointConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -106,7 +106,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/ExternalIdentifierConverter.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/ExternalIdentifierConverter.java index 32527c4e6ba..651a78c3100 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/ExternalIdentifierConverter.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/ExternalIdentifierConverter.java @@ -37,7 +37,7 @@ public ExternalIdentifierConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -56,7 +56,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/ExternalReferenceConverter.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/ExternalReferenceConverter.java index 4219022c3d3..e132c193cd1 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/ExternalReferenceConverter.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/ExternalReferenceConverter.java @@ -37,7 +37,7 @@ public ExternalReferenceConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -100,7 +100,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/ExternalReferenceLinkConverter.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/ExternalReferenceLinkConverter.java index 2a65c4fe891..2068d63b275 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/ExternalReferenceLinkConverter.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/ExternalReferenceLinkConverter.java @@ -36,7 +36,7 @@ public ExternalReferenceLinkConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -55,7 +55,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/GlossaryCategoryConverter.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/GlossaryCategoryConverter.java index b57094d9236..19156ba0a47 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/GlossaryCategoryConverter.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/GlossaryCategoryConverter.java @@ -36,7 +36,7 @@ public GlossaryCategoryConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -104,7 +104,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/GlossaryConverter.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/GlossaryConverter.java index c6ec942bc5a..51ae10f34c6 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/GlossaryConverter.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/GlossaryConverter.java @@ -33,7 +33,7 @@ public GlossaryConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -95,7 +95,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/GlossaryTermConverter.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/GlossaryTermConverter.java index 09db0ae08ab..be65dd17881 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/GlossaryTermConverter.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/GlossaryTermConverter.java @@ -35,7 +35,7 @@ public GlossaryTermConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -107,7 +107,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/GovernanceActionProcessConverter.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/GovernanceActionProcessConverter.java index eebba848d67..ac591ef4bf3 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/GovernanceActionProcessConverter.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/GovernanceActionProcessConverter.java @@ -36,7 +36,7 @@ public GovernanceActionProcessConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -96,7 +96,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/GovernanceActionTypeConverter.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/GovernanceActionTypeConverter.java index e4ac259af55..0e73389ab2c 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/GovernanceActionTypeConverter.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/GovernanceActionTypeConverter.java @@ -37,7 +37,7 @@ public GovernanceActionTypeConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -56,7 +56,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/PortConverter.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/PortConverter.java index 90d88338928..344cd06bfd2 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/PortConverter.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/PortConverter.java @@ -37,7 +37,7 @@ public PortConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -104,7 +104,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/ProcessConverter.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/ProcessConverter.java index 6246ede35c4..d04903925d2 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/ProcessConverter.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/ProcessConverter.java @@ -36,7 +36,7 @@ public ProcessConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -106,7 +106,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/listener/AssetManagerOMRSTopicListener.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/listener/AssetManagerOMRSTopicListener.java index d0d6bdaa6d2..f6815bc4a0f 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/listener/AssetManagerOMRSTopicListener.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/listener/AssetManagerOMRSTopicListener.java @@ -141,7 +141,7 @@ public void processUpdatedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entityProxy details of the entityProxy with the new classification added. No guarantee this is all of the classifications. + * @param entityProxy details of the entityProxy with the new classification added. No guarantee this is all the classifications. * @param classification new classification */ @Override @@ -180,7 +180,7 @@ public void processClassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity with the new classification added. No guarantee this is all of the classifications. + * @param entity details of the entity with the new classification added. No guarantee this is all the classifications. * @param classification new classification */ @Override @@ -257,7 +257,7 @@ public void processClassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entityProxy details of the entityProxy after the classification has been removed. No guarantee this is all of the classifications. + * @param entityProxy details of the entityProxy after the classification has been removed. No guarantee this is all the classifications. * @param originalClassification classification that was removed */ @Override @@ -296,7 +296,7 @@ public void processDeclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity after the classification has been removed. No guarantee this is all of the classifications. + * @param entity details of the entity after the classification has been removed. No guarantee this is all the classifications. * @param originalClassification classification that was removed */ @Override @@ -373,7 +373,7 @@ public void processDeclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entityProxy details of the entityProxy after the classification has been changed. No guarantee this is all of the classifications. + * @param entityProxy details of the entityProxy after the classification has been changed. No guarantee this is all the classifications. * @param originalClassification classification that was removed * @param classification new classification */ @@ -414,7 +414,7 @@ public void processReclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity after the classification has been changed. No guarantee this is all of the classifications. + * @param entity details of the entity after the classification has been changed. No guarantee this is all the classifications. * @param originalClassification classification that was removed * @param classification new classification */ diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/api/AssetClassificationInterface.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/api/AssetClassificationInterface.java index 6957726f33a..b7a015cb593 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/api/AssetClassificationInterface.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/api/AssetClassificationInterface.java @@ -14,7 +14,7 @@ /** * The AssetClassificationInterface is used by the asset owner to add classifications and detailed definitions - * to the asset. Typically this interface is used after the discovery services have explored the asset's content + * to the asset. Typically, this interface is used after the discovery services have explored the asset's content * and created helpful annotations to guide the asset owner. */ public interface AssetClassificationInterface diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/api/AssetOnboardingValidValues.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/api/AssetOnboardingValidValues.java index 653e4f2a0f4..6f91f4b0386 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/api/AssetOnboardingValidValues.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/api/AssetOnboardingValidValues.java @@ -13,7 +13,7 @@ /** * AssetOnboardingValidValues provides the API operations to create and maintain lists of valid * value definitions grouped into a valid value set. Both valid value definitions and valid value sets have - * the same attributes and so inherit from ValidValue where all of the attributes are defined. + * the same attributes and so inherit from ValidValue where all the attributes are defined. * * A set is just grouping of valid values. Valid value definitions and set can be nested many times in other * valid value sets. @@ -55,6 +55,7 @@ String createValidValueSet(String userId, * * @param userId calling user. * @param setGUID unique identifier of the set to attach this to. + * @param isDefaultValue is this the default value for the set? * @param qualifiedName unique name. * @param displayName displayable descriptive name. * @param description further information. @@ -72,6 +73,7 @@ String createValidValueSet(String userId, */ String createValidValueDefinition(String userId, String setGUID, + boolean isDefaultValue, String qualifiedName, String displayName, String description, @@ -146,6 +148,7 @@ void deleteValidValue(String userId, * @param userId calling user. * @param setGUID unique identifier of the set. * @param validValueGUID unique identifier of the valid value to add to the set. + * @param isDefaultValue is this the default value for the set? * * @throws InvalidParameterException one of the parameters is invalid. * @throws UserNotAuthorizedException the user is not authorized to make this request. @@ -153,7 +156,8 @@ void deleteValidValue(String userId, */ void attachValidValueToSet(String userId, String setGUID, - String validValueGUID) throws InvalidParameterException, + String validValueGUID, + boolean isDefaultValue) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException; diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/ffdc/AssetOwnerErrorCode.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/ffdc/AssetOwnerErrorCode.java index 0b2f8d97870..3ce7204b13b 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/ffdc/AssetOwnerErrorCode.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/ffdc/AssetOwnerErrorCode.java @@ -141,7 +141,7 @@ public enum AssetOwnerErrorCode implements ExceptionMessageSet "Only an entity proxy for requested connection {0} is found in the open metadata server {1}, error message was: {2}", "The system is unable to populate the requested connection object because only a stub of the object from a relationship was found.", "Check that the connection name is correct and the caller is connecting to the correct OMAG Server Platform and server. Verify that " + - "all of the members of the cohorts that this server is connecting to are running. " + + "all the members of the cohorts that this server is connecting to are running. " + "Retry the request when the connection is available in the OMAS Service"), UNKNOWN_ASSET(404, "OMAS-ASSET-OWNER-404-008", "The asset with unique identifier {0} is not found for method {1} of access service {2} in open metadata server {3}, error message was: {4}", @@ -163,7 +163,7 @@ public enum AssetOwnerErrorCode implements ExceptionMessageSet "no errors being reported by the open metadata repositories. Once all errors have been resolved, retry the request."), NO_RELATIONSHIPS_FOUND(404, "OMAS-ASSET-OWNER-404-012", "No {0} relationships are connected to the {1} entity with unique identifier {2}: the calling method is {3} and the server is {4}", - "The system is unable to process a request because no relationships have been discovered and it is unable to retrieve all of the information it needs.", + "The system is unable to process a request because no relationships have been discovered and it is unable to retrieve all the information it needs.", "Check that the unique identifier is correct and the property server(s) supporting the assets is/are running."), NULL_ENTITY_RETURNED(404, "OMAS-ASSET-OWNER-404-013", "A null entity was returned to method {0} of server {1} during a request to create a new entity of type {2} (guid {3}) and properties of: {4}", diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/metadataelements/ElementVersions.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/metadataelements/ElementVersions.java index f66d88399f0..6c20abb1382 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/metadataelements/ElementVersions.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/metadataelements/ElementVersions.java @@ -17,7 +17,7 @@ /** * ElementVersions provides the version information for the element plus details of the creation time and last - * update time. Finally it lists all of the users that have made changes to this element. + * update time. Finally, it lists all the users that have made changes to this element. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/metadataelements/ValidValueElement.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/metadataelements/ValidValueElement.java index 800f52b6ba4..968d691da7d 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/metadataelements/ValidValueElement.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/metadataelements/ValidValueElement.java @@ -26,6 +26,8 @@ public class ValidValueElement implements MetadataElement, Serializable private ElementHeader elementHeader = null; private ValidValueProperties validValueProperties = null; + private String setGUID = null; + private boolean isDefaultValue = false; /** @@ -48,6 +50,8 @@ public ValidValueElement(ValidValueElement template) { elementHeader = template.getElementHeader(); validValueProperties = template.getValidValueProperties(); + setGUID = template.setGUID; + isDefaultValue = getIsDefaultValue(); } } @@ -77,7 +81,7 @@ public void setElementHeader(ElementHeader elementHeader) /** - * Return the properties for a valid value definition or set. + * Return the properties for the valid value definition or set. * * @return properties bean */ @@ -88,7 +92,7 @@ public ValidValueProperties getValidValueProperties() /** - * Set up the properties for a valid values definition of set. + * Set up the properties for the valid value definition or set. * * @param validValueProperties properties bean */ @@ -98,6 +102,49 @@ public void setValidValueProperties(ValidValueProperties validValueProperties) } + /** + * Return the set unique identifier if the valid value is retrieved via a set. + * + * @return string identifier + */ + public String getSetGUID() + { + return setGUID; + } + + + /** + * Set up the set unique identifier if the valid value is retrieved via a set. + * + * @param setGUID string identifier + */ + public void setSetGUID(String setGUID) + { + this.setGUID = setGUID; + } + + + /** + * Return whether this valid value is the default of the setGUID (if supplied) + * @return flag + */ + public boolean getIsDefaultValue() + { + return isDefaultValue; + } + + + /** + * Set up whether this valid value is the default of the setGUID (if supplied). + * + * @param defaultValue flag + */ + public void setIsDefaultValue(boolean defaultValue) + { + isDefaultValue = defaultValue; + } + + /** * JSON-style toString * @@ -107,9 +154,11 @@ public void setValidValueProperties(ValidValueProperties validValueProperties) public String toString() { return "ValidValueElement{" + - "elementHeader=" + elementHeader + - ", validValueProperties=" + validValueProperties + - '}'; + "elementHeader=" + elementHeader + + ", validValueProperties=" + validValueProperties + + ", setGUID='" + setGUID + '\'' + + ", isDefaultValue=" + isDefaultValue + + '}'; } @@ -130,13 +179,9 @@ public boolean equals(Object objectToCompare) { return false; } - if (!super.equals(objectToCompare)) - { - return false; - } ValidValueElement that = (ValidValueElement) objectToCompare; - return Objects.equals(elementHeader, that.elementHeader) && - Objects.equals(validValueProperties, that.validValueProperties); + return isDefaultValue == that.isDefaultValue && Objects.equals(elementHeader, that.elementHeader) && Objects.equals( + validValueProperties, that.validValueProperties) && Objects.equals(setGUID, that.setGUID); } @@ -148,6 +193,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), elementHeader, validValueProperties); + return Objects.hash(super.hashCode(), elementHeader, validValueProperties, setGUID, isDefaultValue); } } diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/ValidValuesAssetOwner.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/ValidValuesAssetOwner.java index 6aeea60f1aa..f6911105763 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/ValidValuesAssetOwner.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/ValidValuesAssetOwner.java @@ -18,7 +18,7 @@ /** * ValidValuesAssetOwner provides the API operations to create and maintain lists of valid * value definitions grouped into a valid value set. Both valid value definitions and valid value sets have - * the same attributes and so inherit from ValidValue where all of the attributes are defined. + * the same attributes and so inherit from ValidValue where all the attributes are defined. * * A set is just grouping of valid values. Valid value definitions and set can be nested many times in other * valid value sets. @@ -194,6 +194,7 @@ public String createValidValueSet(String userId, * * @param userId calling user. * @param setGUID unique identifier of the set to attach this to. + * @param isDefaultValue is this the default value for the set? * @param qualifiedName unique name. * @param displayName displayable descriptive name. * @param description further information. @@ -211,6 +212,7 @@ public String createValidValueSet(String userId, @Override public String createValidValueDefinition(String userId, String setGUID, + boolean isDefaultValue, String qualifiedName, String displayName, String description, @@ -224,7 +226,7 @@ public String createValidValueDefinition(String userId, { final String methodName = "createValidValueDefinition"; final String nameParameter = "qualifiedName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/valid-values/new-definition"; + final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/valid-values/new-definition?isDefaultValue={2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(qualifiedName, nameParameter, methodName); @@ -244,7 +246,8 @@ public String createValidValueDefinition(String userId, requestBody, serverName, userId, - setGUID); + setGUID, + isDefaultValue); return restResult.getGUID(); } @@ -359,6 +362,7 @@ public void deleteValidValue(String userId, * @param userId calling user. * @param setGUID unique identifier of the set. * @param validValueGUID unique identifier of the valid value to add to the set. + * @param isDefaultValue is this the default value for the set? * * @throws InvalidParameterException one of the parameters is invalid. * @throws UserNotAuthorizedException the user is not authorized to make this request. @@ -367,14 +371,15 @@ public void deleteValidValue(String userId, @Override public void attachValidValueToSet(String userId, String setGUID, - String validValueGUID) throws InvalidParameterException, + String validValueGUID, + boolean isDefaultValue) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException { final String methodName = "attachValidValueToSet"; final String setGUIDParameter = "setGUID"; final String validValueGUIDParameter = "validValueGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/valid-values/sets/{2}/members/{3}"; + final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/valid-values/sets/{2}/members/{3}?isDefaultValue={4}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(setGUID, setGUIDParameter, methodName); @@ -386,7 +391,8 @@ public void attachValidValueToSet(String userId, serverName, userId, setGUID, - validValueGUID); + validValueGUID, + isDefaultValue); } diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/AssetConverter.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/AssetConverter.java index 0ca35c535a8..8be5dc1ae56 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/AssetConverter.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/AssetConverter.java @@ -34,7 +34,7 @@ public AssetConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -134,7 +134,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/ConnectorTypeConverter.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/ConnectorTypeConverter.java index 08297f45d57..161e4ac96dc 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/ConnectorTypeConverter.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/ConnectorTypeConverter.java @@ -35,7 +35,7 @@ public ConnectorTypeConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -115,7 +115,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/DataFileConverter.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/DataFileConverter.java index 7240e9d443c..80538395790 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/DataFileConverter.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/DataFileConverter.java @@ -36,7 +36,7 @@ public DataFileConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -142,7 +142,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/ElementHeaderConverter.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/ElementHeaderConverter.java index 8ae2a62ede2..1c2b26426f8 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/ElementHeaderConverter.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/ElementHeaderConverter.java @@ -33,7 +33,7 @@ public ElementHeaderConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -79,7 +79,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/EndpointConverter.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/EndpointConverter.java index 4f58176a487..2447d52ad37 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/EndpointConverter.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/EndpointConverter.java @@ -35,7 +35,7 @@ public EndpointConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -106,7 +106,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/FileFolderConverter.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/FileFolderConverter.java index 81f52efea49..6735f842667 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/FileFolderConverter.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/FileFolderConverter.java @@ -36,7 +36,7 @@ public FileFolderConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -142,7 +142,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/FileSystemConverter.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/FileSystemConverter.java index 65854a9f363..44675cab70e 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/FileSystemConverter.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/FileSystemConverter.java @@ -36,7 +36,7 @@ public FileSystemConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -110,7 +110,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/ReferenceableConverter.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/ReferenceableConverter.java index 23f5d86d7c7..4cecb85d2b5 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/ReferenceableConverter.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/ReferenceableConverter.java @@ -37,7 +37,7 @@ public ReferenceableConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -131,7 +131,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/ValidValueConverter.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/ValidValueConverter.java index 2e306c523ca..2da42ff5328 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/ValidValueConverter.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/ValidValueConverter.java @@ -4,6 +4,7 @@ import org.odpi.openmetadata.accessservices.assetowner.metadataelements.ValidValueElement; import org.odpi.openmetadata.accessservices.assetowner.properties.ValidValueProperties; +import org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIMapper; import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties; @@ -16,7 +17,7 @@ /** * ValidValueConverter provides common methods for transferring relevant properties from an Open Metadata Repository Services (OMRS) - * EntityDetail object into a ValidValueElement bean. + * EntityDetail object into a bean that inherits from ValidValueElement. */ public class ValidValueConverter extends AssetOwnerOMASConverter { @@ -35,12 +36,14 @@ public ValidValueConverter(OMRSRepositoryHelper repositoryHelper, } + /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create * @param entity entity containing the properties + * @param relationship relationship containing the properties * @param methodName calling method * @return bean populated with properties from the instances supplied * @throws PropertyServerException there is a problem instantiating the bean @@ -48,6 +51,7 @@ public ValidValueConverter(OMRSRepositoryHelper repositoryHelper, @Override public B getNewBean(Class beanClass, EntityDetail entity, + Relationship relationship, String methodName) throws PropertyServerException { try @@ -60,41 +64,15 @@ public B getNewBean(Class beanClass, if (returnBean instanceof ValidValueElement) { ValidValueElement bean = (ValidValueElement) returnBean; - ValidValueProperties validValueProperties = new ValidValueProperties(); + this.updateSimpleMetadataElement(beanClass, bean, entity, methodName); - if (entity != null) + if (relationship != null) { - /* - * Check that the entity is of the correct type. - */ - bean.setElementHeader(this.getMetadataElementHeader(beanClass, entity, methodName)); - - /* - * The property values come from the entity. - */ - InstanceProperties instanceProperties = new InstanceProperties(entity.getProperties()); - - validValueProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); - validValueProperties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); - validValueProperties.setDisplayName(this.removeName(instanceProperties)); - validValueProperties.setDescription(this.removeDescription(instanceProperties)); - validValueProperties.setUsage(this.removeUsage(instanceProperties)); - validValueProperties.setScope(this.removeScope(instanceProperties)); - validValueProperties.setPreferredValue(this.removePreferredValue(instanceProperties)); - validValueProperties.setIsDeprecated(this.removeIsDeprecated(instanceProperties)); - - /* - * Any remaining properties are returned in the extended properties. They are - * assumed to be defined in a subtype. - */ - validValueProperties.setTypeName(bean.getElementHeader().getType().getTypeName()); - validValueProperties.setExtendedProperties(this.getRemainingExtendedProperties(instanceProperties)); - - bean.setValidValueProperties(validValueProperties); - } - else - { - handleMissingMetadataInstance(beanClass.getName(), TypeDefCategory.ENTITY_DEF, methodName); + if (repositoryHelper.isTypeOf(serviceName, relationship.getType().getTypeDefName(), OpenMetadataAPIMapper.VALID_VALUES_MEMBER_RELATIONSHIP_TYPE_NAME)) + { + bean.setSetGUID(relationship.getEntityOneProxy().getGUID()); + bean.setIsDefaultValue(this.removeIsDefaultValue(relationship.getProperties())); + } } } @@ -110,12 +88,11 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create * @param entity entity containing the properties - * @param relationship relationship containing the properties * @param methodName calling method * @return bean populated with properties from the instances supplied * @throws PropertyServerException there is a problem instantiating the bean @@ -123,9 +100,74 @@ public B getNewBean(Class beanClass, @Override public B getNewBean(Class beanClass, EntityDetail entity, - Relationship relationship, String methodName) throws PropertyServerException { - return getNewBean(beanClass, entity, methodName); + try + { + /* + * This is initial confirmation that the generic converter has been initialized with an appropriate bean class. + */ + B returnBean = beanClass.getDeclaredConstructor().newInstance(); + + if (returnBean instanceof ValidValueElement) + { + this.updateSimpleMetadataElement(beanClass, (ValidValueElement) returnBean, entity, methodName); + } + + return returnBean; + } + catch (IllegalAccessException | InstantiationException | ClassCastException | NoSuchMethodException | InvocationTargetException error) + { + super.handleInvalidBeanClass(beanClass.getName(), error, methodName); + } + + return null; + } + + + /** + * Extract the properties from the entity. Each concrete DataManager OMAS converter implements this method. + * The top level fills in the header + * + * @param beanClass name of the class to create + * @param bean output bean + * @param entity entity containing the properties + * @param methodName calling method + * @throws PropertyServerException there is a problem instantiating the bean + */ + void updateSimpleMetadataElement(Class beanClass, + ValidValueElement bean, + EntityDetail entity, + String methodName) throws PropertyServerException + { + if (entity != null) + { + bean.setElementHeader(this.getMetadataElementHeader(beanClass, entity, methodName)); + ValidValueProperties validValueProperties = new ValidValueProperties(); + + InstanceProperties instanceProperties = new InstanceProperties(entity.getProperties()); + + validValueProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); + validValueProperties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); + validValueProperties.setDisplayName(this.removeName(instanceProperties)); + validValueProperties.setDescription(this.removeDescription(instanceProperties)); + validValueProperties.setUsage(this.removeUsage(instanceProperties)); + validValueProperties.setScope(this.removeScope(instanceProperties)); + validValueProperties.setPreferredValue(this.removePreferredValue(instanceProperties)); + validValueProperties.setIsDeprecated(this.removeIsDeprecated(instanceProperties)); + + /* + * Any remaining properties are returned in the extended properties. They are + * assumed to be defined in a subtype. + */ + validValueProperties.setTypeName(bean.getElementHeader().getType().getTypeName()); + validValueProperties.setExtendedProperties(this.getRemainingExtendedProperties(instanceProperties)); + + bean.setValidValueProperties(validValueProperties); + } + else + { + handleMissingMetadataInstance(beanClass.getName(), TypeDefCategory.ENTITY_DEF, methodName); + } } } diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/outtopic/AssetOwnerOMRSTopicListener.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/outtopic/AssetOwnerOMRSTopicListener.java index 6b3c3b6e989..92df87ab542 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/outtopic/AssetOwnerOMRSTopicListener.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/outtopic/AssetOwnerOMRSTopicListener.java @@ -145,7 +145,7 @@ public void processUpdatedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entityProxy details of the entityProxy with the new classification added. No guarantee this is all of the classifications. + * @param entityProxy details of the entityProxy with the new classification added. No guarantee this is all the classifications. * @param classification new classification */ @Override @@ -184,7 +184,7 @@ public void processClassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity with the new classification added. No guarantee this is all of the classifications. + * @param entity details of the entity with the new classification added. No guarantee this is all the classifications. * @param classification new classification */ @Override @@ -261,7 +261,7 @@ public void processClassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entityProxy details of the entityProxy after the classification has been removed. No guarantee this is all of the classifications. + * @param entityProxy details of the entityProxy after the classification has been removed. No guarantee this is all the classifications. * @param originalClassification classification that was removed */ @Override @@ -300,7 +300,7 @@ public void processDeclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity after the classification has been removed. No guarantee this is all of the classifications. + * @param entity details of the entity after the classification has been removed. No guarantee this is all the classifications. * @param originalClassification classification that was removed */ @Override @@ -377,7 +377,7 @@ public void processDeclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entityProxy details of the entityProxy after the classification has been changed. No guarantee this is all of the classifications. + * @param entityProxy details of the entityProxy after the classification has been changed. No guarantee this is all the classifications. * @param originalClassification classification that was removed * @param classification new classification */ @@ -418,7 +418,7 @@ public void processReclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity after the classification has been changed. No guarantee this is all of the classifications. + * @param entity details of the entity after the classification has been changed. No guarantee this is all the classifications. * @param originalClassification classification that was removed * @param classification new classification */ diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/server/ValidValuesRESTServices.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/server/ValidValuesRESTServices.java index b3f1228b599..6c7fc87cc19 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/server/ValidValuesRESTServices.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/server/ValidValuesRESTServices.java @@ -125,6 +125,7 @@ public GUIDResponse createValidValueSet(String serverName, * @param serverName name of calling server * @param userId calling user. * @param setGUID unique identifier of the set to attach this to. + * @param isDefaultValue is this the default value for the set? * @param requestBody parameters to update. * * @return unique identifier for the new definition @@ -135,6 +136,7 @@ public GUIDResponse createValidValueSet(String serverName, public GUIDResponse createValidValueDefinition(String serverName, String userId, String setGUID, + boolean isDefaultValue, ValidValuesRequestBody requestBody) { final String methodName = "createValidValueDefinition"; @@ -163,6 +165,7 @@ public GUIDResponse createValidValueDefinition(String serverNam null, null, setGUID, + isDefaultValue, requestBody.getQualifiedName(), requestBody.getDisplayName(), requestBody.getDescription(), @@ -345,6 +348,7 @@ public VoidResponse deleteValidValue(String serverName, * @param userId calling user. * @param setGUID unique identifier of the set. * @param validValueGUID unique identifier of the valid value to add to the set. + * @param isDefaultValue is this the default value for the set? * @param requestBody null request body supplied to satisfy REST protocol * * @return void or @@ -357,6 +361,7 @@ public VoidResponse attachValidValueToSet(String serverName, String userId, String setGUID, String validValueGUID, + boolean isDefaultValue, NullRequestBody requestBody) { final String methodName = "attachValidValueToSet"; @@ -384,6 +389,7 @@ public VoidResponse attachValidValueToSet(String serverName, null, setGUID, validValueGUID, + isDefaultValue, null, null, false, diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-spring/src/main/java/org/odpi/openmetadata/accessservices/assetowner/server/spring/ValidValuesOnboardingResource.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-spring/src/main/java/org/odpi/openmetadata/accessservices/assetowner/server/spring/ValidValuesOnboardingResource.java index 2c7d2f9cfa3..6e93cee739f 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-spring/src/main/java/org/odpi/openmetadata/accessservices/assetowner/server/spring/ValidValuesOnboardingResource.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-spring/src/main/java/org/odpi/openmetadata/accessservices/assetowner/server/spring/ValidValuesOnboardingResource.java @@ -17,7 +17,7 @@ /** * ValidValuesOnboardingResource provides the API operations to create and maintain lists of valid * value definitions grouped into a valid value set. Both valid value definitions and valid value sets have - * the same attributes and so inherit from ValidValue where all of the attributes are defined. + * the same attributes and so inherit from ValidValue where all the attributes are defined. * * A set is just grouping of valid values. Valid value definitions and set can be nested many times in other * valid value sets. @@ -31,7 +31,7 @@ public class ValidValuesOnboardingResource { - private ValidValuesRESTServices restAPI = new ValidValuesRESTServices(); + private final ValidValuesRESTServices restAPI = new ValidValuesRESTServices(); /** @@ -77,6 +77,7 @@ public GUIDResponse createValidValueSet(@PathVariable String ser * @param serverName name of calling server * @param userId calling user. * @param setGUID unique identifier of the set to attach this to. + * @param isDefaultValue is this the default value for the set? * @param requestBody parameters for the new object. * * @return unique identifier for the new definition @@ -89,15 +90,18 @@ public GUIDResponse createValidValueSet(@PathVariable String ser public GUIDResponse createValidValueDefinition(@PathVariable String serverName, @PathVariable String userId, @PathVariable String setGUID, + @RequestParam + (required = false, defaultValue = "false") + boolean isDefaultValue, @RequestBody ValidValuesRequestBody requestBody) { - return restAPI.createValidValueDefinition(serverName, userId, setGUID, requestBody); + return restAPI.createValidValueDefinition(serverName, userId, setGUID, isDefaultValue, requestBody); } /** * Update the properties of the valid value. All properties are updated. - * If only changing some of the properties, retrieve the current values from the repository + * If only changing some the properties, retrieve the current values from the repository * and pass existing values back on this call if they are not to change. * * @param serverName name of calling server @@ -154,6 +158,7 @@ public VoidResponse deleteValidValue(@PathVariable String serverName, * @param userId calling user. * @param setGUID unique identifier of the set. * @param validValueGUID unique identifier of the valid value to add to the set. + * @param isDefaultValue is this the default value for the set? * @param requestBody null request body supplied to satisfy REST protocol * @return void or * InvalidParameterException one of the parameters is invalid or @@ -166,9 +171,11 @@ public VoidResponse attachValidValueToSet(@PathVariable Str @PathVariable String userId, @PathVariable String setGUID, @PathVariable String validValueGUID, + @RequestParam(required = false, + defaultValue = "false") boolean isDefaultValue, @RequestBody(required = false) NullRequestBody requestBody) { - return restAPI.attachValidValueToSet(serverName, userId, setGUID, validValueGUID, requestBody); + return restAPI.attachValidValueToSet(serverName, userId, setGUID, validValueGUID, isDefaultValue, requestBody); } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/CollectionManagementInterface.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/CollectionManagementInterface.java index 8d5cc666cce..c4e7169454f 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/CollectionManagementInterface.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/CollectionManagementInterface.java @@ -26,7 +26,7 @@ public interface CollectionManagementInterface * * @param userId userId of user making request * @param parentGUID unique identifier of referenceable object (typically a personal profile, project or - * community) that they collections hang off of. + * community) that the collections hang off of. * @param startFrom index of the list to start from (0 for start) * @param pageSize maximum number of elements to return * diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/CommunityManagementInterface.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/CommunityManagementInterface.java index 13ae2b0449b..2a3b57f79e7 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/CommunityManagementInterface.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/CommunityManagementInterface.java @@ -2,10 +2,268 @@ /* Copyright Contributors to the ODPi Egeria project. */ package org.odpi.openmetadata.accessservices.communityprofile.api; +import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.CommunityElement; +import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.PersonRoleElement; +import org.odpi.openmetadata.accessservices.communityprofile.properties.CommunityMembershipProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.CommunityMembershipType; +import org.odpi.openmetadata.accessservices.communityprofile.properties.CommunityProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.ResourceListProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.TemplateProperties; +import org.odpi.openmetadata.accessservices.communityprofile.rest.PersonRoleListResponse; +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; + +import java.util.List; +import java.util.Map; + /** * The CommunityManagementInterface provides methods for managing communities, their membership and content. - * Communities allow groups of subject matter experts to work together and share content and ideas. + * Communities allow groups of subject-matter experts to work together and share content and ideas. */ public interface CommunityManagementInterface { + + /** + * Create a new metadata element to represent the community. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param communityProperties properties to store + * + * @return unique identifier of the new metadata element + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + String createCommunity(String userId, + String externalSourceGUID, + String externalSourceName, + CommunityProperties communityProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Create a new metadata element to represent a community using an existing metadata element as a template. + * The template defines additional classifications and relationships that should be added to the new community. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param templateGUID unique identifier of the metadata element to copy + * @param templateProperties properties that override the template + * + * @return unique identifier of the new metadata element + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + String createCommunityFromTemplate(String userId, + String externalSourceGUID, + String externalSourceName, + String templateGUID, + TemplateProperties templateProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Update the metadata element representing a community. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param communityGUID unique identifier of the metadata element to update + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param communityProperties new properties for this element + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void updateCommunity(String userId, + String externalSourceGUID, + String externalSourceName, + String communityGUID, + boolean isMergeUpdate, + CommunityProperties communityProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Create a membership relationship between a community and a person role to show that anyone appointed to the role is a member of the community. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param communityGUID unique identifier of the community + * @param membershipProperties describes the permissions that the role has in the community + * @param personRoleGUID unique identifier of the role + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void setupCommunityRole(String userId, + String externalSourceGUID, + String externalSourceName, + String communityGUID, + CommunityMembershipProperties membershipProperties, + String personRoleGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove a membership relationship between a community and a person role. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param communityGUID unique identifier of the community + * @param personRoleGUID unique identifier of the role + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void clearCommunityRole(String userId, + String externalSourceGUID, + String externalSourceName, + String communityGUID, + String personRoleGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the metadata element representing a community. This will delete all anchored + * elements such as comments. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param communityGUID unique identifier of the metadata element to remove + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void removeCommunity(String userId, + String externalSourceGUID, + String externalSourceName, + String communityGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param userId calling user + * @param searchString string to find in the properties + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + List findCommunities(String userId, + String searchString, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param userId calling user + * @param name name to search for + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + List getCommunitiesByName(String userId, + String name, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of communities. + * + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + List getCommunities(String userId, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Return information about the person roles linked to a community. + * + * @param userId calling user + * @param communityGUID unique identifier for the community + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching actor profiles (hopefully only one) + * + * @throws InvalidParameterException name or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + List getRolesForCommunity(String userId, + String communityGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the community metadata element with the supplied unique identifier. + * + * @param userId calling user + * @param communityGUID unique identifier of the requested metadata element + * + * @return matching metadata element + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + CommunityElement getCommunityByGUID(String userId, + String communityGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/LocationManagementInterface.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/LocationManagementInterface.java index 9f38bdfdcf0..e0fbb094f7d 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/LocationManagementInterface.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/LocationManagementInterface.java @@ -3,7 +3,14 @@ package org.odpi.openmetadata.accessservices.communityprofile.api; import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.LocationElement; +import org.odpi.openmetadata.accessservices.communityprofile.properties.AdjacentLocationProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.AssetLocationProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.DigitalLocationProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.FixedLocationProperties; import org.odpi.openmetadata.accessservices.communityprofile.properties.LocationProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.NestedLocationProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.ProfileLocationProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.SecureLocationProperties; import org.odpi.openmetadata.accessservices.communityprofile.properties.TemplateProperties; import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; @@ -21,6 +28,8 @@ public interface LocationManagementInterface * type of location. * * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller * @param locationProperties properties to store * * @return unique identifier of the new metadata element @@ -30,6 +39,8 @@ public interface LocationManagementInterface * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ String createLocation(String userId, + String externalSourceGUID, + String externalSourceName, LocationProperties locationProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException; @@ -40,6 +51,8 @@ String createLocation(String userId, * The template defines additional classifications and relationships that should be added to the new location. * * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller * @param templateGUID unique identifier of the metadata element to copy * @param templateProperties properties that override the template * @@ -50,6 +63,8 @@ String createLocation(String userId, * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ String createLocationFromTemplate(String userId, + String externalSourceGUID, + String externalSourceName, String templateGUID, TemplateProperties templateProperties) throws InvalidParameterException, UserNotAuthorizedException, @@ -60,8 +75,10 @@ String createLocationFromTemplate(String userId, * Update the metadata element representing a location. * * @param userId calling user - * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller * @param locationGUID unique identifier of the metadata element to update + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? * @param locationProperties new properties for this element * * @throws InvalidParameterException one of the parameters is invalid @@ -69,8 +86,10 @@ String createLocationFromTemplate(String userId, * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ void updateLocation(String userId, - boolean isMergeUpdate, + String externalSourceGUID, + String externalSourceName, String locationGUID, + boolean isMergeUpdate, LocationProperties locationProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException; @@ -80,30 +99,30 @@ void updateLocation(String userId, * Classify the location to indicate that it represents a fixed physical location. * * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller * @param locationGUID unique identifier of the metadata element to classify - * @param coordinates position of the location - * @param mapProjection map projection used to define the coordinates - * @param postalAddress postal address of the location (if appropriate) - * @param timeZone time zone for the location + * @param properties time zone and position of the location * * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ - void setLocationAsFixedPhysical(String userId, - String locationGUID, - String coordinates, - String mapProjection, - String postalAddress, - String timeZone) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; + void setLocationAsFixedPhysical(String userId, + String externalSourceGUID, + String externalSourceName, + String locationGUID, + FixedLocationProperties properties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; /** * Remove the fixed physical location designation from the location. * * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller * @param locationGUID unique identifier of the metadata element to unclassify * * @throws InvalidParameterException one of the parameters is invalid @@ -111,6 +130,8 @@ void setLocationAsFixedPhysical(String userId, * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ void clearLocationAsFixedPhysical(String userId, + String externalSourceGUID, + String externalSourceName, String locationGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException; @@ -120,26 +141,30 @@ void clearLocationAsFixedPhysical(String userId, * Classify the location to indicate that it represents a secure location. * * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller * @param locationGUID unique identifier of the metadata element to classify - * @param description description of security at the site - * @param level level of security + * @param properties properties of security at the site * * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ - void setLocationAsSecure(String userId, - String locationGUID, - String description, - String level) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; + void setLocationAsSecure(String userId, + String externalSourceGUID, + String externalSourceName, + String locationGUID, + SecureLocationProperties properties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; /** * Remove the secure location designation from the location. * * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller * @param locationGUID unique identifier of the metadata element to unclassify * * @throws InvalidParameterException one of the parameters is invalid @@ -147,6 +172,8 @@ void setLocationAsSecure(String userId, * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ void clearLocationAsSecure(String userId, + String externalSourceGUID, + String externalSourceName, String locationGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException; @@ -156,24 +183,30 @@ void clearLocationAsSecure(String userId, * Classify the location to indicate that it represents a digital/cyber location. * * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller * @param locationGUID unique identifier of the metadata element to classify - * @param networkAddress position of the location + * @param properties address of the location * * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ - void setLocationAsDigital(String userId, - String locationGUID, - String networkAddress) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; + void setLocationAsDigital(String userId, + String locationGUID, + String externalSourceGUID, + String externalSourceName, + DigitalLocationProperties properties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; /** * Remove the digital/cyber location designation from the location. * * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller * @param locationGUID unique identifier of the metadata element to unclassify * * @throws InvalidParameterException one of the parameters is invalid @@ -181,31 +214,19 @@ void setLocationAsDigital(String userId, * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ void clearLocationAsDigital(String userId, + String externalSourceGUID, + String externalSourceName, String locationGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException; - /** - * Remove the metadata element representing a location. - * - * @param userId calling user - * @param locationGUID unique identifier of the metadata element to remove - * - * @throws InvalidParameterException one of the parameters is invalid - * @throws UserNotAuthorizedException the user is not authorized to issue this request - * @throws PropertyServerException there is a problem reported in the open metadata server(s) - */ - void removeLocation(String userId, - String locationGUID) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; - - /** * Create a parent-child relationship between two locations. * * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller * @param parentLocationGUID unique identifier of the location that is the broader location * @param childLocationGUID unique identifier of the location that is the smaller, nested location * @@ -213,17 +234,22 @@ void removeLocation(String userId, * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ - void setupNestedLocation(String userId, - String parentLocationGUID, - String childLocationGUID) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; + void setupNestedLocation(String userId, + String externalSourceGUID, + String externalSourceName, + String parentLocationGUID, + String childLocationGUID, + NestedLocationProperties properties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; /** * Remove a parent-child relationship between two locations. * * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller * @param parentLocationGUID unique identifier of the location that is the broader location * @param childLocationGUID unique identifier of the location that is the smaller, nested location * @@ -232,6 +258,8 @@ void setupNestedLocation(String userId, * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ void clearNestedLocation(String userId, + String externalSourceGUID, + String externalSourceName, String parentLocationGUID, String childLocationGUID) throws InvalidParameterException, UserNotAuthorizedException, @@ -242,24 +270,32 @@ void clearNestedLocation(String userId, * Create a peer-to-peer relationship between two locations. * * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller * @param locationOneGUID unique identifier of the first location * @param locationTwoGUID unique identifier of the second location + * @param properties relationship properties * * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ - void setupAdjacentLocation(String userId, - String locationOneGUID, - String locationTwoGUID) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; + void setupAdjacentLocation(String userId, + String externalSourceGUID, + String externalSourceName, + String locationOneGUID, + String locationTwoGUID, + AdjacentLocationProperties properties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; /** * Remove a peer-to-peer relationship between two locations. * * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller * @param locationOneGUID unique identifier of the first location * @param locationTwoGUID unique identifier of the second location * @@ -268,12 +304,127 @@ void setupAdjacentLocation(String userId, * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ void clearAdjacentLocation(String userId, + String externalSourceGUID, + String externalSourceName, String locationOneGUID, String locationTwoGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException; + /** + * Create a profile location relationship between an actor profile and a location. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param actorProfileGUID unique identifier of the actor profile + * @param locationGUID unique identifier of the location + * @param properties type of association with the location + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void setupProfileLocation(String userId, + String externalSourceGUID, + String externalSourceName, + String actorProfileGUID, + String locationGUID, + ProfileLocationProperties properties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove a profile location relationship between an actor profile and a location. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param actorProfileGUID unique identifier of the actor profile + * @param locationGUID unique identifier of the location + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void clearProfileLocation(String userId, + String externalSourceGUID, + String externalSourceName, + String actorProfileGUID, + String locationGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + + /** + * Create an asset location relationship between an asset and a location. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param assetGUID unique identifier of the actor profile + * @param locationGUID unique identifier of the location + * @param properties type of association with the location + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void setupAssetLocation(String userId, + String externalSourceGUID, + String externalSourceName, + String assetGUID, + String locationGUID, + AssetLocationProperties properties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove an asset location relationship between an asset and a location. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param assetGUID unique identifier of the asset + * @param locationGUID unique identifier of the location + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void clearAssetLocation(String userId, + String externalSourceGUID, + String externalSourceName, + String assetGUID, + String locationGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the metadata element representing a location. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param locationGUID unique identifier of the metadata element to remove + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void removeLocation(String userId, + String externalSourceGUID, + String externalSourceName, + String locationGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + /** * Retrieve the list of location metadata elements that contain the search string. @@ -299,7 +450,7 @@ List findLocations(String userId, /** - * Retrieve the list of location metadata elements with a matching qualified or display name. + * Retrieve the list of location metadata elements with a matching qualified name, identifier or display name. * There are no wildcards supported on this request. * * @param userId calling user @@ -321,6 +472,136 @@ List getLocationsByName(String userId, PropertyServerException; + /** + * Retrieve the list of adjacent location metadata elements linked to locationGUID. + * + * @param userId calling user + * @param locationGUID locationGUID to search for + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + List getAdjacentLocations(String userId, + String locationGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of nested location metadata elements linked to locationGUID. + * + * @param userId calling user + * @param locationGUID locationGUID to search for + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + List getNestedLocations(String userId, + String locationGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of location metadata elements that has the location identifier with locationGUID nested inside it. + * + * @param userId calling user + * @param locationGUID locationGUID to search for + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + List getGroupingLocations(String userId, + String locationGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of location metadata elements linked to actorProfileGUID. + * + * @param userId calling user + * @param actorProfileGUID actorProfileGUID to search for + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + List getLocationsByProfile(String userId, + String actorProfileGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of location metadata elements linked to assetGUID. + * + * @param userId calling user + * @param assetGUID assetGUID to search for + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + List getKnownLocationsForAsset(String userId, + String assetGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of location metadata elements. + * + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + List getLocations(String userId, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + /** * Retrieve the location metadata element with the supplied unique identifier. * diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/OrganizationManagementInterface.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/OrganizationManagementInterface.java index c770c872950..dbe730aa08a 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/OrganizationManagementInterface.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/OrganizationManagementInterface.java @@ -24,7 +24,7 @@ public interface OrganizationManagementInterface { /** - * Create a definition of a actor profile. This could be for the whole organization, a team, a person or a system. + * Create a definition of an actor profile. This could be for the whole organization, a team, a person or a system. * * @param userId calling user * @param externalSourceGUID guid of the software server capability entity that represented the external source - null for local @@ -225,25 +225,67 @@ ActorProfileElement getActorProfileByUserId(String userId, /** - * Return information about a named actor profile. + * Return information about matching named actor profiles. * * @param userId calling user * @param name unique name for the actor profile * @param startFrom index of the list to start from (0 for start) * @param pageSize maximum number of elements to return. * + * @return list of matching actor profiles + * + * @throws InvalidParameterException name or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + List getActorProfilesByName(String userId, + String name, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Return information about all actor profiles. + * + * @param userId calling user + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * * @return list of matching actor profiles (hopefully only one) * * @throws InvalidParameterException name or userId is null * @throws PropertyServerException problem accessing property server * @throws UserNotAuthorizedException security access problem */ - List getActorProfileByName(String userId, - String name, - int startFrom, - int pageSize) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; + List getActorProfiles(String userId, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Return information about the actor profiles associated with a location. + * + * @param userId calling user + * @param locationGUID unique locationGUID for the actor profile + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching actor profiles + * + * @throws InvalidParameterException locationGUID or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + List getActorProfilesByLocation(String userId, + String locationGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; /** @@ -260,10 +302,10 @@ List getActorProfileByName(String userId, * @throws PropertyServerException the server is not available. * @throws UserNotAuthorizedException the calling user is not authorized to issue the call. */ - List findActorProfile(String userId, - String searchString, - int startFrom, - int pageSize) throws InvalidParameterException, + List findActorProfiles(String userId, + String searchString, + int startFrom, + int pageSize) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException; @@ -437,7 +479,7 @@ void unlinkPersonRoleFromProfile(String userId, * @param teamRoleGUID unique identifier of the person role * @param teamProfileGUID unique identifier of the team profile * @param position position name of the role in the team - * @param leadershipPosition is this a leadership position + * @param leadershipPosition is this a leadership position? * * * @throws InvalidParameterException one of the guids is null or not known; the person role is not a team member or team leader @@ -463,7 +505,7 @@ void linkTeamPlayer(String userId, * @param externalSourceName name of the software server capability entity that represented the external source * @param teamRoleGUID unique identifier of the person role * @param teamProfileGUID unique identifier of the team profile - * @param leadershipPosition is this a leadership position + * @param leadershipPosition is this a leadership position? * * @throws InvalidParameterException one of the guids is null or not known; the person role is not a team member or team leader * @throws PropertyServerException problem accessing property server @@ -511,12 +553,56 @@ PersonRoleElement getPersonRoleByGUID(String userId, * @throws PropertyServerException problem accessing property server * @throws UserNotAuthorizedException security access problem */ - List getPersonRoleByName(String userId, - String name, - int startFrom, - int pageSize) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; + List getPersonRolesByName(String userId, + String name, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Return information about the leadership person roles linked to a team. + * + * @param userId calling user + * @param teamGUID unique identifier for the Team actor profile + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching actor profiles (hopefully only one) + * + * @throws InvalidParameterException name or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + List getLeadershipRolesForTeam(String userId, + String teamGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Return information about the membership person roles linked to a team. + * + * @param userId calling user + * @param teamGUID unique identifier for the Team actor profile + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching actor profiles (hopefully only one) + * + * @throws InvalidParameterException name or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + List getMembershipRolesForTeam(String userId, + String teamGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; /** @@ -533,10 +619,10 @@ List getPersonRoleByName(String userId, * @throws PropertyServerException the server is not available. * @throws UserNotAuthorizedException the calling user is not authorized to issue the call. */ - List findPersonRole(String userId, - String searchString, - int startFrom, - int pageSize) throws InvalidParameterException, + List findPersonRoles(String userId, + String searchString, + int startFrom, + int pageSize) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException; } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/RelatedElementsManagementInterface.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/RelatedElementsManagementInterface.java new file mode 100644 index 00000000000..1a78095f4ba --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/RelatedElementsManagementInterface.java @@ -0,0 +1,363 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.communityprofile.api; + +import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.RelatedElement; +import org.odpi.openmetadata.accessservices.communityprofile.properties.AssignmentScopeProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.RelationshipProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.ResourceListProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.StakeholderProperties; +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; + +import java.util.List; + +/** + * Defines the interface that is common to multiple element types + */ +public interface RelatedElementsManagementInterface +{ + /** + * Create a "MoreInformation" relationship between an element that is descriptive and one that is providing the detail. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element that is descriptive + * @param properties properties of the relationship + * @param detailGUID unique identifier of the element that provides the detail + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void setupMoreInformation(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + RelationshipProperties properties, + String detailGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove a "MoreInformation" relationship between two referenceables. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element that is descriptive + * @param detailGUID unique identifier of the element that provides the detail + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void clearMoreInformation(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String detailGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the detail elements linked via a "MoreInformation" relationship between two referenceables. + * + * @param userId calling user + * @param elementGUID unique identifier of the element that is descriptive + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + List getMoreInformation(String userId, + String elementGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the descriptive elements linked via a "MoreInformation" relationship between two referenceables. + * + * @param userId calling user + * @param detailGUID unique identifier of the element that provides the detail + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + List getDescriptiveElements(String userId, + String detailGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Create a "Stakeholder" relationship between an element and its stakeholder. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param properties properties of the relationship + * @param stakeholderGUID unique identifier of the stakeholder + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void setupStakeholder(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + StakeholderProperties properties, + String stakeholderGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove a "Stakeholder" relationship between two referenceables. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param stakeholderGUID unique identifier of the stakeholder + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void clearStakeholder(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String stakeholderGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the stakeholder elements linked via the "Stakeholder" relationship between two referenceables. + * + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + List getStakeholders(String userId, + String elementGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the elements commissioned by a stakeholder, linked via the "Stakeholder" relationship between two referenceables. + * + * @param userId calling user + * @param stakeholderGUID unique identifier of the stakeholder + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + List getStakeholderCommissionedElements(String userId, + String stakeholderGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Create an "AssignmentScope" relationship between an element and its scope. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param properties properties of the relationship + * @param scopeGUID unique identifier of the scope + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void setupAssignmentScope(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + AssignmentScopeProperties properties, + String scopeGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove an "AssignmentScope" relationship between two referenceables. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param scopeGUID unique identifier of the scope + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void clearAssignmentScope(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String scopeGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the assigned scopes linked by the "AssignmentScope" relationship between two referenceables. + * + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + List getAssignedScopes(String userId, + String elementGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the assigned actors linked by the "AssignmentScope" relationship between two referenceables. + * + * @param userId calling user + * @param scopeGUID unique identifier of the scope + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + List getAssignedActors(String userId, + String scopeGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Create a "ResourceList" relationship between a consuming element and an element that represents resources. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param properties properties of the relationship + * @param resourceGUID unique identifier of the resource + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void setupResource(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + ResourceListProperties properties, + String resourceGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove a "ResourceList" relationship between two referenceables. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param resourceGUID unique identifier of the resource + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void clearResource(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String resourceGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of resources assigned to an element via the "ResourceList" relationship between two referenceables. + * + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + List getResourceList(String userId, + String elementGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of elements assigned to a resource via the "ResourceList" relationship between two referenceables. + * + * @param userId calling user + * @param resourceGUID unique identifier of the resource + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + List getSupportedByResource(String userId, + String resourceGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; +} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/SecurityGroupInterface.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/SecurityGroupInterface.java index cac419a704e..c2f8b237acf 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/SecurityGroupInterface.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/SecurityGroupInterface.java @@ -67,7 +67,7 @@ void deleteSecurityGroup(String userId, /** - * Return the list of security groups associated with a unique distinguishedName. In an ideal world, the should be only one. + * Return the list of security groups associated with a unique distinguishedName. In an ideal world, there should be only one. * * @param userId calling user * @param distinguishedName unique name of the security group diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/ActorProfileElement.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/ActorProfileElement.java index 069890f0b3b..d00602984db 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/ActorProfileElement.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/ActorProfileElement.java @@ -30,6 +30,7 @@ public class ActorProfileElement implements Serializable, MetadataElement private List contactMethods = null; private ContributionRecordElement contributionRecord = null; /* Person only */ private List personRoles = null; /* Person only */ + private List locations = null; private List userIdentities = null; private ElementStub superTeam = null; /* Team only */ private List subTeams = null; /* Team only */ @@ -60,6 +61,7 @@ public ActorProfileElement(ActorProfileElement template) contactMethods = template.getContactMethods(); contributionRecord = template.getContributionRecord(); personRoles = template.getPersonRoles(); + locations = template.getLocations(); userIdentities = template.getUserIdentities(); superTeam = template.getSuperTeam(); subTeams = template.getSubTeams(); @@ -161,7 +163,7 @@ public void setContributionRecord(ContributionRecordElement contributionRecord) /** * Return the headers of the person roles that this actor is appointed to. * - * @return role stub + * @return role stubs */ public List getPersonRoles() { @@ -180,6 +182,29 @@ public void setPersonRoles(List personRoles) } + + /** + * Return the headers of the location that this actor is linked to. + * + * @return location stubs + */ + public List getLocations() + { + return locations; + } + + + /** + * Set up the headers of the person roles that this actor is linked to. + * + * @param locations location stubs + */ + public void setLocations(List locations) + { + this.locations = locations; + } + + /** * Return the list of user identities for this profile. * @@ -326,6 +351,7 @@ public String toString() ", contactMethods=" + contactMethods + ", contributionRecord=" + contributionRecord + ", personRoles=" + personRoles + + ", locations=" + locations + ", userIdentities=" + userIdentities + ", superTeam=" + superTeam + ", subTeams=" + subTeams + @@ -359,6 +385,7 @@ public boolean equals(Object objectToCompare) Objects.equals(contactMethods, that.contactMethods) && Objects.equals(contributionRecord, that.contributionRecord) && Objects.equals(personRoles, that.personRoles) && + Objects.equals(locations, that.locations) && Objects.equals(userIdentities, that.userIdentities) && Objects.equals(superTeam, that.superTeam) && Objects.equals(subTeams, that.subTeams) && @@ -377,6 +404,6 @@ public boolean equals(Object objectToCompare) public int hashCode() { return Objects.hash(elementHeader, profileProperties, contactMethods, contributionRecord, userIdentities, superTeam, subTeams, - teamLeaderRoles, personRoles, teamMemberRoles, linkedInfrastructure); + teamLeaderRoles, personRoles, locations, teamMemberRoles, linkedInfrastructure); } } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/CollectionElement.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/CollectionElement.java index 45b405bf5c4..10a44a28485 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/CollectionElement.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/CollectionElement.java @@ -26,6 +26,7 @@ public class CollectionElement implements MetadataElement, Serializable private ElementHeader elementHeader = null; private CollectionProperties properties = null; + private RelatedElement relatedElement = null; /** @@ -48,6 +49,7 @@ public CollectionElement(CollectionElement template) { elementHeader = template.getElementHeader(); properties = template.getProperties(); + relatedElement = template.getRelatedElement(); } } @@ -98,6 +100,30 @@ public void setProperties(CollectionProperties properties) } + /** + * Return details of the relationship used to retrieve this element. + * Will be null if the element was retrieved directly rather than via a relationship. + * + * @return list of element stubs + */ + public RelatedElement getRelatedElement() + { + return relatedElement; + } + + + /** + * Set up details of the relationship used to retrieve this element. + * Will be null if the element was retrieved directly rather than via a relationship. + * + * @param relatedElement relationship details + */ + public void setRelatedElement(RelatedElement relatedElement) + { + this.relatedElement = relatedElement; + } + + /** * JSON-style toString * @@ -109,6 +135,7 @@ public String toString() return "CollectionElement{" + "elementHeader=" + elementHeader + ", properties=" + properties + + ", relatedElement=" + relatedElement + '}'; } @@ -132,7 +159,8 @@ public boolean equals(Object objectToCompare) } CollectionElement that = (CollectionElement) objectToCompare; return Objects.equals(elementHeader, that.elementHeader) && - Objects.equals(properties, that.properties); + Objects.equals(properties, that.properties) && + Objects.equals(relatedElement, that.relatedElement); } @@ -144,6 +172,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), elementHeader, properties); + return Objects.hash(super.hashCode(), elementHeader, properties, relatedElement); } } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/CommentElement.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/CommentElement.java index 1d37d6a52fb..3562b317690 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/CommentElement.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/CommentElement.java @@ -9,7 +9,6 @@ import org.odpi.openmetadata.accessservices.communityprofile.properties.CommentProperties; import java.io.Serializable; -import java.util.List; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; @@ -28,8 +27,8 @@ public class CommentElement implements MetadataElement, Serializable private ElementHeader elementHeader = null; private CommentProperties properties = null; - private List answeredBy = null; - private List answers = null; + private RelatedElement relatedElement = null; + /** * Default constructor @@ -51,8 +50,7 @@ public CommentElement(CommentElement template) { elementHeader = template.getElementHeader(); properties = template.getProperties(); - answeredBy = template.getAnsweredBy(); - answers = template.getAnswers(); + relatedElement = template.getRelatedElement(); } } @@ -104,48 +102,29 @@ public void setProperties(CommentProperties properties) /** - * Return the list of comments that answer a question posed in this comment. - * - * @return list of related comments - */ - public List getAnsweredBy() - { - return answeredBy; - } - - - /** - * Set up the list of comments that answer a question posed in this comment. + * Return details of the relationship used to retrieve this element. + * Will be null if the element was retrieved directly rather than via a relationship. * - * @param answeredBy list of related comments + * @return list of element stubs */ - public void setAnsweredBy(List answeredBy) + public RelatedElement getRelatedElement() { - this.answeredBy = answeredBy; + return relatedElement; } /** - * Return the list of unique identifiers (guids) for comments that contain a question that this comment answers. + * Set up details of the relationship used to retrieve this element. + * Will be null if the element was retrieved directly rather than via a relationship. * - * @return list of related comments + * @param relatedElement relationship details */ - public List getAnswers() + public void setRelatedElement(RelatedElement relatedElement) { - return answers; + this.relatedElement = relatedElement; } - /** - * Set up the list of comments that contain a question that this comment answers. - * - * @param answers list of related comments - */ - public void setAnswers(List answers) - { - this.answers = answers; - } - /** * JSON-style toString @@ -158,8 +137,7 @@ public String toString() return "CommentElement{" + "elementHeader=" + elementHeader + ", properties=" + properties + - ", answeredBy=" + answeredBy + - ", answers=" + answers + + ", relatedElement=" + relatedElement + '}'; } @@ -184,8 +162,7 @@ public boolean equals(Object objectToCompare) CommentElement that = (CommentElement) objectToCompare; return Objects.equals(elementHeader, that.elementHeader) && Objects.equals(properties, that.properties) && - Objects.equals(answeredBy, that.answeredBy) && - Objects.equals(answers, that.answers); + Objects.equals(relatedElement, that.relatedElement); } @@ -197,6 +174,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), elementHeader, properties, answeredBy, answers); + return Objects.hash(super.hashCode(), elementHeader, properties, relatedElement); } } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/CommunityElement.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/CommunityElement.java index b23c27e41fd..5d71f2f2b45 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/CommunityElement.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/CommunityElement.java @@ -26,6 +26,7 @@ public class CommunityElement implements MetadataElement, Serializable private ElementHeader elementHeader = null; private CommunityProperties properties = null; + private RelatedElement relatedElement = null; /** @@ -48,6 +49,7 @@ public CommunityElement(CommunityElement template) { elementHeader = template.getElementHeader(); properties = template.getProperties(); + relatedElement = template.getRelatedElement(); } } @@ -98,6 +100,30 @@ public void setProperties(CommunityProperties properties) } + /** + * Return details of the relationship used to retrieve this element. + * Will be null if the element was retrieved directly rather than via a relationship. + * + * @return list of element stubs + */ + public RelatedElement getRelatedElement() + { + return relatedElement; + } + + + /** + * Set up details of the relationship used to retrieve this element. + * Will be null if the element was retrieved directly rather than via a relationship. + * + * @param relatedElement relationship details + */ + public void setRelatedElement(RelatedElement relatedElement) + { + this.relatedElement = relatedElement; + } + + /** * JSON-style toString * @@ -107,9 +133,10 @@ public void setProperties(CommunityProperties properties) public String toString() { return "CommunityElement{" + - "elementHeader=" + elementHeader + - ", properties=" + properties + - '}'; + "elementHeader=" + elementHeader + + ", properties=" + properties + + ", relatedElement=" + relatedElement + + '}'; } @@ -132,7 +159,8 @@ public boolean equals(Object objectToCompare) } CommunityElement that = (CommunityElement) objectToCompare; return Objects.equals(elementHeader, that.elementHeader) && - Objects.equals(properties, that.properties); + Objects.equals(properties, that.properties) && + Objects.equals(relatedElement, that.relatedElement); } @@ -144,6 +172,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), elementHeader, properties); + return Objects.hash(super.hashCode(), elementHeader, properties, relatedElement); } } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/ElementVersions.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/ElementVersions.java index 528600d42a9..ddfcda5aa86 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/ElementVersions.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/ElementVersions.java @@ -17,7 +17,7 @@ /** * ElementVersions provides the version information for the element plus details of the creation time and last - * update time. Finally it lists all of the users that have made changes to this element. + * update time. Finally it lists all the users that have made changes to this element. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/LocationElement.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/LocationElement.java index d89f30eb61c..98e32b98643 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/LocationElement.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/LocationElement.java @@ -26,6 +26,7 @@ public class LocationElement implements MetadataElement, Serializable private ElementHeader elementHeader = null; private LocationProperties locationProperties = null; + private RelatedElement relatedElement = null; /** @@ -48,6 +49,7 @@ public LocationElement(LocationElement template) { elementHeader = template.getElementHeader(); locationProperties = template.getLocationProperties(); + relatedElement = template.getRelatedElement(); } } @@ -98,6 +100,30 @@ public void setLocationProperties(LocationProperties locationProperties) } + /** + * Return details of the relationship used to retrieve this element. + * Will be null if the element was retrieved directly rather than via a relationship. + * + * @return list of element stubs + */ + public RelatedElement getRelatedElement() + { + return relatedElement; + } + + + /** + * Set up details of the relationship used to retrieve this element. + * Will be null if the element was retrieved directly rather than via a relationship. + * + * @param relatedElement relationship details + */ + public void setRelatedElement(RelatedElement relatedElement) + { + this.relatedElement = relatedElement; + } + + /** * JSON-style toString * @@ -107,9 +133,10 @@ public void setLocationProperties(LocationProperties locationProperties) public String toString() { return "LocationElement{" + - "elementHeader=" + elementHeader + - ", locationProperties=" + locationProperties + - '}'; + "elementHeader=" + elementHeader + + ", locationProperties=" + locationProperties + + ", relatedElement=" + relatedElement + + '}'; } @@ -136,7 +163,8 @@ public boolean equals(Object objectToCompare) } LocationElement that = (LocationElement) objectToCompare; return Objects.equals(elementHeader, that.elementHeader) && - Objects.equals(locationProperties, that.locationProperties); + Objects.equals(locationProperties, that.locationProperties) && + Objects.equals(relatedElement, that.relatedElement); } @@ -148,6 +176,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), elementHeader, locationProperties); + return Objects.hash(super.hashCode(), elementHeader, locationProperties, relatedElement); } } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/PersonRoleElement.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/PersonRoleElement.java index 4bade301484..496f480ee97 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/PersonRoleElement.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/PersonRoleElement.java @@ -9,7 +9,6 @@ import org.odpi.openmetadata.accessservices.communityprofile.properties.PersonRoleProperties; import java.io.Serializable; -import java.util.List; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; @@ -26,8 +25,8 @@ public class PersonRoleElement implements MetadataElement, Serializable private static final long serialVersionUID = 1L; private ElementHeader elementHeader = null; - private PersonRoleProperties properties = null; - private List appointees = null; + private PersonRoleProperties properties = null; + private RelatedElement relatedElement = null; /** @@ -50,7 +49,7 @@ public PersonRoleElement(PersonRoleElement template) { elementHeader = template.getElementHeader(); properties = template.getProperties(); - appointees = template.getAppointees(); + relatedElement = template.getRelatedElement(); } } @@ -102,24 +101,26 @@ public void setProperties(PersonRoleProperties properties) /** - * Return the list of Person profiles that are appointed to the role. + * Return details of the relationship used to retrieve this element. + * Will be null if the element was retrieved directly rather than via a relationship. * * @return list of element stubs */ - public List getAppointees() + public RelatedElement getRelatedElement() { - return appointees; + return relatedElement; } /** - * Set up the list of Person profiles that are appointed to the role. + * Set up details of the relationship used to retrieve this element. + * Will be null if the element was retrieved directly rather than via a relationship. * - * @param appointees list of element stubs + * @param relatedElement relationship details */ - public void setAppointees(List appointees) + public void setRelatedElement(RelatedElement relatedElement) { - this.appointees = appointees; + this.relatedElement = relatedElement; } @@ -134,7 +135,7 @@ public String toString() return "PersonRoleElement{" + "elementHeader=" + elementHeader + ", properties=" + properties + - ", appointees=" + appointees + + ", relatedElement=" + relatedElement + '}'; } @@ -159,7 +160,7 @@ public boolean equals(Object objectToCompare) PersonRoleElement that = (PersonRoleElement) objectToCompare; return Objects.equals(elementHeader, that.elementHeader) && Objects.equals(properties, that.properties) && - Objects.equals(appointees, that.appointees); + Objects.equals(relatedElement, that.relatedElement); } @@ -171,6 +172,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), elementHeader, properties, appointees); + return Objects.hash(super.hashCode(), elementHeader, properties, relatedElement); } } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/PersonalRoleElement.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/PersonalRoleElement.java index 36aa83ffa62..c8cd1bdce9b 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/PersonalRoleElement.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/PersonalRoleElement.java @@ -26,6 +26,7 @@ public class PersonalRoleElement implements MetadataElement, Serializable private ElementHeader elementHeader = null; private PersonalRoleProperties properties = null; + private RelatedElement relatedElement = null; /** @@ -48,6 +49,7 @@ public PersonalRoleElement(PersonalRoleElement template) { elementHeader = template.getElementHeader(); properties = template.getProperties(); + relatedElement = template.getRelatedElement(); } } @@ -98,6 +100,30 @@ public void setProperties(PersonalRoleProperties properties) } + /** + * Return details of the relationship used to retrieve this element. + * Will be null if the element was retrieved directly rather than via a relationship. + * + * @return list of element stubs + */ + public RelatedElement getRelatedElement() + { + return relatedElement; + } + + + /** + * Set up details of the relationship used to retrieve this element. + * Will be null if the element was retrieved directly rather than via a relationship. + * + * @param relatedElement relationship details + */ + public void setRelatedElement(RelatedElement relatedElement) + { + this.relatedElement = relatedElement; + } + + /** * JSON-style toString * @@ -107,9 +133,10 @@ public void setProperties(PersonalRoleProperties properties) public String toString() { return "PersonalRoleElement{" + - "elementHeader=" + elementHeader + - ", properties=" + properties + - '}'; + "elementHeader=" + elementHeader + + ", properties=" + properties + + ", relatedElement=" + relatedElement + + '}'; } @@ -132,7 +159,8 @@ public boolean equals(Object objectToCompare) } PersonalRoleElement that = (PersonalRoleElement) objectToCompare; return Objects.equals(elementHeader, that.elementHeader) && - Objects.equals(properties, that.properties); + Objects.equals(properties, that.properties) && + Objects.equals(relatedElement, that.relatedElement); } @@ -144,6 +172,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), elementHeader, properties); + return Objects.hash(super.hashCode(), elementHeader, properties, relatedElement); } } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/ProfileLocationElement.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/ProfileLocationElement.java new file mode 100644 index 00000000000..cae02488775 --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/ProfileLocationElement.java @@ -0,0 +1,149 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.communityprofile.metadataelements; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.communityprofile.properties.ProfileIdentityProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.ProfileLocationProperties; + +import java.io.Serializable; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ProfileLocationElement contains the properties and header for a relationship between a profile and a user identity retrieved + * from the metadata repository. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ProfileLocationElement implements Serializable +{ + private static final long serialVersionUID = 1L; + + private ProfileLocationProperties properties = null; + private ElementStub location = null; + + + /** + * Default constructor + */ + public ProfileLocationElement() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ProfileLocationElement(ProfileLocationElement template) + { + if (template != null) + { + properties = template.getProperties(); + location = template.getLocation(); + } + } + + + /** + * Return the properties from the profile location relationship. + * + * @return profile identity + */ + public ProfileLocationProperties getProperties() + { + return properties; + } + + + /** + * Set up the properties from the profile location relationship. + * + * @param properties profile identity + */ + public void setProperties(ProfileLocationProperties properties) + { + this.properties = properties; + } + + + /** + * Return the properties of the location. + * + * @return properties + */ + public ElementStub getLocation() + { + return location; + } + + + /** + * Set up the userId properties. + * + * @param location properties + */ + public void setLocation(ElementStub location) + { + this.location = location; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ProfileLocationElement{" + + "properties=" + properties + + ", location=" + location + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + ProfileLocationElement that = (ProfileLocationElement) objectToCompare; + return Objects.equals(properties, that.properties) && + Objects.equals(location, that.location); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), properties, location); + } +} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/RelatedElement.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/RelatedElement.java new file mode 100644 index 00000000000..84fb4d50762 --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/RelatedElement.java @@ -0,0 +1,173 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.communityprofile.metadataelements; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.communityprofile.properties.RelationshipProperties; + +import java.io.Serializable; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * RelatedElement contains the properties and header for a relationship retrieved from the metadata repository along with the stub + * of the related element. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class RelatedElement implements Serializable +{ + private static final long serialVersionUID = 1L; + + private ElementHeader relationshipHeader = null; + private RelationshipProperties relationshipProperties = null; + private ElementStub relatedElement = null; + + /** + * Default constructor + */ + public RelatedElement() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public RelatedElement(RelatedElement template) + { + if (template != null) + { + relationshipHeader = template.getRelationshipHeader(); + relationshipProperties = template.getRelationshipProperties(); + relatedElement = template.getRelatedElement(); + } + } + + + /** + * Return the element header associated with the relationship. + * + * @return element header object + */ + public ElementHeader getRelationshipHeader() + { + return relationshipHeader; + } + + + /** + * Set up the element header associated with the relationship. + * + * @param relationshipHeader element header object + */ + public void setRelationshipHeader(ElementHeader relationshipHeader) + { + this.relationshipHeader = relationshipHeader; + } + + + /** + * Return details of the relationship + * + * @return relationship properties + */ + public RelationshipProperties getRelationshipProperties() + { + return relationshipProperties; + } + + + /** + * Set up relationship properties + * + * @param relationshipProperties relationship properties + */ + public void setRelationshipProperties(RelationshipProperties relationshipProperties) + { + this.relationshipProperties = relationshipProperties; + } + + + /** + * Return the element header associated with end 1 of the relationship. + * + * @return element stub object + */ + public ElementStub getRelatedElement() + { + return relatedElement; + } + + + /** + * Set up the element header associated with end 1 of the relationship. + * + * @param relatedElement element stub object + */ + public void setRelatedElement(ElementStub relatedElement) + { + this.relatedElement = relatedElement; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "RelatedElement{" + + "relationshipHeader=" + relationshipHeader + + ", relationshipProperties=" + relationshipProperties + + ", relatedElement=" + relatedElement + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + RelatedElement that = (RelatedElement) objectToCompare; + return Objects.equals(getRelationshipHeader(), that.getRelationshipHeader()) && + Objects.equals(getRelationshipProperties(), that.getRelationshipProperties()) && + Objects.equals(getRelatedElement(), that.getRelatedElement()); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), relationshipHeader, relationshipProperties, relatedElement); + } +} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/RelationshipElement.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/RelationshipElement.java new file mode 100644 index 00000000000..7e1f8e58149 --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/RelationshipElement.java @@ -0,0 +1,199 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.communityprofile.metadataelements; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.communityprofile.properties.RelationshipProperties; + +import java.io.Serializable; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * RelationshipElement contains the properties and header for a relationship retrieved from the metadata repository. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class RelationshipElement implements Serializable +{ + private static final long serialVersionUID = 1L; + + private ElementHeader relationshipHeader = null; + private RelationshipProperties relationshipProperties = null; + private ElementHeader end1GUID = null; + private ElementHeader end2GUID = null; + + /** + * Default constructor + */ + public RelationshipElement() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public RelationshipElement(RelationshipElement template) + { + if (template != null) + { + relationshipHeader = template.getRelationshipHeader(); + relationshipProperties = template.getRelationshipProperties(); + end1GUID = template.getEnd1GUID(); + end2GUID = template.getEnd2GUID(); + } + } + + + /** + * Return the element header associated with the relationship. + * + * @return element header object + */ + public ElementHeader getRelationshipHeader() + { + return relationshipHeader; + } + + + /** + * Set up the element header associated with the relationship. + * + * @param relationshipHeader element header object + */ + public void setRelationshipHeader(ElementHeader relationshipHeader) + { + this.relationshipHeader = relationshipHeader; + } + + + /** + * Return details of the relationship + * + * @return relationship properties + */ + public RelationshipProperties getRelationshipProperties() + { + return relationshipProperties; + } + + + /** + * Set up relationship properties + * + * @param relationshipProperties relationship properties + */ + public void setRelationshipProperties(RelationshipProperties relationshipProperties) + { + this.relationshipProperties = relationshipProperties; + } + + + /** + * Return the element header associated with end 1 of the relationship. + * + * @return element header object + */ + public ElementHeader getEnd1GUID() + { + return end1GUID; + } + + + /** + * Set up the element header associated with end 1 of the relationship. + * + * @param end1GUID element header object + */ + public void setEnd1GUID(ElementHeader end1GUID) + { + this.end1GUID = end1GUID; + } + + + + /** + * Return the element header associated with end 2 of the relationship. + * + * @return element header object + */ + public ElementHeader getEnd2GUID() + { + return end2GUID; + } + + + /** + * Set up the element header associated with end 2 of the relationship. + * + * @param end2GUID element header object + */ + public void setEnd2GUID(ElementHeader end2GUID) + { + this.end2GUID = end2GUID; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "RelationshipElement{" + + "relationshipHeader=" + relationshipHeader + + ", relationshipProperties=" + relationshipProperties + + ", end1GUID=" + end1GUID + + ", end2GUID=" + end2GUID + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + RelationshipElement that = (RelationshipElement) objectToCompare; + return Objects.equals(getRelationshipHeader(), that.getRelationshipHeader()) && + Objects.equals(getRelationshipProperties(), that.getRelationshipProperties()) && + Objects.equals(getEnd1GUID(), that.getEnd1GUID()) && + Objects.equals(getEnd2GUID(), that.getEnd2GUID()); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), relationshipHeader, relationshipProperties, end1GUID, end2GUID); + } +} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/ResourceElement.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/ResourceElement.java index fe9e2488d51..2bfb5baa356 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/ResourceElement.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/ResourceElement.java @@ -26,6 +26,7 @@ public class ResourceElement implements MetadataElement, Serializable private ElementHeader elementHeader = null; private ResourceProperties properties = null; + private RelatedElement relatedElement = null; /** @@ -48,6 +49,7 @@ public ResourceElement(ResourceElement template) { elementHeader = template.getElementHeader(); properties = template.getProperties(); + relatedElement = template.getRelatedElement(); } } @@ -98,6 +100,30 @@ public void setProperties(ResourceProperties properties) } + /** + * Return details of the relationship used to retrieve this element. + * Will be null if the element was retrieved directly rather than via a relationship. + * + * @return list of element stubs + */ + public RelatedElement getRelatedElement() + { + return relatedElement; + } + + + /** + * Set up details of the relationship used to retrieve this element. + * Will be null if the element was retrieved directly rather than via a relationship. + * + * @param relatedElement relationship details + */ + public void setRelatedElement(RelatedElement relatedElement) + { + this.relatedElement = relatedElement; + } + + /** * JSON-style toString * @@ -109,6 +135,7 @@ public String toString() return "ResourceElement{" + "elementHeader=" + elementHeader + ", properties=" + properties + + ", relatedElement=" + relatedElement + '}'; } @@ -132,7 +159,8 @@ public boolean equals(Object objectToCompare) } ResourceElement that = (ResourceElement) objectToCompare; return Objects.equals(elementHeader, that.elementHeader) && - Objects.equals(properties, that.properties); + Objects.equals(properties, that.properties) && + Objects.equals(relatedElement, that.relatedElement); } @@ -144,6 +172,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), elementHeader, properties); + return Objects.hash(super.hashCode(), elementHeader, properties, relatedElement); } } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/SecurityGroupElement.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/SecurityGroupElement.java index 63be517b56e..452d17baccd 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/SecurityGroupElement.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/SecurityGroupElement.java @@ -27,6 +27,7 @@ public class SecurityGroupElement implements Serializable, MetadataElement private ElementHeader elementHeader = null; private SecurityGroupProperties properties = null; + private RelatedElement relatedElement = null; /** @@ -49,6 +50,7 @@ public SecurityGroupElement(SecurityGroupElement template) { this.elementHeader = template.getElementHeader(); this.properties = template.getProperties(); + this.relatedElement = template.getRelatedElement(); } } @@ -97,6 +99,30 @@ public void setProperties(SecurityGroupProperties properties) } + /** + * Return details of the relationship used to retrieve this element. + * Will be null if the element was retrieved directly rather than via a relationship. + * + * @return list of element stubs + */ + public RelatedElement getRelatedElement() + { + return relatedElement; + } + + + /** + * Set up details of the relationship used to retrieve this element. + * Will be null if the element was retrieved directly rather than via a relationship. + * + * @param relatedElement relationship details + */ + public void setRelatedElement(RelatedElement relatedElement) + { + this.relatedElement = relatedElement; + } + + /** * JSON-style toString * @@ -108,6 +134,7 @@ public String toString() return "SecurityGroupElement{" + "elementHeader=" + elementHeader + ", properties=" + properties + + ", relatedElement=" + relatedElement + '}'; } @@ -131,7 +158,8 @@ public boolean equals(Object objectToCompare) } SecurityGroupElement that = (SecurityGroupElement) objectToCompare; return Objects.equals(elementHeader, that.elementHeader) && - Objects.equals(properties, that.properties); + Objects.equals(properties, that.properties) && + Objects.equals(relatedElement, that.relatedElement); } @@ -143,6 +171,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), elementHeader, properties); + return Objects.hash(super.hashCode(), elementHeader, properties, relatedElement); } } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/ToDoElement.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/ToDoElement.java index 41c509ad67e..30e30a984d5 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/ToDoElement.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/ToDoElement.java @@ -15,7 +15,7 @@ import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; /** - * ToDoElement contains the properties and header for a to do (informal task) retrieved from the metadata repository. + * ToDoElement contains the properties and header for a "to do" (informal task) retrieved from the metadata repository. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @@ -26,7 +26,7 @@ public class ToDoElement implements MetadataElement, Serializable private ElementHeader elementHeader = null; private ToDoProperties properties = null; - + private RelatedElement relatedElement = null; /** * Default constructor @@ -48,6 +48,7 @@ public ToDoElement(ToDoElement template) { elementHeader = template.getElementHeader(); properties = template.getProperties(); + relatedElement = template.getRelatedElement(); } } @@ -98,6 +99,30 @@ public void setProperties(ToDoProperties properties) } + /** + * Return details of the relationship used to retrieve this element. + * Will be null if the element was retrieved directly rather than via a relationship. + * + * @return list of element stubs + */ + public RelatedElement getRelatedElement() + { + return relatedElement; + } + + + /** + * Set up details of the relationship used to retrieve this element. + * Will be null if the element was retrieved directly rather than via a relationship. + * + * @param relatedElement relationship details + */ + public void setRelatedElement(RelatedElement relatedElement) + { + this.relatedElement = relatedElement; + } + + /** * JSON-style toString * @@ -107,9 +132,10 @@ public void setProperties(ToDoProperties properties) public String toString() { return "ToDoElement{" + - "elementHeader=" + elementHeader + - ", properties=" + properties + - '}'; + "elementHeader=" + elementHeader + + ", properties=" + properties + + ", relatedElement=" + relatedElement + + '}'; } @@ -132,7 +158,8 @@ public boolean equals(Object objectToCompare) } ToDoElement that = (ToDoElement) objectToCompare; return Objects.equals(elementHeader, that.elementHeader) && - Objects.equals(properties, that.properties); + Objects.equals(properties, that.properties) && + Objects.equals(relatedElement, that.relatedElement); } @@ -144,6 +171,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), elementHeader, properties); + return Objects.hash(super.hashCode(), elementHeader, properties, relatedElement); } } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/UserIdentityElement.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/UserIdentityElement.java index eb2fdd5da58..c392de02a1d 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/UserIdentityElement.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/UserIdentityElement.java @@ -27,6 +27,7 @@ public class UserIdentityElement implements MetadataElement, Serializable private ElementHeader elementHeader = null; private UserIdentityProperties properties = null; + private RelatedElement relatedElement = null; /** @@ -49,6 +50,7 @@ public UserIdentityElement(UserIdentityElement template) { elementHeader = template.getElementHeader(); properties = template.getProperties(); + relatedElement = template.getRelatedElement(); } } @@ -99,6 +101,30 @@ public void setProperties(UserIdentityProperties properties) } + /** + * Return details of the relationship used to retrieve this element. + * Will be null if the element was retrieved directly rather than via a relationship. + * + * @return list of element stubs + */ + public RelatedElement getRelatedElement() + { + return relatedElement; + } + + + /** + * Set up details of the relationship used to retrieve this element. + * Will be null if the element was retrieved directly rather than via a relationship. + * + * @param relatedElement relationship details + */ + public void setRelatedElement(RelatedElement relatedElement) + { + this.relatedElement = relatedElement; + } + + /** * JSON-style toString * @@ -110,6 +136,7 @@ public String toString() return "UserIdentityElement{" + "elementHeader=" + elementHeader + ", properties=" + properties + + ", relatedElement=" + relatedElement + '}'; } @@ -133,7 +160,8 @@ public boolean equals(Object objectToCompare) } UserIdentityElement that = (UserIdentityElement) objectToCompare; return Objects.equals(elementHeader, that.elementHeader) && - Objects.equals(properties, that.properties); + Objects.equals(properties, that.properties) && + Objects.equals(relatedElement, that.relatedElement); } @@ -145,6 +173,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), elementHeader, properties); + return Objects.hash(super.hashCode(), elementHeader, properties, relatedElement); } } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/AdjacentLocationProperties.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/AdjacentLocationProperties.java new file mode 100644 index 00000000000..6afe514dda0 --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/AdjacentLocationProperties.java @@ -0,0 +1,57 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.communityprofile.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * AdjacentLocationProperties describes the properties for the AdjacentLocation relationship between adjacent locations. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class AdjacentLocationProperties extends RelationshipProperties +{ + private static final long serialVersionUID = 1L; + + + /** + * Default constructor + */ + public AdjacentLocationProperties() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public AdjacentLocationProperties(AdjacentLocationProperties template) + { + super(template); + } + + + /** + * JSON-style toString. + * + * @return list of properties and their values. + */ + @Override + public String toString() + { + return "AdjacentLocationProperties{" + + "effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", extendedProperties=" + getExtendedProperties() + + '}'; + } +} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/AppointmentProperties.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/AppointmentProperties.java index 3bb03487afb..36835d32fd9 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/AppointmentProperties.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/AppointmentProperties.java @@ -5,7 +5,6 @@ import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; -import org.odpi.openmetadata.accessservices.communityprofile.rest.MetadataSourceRequestBody; import java.io.Serializable; import java.util.Date; @@ -15,7 +14,7 @@ import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; /** - * MetadataSourceRequestBody carries the parameters for marking an asset or schema as external. + * ExternalSourceRequestBody carries the parameters for marking an asset or schema as external. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/AssetLocationProperties.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/AssetLocationProperties.java new file mode 100644 index 00000000000..06efa8d4d3b --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/AssetLocationProperties.java @@ -0,0 +1,57 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.communityprofile.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * AssetLocationProperties describes the properties for the AssetLocation relationship between an asset and a location. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class AssetLocationProperties extends RelationshipProperties +{ + private static final long serialVersionUID = 1L; + + + /** + * Default constructor + */ + public AssetLocationProperties() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public AssetLocationProperties(AssetLocationProperties template) + { + super(template); + } + + + /** + * JSON-style toString. + * + * @return list of properties and their values. + */ + @Override + public String toString() + { + return "AssetLocationProperties{" + + "effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", extendedProperties=" + getExtendedProperties() + + '}'; + } +} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/AssignmentScopeProperties.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/AssignmentScopeProperties.java new file mode 100644 index 00000000000..4eee5827585 --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/AssignmentScopeProperties.java @@ -0,0 +1,152 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.communityprofile.properties; + + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * AssignmentScopeProperties provides a details of the scope of work/influence expected by the assigned actor(s). + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class AssignmentScopeProperties extends RelationshipProperties +{ + private static final long serialVersionUID = 1L; + + String assignmentType = null; + String description = null; + + /** + * Default constructor + */ + public AssignmentScopeProperties() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public AssignmentScopeProperties(AssignmentScopeProperties template) + { + super(template); + + if (template != null) + { + this.assignmentType = template.getAssignmentType(); + this.description = template.getDescription(); + } + } + + + /** + * Return the expectations with respect to the scope. + * + * @return type of assignment + */ + public String getAssignmentType() + { + return assignmentType; + } + + + /** + * Set up the expectations with respect to the scope. + * + * @param assignmentType type of assignment + */ + public void setAssignmentType(String assignmentType) + { + this.assignmentType = assignmentType; + } + + + /** + * Return additional descriptive text. + * + * @return text + */ + public String getDescription() + { + return description; + } + + + /** + * Set up additional descriptive text. + * + * @param description text + */ + public void setDescription(String description) + { + this.description = description; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "AssignmentScopeProperties{" + + "assignmentType='" + assignmentType + '\'' + + ", description='" + description + '\'' + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", extendedProperties=" + getExtendedProperties() + + '}'; + } + + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (! super.equals(objectToCompare)) + { + return false; + } + AssignmentScopeProperties that = (AssignmentScopeProperties) objectToCompare; + return Objects.equals(assignmentType, that.assignmentType) && Objects.equals(description, that.description); + } + + + /** + * Return has code based on properties. + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), assignmentType, description); + } +} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ClassificationProperties.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ClassificationProperties.java new file mode 100644 index 00000000000..094b7c4c3f9 --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ClassificationProperties.java @@ -0,0 +1,199 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.communityprofile.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + +import java.io.Serializable; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * RelationshipProperties provides the base class for relationships items. This provides extended properties with the ability to + * set effectivity dates. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "class") +@JsonSubTypes( + { + @JsonSubTypes.Type(value = FixedLocationProperties.class, name = "FixedLocationProperties"), + @JsonSubTypes.Type(value = DigitalLocationProperties.class, name = "DigitalLocationProperties"), + @JsonSubTypes.Type(value = SecureLocationProperties.class, name = "SecureLocationProperties"), + }) +public class ClassificationProperties implements Serializable +{ + private static final long serialVersionUID = 1L; + + private Date effectiveFrom = null; + private Date effectiveTo = null; + + private Map extendedProperties = null; + + + /** + * Default constructor + */ + public ClassificationProperties() + { + super(); + } + + + /** + * Copy/clone constructor. Retrieve values from the supplied template + * + * @param template element to copy + */ + public ClassificationProperties(ClassificationProperties template) + { + if (template != null) + { + effectiveFrom = template.getEffectiveFrom(); + effectiveTo = template.getEffectiveTo(); + extendedProperties = template.getExtendedProperties(); + } + } + + + /** + * Return the date/time that this element is effective from (null means effective from the epoch). + * + * @return date object + */ + public Date getEffectiveFrom() + { + return effectiveFrom; + } + + + /** + * Set up the date/time that this element is effective from (null means effective from the epoch). + * + * @param effectiveFrom date object + */ + public void setEffectiveFrom(Date effectiveFrom) + { + this.effectiveFrom = effectiveFrom; + } + + + /** + * Return the date/time that element is effective to (null means that it is effective indefinitely into the future). + * + * @return date object + */ + public Date getEffectiveTo() + { + return effectiveTo; + } + + + /** + * Set the date/time that element is effective to (null means that it is effective indefinitely into the future). + * + * @param effectiveTo date object + */ + public void setEffectiveTo(Date effectiveTo) + { + this.effectiveTo = effectiveTo; + } + + + /** + * Return the properties that have been defined for a subtype of this object that are not supported explicitly + * by this bean. + * + * @return property map + */ + public Map getExtendedProperties() + { + if (extendedProperties == null) + { + return null; + } + else if (extendedProperties.isEmpty()) + { + return null; + } + else + { + return new HashMap<>(extendedProperties); + } + } + + + /** + * Set up the properties that have been defined for a subtype of this object that are not supported explicitly + * by this bean. + * + * @param extendedProperties property map + */ + public void setExtendedProperties(Map extendedProperties) + { + this.extendedProperties = extendedProperties; + } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "RelationshipProperties{" + + "effectiveFrom=" + effectiveFrom + + ", effectiveTo=" + effectiveTo + + ", extendedProperties=" + extendedProperties + + '}'; + } + + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + ClassificationProperties that = (ClassificationProperties) objectToCompare; + return Objects.equals(effectiveFrom, that.effectiveFrom) && + Objects.equals(effectiveTo, that.effectiveTo); + } + + + /** + * Return has code based on properties. + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(effectiveFrom, effectiveTo); + } +} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/CollectionStatus.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/CollectionStatus.java index d10f03af08b..aaf5de21828 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/CollectionStatus.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/CollectionStatus.java @@ -16,10 +16,10 @@ * that links a member into a collection has an start and end date (called the effective dates). The * Community Profile OMAS uses the CollectionStatus and the effective dates to determine which members to return. *

        - *
      • ACTIVE - All of the collection members with a current effective dates. This is the default.
      • - *
      • PAST - All of the collection members that have effective dates in the past.
      • - *
      • FUTURE - All of the collection members that become effective in the future.
      • - *
      • ALL - All of the collection members linked to the collection irrespective of their effective dates.
      • + *
      • ACTIVE - all the collection members with a current effective dates. This is the default.
      • + *
      • PAST - all the collection members that have effective dates in the past.
      • + *
      • FUTURE - all the collection members that become effective in the future.
      • + *
      • ALL - all the collection members linked to the collection irrespective of their effective dates.
      • *
      */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @@ -27,10 +27,10 @@ @JsonIgnoreProperties(ignoreUnknown=true) public enum CollectionStatus implements Serializable { - ACTIVE (0, "Active", "All of the collection members with a current effective dates (default)."), - PAST (1, "Past", "All of the collection members that have effective dates in the past."), - FUTURE (2, "Future", "All of the collection members that become effective in the future."), - ALL (99, "All", "All of the collection members linked to the collection irrespective of their effective dates."); + ACTIVE (0, "Active", "all the collection members with a current effective dates (default)."), + PAST (1, "Past", "all the collection members that have effective dates in the past."), + FUTURE (2, "Future", "all the collection members that become effective in the future."), + ALL (99, "All", "all the collection members linked to the collection irrespective of their effective dates."); private static final long serialVersionUID = 1L; diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/CommunityMembershipProperties.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/CommunityMembershipProperties.java new file mode 100644 index 00000000000..1f5039f1e73 --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/CommunityMembershipProperties.java @@ -0,0 +1,127 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.communityprofile.properties; + + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * CommunityMembershipProperties provides a details of the purpose (and privileges) of the membership role. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class CommunityMembershipProperties extends RelationshipProperties +{ + private static final long serialVersionUID = 1L; + + CommunityMembershipType membershipType = null; + + /** + * Default constructor + */ + public CommunityMembershipProperties() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public CommunityMembershipProperties(CommunityMembershipProperties template) + { + super(template); + + if (template != null) + { + this.membershipType = template.getMembershipType(); + } + } + + + /** + * Return the membership type. + * + * @return membership type + */ + public CommunityMembershipType getMembershipType() + { + return membershipType; + } + + + /** + * Set up the membership type. + * + * @param membershipType membership type + */ + public void setMembershipType(CommunityMembershipType membershipType) + { + this.membershipType = membershipType; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "CommunityMembershipProperties{" + + "membershipType=" + membershipType + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", extendedProperties=" + getExtendedProperties() + + '}'; + } + + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (! super.equals(objectToCompare)) + { + return false; + } + CommunityMembershipProperties that = (CommunityMembershipProperties) objectToCompare; + return Objects.equals(membershipType, that.membershipType); + } + + + /** + * Return has code based on properties. + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), membershipType); + } +} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ContactMethodProperties.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ContactMethodProperties.java index d0604f83f15..955614540bd 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ContactMethodProperties.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ContactMethodProperties.java @@ -25,9 +25,12 @@ public class ContactMethodProperties implements Serializable { private static final long serialVersionUID = 1L; - private ContactMethodType type = null; - private String service = null; - private String value = null; + private String name = null; + private String contactType = null; + + private ContactMethodType contactMethodType = null; + private String contactMethodService = null; + private String contactMethodValue = null; private Date effectiveFrom = null; private Date effectiveTo = null; @@ -54,9 +57,9 @@ public ContactMethodProperties(ContactMethodProperties template) { if (template != null) { - type = template.getType(); - service = template.getService(); - value = template.getValue(); + contactMethodType = template.getContactMethodType(); + contactMethodService = template.getContactMethodService(); + contactMethodValue = template.getContactMethodValue(); effectiveFrom = template.getEffectiveFrom(); effectiveTo = template.getEffectiveTo(); typeName = template.getTypeName(); @@ -65,25 +68,69 @@ public ContactMethodProperties(ContactMethodProperties template) } + /** + * Return the name to give this contact method (imagine a list of contact methods). + * + * @return string + */ + public String getName() + { + return name; + } + + + /** + * Set up the name to give this contact method (imagine a list of contact methods). + * + * @param name string + */ + public void setName(String name) + { + this.name = name; + } + + + /** + * Return the type of contact - is it related to work or personal etc. + * + * @return string type name - often controlled by a valid value set + */ + public String getContactType() + { + return contactType; + } + + + /** + * Set up the type of contact - is it related to work or personal etc. + * + * @param contactType string type name - often controlled by a valid value set + */ + public void setContactType(String contactType) + { + this.contactType = contactType; + } + + /** * Return the type of the contact method. * * @return contact method type enum */ - public ContactMethodType getType() + public ContactMethodType getContactMethodType() { - return type; + return contactMethodType; } /** * Set up the type of the contact method. * - * @param type contact method type enum + * @param contactMethodType contact method type enum */ - public void setType(ContactMethodType type) + public void setContactMethodType(ContactMethodType contactMethodType) { - this.type = type; + this.contactMethodType = contactMethodType; } @@ -92,20 +139,20 @@ public void setType(ContactMethodType type) * * @return service URL */ - public String getService() + public String getContactMethodService() { - return service; + return contactMethodService; } /** * Set up theURL of the service used to contact the individual. * - * @param service service URL + * @param contactMethodService service URL */ - public void setService(String service) + public void setContactMethodService(String contactMethodService) { - this.service = service; + this.contactMethodService = contactMethodService; } @@ -114,20 +161,20 @@ public void setService(String service) * * @return value string */ - public String getValue() + public String getContactMethodValue() { - return value; + return contactMethodValue; } /** * Set up the account name or similar value used to direct the message to the individual. * - * @param value value string + * @param contactMethodValue value string */ - public void setValue(String value) + public void setContactMethodValue(String contactMethodValue) { - this.value = value; + this.contactMethodValue = contactMethodValue; } @@ -242,9 +289,9 @@ public void setExtendedProperties(Map extendedProperties) public String toString() { return "ContactMethodProperties{" + - "type=" + type + - ", service='" + service + '\'' + - ", value='" + value + '\'' + + "type=" + contactMethodType + + ", service='" + contactMethodService + '\'' + + ", value='" + contactMethodValue + '\'' + ", effectiveFrom=" + effectiveFrom + ", effectiveTo=" + effectiveTo + ", typeName='" + typeName + '\'' + @@ -271,9 +318,9 @@ public boolean equals(Object objectToCompare) return false; } ContactMethodProperties that = (ContactMethodProperties) objectToCompare; - return type == that.type && - Objects.equals(service, that.service) && - Objects.equals(value, that.value) && + return contactMethodType == that.contactMethodType && + Objects.equals(contactMethodService, that.contactMethodService) && + Objects.equals(contactMethodValue, that.contactMethodValue) && Objects.equals(effectiveFrom, that.effectiveFrom) && Objects.equals(effectiveTo, that.effectiveTo) && Objects.equals(typeName, that.typeName) && @@ -289,6 +336,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(type, service, value, effectiveFrom, effectiveTo, typeName, extendedProperties); + return Objects.hash(contactMethodType, contactMethodService, contactMethodValue, effectiveFrom, effectiveTo, typeName, extendedProperties); } } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/DigitalLocationRequestBody.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/DigitalLocationProperties.java similarity index 71% rename from open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/DigitalLocationRequestBody.java rename to open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/DigitalLocationProperties.java index 9120867dbe5..3b4fe173489 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/DigitalLocationRequestBody.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/DigitalLocationProperties.java @@ -1,24 +1,23 @@ /* SPDX-License-Identifier: Apache 2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.communityprofile.rest; +package org.odpi.openmetadata.accessservices.communityprofile.properties; import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; -import java.io.Serializable; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; /** - * DigitalLocationRequestBody carries the parameters for marking a location as a digital (cyber) location. + * DigitalLocationProperties carries the parameters for marking a location as a digital (cyber) location. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown=true) -public class DigitalLocationRequestBody implements Serializable +public class DigitalLocationProperties extends ClassificationProperties { private static final long serialVersionUID = 1L; @@ -28,8 +27,9 @@ public class DigitalLocationRequestBody implements Serializable /** * Default constructor */ - public DigitalLocationRequestBody() + public DigitalLocationProperties() { + super(); } @@ -38,8 +38,10 @@ public DigitalLocationRequestBody() * * @param template object to copy */ - public DigitalLocationRequestBody(DigitalLocationRequestBody template) + public DigitalLocationProperties(DigitalLocationProperties template) { + super(template); + if (template != null) { networkAddress = template.getNetworkAddress(); @@ -77,8 +79,11 @@ public void setNetworkAddress(String networkAddress) @Override public String toString() { - return "DigitalLocationRequestBody{" + - "networkAddress='" + networkAddress + '\'' + + return "DigitalLocationProperties{" + + "effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", extendedProperties=" + getExtendedProperties() + + ", networkAddress='" + networkAddress + '\'' + '}'; } @@ -100,7 +105,11 @@ public boolean equals(Object objectToCompare) { return false; } - DigitalLocationRequestBody that = (DigitalLocationRequestBody) objectToCompare; + if (! super.equals(objectToCompare)) + { + return false; + } + DigitalLocationProperties that = (DigitalLocationProperties) objectToCompare; return Objects.equals(networkAddress, that.networkAddress); } @@ -113,6 +122,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(networkAddress); + return Objects.hash(super.hashCode(), networkAddress); } } \ No newline at end of file diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/FixedLocationRequestBody.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/FixedLocationProperties.java similarity index 81% rename from open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/FixedLocationRequestBody.java rename to open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/FixedLocationProperties.java index 47c8b7556ad..fa749d7c6ea 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/FixedLocationRequestBody.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/FixedLocationProperties.java @@ -1,24 +1,23 @@ /* SPDX-License-Identifier: Apache 2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.communityprofile.rest; +package org.odpi.openmetadata.accessservices.communityprofile.properties; import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; -import java.io.Serializable; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; /** - * FixedLocationRequestBody carries the parameters for marking a location as a fixed physical location. + * FixedLocationProperties carries the parameters for marking a location as a fixed physical location. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown=true) -public class FixedLocationRequestBody implements Serializable +public class FixedLocationProperties extends ClassificationProperties { private static final long serialVersionUID = 1L; @@ -32,8 +31,9 @@ public class FixedLocationRequestBody implements Serializable /** * Default constructor */ - public FixedLocationRequestBody() + public FixedLocationProperties() { + super(); } @@ -42,8 +42,10 @@ public FixedLocationRequestBody() * * @param template object to copy */ - public FixedLocationRequestBody(FixedLocationRequestBody template) + public FixedLocationProperties(FixedLocationProperties template) { + super(template); + if (template != null) { coordinates = template.getCoordinates(); @@ -150,8 +152,11 @@ public void setTimeZone(String timeZone) @Override public String toString() { - return "FixedLocationRequestBody{" + - "coordinates='" + coordinates + '\'' + + return "FixedLocationProperties{" + + "effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", extendedProperties=" + getExtendedProperties() + + ", coordinates='" + coordinates + '\'' + ", mapProjection='" + mapProjection + '\'' + ", postalAddress='" + postalAddress + '\'' + ", timeZone='" + timeZone + '\'' + @@ -176,7 +181,11 @@ public boolean equals(Object objectToCompare) { return false; } - FixedLocationRequestBody that = (FixedLocationRequestBody) objectToCompare; + if (! super.equals(objectToCompare)) + { + return false; + } + FixedLocationProperties that = (FixedLocationProperties) objectToCompare; return Objects.equals(coordinates, that.coordinates) && Objects.equals(mapProjection, that.mapProjection) && Objects.equals(postalAddress, that.postalAddress) && @@ -192,6 +201,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(coordinates, mapProjection, postalAddress, timeZone); + return Objects.hash(super.hashCode(), coordinates, mapProjection, postalAddress, timeZone); } } \ No newline at end of file diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/LocationProperties.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/LocationProperties.java index bd995c504fb..1f032c6a4b3 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/LocationProperties.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/LocationProperties.java @@ -22,6 +22,7 @@ public class LocationProperties extends ReferenceableProperties { private static final long serialVersionUID = 1L; + private String identifier = null; private String displayName = null; private String description = null; @@ -46,12 +47,35 @@ public LocationProperties(LocationProperties template) if (template != null) { + identifier = template.getIdentifier(); displayName = template.getDisplayName(); description = template.getDescription(); } } + /** + * Return the code value or symbol used to identify the location - typically unique. + * + * @return string identifier + */ + public String getIdentifier() + { + return identifier; + } + + + /** + * Set up the code value or symbol used to identify the location - typically unique. + * + * @param identifier string identifier + */ + public void setIdentifier(String identifier) + { + this.identifier = identifier; + } + + /** * Return a human memorable name for the location. * @@ -105,7 +129,8 @@ public void setDescription(String description) public String toString() { return "LocationProperties{" + - "displayName='" + displayName + '\'' + + "identifier='" + identifier + '\'' + + ", displayName='" + displayName + '\'' + ", description='" + description + '\'' + ", qualifiedName='" + getQualifiedName() + '\'' + ", additionalProperties=" + getAdditionalProperties() + @@ -140,7 +165,8 @@ public boolean equals(Object objectToCompare) return false; } LocationProperties that = (LocationProperties) objectToCompare; - return Objects.equals(displayName, that.displayName) && + return Objects.equals(identifier, that.identifier) && + Objects.equals(displayName, that.displayName) && Objects.equals(description, that.description); } @@ -153,6 +179,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), displayName, description); + return Objects.hash(super.hashCode(), identifier, displayName, description); } } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/NestedLocationProperties.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/NestedLocationProperties.java new file mode 100644 index 00000000000..1d459454ed5 --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/NestedLocationProperties.java @@ -0,0 +1,57 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.communityprofile.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * NestedLocationProperties describes the properties for the NestedLocation relationship between locations. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class NestedLocationProperties extends RelationshipProperties +{ + private static final long serialVersionUID = 1L; + + + /** + * Default constructor + */ + public NestedLocationProperties() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public NestedLocationProperties(NestedLocationProperties template) + { + super(template); + } + + + /** + * JSON-style toString. + * + * @return list of properties and their values. + */ + @Override + public String toString() + { + return "NestedLocationProperties{" + + "effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", extendedProperties=" + getExtendedProperties() + + '}'; + } +} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/PersonRoleProperties.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/PersonRoleProperties.java index 41c5e6b8dec..17424dae53a 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/PersonRoleProperties.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/PersonRoleProperties.java @@ -47,7 +47,8 @@ public PersonRoleProperties(PersonRoleProperties template) if (template != null) { - + this.headCountLimitSet = template.getHeadCountLimitSet(); + this.headCount = template.getHeadCount(); } } @@ -108,10 +109,12 @@ public String toString() return "PersonRoleProperties{" + "headCountLimitSet=" + headCountLimitSet + ", headCount=" + headCount + + ", qualifiedName='" + getQualifiedName() + '\'' + ", roleId='" + getRoleId() + '\'' + ", scope='" + getScope() + '\'' + ", title='" + getTitle() + '\'' + ", description='" + getDescription() + '\'' + + ", domainIdentifier=" + getDomainIdentifier() + ", additionalProperties=" + getAdditionalProperties() + ", effectiveFrom=" + getEffectiveFrom() + ", effectiveTo=" + getEffectiveTo() + diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/PersonalProfileProperties.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/PersonalProfileProperties.java index a5c5fe3f34c..614e531043f 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/PersonalProfileProperties.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/PersonalProfileProperties.java @@ -28,6 +28,7 @@ public class PersonalProfileProperties extends ActorProfileProperties private String givenNames = null; private String surname = null; private String fullName = null; + private String pronouns = null; private String jobTitle = null; private String employeeNumber = null; private String employeeType = null; @@ -93,6 +94,28 @@ public void setFullName(String fullName) } + /** + * Return the person's preferred pronouns. + * + * @return string + */ + public String getPronouns() + { + return pronouns; + } + + + /** + * Set up the person's preferred pronouns. + * + * @param pronouns string + */ + public void setPronouns(String pronouns) + { + this.pronouns = pronouns; + } + + /** * Return the primary job title for this person. * diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/PersonalRoleProperties.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/PersonalRoleProperties.java index 665f57029ed..1fd6637cbad 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/PersonalRoleProperties.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/PersonalRoleProperties.java @@ -24,10 +24,13 @@ public class PersonalRoleProperties implements Serializable { private static final long serialVersionUID = 1L; - private String roleId = null; /* qualifiedName */ - private String scope = null; /* scope */ - private String title = null; /* name */ - private String description = null; /* description */ + private String qualifiedName = null; /* qualifiedName */ + private String roleId = null; /* identifier */ + private String scope = null; /* scope */ + private String title = null; /* name */ + private String description = null; /* description */ + + private int domainIdentifier = 0; /* Zero means not specific to a governance domain */ private Map additionalProperties = null; @@ -55,10 +58,12 @@ public PersonalRoleProperties(PersonalRoleProperties template) { if (template != null) { + this.qualifiedName = template.getQualifiedName(); this.roleId = template.getRoleId(); this.scope = template.getScope(); this.title = template.getTitle(); this.description = template.getDescription(); + this.domainIdentifier = template.getDomainIdentifier(); this.additionalProperties = template.getAdditionalProperties(); this.effectiveFrom = template.getEffectiveFrom(); this.effectiveTo = template.getEffectiveTo(); @@ -68,11 +73,34 @@ public PersonalRoleProperties(PersonalRoleProperties template) } + /** - * Return the unique identifier for this job role/appointment. + * Return the unique name for element in open metadata ecosystem. * * @return unique name */ + public String getQualifiedName() + { + return qualifiedName; + } + + + /** + * Set up the unique name for element in open metadata ecosystem. + * + * @param qualifiedName unique name + */ + public void setQualifiedName(String qualifiedName) + { + this.qualifiedName = qualifiedName; + } + + + /** + * Return the unique identifier for this job role/appointment typically from an HR system. + * + * @return unique identifier + */ public String getRoleId() { return roleId; @@ -82,7 +110,7 @@ public String getRoleId() /** * Set up the unique identifier for this job role/appointment. * - * @param roleId unique name + * @param roleId unique identifier */ public void setRoleId(String roleId) { @@ -90,8 +118,9 @@ public void setRoleId(String roleId) } + /** - * Return the context in which the governance officer is appointed. This may be an organizational scope, + * Return the context in which the person is appointed. This may be an organizational scope, * location, or scope of assets. * * @return string description @@ -103,7 +132,7 @@ public String getScope() /** - * Set up the context in which the governance officer is appointed. This may be an organizational scope, + * Set up the context in which the person is appointed. This may be an organizational scope, * location, or scope of assets. * * @param scope string description @@ -137,9 +166,7 @@ public void setTitle(String title) /** - * Return the description of the job role for this governance appointment. This may relate to the specific - * governance responsibilities, or may be their main role if the governance responsibilities are - * just an adjunct to their main role. + * Return the description of the job role. * * @return string description */ @@ -150,9 +177,7 @@ public String getDescription() /** - * Set up the description of the job role for this governance officer. This may relate to the specific - * governance responsibilities, or may be their main role if the governance responsibilities are - * just an adjunct to their main role. + * Set up the description of the job role. * * @param description string description */ @@ -162,10 +187,34 @@ public void setDescription(String description) } + /** + * Return the identifier of the governance domain that this role belongs to. Zero means that the + * role is not specific to any domain. + * + * @return int + */ + public int getDomainIdentifier() + { + return domainIdentifier; + } + + + /** + * Set up the identifier of the governance domain that this role belongs to. Zero means that the + * role is not specific to any domain. + * + * @param domainIdentifier int + */ + public void setDomainIdentifier(int domainIdentifier) + { + this.domainIdentifier = domainIdentifier; + } + + /** * Return a copy of the additional properties. Null means no additional properties are available. * - * @return AdditionalProperties + * @return AdditionalProperties map */ public Map getAdditionalProperties() { @@ -187,7 +236,7 @@ else if (additionalProperties.isEmpty()) /** * Set up additional properties. * - * @param additionalProperties Additional properties object + * @param additionalProperties Additional properties map */ public void setAdditionalProperties(Map additionalProperties) { @@ -307,10 +356,12 @@ public void setExtendedProperties(Map extendedProperties) public String toString() { return "PersonalRoleProperties{" + - "roleId='" + roleId + '\'' + + "qualifiedName='" + qualifiedName + '\'' + + ", roleId='" + roleId + '\'' + ", scope='" + scope + '\'' + ", title='" + title + '\'' + ", description='" + description + '\'' + + ", domainIdentifier=" + domainIdentifier + ", additionalProperties=" + additionalProperties + ", effectiveFrom=" + effectiveFrom + ", effectiveTo=" + effectiveTo + @@ -338,7 +389,9 @@ public boolean equals(Object objectToCompare) return false; } PersonalRoleProperties that = (PersonalRoleProperties) objectToCompare; - return Objects.equals(roleId, that.roleId) && + return domainIdentifier == that.domainIdentifier && + Objects.equals(qualifiedName, that.qualifiedName) && + Objects.equals(roleId, that.roleId) && Objects.equals(scope, that.scope) && Objects.equals(title, that.title) && Objects.equals(description, that.description) && @@ -358,6 +411,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(roleId, scope, title, description, additionalProperties, effectiveFrom, effectiveTo, typeName, extendedProperties); + return Objects.hash(qualifiedName, roleId, scope, title, description, domainIdentifier, additionalProperties, effectiveFrom, effectiveTo, typeName, extendedProperties); } } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ProfileLocationProperties.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ProfileLocationProperties.java new file mode 100644 index 00000000000..455ae746251 --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ProfileLocationProperties.java @@ -0,0 +1,129 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.communityprofile.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.io.Serializable; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ProfileLocationProperties describes the properties for the ProfileLocation relationship between a profile + * and a location. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ProfileLocationProperties extends RelationshipProperties +{ + private static final long serialVersionUID = 1L; + + private String associationType = null; + + + /** + * Default constructor + */ + public ProfileLocationProperties() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ProfileLocationProperties(ProfileLocationProperties template) + { + super(template); + + if (template != null) + { + associationType = template.getAssociationType(); + } + } + + + /** + * Return the type of the association. + * + * @return string + */ + public String getAssociationType() + { + return associationType; + } + + + /** + * Set up the type of the association. + * + * @param associationType string + */ + public void setAssociationType(String associationType) + { + this.associationType = associationType; + } + + + /** + * JSON-style toString. + * + * @return list of properties and their values. + */ + @Override + public String toString() + { + return "ProfileLocationProperties{" + + "associationType='" + associationType + '\'' + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", extendedProperties=" + getExtendedProperties() + + '}'; + } + + + /** + * Equals method that returns true if containing properties are the same. + * + * @param objectToCompare object to compare + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (! super.equals(objectToCompare)) + { + return false; + } + ProfileLocationProperties that = (ProfileLocationProperties) objectToCompare; + return Objects.equals(associationType, that.associationType); + } + + + /** + * Hash code for this object + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), associationType); + } +} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ProjectProperties.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ProjectProperties.java index 1b121772e5b..f5633058197 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ProjectProperties.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ProjectProperties.java @@ -21,6 +21,7 @@ public class ProjectProperties extends ReferenceableProperties { private static final long serialVersionUID = 1L; + private String identifier = null; private String name = null; private String description = null; private String status = null; @@ -48,6 +49,7 @@ public ProjectProperties(ProjectProperties template) if (template != null) { + this.identifier = template.getIdentifier(); this.name = template.getName(); this.description = template.getDescription(); this.status = template.getStatus(); @@ -57,6 +59,28 @@ public ProjectProperties(ProjectProperties template) } + /** + * Return the code value or symbol used to identify the project - typically unique. + * + * @return string identifier + */ + public String getIdentifier() + { + return identifier; + } + + + /** + * Set up the code value or symbol used to identify the project - typically unique. + * + * @param identifier string identifier + */ + public void setIdentifier(String identifier) + { + this.identifier = identifier; + } + + /** * Return the name of the project. @@ -192,7 +216,8 @@ public void setPlannedEndDate(Date plannedEndDate) public String toString() { return "ProjectProperties{" + - "name='" + name + '\'' + + "identifier='" + identifier + '\'' + + ", name='" + name + '\'' + ", description='" + description + '\'' + ", status='" + status + '\'' + ", startDate=" + startDate + @@ -225,14 +250,15 @@ public boolean equals(Object objectToCompare) { return false; } - if (!super.equals(objectToCompare)) + if (! super.equals(objectToCompare)) { return false; } ProjectProperties that = (ProjectProperties) objectToCompare; - return Objects.equals(status, that.status) && - Objects.equals(getName(), that.getName()) && - Objects.equals(getDescription(), that.getDescription()) && + return Objects.equals(identifier, that.identifier) && + Objects.equals(name, that.name) && + Objects.equals(description, that.description) && + Objects.equals(status, that.status) && Objects.equals(startDate, that.startDate) && Objects.equals(plannedEndDate, that.plannedEndDate); } @@ -246,6 +272,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), getName(), getDescription(), getStatus(), getStartDate(), getPlannedEndDate()); + return Objects.hash(super.hashCode(), identifier, name, description, status, startDate, plannedEndDate); } } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/RelationshipProperties.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/RelationshipProperties.java new file mode 100644 index 00000000000..7a34733c8e6 --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/RelationshipProperties.java @@ -0,0 +1,203 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.communityprofile.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + +import java.io.Serializable; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * RelationshipProperties provides the base class for relationships items. This provides extended properties with the ability to + * set effectivity dates. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "class") +@JsonSubTypes( + { + @JsonSubTypes.Type(value = ResourceListProperties.class, name = "ResourceListProperties"), + @JsonSubTypes.Type(value = AssignmentScopeProperties.class, name = "AssignmentScopeProperties"), + @JsonSubTypes.Type(value = StakeholderProperties.class, name = "StakeholderProperties"), + @JsonSubTypes.Type(value = ProfileLocationProperties.class, name = "ProfileLocationProperties"), + @JsonSubTypes.Type(value = AssetLocationProperties.class, name = "AssetLocationProperties"), + @JsonSubTypes.Type(value = AdjacentLocationProperties.class, name = "AdjacentLocationProperties"), + @JsonSubTypes.Type(value = NestedLocationProperties.class, name = "NestedLocationProperties"), + }) +public class RelationshipProperties implements Serializable +{ + private static final long serialVersionUID = 1L; + + private Date effectiveFrom = null; + private Date effectiveTo = null; + + private Map extendedProperties = null; + + + /** + * Default constructor + */ + public RelationshipProperties() + { + super(); + } + + + /** + * Copy/clone constructor. Retrieve values from the supplied template + * + * @param template element to copy + */ + public RelationshipProperties(RelationshipProperties template) + { + if (template != null) + { + effectiveFrom = template.getEffectiveFrom(); + effectiveTo = template.getEffectiveTo(); + extendedProperties = template.getExtendedProperties(); + } + } + + + /** + * Return the date/time that this element is effective from (null means effective from the epoch). + * + * @return date object + */ + public Date getEffectiveFrom() + { + return effectiveFrom; + } + + + /** + * Set up the date/time that this element is effective from (null means effective from the epoch). + * + * @param effectiveFrom date object + */ + public void setEffectiveFrom(Date effectiveFrom) + { + this.effectiveFrom = effectiveFrom; + } + + + /** + * Return the date/time that element is effective to (null means that it is effective indefinitely into the future). + * + * @return date object + */ + public Date getEffectiveTo() + { + return effectiveTo; + } + + + /** + * Set the date/time that element is effective to (null means that it is effective indefinitely into the future). + * + * @param effectiveTo date object + */ + public void setEffectiveTo(Date effectiveTo) + { + this.effectiveTo = effectiveTo; + } + + + /** + * Return the properties that have been defined for a subtype of this object that are not supported explicitly + * by this bean. + * + * @return property map + */ + public Map getExtendedProperties() + { + if (extendedProperties == null) + { + return null; + } + else if (extendedProperties.isEmpty()) + { + return null; + } + else + { + return new HashMap<>(extendedProperties); + } + } + + + /** + * Set up the properties that have been defined for a subtype of this object that are not supported explicitly + * by this bean. + * + * @param extendedProperties property map + */ + public void setExtendedProperties(Map extendedProperties) + { + this.extendedProperties = extendedProperties; + } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "RelationshipProperties{" + + "effectiveFrom=" + effectiveFrom + + ", effectiveTo=" + effectiveTo + + ", extendedProperties=" + extendedProperties + + '}'; + } + + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + RelationshipProperties that = (RelationshipProperties) objectToCompare; + return Objects.equals(effectiveFrom, that.effectiveFrom) && + Objects.equals(effectiveTo, that.effectiveTo); + } + + + /** + * Return has code based on properties. + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(effectiveFrom, effectiveTo); + } +} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ResourceListProperties.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ResourceListProperties.java new file mode 100644 index 00000000000..ecb562e5783 --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ResourceListProperties.java @@ -0,0 +1,150 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.communityprofile.properties; + + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ResourceListProperties provides a details of why an element providing resources (such as a community) has been attached to an initiative + * such as a governance domain. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ResourceListProperties extends RelationshipProperties +{ + private static final long serialVersionUID = 1L; + + String resourceUse = null; + boolean watchResource = false; + + /** + * Default constructor + */ + public ResourceListProperties() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ResourceListProperties(ResourceListProperties template) + { + super(template); + + if (template != null) + { + this.resourceUse = template.getResourceUse(); + this.watchResource = template.getWatchResource(); + } + } + + + /** + * Return the reason why the resource has been attached to the initiative. + * + * @return description + */ + public String getResourceUse() + { + return resourceUse; + } + + + /** + * Set up the reason why the resource has been attached to the initiative. + * + * @param resourceUse description + */ + public void setResourceUse(String resourceUse) + { + this.resourceUse = resourceUse; + } + + + /** + * Return whether changes to the resource result in notifications to the initiative. + * + * @return flag + */ + public boolean getWatchResource() + { + return watchResource; + } + + + /** + * Set up whether changes to the resource result in notifications to the initiative. + * + * @param watchResource flag + */ + public void setWatchResource(boolean watchResource) + { + this.watchResource = watchResource; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ResourceListProperties{" + + "resourceUse='" + resourceUse + '\'' + + ", watchResource=" + watchResource + + '}'; + } + + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (! super.equals(objectToCompare)) + { + return false; + } + ResourceListProperties that = (ResourceListProperties) objectToCompare; + return watchResource == that.watchResource && Objects.equals(resourceUse, that.resourceUse); + } + + + /** + * Return has code based on properties. + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), resourceUse, watchResource); + } +} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/SecureLocationRequestBody.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/SecureLocationProperties.java similarity index 72% rename from open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/SecureLocationRequestBody.java rename to open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/SecureLocationProperties.java index 79197fee114..a9386217381 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/SecureLocationRequestBody.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/SecureLocationProperties.java @@ -1,24 +1,23 @@ /* SPDX-License-Identifier: Apache 2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.communityprofile.rest; +package org.odpi.openmetadata.accessservices.communityprofile.properties; import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; -import java.io.Serializable; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; /** - * SecureLocationRequestBody carries the parameters for marking a location as secure. + * SecureLocationProperties carries the parameters for marking a location as secure. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown=true) -public class SecureLocationRequestBody implements Serializable +public class SecureLocationProperties extends ClassificationProperties { private static final long serialVersionUID = 1L; @@ -29,8 +28,9 @@ public class SecureLocationRequestBody implements Serializable /** * Default constructor */ - public SecureLocationRequestBody() + public SecureLocationProperties() { + super(); } @@ -39,13 +39,14 @@ public SecureLocationRequestBody() * * @param template object to copy */ - public SecureLocationRequestBody(SecureLocationRequestBody template) + public SecureLocationProperties(SecureLocationProperties template) { + super(template); + if (template != null) { description = template.getDescription(); level = template.getLevel(); - } } @@ -102,8 +103,11 @@ public void setLevel(String level) @Override public String toString() { - return "SecureLocationRequestBody{" + - "description='" + description + '\'' + + return "SecureLocationProperties{" + + "effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", extendedProperties=" + getExtendedProperties() + + ", description='" + description + '\'' + ", level='" + level + '\'' + '}'; } @@ -126,9 +130,12 @@ public boolean equals(Object objectToCompare) { return false; } - SecureLocationRequestBody that = (SecureLocationRequestBody) objectToCompare; - return Objects.equals(description, that.description) && - Objects.equals(level, that.level); + if (! super.equals(objectToCompare)) + { + return false; + } + SecureLocationProperties that = (SecureLocationProperties) objectToCompare; + return Objects.equals(description, that.description) && Objects.equals(level, that.level); } @@ -140,6 +147,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(description, level); + return Objects.hash(super.hashCode(), description, level); } } \ No newline at end of file diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/StakeholderProperties.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/StakeholderProperties.java new file mode 100644 index 00000000000..6cb654c45ab --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/StakeholderProperties.java @@ -0,0 +1,127 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.communityprofile.properties; + + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * StakeholderProperties provides a details of a stakeholder for an initiative. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class StakeholderProperties extends RelationshipProperties +{ + private static final long serialVersionUID = 1L; + + String stakeholderRole = null; + + /** + * Default constructor + */ + public StakeholderProperties() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public StakeholderProperties(StakeholderProperties template) + { + super(template); + + if (template != null) + { + this.stakeholderRole = template.getStakeholderRole(); + } + } + + + /** + * Return the role of the stakeholder to the initiative. + * + * @return role type + */ + public String getStakeholderRole() + { + return stakeholderRole; + } + + + /** + * Set up the role of the stakeholder to the initiative. + * + * @param stakeholderRole role type + */ + public void setStakeholderRole(String stakeholderRole) + { + this.stakeholderRole = stakeholderRole; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "StakeholderProperties{" + + "effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", extendedProperties=" + getExtendedProperties() + + ", stakeholderRole='" + stakeholderRole + '\'' + + '}'; + } + + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (! super.equals(objectToCompare)) + { + return false; + } + StakeholderProperties that = (StakeholderProperties) objectToCompare; + return Objects.equals(stakeholderRole, that.stakeholderRole); + } + + + /** + * Return has code based on properties. + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), stakeholderRole); + } +} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/TeamProfileProperties.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/TeamProfileProperties.java index f7d6141bc07..494e4c24216 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/TeamProfileProperties.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/TeamProfileProperties.java @@ -22,6 +22,7 @@ public class TeamProfileProperties extends ActorProfileProperties private static final long serialVersionUID = 1L; private String teamType = null; + private String identifier = null; /** @@ -71,6 +72,28 @@ public void setTeamType(String teamType) } + /** + * Return the code that uniquely identifies the team. + * + * @return string code + */ + public String getIdentifier() + { + return identifier; + } + + + /** + * Set up the code that uniquely identifies the team. + * + * @param identifier string code + */ + public void setIdentifier(String identifier) + { + this.identifier = identifier; + } + + /** * JSON-style toString. * diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/TemplateProperties.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/TemplateProperties.java index d3ae77d30ee..b0f93d93227 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/TemplateProperties.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/TemplateProperties.java @@ -25,6 +25,7 @@ public class TemplateProperties implements Serializable private static final long serialVersionUID = 1L; private String qualifiedName = null; + private String identifier = null; private String displayName = null; private String description = null; @@ -47,6 +48,7 @@ public TemplateProperties(TemplateProperties template) if (template != null) { qualifiedName = template.getQualifiedName(); + identifier = template.getIdentifier(); displayName = template.getDisplayName(); description = template.getDescription(); } @@ -76,6 +78,28 @@ public void setQualifiedName(String qualifiedName) } + /** + * Return the code value or symbol used to identify the element - typically unique. + * + * @return string identifier + */ + public String getIdentifier() + { + return identifier; + } + + + /** + * Set up the code value or symbol used to identify the element - typically unique. + * + * @param identifier string identifier + */ + public void setIdentifier(String identifier) + { + this.identifier = identifier; + } + + /** * Returns the stored display name property for the metadata entity. * If no display name is available then null is returned. @@ -121,6 +145,7 @@ public void setDescription(String description) this.description = description; } + /** * Standard toString method. * @@ -131,6 +156,7 @@ public String toString() { return "TemplateProperties{" + "qualifiedName='" + qualifiedName + '\'' + + ", identifier='" + identifier + '\'' + ", displayName='" + displayName + '\'' + ", description='" + description + '\'' + '}'; @@ -156,8 +182,9 @@ public boolean equals(Object objectToCompare) } TemplateProperties that = (TemplateProperties) objectToCompare; return Objects.equals(qualifiedName, that.qualifiedName) && - Objects.equals(displayName, that.displayName) && - Objects.equals(description, that.description); + Objects.equals(identifier, that.identifier) && + Objects.equals(displayName, that.displayName) && + Objects.equals(description, that.description); } @@ -169,6 +196,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(qualifiedName, displayName, description); + return Objects.hash(qualifiedName, identifier, displayName, description); } } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/UserIdentityProperties.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/UserIdentityProperties.java index 08114ac67f5..9eaaeed345e 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/UserIdentityProperties.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/UserIdentityProperties.java @@ -21,6 +21,7 @@ public class UserIdentityProperties extends ReferenceableProperties { private static final long serialVersionUID = 1L; + private String userId = null; private String distinguishedName = null; @@ -41,6 +42,34 @@ public UserIdentityProperties() public UserIdentityProperties(UserIdentityProperties template) { super(template); + + if (template != null) + { + this.userId = template.getUserId(); + this.distinguishedName = template.getDistinguishedName(); + } + } + + + /** + * Return the identifier of the user's account + * + * @return string + */ + public String getUserId() + { + return userId; + } + + + /** + * Return the identifier of the user's account. + * + * @param userId string + */ + public void setUserId(String userId) + { + this.userId = userId; } @@ -75,14 +104,15 @@ public void setDistinguishedName(String distinguishedName) public String toString() { return "UserIdentityProperties{" + - "distinguishedName='" + distinguishedName + '\'' + - ", qualifiedName='" + getQualifiedName() + '\'' + + "qualifiedName='" + getQualifiedName() + '\'' + ", additionalProperties=" + getAdditionalProperties() + ", effectiveFrom=" + getEffectiveFrom() + ", effectiveTo=" + getEffectiveTo() + ", vendorProperties=" + getVendorProperties() + ", typeName='" + getTypeName() + '\'' + ", extendedProperties=" + getExtendedProperties() + + ", userId='" + userId + '\'' + + ", distinguishedName='" + distinguishedName + '\'' + '}'; } @@ -104,12 +134,13 @@ public boolean equals(Object objectToCompare) { return false; } - if (!super.equals(objectToCompare)) + if (! super.equals(objectToCompare)) { return false; } UserIdentityProperties that = (UserIdentityProperties) objectToCompare; - return Objects.equals(distinguishedName, that.distinguishedName); + return Objects.equals(userId, that.userId) && + Objects.equals(distinguishedName, that.distinguishedName); } @@ -121,6 +152,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), distinguishedName); + return Objects.hash(super.hashCode(), userId, distinguishedName); } } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ActorProfileListResponse.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ActorProfileListResponse.java index ced7d3780d4..46989b5558e 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ActorProfileListResponse.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ActorProfileListResponse.java @@ -16,7 +16,7 @@ /** - * ActorProfileListResponse is the response structure used on the OMAS REST API calls that return a + * ActorProfileListResponse is the response structure used on the OMAS REST API calls that return * a list of profile elements. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ActorProfileRequestBody.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ActorProfileRequestBody.java index bad5f4d1fae..6e78655a55d 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ActorProfileRequestBody.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ActorProfileRequestBody.java @@ -7,7 +7,6 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.communityprofile.properties.ActorProfileProperties; import org.odpi.openmetadata.accessservices.communityprofile.properties.ContributionRecord; -import org.odpi.openmetadata.accessservices.communityprofile.properties.UserIdentityProperties; import java.util.Objects; @@ -20,7 +19,7 @@ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown=true) -public class ActorProfileRequestBody extends MetadataSourceRequestBody +public class ActorProfileRequestBody extends ExternalSourceRequestBody { private static final long serialVersionUID = 1L; diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/AppointmentRequestBody.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/AppointmentRequestBody.java index 6be34cb16d8..ffb059aeb3b 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/AppointmentRequestBody.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/AppointmentRequestBody.java @@ -18,7 +18,7 @@ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown=true) -public class AppointmentRequestBody extends MetadataSourceRequestBody +public class AppointmentRequestBody extends ExternalSourceRequestBody { private static final long serialVersionUID = 1L; diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ClassificationRequestBody.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ClassificationRequestBody.java new file mode 100644 index 00000000000..40e195a3398 --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ClassificationRequestBody.java @@ -0,0 +1,129 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.communityprofile.rest; + + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.communityprofile.properties.ClassificationProperties; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + + +/** + * ClassificationRequestBody describes the request body used when attaching classification to elements. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ClassificationRequestBody extends ExternalSourceRequestBody +{ + private static final long serialVersionUID = 1L; + + private ClassificationProperties properties = null; + + + /** + * Default constructor + */ + public ClassificationRequestBody() + { + super(); + } + + + /** + * Copy/clone constructor. + * + * @param template object to copy + */ + public ClassificationRequestBody(ClassificationRequestBody template) + { + super(template); + + if (template != null) + { + properties = template.getProperties(); + } + } + + + /** + * Return the properties for the classification. + * + * @return properties object + */ + public ClassificationProperties getProperties() + { + return properties; + } + + + /** + * Set up the properties for the classification. + * + * @param properties properties object + */ + public void setProperties(ClassificationProperties properties) + { + this.properties = properties; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ClassificationRequestBody{" + + "externalSourceGUID='" + getExternalSourceGUID() + '\'' + + ", externalSourceName='" + getExternalSourceName() + '\'' + + ", properties=" + properties + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + ClassificationRequestBody that = (ClassificationRequestBody) objectToCompare; + return Objects.equals(getProperties(), that.getProperties()); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), properties); + } +} diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/rest/PersonalProfileListResponse.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/CommunityListResponse.java similarity index 65% rename from open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/rest/PersonalProfileListResponse.java rename to open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/CommunityListResponse.java index 5a3630d4bc3..c42e039cc37 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/rest/PersonalProfileListResponse.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/CommunityListResponse.java @@ -1,11 +1,11 @@ /* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.governanceprogram.rest; +package org.odpi.openmetadata.accessservices.communityprofile.rest; import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; -import org.odpi.openmetadata.accessservices.governanceprogram.metadataelements.PersonalProfileElement; +import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.CommunityElement; import java.util.Arrays; import java.util.List; @@ -16,23 +16,23 @@ /** - * PersonalProfileListResponse is the response structure used on the OMAS REST API calls that return a - * a list of personal profile objects. + * CommunityListResponse is the response structure used on the OMAS REST API calls that return + * a list of community elements. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown=true) -public class PersonalProfileListResponse extends GovernanceProgramOMASAPIResponse +public class CommunityListResponse extends CommunityProfileOMASAPIResponse { private static final long serialVersionUID = 1L; - private List personalProfiles = null; + private List elements = null; /** * Default constructor */ - public PersonalProfileListResponse() + public CommunityListResponse() { super(); } @@ -43,47 +43,47 @@ public PersonalProfileListResponse() * * @param template object to copy */ - public PersonalProfileListResponse(PersonalProfileListResponse template) + public CommunityListResponse(CommunityListResponse template) { super(template); if (template != null) { - this.personalProfiles = template.getPersonalProfiles(); + this.elements = template.getElements(); } } /** - * Return the personalProfile result. + * Return the community result. * * @return unique identifier */ - public List getPersonalProfiles() + public List getElements() { - if (personalProfiles == null) + if (elements == null) { return null; } - else if (personalProfiles.isEmpty()) + else if (elements.isEmpty()) { return null; } else { - return personalProfiles; + return elements; } } /** - * Set up the personalProfile result. + * Set up the community result. * - * @param personalProfiles - unique identifier + * @param elements - unique identifier */ - public void setPersonalProfiles(List personalProfiles) + public void setElements(List elements) { - this.personalProfiles = personalProfiles; + this.elements = elements; } @@ -95,8 +95,8 @@ public void setPersonalProfiles(List personalProfiles) @Override public String toString() { - return "PersonalProfileListResponse{" + - "personalProfiles='" + getPersonalProfiles() + '\'' + + return "CommunityListResponse{" + + "elements=" + elements + ", exceptionClassName='" + getExceptionClassName() + '\'' + ", exceptionCausedBy='" + getExceptionCausedBy() + '\'' + ", actionDescription='" + getActionDescription() + '\'' + @@ -124,7 +124,7 @@ public boolean equals(Object objectToCompare) { return true; } - if (!(objectToCompare instanceof PersonalProfileListResponse)) + if (!(objectToCompare instanceof CommunityListResponse)) { return false; } @@ -132,8 +132,8 @@ public boolean equals(Object objectToCompare) { return false; } - PersonalProfileListResponse that = (PersonalProfileListResponse) objectToCompare; - return Objects.equals(getPersonalProfiles(), that.getPersonalProfiles()); + CommunityListResponse that = (CommunityListResponse) objectToCompare; + return Objects.equals(getElements(), that.getElements()); } @@ -145,6 +145,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), personalProfiles); + return Objects.hash(super.hashCode(), elements); } } diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/rest/PersonalProfileResponse.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/CommunityResponse.java similarity index 65% rename from open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/rest/PersonalProfileResponse.java rename to open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/CommunityResponse.java index b29cf31b324..d0ee59e9d3f 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/rest/PersonalProfileResponse.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/CommunityResponse.java @@ -1,11 +1,11 @@ /* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.governanceprogram.rest; +package org.odpi.openmetadata.accessservices.communityprofile.rest; import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; -import org.odpi.openmetadata.accessservices.governanceprogram.metadataelements.PersonalProfileElement; +import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.CommunityElement; import java.util.Arrays; import java.util.Objects; @@ -15,23 +15,23 @@ /** - * PersonalProfileResponse is the response structure used on the OMAS REST API calls that return a - * PersonalProfileElement object as a response. + * CommunityResponse is the response structure used on the OMAS REST API calls that return a + * CommunityElement object as a response. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown=true) -public class PersonalProfileResponse extends GovernanceProgramOMASAPIResponse +public class CommunityResponse extends CommunityProfileOMASAPIResponse { private static final long serialVersionUID = 1L; - private PersonalProfileElement personalProfile = null; + private CommunityElement element = null; /** * Default constructor */ - public PersonalProfileResponse() + public CommunityResponse() { super(); } @@ -42,36 +42,36 @@ public PersonalProfileResponse() * * @param template object to copy */ - public PersonalProfileResponse(PersonalProfileResponse template) + public CommunityResponse(CommunityResponse template) { super(template); if (template != null) { - this.personalProfile = template.getPersonalProfile(); + this.element = template.getElement(); } } /** - * Return the personalProfile result. + * Return the element result. * - * @return details of individual + * @return details of person role */ - public PersonalProfileElement getPersonalProfile() + public CommunityElement getElement() { - return personalProfile; + return element; } /** - * Set up the personalProfile result. + * Set up the element result. * - * @param personalProfile details of individual + * @param element details of person role */ - public void setPersonalProfile(PersonalProfileElement personalProfile) + public void setElement(CommunityElement element) { - this.personalProfile = personalProfile; + this.element = element; } @@ -83,8 +83,8 @@ public void setPersonalProfile(PersonalProfileElement personalProfile) @Override public String toString() { - return "PersonalProfileResponse{" + - "personalProfiles='" + getPersonalProfile() + '\'' + + return "CommunityResponse{" + + "element=" + element + ", exceptionClassName='" + getExceptionClassName() + '\'' + ", exceptionCausedBy='" + getExceptionCausedBy() + '\'' + ", actionDescription='" + getActionDescription() + '\'' + @@ -112,7 +112,7 @@ public boolean equals(Object objectToCompare) { return true; } - if (!(objectToCompare instanceof PersonalProfileResponse)) + if (!(objectToCompare instanceof CommunityResponse)) { return false; } @@ -120,8 +120,8 @@ public boolean equals(Object objectToCompare) { return false; } - PersonalProfileResponse that = (PersonalProfileResponse) objectToCompare; - return Objects.equals(personalProfile, that.personalProfile); + CommunityResponse that = (CommunityResponse) objectToCompare; + return Objects.equals(element, that.element); } @@ -133,6 +133,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), personalProfile); + return Objects.hash(super.hashCode(), element); } } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ContactMethodRequestBody.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ContactMethodRequestBody.java index 9c904e22880..46df58cfe9f 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ContactMethodRequestBody.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ContactMethodRequestBody.java @@ -18,7 +18,7 @@ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown=true) -public class ContactMethodRequestBody extends MetadataSourceRequestBody +public class ContactMethodRequestBody extends ExternalSourceRequestBody { private static final long serialVersionUID = 1L; diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/EffectiveDatesRequestBody.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/EffectiveDatesRequestBody.java index f7ba19c2f38..63014a3cc95 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/EffectiveDatesRequestBody.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/EffectiveDatesRequestBody.java @@ -13,12 +13,12 @@ import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; /** - * MetadataSourceRequestBody carries the parameters for marking an asset or schema as external. + * ExternalSourceRequestBody carries the parameters for marking an asset or schema as external. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown=true) -public class EffectiveDatesRequestBody extends MetadataSourceRequestBody +public class EffectiveDatesRequestBody extends ExternalSourceRequestBody { private static final long serialVersionUID = 1L; diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/MetadataSourceRequestBody.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ExternalSourceRequestBody.java similarity index 91% rename from open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/MetadataSourceRequestBody.java rename to open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ExternalSourceRequestBody.java index 2e1c390ac36..6066818ba98 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/MetadataSourceRequestBody.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ExternalSourceRequestBody.java @@ -12,12 +12,12 @@ import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; /** - * MetadataSourceRequestBody carries the parameters for marking an asset or schema as external. + * ExternalSourceRequestBody carries the parameters for marking an asset or schema as external. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown=true) -public class MetadataSourceRequestBody extends CommunityProfileOMASAPIRequestBody +public class ExternalSourceRequestBody extends CommunityProfileOMASAPIRequestBody { private static final long serialVersionUID = 1L; @@ -28,7 +28,7 @@ public class MetadataSourceRequestBody extends CommunityProfileOMASAPIRequestBod /** * Default constructor */ - public MetadataSourceRequestBody() + public ExternalSourceRequestBody() { super(); } @@ -39,7 +39,7 @@ public MetadataSourceRequestBody() * * @param template object to copy */ - public MetadataSourceRequestBody(MetadataSourceRequestBody template) + public ExternalSourceRequestBody(ExternalSourceRequestBody template) { super(template); @@ -103,7 +103,7 @@ public void setExternalSourceName(String externalSourceName) @Override public String toString() { - return "MetadataSourceRequestBody{" + + return "ExternalSourceRequestBody{" + "externalSourceGUID='" + externalSourceGUID + '\'' + ", externalSourceName='" + externalSourceName + '\'' + '}'; @@ -126,7 +126,7 @@ public boolean equals(Object objectToCompare) { return false; } - MetadataSourceRequestBody that = (MetadataSourceRequestBody) objectToCompare; + ExternalSourceRequestBody that = (ExternalSourceRequestBody) objectToCompare; return Objects.equals(externalSourceGUID, that.externalSourceGUID) && Objects.equals(externalSourceName, that.externalSourceName); } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/LocationsResponse.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/LocationListResponse.java similarity index 77% rename from open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/LocationsResponse.java rename to open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/LocationListResponse.java index 8370bb8afa6..73382047e6d 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/LocationsResponse.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/LocationListResponse.java @@ -16,22 +16,22 @@ import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; /** - * LocationsResponse is a response object for passing back a list of location objects. + * LocationListResponse is a response object for passing back a list of location objects. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown=true) -public class LocationsResponse extends CommunityProfileOMASAPIResponse +public class LocationListResponse extends CommunityProfileOMASAPIResponse { private static final long serialVersionUID = 1L; - private List elementList = null; + private List elements = null; /** * Default constructor */ - public LocationsResponse() + public LocationListResponse() { } @@ -41,13 +41,13 @@ public LocationsResponse() * * @param template object to copy */ - public LocationsResponse(LocationsResponse template) + public LocationListResponse(LocationListResponse template) { super(template); if (template != null) { - elementList = template.getElementList(); + elements = template.getElements(); } } @@ -57,19 +57,19 @@ public LocationsResponse(LocationsResponse template) * * @return result object */ - public List getElementList() + public List getElements() { - if (elementList == null) + if (elements == null) { return null; } - else if (elementList.isEmpty()) + else if (elements.isEmpty()) { return null; } else { - return elementList; + return elements; } } @@ -77,11 +77,11 @@ else if (elementList.isEmpty()) /** * Set up the list of metadata elements to return. * - * @param elementList result object + * @param elements result object */ - public void setElementList(List elementList) + public void setElements(List elements) { - this.elementList = elementList; + this.elements = elements; } @@ -93,8 +93,8 @@ public void setElementList(List elementList) @Override public String toString() { - return "LocationsResponse{" + - "element=" + elementList + + return "LocationListResponse{" + + "element=" + elements + ", exceptionClassName='" + getExceptionClassName() + '\'' + ", exceptionCausedBy='" + getExceptionCausedBy() + '\'' + ", actionDescription='" + getActionDescription() + '\'' + @@ -130,8 +130,8 @@ public boolean equals(Object objectToCompare) { return false; } - LocationsResponse that = (LocationsResponse) objectToCompare; - return Objects.equals(elementList, that.elementList); + LocationListResponse that = (LocationListResponse) objectToCompare; + return Objects.equals(elements, that.elements); } @@ -143,6 +143,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), elementList); + return Objects.hash(super.hashCode(), elements); } } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/PersonRoleListResponse.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/PersonRoleListResponse.java index 750f96591b1..6ea740e0319 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/PersonRoleListResponse.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/PersonRoleListResponse.java @@ -16,7 +16,7 @@ /** - * PersonRoleListResponse is the response structure used on the OMAS REST API calls that return a + * PersonRoleListResponse is the response structure used on the OMAS REST API calls that return * a list of person role elements. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/PersonRoleRequestBody.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/PersonRoleRequestBody.java index 6149f4aed9e..b68c32a258f 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/PersonRoleRequestBody.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/PersonRoleRequestBody.java @@ -18,7 +18,7 @@ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown=true) -public class PersonRoleRequestBody extends MetadataSourceRequestBody +public class PersonRoleRequestBody extends ExternalSourceRequestBody { private static final long serialVersionUID = 1L; diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/PersonalProfileListResponse.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/PersonalProfileListResponse.java index ba6efd8e5ca..fe5f77163d5 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/PersonalProfileListResponse.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/PersonalProfileListResponse.java @@ -16,7 +16,7 @@ /** - * PersonalProfileListResponse is the response structure used on the OMAS REST API calls that return a + * PersonalProfileListResponse is the response structure used on the OMAS REST API calls that return * a list of personal profile objects. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ProfileIdentityRequestBody.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ProfileIdentityRequestBody.java index 2285ca82b20..d1c719e13aa 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ProfileIdentityRequestBody.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ProfileIdentityRequestBody.java @@ -5,7 +5,6 @@ import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; -import org.odpi.openmetadata.accessservices.communityprofile.properties.ContactMethodProperties; import org.odpi.openmetadata.accessservices.communityprofile.properties.ProfileIdentityProperties; import java.util.Objects; @@ -14,12 +13,12 @@ import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; /** - * ContactMethodRequestBody provides the request body payload for working on ContactMethod entities. + * ProfileIdentityRequestBody provides the request body payload for working on ProfileIdentity relationships. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown=true) -public class ProfileIdentityRequestBody extends MetadataSourceRequestBody +public class ProfileIdentityRequestBody extends ExternalSourceRequestBody { private static final long serialVersionUID = 1L; diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ReferenceableRequestBody.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ReferenceableRequestBody.java new file mode 100644 index 00000000000..f85c5e48864 --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ReferenceableRequestBody.java @@ -0,0 +1,129 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.communityprofile.rest; + + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.communityprofile.properties.ReferenceableProperties; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + + +/** + * RelationshipRequestBody describes the request body used when linking elements together. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ReferenceableRequestBody extends ExternalSourceRequestBody +{ + private static final long serialVersionUID = 1L; + + private ReferenceableProperties properties = null; + + + /** + * Default constructor + */ + public ReferenceableRequestBody() + { + super(); + } + + + /** + * Copy/clone constructor. + * + * @param template object to copy + */ + public ReferenceableRequestBody(ReferenceableRequestBody template) + { + super(template); + + if (template != null) + { + properties = template.getProperties(); + } + } + + + /** + * Return the properties for the relationship. + * + * @return properties object + */ + public ReferenceableProperties getProperties() + { + return properties; + } + + + /** + * Set up the properties for the relationship. + * + * @param properties properties object + */ + public void setProperties(ReferenceableProperties properties) + { + this.properties = properties; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ReferenceableRequestBody{" + + "externalSourceGUID='" + getExternalSourceGUID() + '\'' + + ", externalSourceName='" + getExternalSourceName() + '\'' + + ", properties=" + properties + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + ReferenceableRequestBody that = (ReferenceableRequestBody) objectToCompare; + return Objects.equals(getProperties(), that.getProperties()); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), properties); + } +} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/RelatedElementListResponse.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/RelatedElementListResponse.java new file mode 100644 index 00000000000..d462d90e5ab --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/RelatedElementListResponse.java @@ -0,0 +1,148 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.communityprofile.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.RelatedElement; + +import java.util.Arrays; +import java.util.List; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * RelatedElementListResponse is a response object for passing back a list of relatedElement objects. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class RelatedElementListResponse extends CommunityProfileOMASAPIResponse +{ + private static final long serialVersionUID = 1L; + + private List elements = null; + + + /** + * Default constructor + */ + public RelatedElementListResponse() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public RelatedElementListResponse(RelatedElementListResponse template) + { + super(template); + + if (template != null) + { + elements = template.getElements(); + } + } + + + /** + * Return the list of metadata elements. + * + * @return result object + */ + public List getElements() + { + if (elements == null) + { + return null; + } + else if (elements.isEmpty()) + { + return null; + } + else + { + return elements; + } + } + + + /** + * Set up the list of metadata elements to return. + * + * @param elements result object + */ + public void setElements(List elements) + { + this.elements = elements; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "RelatedElementListResponse{" + + "element=" + elements + + ", exceptionClassName='" + getExceptionClassName() + '\'' + + ", exceptionCausedBy='" + getExceptionCausedBy() + '\'' + + ", actionDescription='" + getActionDescription() + '\'' + + ", relatedHTTPCode=" + getRelatedHTTPCode() + + ", exceptionErrorMessage='" + getExceptionErrorMessage() + '\'' + + ", exceptionErrorMessageId='" + getExceptionErrorMessageId() + '\'' + + ", exceptionErrorMessageParameters=" + Arrays.toString(getExceptionErrorMessageParameters()) + + ", exceptionSystemAction='" + getExceptionSystemAction() + '\'' + + ", exceptionUserAction='" + getExceptionUserAction() + '\'' + + ", exceptionProperties=" + getExceptionProperties() + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + RelatedElementListResponse that = (RelatedElementListResponse) objectToCompare; + return Objects.equals(elements, that.elements); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), elements); + } +} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/RelationshipElementResponse.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/RelationshipElementResponse.java new file mode 100644 index 00000000000..7084db6181b --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/RelationshipElementResponse.java @@ -0,0 +1,139 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.communityprofile.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.RelationshipElement; + +import java.util.Arrays; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + + +/** + * RelationshipElementResponse is the response structure used on the OMAS REST API calls that return the properties + * for a relationship. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class RelationshipElementResponse extends CommunityProfileOMASAPIResponse +{ + private static final long serialVersionUID = 1L; + + private RelationshipElement element = null; + + + /** + * Default constructor + */ + public RelationshipElementResponse() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public RelationshipElementResponse(RelationshipElementResponse template) + { + super(template); + + if (template != null) + { + this.element = template.getElement(); + } + } + + + /** + * Return the element result. + * + * @return bean + */ + public RelationshipElement getElement() + { + return element; + } + + + /** + * Set up the element result. + * + * @param element bean + */ + public void setElement(RelationshipElement element) + { + this.element = element; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "RelationshipElementResponse{" + + "element=" + element + + ", exceptionClassName='" + getExceptionClassName() + '\'' + + ", exceptionCausedBy='" + getExceptionCausedBy() + '\'' + + ", actionDescription='" + getActionDescription() + '\'' + + ", relatedHTTPCode=" + getRelatedHTTPCode() + + ", exceptionErrorMessage='" + getExceptionErrorMessage() + '\'' + + ", exceptionErrorMessageId='" + getExceptionErrorMessageId() + '\'' + + ", exceptionErrorMessageParameters=" + Arrays.toString(getExceptionErrorMessageParameters()) + + ", exceptionSystemAction='" + getExceptionSystemAction() + '\'' + + ", exceptionUserAction='" + getExceptionUserAction() + '\'' + + ", exceptionProperties=" + getExceptionProperties() + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (!(objectToCompare instanceof RelationshipElementResponse)) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + RelationshipElementResponse that = (RelationshipElementResponse) objectToCompare; + return Objects.equals(element, that.element); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(element); + } +} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/RelationshipElementsResponse.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/RelationshipElementsResponse.java new file mode 100644 index 00000000000..bb1b8d76e5a --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/RelationshipElementsResponse.java @@ -0,0 +1,150 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.communityprofile.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.RelationshipElement; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * RelationshipElementsResponse is a response object for passing back a list of relationships + * or an exception if the request failed. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class RelationshipElementsResponse extends CommunityProfileOMASAPIResponse +{ + private static final long serialVersionUID = 1L; + + private List elementList = null; + + + /** + * Default constructor + */ + public RelationshipElementsResponse() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public RelationshipElementsResponse(RelationshipElementsResponse template) + { + super(template); + + if (template != null) + { + elementList = template.getElementList(); + } + } + + + /** + * Return the list of metadata elements. + * + * @return result object + */ + public List getElementList() + { + if (elementList == null) + { + return null; + } + else if (elementList.isEmpty()) + { + return null; + } + else + { + return new ArrayList<>(elementList); + } + } + + + /** + * Set up the metadata element to return. + * + * @param elementList result object + */ + public void setElementList(List elementList) + { + this.elementList = elementList; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "RelationshipElementsResponse{" + + "elementList=" + elementList + + ", exceptionClassName='" + getExceptionClassName() + '\'' + + ", exceptionCausedBy='" + getExceptionCausedBy() + '\'' + + ", actionDescription='" + getActionDescription() + '\'' + + ", relatedHTTPCode=" + getRelatedHTTPCode() + + ", exceptionErrorMessage='" + getExceptionErrorMessage() + '\'' + + ", exceptionErrorMessageId='" + getExceptionErrorMessageId() + '\'' + + ", exceptionErrorMessageParameters=" + Arrays.toString(getExceptionErrorMessageParameters()) + + ", exceptionSystemAction='" + getExceptionSystemAction() + '\'' + + ", exceptionUserAction='" + getExceptionUserAction() + '\'' + + ", exceptionProperties=" + getExceptionProperties() + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + RelationshipElementsResponse that = (RelationshipElementsResponse) objectToCompare; + return Objects.equals(elementList, that.elementList); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), elementList); + } +} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/RelationshipRequestBody.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/RelationshipRequestBody.java new file mode 100644 index 00000000000..0d0ffcc2984 --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/RelationshipRequestBody.java @@ -0,0 +1,129 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.communityprofile.rest; + + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.communityprofile.properties.RelationshipProperties; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + + +/** + * RelationshipRequestBody describes the request body used when linking elements together. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class RelationshipRequestBody extends ExternalSourceRequestBody +{ + private static final long serialVersionUID = 1L; + + private RelationshipProperties properties = null; + + + /** + * Default constructor + */ + public RelationshipRequestBody() + { + super(); + } + + + /** + * Copy/clone constructor. + * + * @param template object to copy + */ + public RelationshipRequestBody(RelationshipRequestBody template) + { + super(template); + + if (template != null) + { + properties = template.getProperties(); + } + } + + + /** + * Return the properties for the relationship. + * + * @return properties object + */ + public RelationshipProperties getProperties() + { + return properties; + } + + + /** + * Set up the properties for the relationship. + * + * @param properties properties object + */ + public void setProperties(RelationshipProperties properties) + { + this.properties = properties; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "RelationshipRequestBody{" + + "externalSourceGUID='" + getExternalSourceGUID() + '\'' + + ", externalSourceName='" + getExternalSourceName() + '\'' + + ", properties=" + properties + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + RelationshipRequestBody that = (RelationshipRequestBody) objectToCompare; + return Objects.equals(getProperties(), that.getProperties()); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), properties); + } +} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/TeamPlayerRequestBody.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/TeamPlayerRequestBody.java index 0b4efeeb400..fecaa6a88bd 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/TeamPlayerRequestBody.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/TeamPlayerRequestBody.java @@ -17,7 +17,7 @@ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown=true) -public class TeamPlayerRequestBody extends MetadataSourceRequestBody +public class TeamPlayerRequestBody extends ExternalSourceRequestBody { private static final long serialVersionUID = 1L; diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/TemplateRequestBody.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/TemplateRequestBody.java new file mode 100644 index 00000000000..25f033edbb4 --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/TemplateRequestBody.java @@ -0,0 +1,165 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.communityprofile.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.communityprofile.properties.TemplateProperties; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * TemplateRequestBody carries the parameters for creating a new asset using a template. + * The external source identifiers indicate whether the new asset should be created as an external element or not. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class TemplateRequestBody extends TemplateProperties +{ + private static final long serialVersionUID = 1L; + + private String externalSourceGUID = null; + private String externalSourceName = null; + + + /** + * Default constructor + */ + public TemplateRequestBody() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public TemplateRequestBody(TemplateRequestBody template) + { + super(template); + + if (template != null) + { + externalSourceGUID = template.getExternalSourceGUID(); + externalSourceName = template.getExternalSourceName(); + } + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public TemplateRequestBody(TemplateProperties template) + { + super(template); + } + + + /** + * Return the unique identifier of the software server capability entity that represented the external source - null for local. + * + * @return string guid + */ + public String getExternalSourceGUID() + { + return externalSourceGUID; + } + + + /** + * Set up the unique identifier of the software server capability entity that represented the external source - null for local. + * + * @param externalSourceGUID string guid + */ + public void setExternalSourceGUID(String externalSourceGUID) + { + this.externalSourceGUID = externalSourceGUID; + } + + + /** + * Return the unique name of the software server capability entity that represented the external source. + * + * @return string name + */ + public String getExternalSourceName() + { + return externalSourceName; + } + + + /** + * Set up the unique name of the software server capability entity that represented the external source. + * + * @param externalSourceName string name + */ + public void setExternalSourceName(String externalSourceName) + { + this.externalSourceName = externalSourceName; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "TemplateRequestBody{" + + "externalSourceGUID='" + externalSourceGUID + '\'' + + ", externalSourceName='" + externalSourceName + '\'' + + ", qualifiedName='" + getQualifiedName() + '\'' + + ", displayName='" + getDisplayName() + '\'' + + ", description='" + getDescription() + '\'' + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + TemplateRequestBody that = (TemplateRequestBody) objectToCompare; + return Objects.equals(externalSourceGUID, that.externalSourceGUID) && + Objects.equals(externalSourceName, that.externalSourceName); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), externalSourceGUID, externalSourceName); + } +} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/UserIdentityListResponse.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/UserIdentityListResponse.java index 9db60ec4479..35ccf24c2a8 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/UserIdentityListResponse.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/UserIdentityListResponse.java @@ -16,7 +16,7 @@ /** - * UserIdentityListResponse is the response structure used on the OMAS REST API calls that return a + * UserIdentityListResponse is the response structure used on the OMAS REST API calls that return * a list of user identity elements. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/UserIdentityRequestBody.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/UserIdentityRequestBody.java index 2302c2ba24d..51158784f31 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/UserIdentityRequestBody.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/UserIdentityRequestBody.java @@ -19,7 +19,7 @@ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown=true) -public class UserIdentityRequestBody extends MetadataSourceRequestBody +public class UserIdentityRequestBody extends ExternalSourceRequestBody { private static final long serialVersionUID = 1L; diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityManagement.java b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityManagement.java new file mode 100644 index 00000000000..b3419757d89 --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityManagement.java @@ -0,0 +1,539 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.communityprofile.client; + +import org.odpi.openmetadata.accessservices.communityprofile.api.CommunityManagementInterface; +import org.odpi.openmetadata.accessservices.communityprofile.client.rest.CommunityProfileRESTClient; +import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.CommunityElement; +import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.PersonRoleElement; +import org.odpi.openmetadata.accessservices.communityprofile.properties.CommunityMembershipProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.CommunityProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.TemplateProperties; +import org.odpi.openmetadata.accessservices.communityprofile.rest.CommunityResponse; +import org.odpi.openmetadata.accessservices.communityprofile.rest.CommunityListResponse; +import org.odpi.openmetadata.accessservices.communityprofile.rest.PersonRoleListResponse; +import org.odpi.openmetadata.commonservices.ffdc.rest.NameRequestBody; +import org.odpi.openmetadata.commonservices.ffdc.rest.SearchStringRequestBody; +import org.odpi.openmetadata.frameworks.auditlog.AuditLog; +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; + +import java.util.List; + +/** + * CommunityManagerClient supports the APIs to maintain communities and their related objects. + */ +public class CommunityManagement extends CommunityProfileBaseClient implements CommunityManagementInterface +{ + private static final String communityURLTemplatePrefix = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/communities"; + + + /** + * Create a new client with no authentication embedded in the HTTP request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @param auditLog logging destination + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public CommunityManagement(String serverName, + String serverPlatformURLRoot, + AuditLog auditLog) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot, auditLog); + } + + + /** + * Create a new client with no authentication embedded in the HTTP request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public CommunityManagement(String serverName, + String serverPlatformURLRoot) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot); + } + + + /** + * Create a new client that passes userId and password in each HTTP request. This is the + * userId/password of the calling server. The end user's userId is sent on each request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @param userId caller's userId embedded in all HTTP requests + * @param password caller's userId embedded in all HTTP requests + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public CommunityManagement(String serverName, + String serverPlatformURLRoot, + String userId, + String password) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot, userId, password); + } + + + /** + * Create a new client that passes userId and password in each HTTP request. This is the + * userId/password of the calling server. The end user's userId is sent on each request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @param userId caller's userId embedded in all HTTP requests + * @param password caller's userId embedded in all HTTP requests + * @param auditLog logging destination + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public CommunityManagement(String serverName, + String serverPlatformURLRoot, + String userId, + String password, + AuditLog auditLog) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot, userId, password, auditLog); + } + + + /** + * Create a new client that is going to be used in an OMAG Server. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @param restClient client that issues the REST API calls + * @param maxPageSize maximum number of results supported by this server + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public CommunityManagement(String serverName, + String serverPlatformURLRoot, + CommunityProfileRESTClient restClient, + int maxPageSize) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot, restClient, maxPageSize); + } + + + /* ===================================================================================================================== + * A Community is the top level object for working with connectors + */ + + /** + * Create a new metadata element to represent a community. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param communityProperties properties about the community to store + * + * @return unique identifier of the new community + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public String createCommunity(String userId, + String externalSourceGUID, + String externalSourceName, + CommunityProperties communityProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "createCommunity"; + final String propertiesParameterName = "communityProperties"; + final String urlTemplate = serverPlatformURLRoot + communityURLTemplatePrefix; + + return super.createReferenceable(userId, externalSourceGUID, externalSourceName, communityProperties, propertiesParameterName, urlTemplate, methodName); + } + + + /** + * Create a new metadata element to represent a community using an existing metadata element as a template. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param templateGUID unique identifier of the metadata element to copy + * @param templateProperties properties that override the template + * + * @return unique identifier of the new community + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public String createCommunityFromTemplate(String userId, + String externalSourceGUID, + String externalSourceName, + String templateGUID, + TemplateProperties templateProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "createCommunityFromTemplate"; + final String urlTemplate = serverPlatformURLRoot + communityURLTemplatePrefix + "/from-template/{2}"; + + return super.createReferenceableFromTemplate(userId, externalSourceGUID, externalSourceName, templateGUID, templateProperties, urlTemplate, methodName); + } + + + /** + * Update the metadata element representing a community. It is possible to use the subtype property classes or + * set up specialized properties in extended properties. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param communityGUID unique identifier of the metadata element to update + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param communityProperties new properties for the metadata element + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void updateCommunity(String userId, + String externalSourceGUID, + String externalSourceName, + String communityGUID, + boolean isMergeUpdate, + CommunityProperties communityProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "updateCommunity"; + final String elementGUIDParameterName = "communityGUID"; + final String propertiesParameterName = "communityProperties"; + final String urlTemplate = serverPlatformURLRoot + communityURLTemplatePrefix + "/{2}?isMergeUpdate={3}"; + + super.updateReferenceable(userId, externalSourceGUID, externalSourceName, communityGUID, elementGUIDParameterName, isMergeUpdate, communityProperties, propertiesParameterName, urlTemplate, methodName); + } + + + /** + * Create a membership relationship between a community and a person role to show that anyone appointed to the role is a member of the community. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param communityGUID unique identifier of the community in the external data manager + * @param membershipProperties describes the permissions that the role has in the community + * @param personRoleGUID unique identifier of the person role in the external data manager + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void setupCommunityRole(String userId, + String externalSourceGUID, + String externalSourceName, + String communityGUID, + CommunityMembershipProperties membershipProperties, + String personRoleGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "setupCommunityRole"; + final String communityGUIDParameterName = "communityGUID"; + final String personRoleGUIDParameterName = "personRoleGUID"; + + final String urlTemplate = serverPlatformURLRoot + communityURLTemplatePrefix + "/{2}/community-roles/{3}"; + + super.setupRelationship(userId, externalSourceGUID, externalSourceName, communityGUID, communityGUIDParameterName, membershipProperties, personRoleGUID, personRoleGUIDParameterName, urlTemplate, methodName); + } + + + /** + * Remove a membership relationship between a community and a person role. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param communityGUID unique identifier of the community in the external data manager + * @param personRoleGUID unique identifier of the person role in the external data manager + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void clearCommunityRole(String userId, + String externalSourceGUID, + String externalSourceName, + String communityGUID, + String personRoleGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "clearCommunityRole"; + final String communityGUIDParameterName = "communityGUID"; + final String personRoleGUIDParameterName = "personRoleGUID"; + final String urlTemplate = serverPlatformURLRoot + communityURLTemplatePrefix + "/{2}/community-roles/{3}/delete"; + + super.clearRelationship(userId, + externalSourceGUID, + externalSourceName, + communityGUID, + communityGUIDParameterName, + personRoleGUID, + personRoleGUIDParameterName, + urlTemplate, + methodName); + } + + + /** + * Remove the metadata element representing a community. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param communityGUID unique identifier of the metadata element to remove + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void removeCommunity(String userId, + String externalSourceGUID, + String externalSourceName, + String communityGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "removeCommunity"; + final String elementGUIDParameterName = "communityGUID"; + final String urlTemplate = serverPlatformURLRoot + communityURLTemplatePrefix + "/{2}/delete"; + + super.removeReferenceable(userId, externalSourceGUID, externalSourceName, communityGUID, elementGUIDParameterName, urlTemplate, methodName); + } + + + /** + * Retrieve the list of metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param userId calling user + * @param searchString string to find in the properties + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public List findCommunities(String userId, + String searchString, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "findCommunity"; + final String searchStringParameterName = "searchString"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateSearchString(searchString, searchStringParameterName, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = serverPlatformURLRoot + communityURLTemplatePrefix + "/by-search-string?startFrom={2}&pageSize={3}"; + + SearchStringRequestBody requestBody = new SearchStringRequestBody(); + + requestBody.setSearchString(searchString); + requestBody.setSearchStringParameterName(searchStringParameterName); + + CommunityListResponse restResult = restClient.callCommunityListPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + startFrom, + validatedPageSize); + + return restResult.getElements(); + } + + + /** + * Retrieve the list of metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param userId calling user + * @param name name to search for + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public List getCommunitiesByName(String userId, + String name, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getCommunityByName"; + final String nameParameterName = "name"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateName(name, nameParameterName, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = serverPlatformURLRoot + communityURLTemplatePrefix + "/by-name?startFrom={2}&pageSize={3}"; + + NameRequestBody requestBody = new NameRequestBody(); + + requestBody.setName(name); + requestBody.setNamePropertyName(nameParameterName); + + CommunityListResponse restResult = restClient.callCommunityListPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + startFrom, + validatedPageSize); + + return restResult.getElements(); + } + + + /** + * Retrieve the list of communities. + * + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public List getCommunities(String userId, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getCommunities"; + + invalidParameterHandler.validateUserId(userId, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = serverPlatformURLRoot + communityURLTemplatePrefix + "?startFrom={2}&pageSize={3}"; + + CommunityListResponse restResult = restClient.callCommunityListGetRESTCall(methodName, + urlTemplate, + serverName, + userId, + startFrom, + validatedPageSize); + + return restResult.getElements(); + } + + + + /** + * Return information about the person roles linked to a community. + * + * @param userId calling user + * @param communityGUID unique identifier for the community + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching actor profiles (hopefully only one) + * + * @throws InvalidParameterException name or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public List getRolesForCommunity(String userId, + String communityGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getRolesForCommunity"; + final String guidPropertyName = "communityGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(communityGUID, guidPropertyName, methodName); + + final String urlTemplate = serverPlatformURLRoot + communityURLTemplatePrefix + "/person-roles/by-community/{2}?startFrom={3}&pageSize={4}"; + + PersonRoleListResponse restResult = restClient.callPersonRoleListGetRESTCall(methodName, + urlTemplate, + serverName, + userId, + communityGUID, + Integer.toString(startFrom), + Integer.toString(pageSize)); + + return restResult.getElements(); + } + + + /** + * Retrieve the metadata element with the supplied unique identifier. + * + * @param userId calling user + * @param communityGUID unique identifier of the requested metadata element + * + * @return requested metadata element + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public CommunityElement getCommunityByGUID(String userId, + String communityGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getCommunityByGUID"; + final String guidParameterName = "communityGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(communityGUID, guidParameterName, methodName); + + final String urlTemplate = serverPlatformURLRoot + communityURLTemplatePrefix + "/{2}"; + + CommunityResponse restResult = restClient.callCommunityGetRESTCall(methodName, + urlTemplate, + serverName, + userId, + communityGUID); + + return restResult.getElement(); + } +} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityProfileBaseClient.java b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityProfileBaseClient.java new file mode 100644 index 00000000000..0f32d322688 --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityProfileBaseClient.java @@ -0,0 +1,1162 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.communityprofile.client; + +import org.odpi.openmetadata.accessservices.communityprofile.api.RelatedElementsManagementInterface; +import org.odpi.openmetadata.accessservices.communityprofile.client.rest.CommunityProfileRESTClient; +import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.RelatedElement; +import org.odpi.openmetadata.accessservices.communityprofile.properties.AssignmentScopeProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.ClassificationProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.ReferenceableProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.RelationshipProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.ResourceListProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.StakeholderProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.TemplateProperties; +import org.odpi.openmetadata.accessservices.communityprofile.rest.ClassificationRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.rest.RelatedElementListResponse; +import org.odpi.openmetadata.accessservices.communityprofile.rest.ExternalSourceRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.rest.ReferenceableRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.rest.RelationshipRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.rest.TemplateRequestBody; +import org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler; +import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDResponse; +import org.odpi.openmetadata.frameworks.auditlog.AuditLog; +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; + +import java.util.List; + +/** + * CommunityProfileBaseClient supports the common properties and functions for the Community Profile OMAS. + */ +public class CommunityProfileBaseClient implements RelatedElementsManagementInterface +{ + final String serverName; /* Initialized in constructor */ + final String serverPlatformURLRoot; /* Initialized in constructor */ + + final InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); + final CommunityProfileRESTClient restClient; /* Initialized in constructor */ + + private static final String elementsURLTemplatePrefix = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/related-elements"; + + + /** + * Create a new client with no authentication embedded in the HTTP request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @param auditLog logging destination + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public CommunityProfileBaseClient(String serverName, + String serverPlatformURLRoot, + AuditLog auditLog) throws InvalidParameterException + { + final String methodName = "Client Constructor"; + + invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); + + this.serverName = serverName; + this.serverPlatformURLRoot = serverPlatformURLRoot; + + this.restClient = new CommunityProfileRESTClient(serverName, serverPlatformURLRoot, auditLog); + } + + + /** + * Create a new client with no authentication embedded in the HTTP request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public CommunityProfileBaseClient(String serverName, + String serverPlatformURLRoot) throws InvalidParameterException + { + final String methodName = "Client Constructor"; + + invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); + + this.serverName = serverName; + this.serverPlatformURLRoot = serverPlatformURLRoot; + + this.restClient = new CommunityProfileRESTClient(serverName, serverPlatformURLRoot); + } + + + /** + * Create a new client that passes userId and password in each HTTP request. This is the + * userId/password of the calling server. The end user's userId is sent on each request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @param userId caller's userId embedded in all HTTP requests + * @param password caller's userId embedded in all HTTP requests + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public CommunityProfileBaseClient(String serverName, + String serverPlatformURLRoot, + String userId, + String password) throws InvalidParameterException + { + final String methodName = "Client Constructor"; + + invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); + + this.serverName = serverName; + this.serverPlatformURLRoot = serverPlatformURLRoot; + + this.restClient = new CommunityProfileRESTClient(serverName, serverPlatformURLRoot, userId, password); + } + + + /** + * Create a new client that passes userId and password in each HTTP request. This is the + * userId/password of the calling server. The end user's userId is sent on each request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @param userId caller's userId embedded in all HTTP requests + * @param password caller's userId embedded in all HTTP requests + * @param auditLog logging destination + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public CommunityProfileBaseClient(String serverName, + String serverPlatformURLRoot, + String userId, + String password, + AuditLog auditLog) throws InvalidParameterException + { + final String methodName = "Client Constructor"; + + invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); + + this.serverName = serverName; + this.serverPlatformURLRoot = serverPlatformURLRoot; + + this.restClient = new CommunityProfileRESTClient(serverName, serverPlatformURLRoot, userId, password, auditLog); + } + + + /** + * Create a new client that is going to be used in an OMAG Server. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @param restClient client that issues the REST API calls + * @param maxPageSize maximum number of results supported by this server + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public CommunityProfileBaseClient(String serverName, + String serverPlatformURLRoot, + CommunityProfileRESTClient restClient, + int maxPageSize) throws InvalidParameterException + { + final String methodName = "Client Constructor"; + + invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); + + this.serverName = serverName; + this.serverPlatformURLRoot = serverPlatformURLRoot; + + invalidParameterHandler.setMaxPagingSize(maxPageSize); + + this.restClient = restClient; + } + + + /* ===================================================================================================================== + * Basic client methods + */ + + + /** + * Create a new metadata element. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param properties properties about the element to store + * @param propertiesParameterName name of parameter passing the properties + * @param urlTemplate URL to call (no expected placeholders) + * @param methodName calling method + * + * @return unique identifier of the new element + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + String createReferenceable(String userId, + String externalSourceGUID, + String externalSourceName, + ReferenceableProperties properties, + String propertiesParameterName, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String qualifiedNameParameterName = "qualifiedName"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateObject(properties, propertiesParameterName, methodName); + invalidParameterHandler.validateName(properties.getQualifiedName(), qualifiedNameParameterName, methodName); + + ReferenceableRequestBody requestBody = new ReferenceableRequestBody(); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + requestBody.setProperties(properties); + + GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId); + + return restResult.getGUID(); + } + + + /** + * Create a new metadata element to represent a community using an existing metadata element as a template. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param templateGUID unique identifier of the metadata element to copy + * @param templateProperties properties that override the template + * @param urlTemplate URL to call (with placeholders) + * @param methodName calling method + * + * @return unique identifier of the new community + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + String createReferenceableFromTemplate(String userId, + String externalSourceGUID, + String externalSourceName, + String templateGUID, + TemplateProperties templateProperties, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String templateGUIDParameterName = "templateGUID"; + final String propertiesParameterName = "templateProperties"; + final String qualifiedNameParameterName = "qualifiedName"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(templateGUID, templateGUIDParameterName, methodName); + invalidParameterHandler.validateObject(templateProperties, propertiesParameterName, methodName); + invalidParameterHandler.validateName(templateProperties.getQualifiedName(), qualifiedNameParameterName, methodName); + + TemplateRequestBody requestBody = new TemplateRequestBody(templateProperties); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + + GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + templateGUID); + + return restResult.getGUID(); + } + + + /** + * Update the metadata element. It is possible to use the subtype property classes or + * set up specialized properties in extended properties. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the metadata element to update + * @param elementGUIDParameterName name of parameter passing the elementGUID + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param properties new properties for the metadata element + * @param propertiesParameterName name of parameter passing the properties + * @param urlTemplate URL to call (no expected placeholders) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void updateReferenceable(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String elementGUIDParameterName, + boolean isMergeUpdate, + ReferenceableProperties properties, + String propertiesParameterName, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String qualifiedNameParameterName = "qualifiedName"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameterName, methodName); + invalidParameterHandler.validateObject(properties, propertiesParameterName, methodName); + + if (! isMergeUpdate) + { + invalidParameterHandler.validateName(properties.getQualifiedName(), qualifiedNameParameterName, methodName); + } + + ReferenceableRequestBody requestBody = new ReferenceableRequestBody(); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + requestBody.setProperties(properties); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + elementGUID, + isMergeUpdate); + } + + + /** + * Add or update classification on referenceable. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the metadata element to classify + * @param elementGUIDParameter parameter name for elementGUID + * @param properties properties of security at the site + * @param urlTemplate URL to call with placeholder for guid + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void setReferenceableClassification(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String elementGUIDParameter, + ClassificationProperties properties, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + + { + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameter, methodName); + + ClassificationRequestBody requestBody = new ClassificationRequestBody(); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + requestBody.setProperties(properties); + + restClient.callVoidPostRESTCall(methodName, + serverPlatformURLRoot + urlTemplate, + requestBody, + serverName, + userId, + elementGUID); + } + + + /** + * Remove classification from the referenceable. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the metadata element to classify + * @param elementGUIDParameter parameter name for elementGUID + * @param urlTemplate URL to call with placeholder for guid + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void removeReferenceableClassification(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String elementGUIDParameter, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + + { + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameter, methodName); + + ExternalSourceRequestBody requestBody = new ExternalSourceRequestBody(); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + + restClient.callVoidPostRESTCall(methodName, + serverPlatformURLRoot + urlTemplate, + requestBody, + serverName, + userId, + elementGUID); + } + + + /** + * Create a relationship between a primary element and a secondary element. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param primaryElementGUID unique identifier of the primary element + * @param primaryElementGUIDParameterName name of parameter passing the primaryElementGUID + * @param properties describes the properties for the relationship + * @param secondaryElementGUID unique identifier of the element to connect it to + * @param secondaryElementGUIDParameterName name of parameter passing the secondaryElementGUID + * @param urlTemplate URL to call (no expected placeholders) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void setupRelationship(String userId, + String externalSourceGUID, + String externalSourceName, + String primaryElementGUID, + String primaryElementGUIDParameterName, + RelationshipProperties properties, + String secondaryElementGUID, + String secondaryElementGUIDParameterName, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(primaryElementGUID, primaryElementGUIDParameterName, methodName); + invalidParameterHandler.validateGUID(secondaryElementGUID, secondaryElementGUIDParameterName, methodName); + + RelationshipRequestBody requestBody = new RelationshipRequestBody(); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + requestBody.setProperties(properties); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + primaryElementGUID, + secondaryElementGUID); + } + + + /** + * Remove a relationship. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param primaryElementGUID unique identifier of the primary element + * @param primaryElementGUIDParameterName name of parameter passing the primaryElementGUID + * @param secondaryElementGUID unique identifier of the element to connect it to + * @param secondaryElementGUIDParameterName name of parameter passing the secondaryElementGUID + * @param urlTemplate URL to call (no expected placeholders) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void clearRelationship(String userId, + String externalSourceGUID, + String externalSourceName, + String primaryElementGUID, + String primaryElementGUIDParameterName, + String secondaryElementGUID, + String secondaryElementGUIDParameterName, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(primaryElementGUID, primaryElementGUIDParameterName, methodName); + invalidParameterHandler.validateGUID(secondaryElementGUID, secondaryElementGUIDParameterName, methodName); + + ExternalSourceRequestBody requestBody = new ExternalSourceRequestBody(); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + primaryElementGUID, + secondaryElementGUID); + } + + + /** + * Remove a relationship. + * + * @param userId calling user + * @param startingElementGUID unique identifier of the primary element + * @param startingElementGUIDParameterName name of parameter passing the startingElementGUID + * @param urlTemplate URL to call (no expected placeholders) + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + List getRelatedElements(String userId, + String startingElementGUID, + String startingElementGUIDParameterName, + String urlTemplate, + int startFrom, + int pageSize, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(startingElementGUID, startingElementGUIDParameterName, methodName); + + RelatedElementListResponse restResult = restClient.callRelatedElementListGetRESTCall(methodName, + urlTemplate, + serverName, + userId, + startingElementGUID, + Integer.toString(startFrom), + Integer.toString(pageSize)); + + return restResult.getElements(); + } + + + /** + * Remove the metadata element. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the metadata element to remove + * @param elementGUIDParameterName name of parameter passing the elementGUID + * @param urlTemplate URL to call (no expected placeholders) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void removeReferenceable(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String elementGUIDParameterName, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameterName, methodName); + + ExternalSourceRequestBody requestBody = new ExternalSourceRequestBody(); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + elementGUID); + } + + + /** + * Create a "MoreInformation" relationship between an element that is descriptive and one that is providing the detail. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element that is descriptive + * @param properties properties of the relationship + * @param detailGUID unique identifier of the element that provides the detail + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void setupMoreInformation(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + RelationshipProperties properties, + String detailGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "setupMoreInformation"; + final String elementGUIDParameterName = "elementGUID"; + final String detailGUIDParameterName = "detailGUID"; + + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/{2}/more-information/{3}"; + + this.setupRelationship(userId, + externalSourceGUID, + externalSourceName, + elementGUID, + elementGUIDParameterName, + properties, + detailGUID, + detailGUIDParameterName, + urlTemplate, + methodName); + } + + + /** + * Remove a "MoreInformation" relationship between two referenceables. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element that is descriptive + * @param detailGUID unique identifier of the element that provides the detail + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void clearMoreInformation(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String detailGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "clearMoreInformation"; + final String elementGUIDParameterName = "elementGUID"; + final String detailGUIDParameterName = "detailGUID"; + + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/{2}/more-information/{3}/delete"; + + this.clearRelationship(userId, + externalSourceGUID, + externalSourceName, + elementGUID, + elementGUIDParameterName, + detailGUID, + detailGUIDParameterName, + urlTemplate, + methodName); + } + + + /** + * Retrieve the detail elements linked via a "MoreInformation" relationship between two referenceables. + * + * @param userId calling user + * @param elementGUID unique identifier of the element that is descriptive + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public List getMoreInformation(String userId, + String elementGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getMoreInformation"; + final String guidPropertyName = "elementGUID"; + + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/more-information/by-descriptive-element/{2}?startFrom={3}&pageSize={4}"; + + return this.getRelatedElements(userId, elementGUID, guidPropertyName, urlTemplate, startFrom, pageSize, methodName); + } + + + /** + * Retrieve the descriptive elements linked via a "MoreInformation" relationship between two referenceables. + * + * @param userId calling user + * @param detailGUID unique identifier of the element that provides the detail + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public List getDescriptiveElements(String userId, + String detailGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getDescriptiveElements"; + final String guidPropertyName = "detailGUID"; + + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/more-information/by-detail-element/{2}?startFrom={3}&pageSize={4}"; + + return this.getRelatedElements(userId, detailGUID, guidPropertyName, urlTemplate, startFrom, pageSize, methodName); + } + + + /** + * Create a "Stakeholder" relationship between an element and its stakeholder. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param properties properties of the relationship + * @param stakeholderGUID unique identifier of the stakeholder + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void setupStakeholder(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + StakeholderProperties properties, + String stakeholderGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "setupStakeholder"; + final String elementGUIDParameterName = "elementGUID"; + final String stakeholderGUIDParameterName = "stakeholderGUID"; + + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/{2}/stakeholders/{3}"; + + this.setupRelationship(userId, + externalSourceGUID, + externalSourceName, + elementGUID, + elementGUIDParameterName, + properties, + stakeholderGUID, + stakeholderGUIDParameterName, + urlTemplate, + methodName); + } + + + /** + * Remove a "Stakeholder" relationship between two referenceables. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param stakeholderGUID unique identifier of the stakeholder + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void clearStakeholder(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String stakeholderGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "clearStakeholder"; + final String elementGUIDParameterName = "elementGUID"; + final String stakeholderGUIDParameterName = "stakeholderGUID"; + + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/{2}/stakeholders/{3}/delete"; + + this.clearRelationship(userId, + externalSourceGUID, + externalSourceName, + elementGUID, + elementGUIDParameterName, + stakeholderGUID, + stakeholderGUIDParameterName, + urlTemplate, + methodName); + } + + + /** + * Retrieve the stakeholder elements linked via the "Stakeholder" relationship between two referenceables. + * + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public List getStakeholders(String userId, + String elementGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getStakeholders"; + final String guidPropertyName = "elementGUID"; + + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/stakeholders/by-commissioned-element/{2}?startFrom={3}&pageSize={4}"; + + return this.getRelatedElements(userId, elementGUID, guidPropertyName, urlTemplate, startFrom, pageSize, methodName); + } + + + /** + * Retrieve the elements commissioned by a stakeholder, linked via the "Stakeholder" relationship between two referenceables. + * + * @param userId calling user + * @param stakeholderGUID unique identifier of the stakeholder + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public List getStakeholderCommissionedElements(String userId, + String stakeholderGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getStakeholderCommissionedElements"; + final String guidPropertyName = "stakeholderGUID"; + + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/stakeholders/by-stakeholder/{2}?startFrom={3}&pageSize={4}"; + + return this.getRelatedElements(userId, stakeholderGUID, guidPropertyName, urlTemplate, startFrom, pageSize, methodName); + } + + + + /** + * Create an "AssignmentScope" relationship between an element and its scope. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param properties properties of the relationship + * @param scopeGUID unique identifier of the scope + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void setupAssignmentScope(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + AssignmentScopeProperties properties, + String scopeGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "setupAssignmentScope"; + final String elementGUIDParameterName = "elementGUID"; + final String scopeGUIDParameterName = "scopeGUID"; + + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/{2}/assignment-scopes/{3}"; + + this.setupRelationship(userId, + externalSourceGUID, + externalSourceName, + elementGUID, + elementGUIDParameterName, + properties, + scopeGUID, + scopeGUIDParameterName, + urlTemplate, + methodName); + } + + + /** + * Remove an "AssignmentScope" relationship between two referenceables. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param scopeGUID unique identifier of the scope + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void clearAssignmentScope(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String scopeGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "clearAssignmentScope"; + final String elementGUIDParameterName = "elementGUID"; + final String scopeGUIDParameterName = "scopeGUID"; + + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/{2}/assignment-scopes/{3}/delete"; + + this.clearRelationship(userId, externalSourceGUID, externalSourceName, elementGUID, elementGUIDParameterName, scopeGUID, scopeGUIDParameterName, urlTemplate, methodName); + } + + + /** + * Retrieve the assigned scopes linked by the "AssignmentScope" relationship between two referenceables. + * + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public List getAssignedScopes(String userId, + String elementGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getAssignedScopes"; + final String guidPropertyName = "elementGUID"; + + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/assignment-scopes/by-assigned-actor/{2}?startFrom={3}&pageSize={4}"; + + return this.getRelatedElements(userId, elementGUID, guidPropertyName, urlTemplate, startFrom, pageSize, methodName); + } + + + /** + * Retrieve the assigned actors linked by the "AssignmentScope" relationship between two referenceables. + * + * @param userId calling user + * @param scopeGUID unique identifier of the scope + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public List getAssignedActors(String userId, + String scopeGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getAssignedActors"; + final String guidPropertyName = "scopeGUID"; + + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/assignment-scopes/by-assigned-scope/{2}?startFrom={3}&pageSize={4}"; + + return this.getRelatedElements(userId, scopeGUID, guidPropertyName, urlTemplate, startFrom, pageSize, methodName); + } + + + + /** + * Create a "ResourceList" relationship between a consuming element and an element that represents resources. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param properties properties of the relationship + * @param resourceGUID unique identifier of the resource + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void setupResource(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + ResourceListProperties properties, + String resourceGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "setupResource"; + final String elementGUIDParameterName = "elementGUID"; + final String resourceGUIDParameterName = "resourceGUID"; + + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/{2}/resource-list/{3}"; + + this.setupRelationship(userId, + externalSourceGUID, + externalSourceName, + elementGUID, + elementGUIDParameterName, + properties, + resourceGUID, + resourceGUIDParameterName, + urlTemplate, + methodName); + } + + + /** + * Remove a "ResourceList" relationship between two referenceables. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param resourceGUID unique identifier of the resource + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void clearResource(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String resourceGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "clearResource"; + final String elementGUIDParameterName = "elementGUID"; + final String resourceGUIDParameterName = "resourceGUID"; + + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/{2}/resource-list/{3}/delete"; + + this.clearRelationship(userId, externalSourceGUID, externalSourceName, elementGUID, elementGUIDParameterName, resourceGUID, resourceGUIDParameterName, urlTemplate, methodName); + } + + + /** + * Retrieve the list of resources assigned to an element via the "ResourceList" relationship between two referenceables. + * + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public List getResourceList(String userId, + String elementGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getResourceList"; + final String guidPropertyName = "elementGUID"; + + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/resource-list/by-assignee/{2}?startFrom={3}&pageSize={4}"; + + return this.getRelatedElements(userId, elementGUID, guidPropertyName, urlTemplate, startFrom, pageSize, methodName); + } + + + /** + * Retrieve the list of elements assigned to a resource via the "ResourceList" relationship between two referenceables. + * + * @param userId calling user + * @param resourceGUID unique identifier of the resource + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public List getSupportedByResource(String userId, + String resourceGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getSupportedByResource"; + final String guidPropertyName = "resourceGUID"; + + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/resource-list/by-resource/{2}?startFrom={3}&pageSize={4}"; + + return this.getRelatedElements(userId, resourceGUID, guidPropertyName, urlTemplate, startFrom, pageSize, methodName); + } +} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityProfileEventClient.java b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityProfileEventClient.java index 6c5efa8565a..6465b998d5a 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityProfileEventClient.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityProfileEventClient.java @@ -28,12 +28,12 @@ public class CommunityProfileEventClient implements CommunityProfileEventInterfa { private static final String serviceName = "Community Profile OMAS"; - private String serverName; /* Initialized in constructor */ - private String serverPlatformURLRoot; /* Initialized in constructor */ - private String callerId; /* Initialized in constructor */ - private OCFRESTClient restClient; /* Initialized in constructor */ + private final String serverName; /* Initialized in constructor */ + private final String serverPlatformURLRoot; /* Initialized in constructor */ + private final String callerId; /* Initialized in constructor */ + private final OCFRESTClient restClient; /* Initialized in constructor */ - private InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); + private final InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); private CommunityProfileOutTopicClientConnector configurationEventTopicConnector = null; private AuditLog auditLog = null; diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/LocationManagement.java b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/LocationManagement.java index 7a1d3be535d..d11b7ba6ed0 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/LocationManagement.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/LocationManagement.java @@ -5,17 +5,18 @@ import org.odpi.openmetadata.accessservices.communityprofile.api.LocationManagementInterface; import org.odpi.openmetadata.accessservices.communityprofile.client.rest.CommunityProfileRESTClient; import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.LocationElement; +import org.odpi.openmetadata.accessservices.communityprofile.properties.AdjacentLocationProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.AssetLocationProperties; import org.odpi.openmetadata.accessservices.communityprofile.properties.LocationProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.NestedLocationProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.ProfileLocationProperties; import org.odpi.openmetadata.accessservices.communityprofile.properties.TemplateProperties; -import org.odpi.openmetadata.accessservices.communityprofile.rest.DigitalLocationRequestBody; -import org.odpi.openmetadata.accessservices.communityprofile.rest.FixedLocationRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.properties.DigitalLocationProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.FixedLocationProperties; +import org.odpi.openmetadata.accessservices.communityprofile.rest.LocationListResponse; import org.odpi.openmetadata.accessservices.communityprofile.rest.LocationResponse; -import org.odpi.openmetadata.accessservices.communityprofile.rest.LocationsResponse; -import org.odpi.openmetadata.accessservices.communityprofile.rest.SecureLocationRequestBody; -import org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler; -import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDResponse; +import org.odpi.openmetadata.accessservices.communityprofile.properties.SecureLocationProperties; import org.odpi.openmetadata.commonservices.ffdc.rest.NameRequestBody; -import org.odpi.openmetadata.commonservices.ffdc.rest.NullRequestBody; import org.odpi.openmetadata.commonservices.ffdc.rest.SearchStringRequestBody; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; @@ -28,15 +29,8 @@ * LocationManager provides the API operations to create and maintain location definitions. * */ -public class LocationManagement implements LocationManagementInterface +public class LocationManagement extends CommunityProfileBaseClient implements LocationManagementInterface { - private String serverName; /* Initialized in constructor */ - private String serverPlatformURLRoot; /* Initialized in constructor */ - private CommunityProfileRESTClient restClient; /* Initialized in constructor */ - - private InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); - private NullRequestBody nullRequestBody = new NullRequestBody(); - /** * Create a new client with no authentication embedded in the HTTP request. * @@ -48,13 +42,7 @@ public class LocationManagement implements LocationManagementInterface public LocationManagement(String serverName, String serverPlatformURLRoot) throws InvalidParameterException { - final String methodName = "Constructor (no security)"; - - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); - - this.serverName = serverName; - this.serverPlatformURLRoot = serverPlatformURLRoot; - this.restClient = new CommunityProfileRESTClient(serverName, serverPlatformURLRoot); + super(serverName, serverPlatformURLRoot); } @@ -71,13 +59,7 @@ public LocationManagement(String serverName, String serverPlatformURLRoot, AuditLog auditLog) throws InvalidParameterException { - final String methodName = "Constructor (no security)"; - - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); - - this.serverName = serverName; - this.serverPlatformURLRoot = serverPlatformURLRoot; - this.restClient = new CommunityProfileRESTClient(serverName, serverPlatformURLRoot, auditLog); + super(serverName, serverPlatformURLRoot, auditLog); } @@ -97,13 +79,7 @@ public LocationManagement(String serverName, String userId, String password) throws InvalidParameterException { - final String methodName = "Constructor (with security)"; - - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); - - this.serverName = serverName; - this.serverPlatformURLRoot = serverPlatformURLRoot; - this.restClient = new CommunityProfileRESTClient(serverName, serverPlatformURLRoot, userId, password); + super(serverName, serverPlatformURLRoot, userId, password); } @@ -125,13 +101,7 @@ public LocationManagement(String serverName, String password, AuditLog auditLog) throws InvalidParameterException { - final String methodName = "Constructor (with security)"; - - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); - - this.serverName = serverName; - this.serverPlatformURLRoot = serverPlatformURLRoot; - this.restClient = new CommunityProfileRESTClient(serverName, serverPlatformURLRoot, userId, password, auditLog); + super(serverName, serverPlatformURLRoot, userId, password, auditLog); } @@ -150,21 +120,13 @@ public LocationManagement(String serverName, CommunityProfileRESTClient restClient, int maxPageSize) throws InvalidParameterException { - final String methodName = "Constructor (with security)"; - - invalidParameterHandler.setMaxPagingSize(maxPageSize); - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); - - this.serverName = serverName; - this.serverPlatformURLRoot = serverPlatformURLRoot; - this.restClient = restClient; + super(serverName, serverPlatformURLRoot, restClient, maxPageSize); } - /* * ============================================== - * ManageLocations + * Manage Locations * ============================================== */ @@ -174,6 +136,8 @@ public LocationManagement(String serverName, * type of location. * * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller * @param locationProperties properties to store * @return unique identifier of the new metadata element * @throws InvalidParameterException one of the parameters is invalid @@ -182,27 +146,17 @@ public LocationManagement(String serverName, */ @Override public String createLocation(String userId, + String externalSourceGUID, + String externalSourceName, LocationProperties locationProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException { final String methodName = "createLocation"; - final String nameParameter = "qualifiedName"; final String propertiesParameter = "locationProperties"; + final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/locations"; - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateObject(locationProperties, propertiesParameter, methodName); - invalidParameterHandler.validateName(locationProperties.getQualifiedName(), nameParameter, methodName); - - final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/locations"; - - GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - locationProperties, - serverName, - userId); - - return restResult.getGUID(); + return super.createReferenceable(userId, externalSourceGUID, externalSourceName, locationProperties, propertiesParameter, urlTemplate, methodName); } @@ -211,6 +165,8 @@ public String createLocation(String userId, * The template defines additional classifications and relationships that should be added to the new location. * * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller * @param templateGUID unique identifier of the metadata element to copy * @param templateProperties properties that override the template * @return unique identifier of the new metadata element @@ -220,29 +176,17 @@ public String createLocation(String userId, */ @Override public String createLocationFromTemplate(String userId, + String externalSourceGUID, + String externalSourceName, String templateGUID, TemplateProperties templateProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException { final String methodName = "createLocationFromTemplate"; - final String nameParameter = "qualifiedName"; - final String propertiesParameter = "templateProperties"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateObject(templateProperties, propertiesParameter, methodName); - invalidParameterHandler.validateName(templateProperties.getQualifiedName(), nameParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/locations/from-template/{2}"; - GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - templateProperties, - serverName, - userId, - templateGUID); - - return restResult.getGUID(); + return super.createReferenceableFromTemplate(userId, externalSourceGUID, externalSourceName, templateGUID, templateProperties, urlTemplate, methodName); } @@ -250,8 +194,10 @@ public String createLocationFromTemplate(String userId, * Update the metadata element representing a location. * * @param userId calling user - * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller * @param locationGUID unique identifier of the metadata element to update + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? * @param locationProperties new properties for this element * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request @@ -259,8 +205,10 @@ public String createLocationFromTemplate(String userId, */ @Override public void updateLocation(String userId, - boolean isMergeUpdate, + String externalSourceGUID, + String externalSourceName, String locationGUID, + boolean isMergeUpdate, LocationProperties locationProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException @@ -268,26 +216,18 @@ public void updateLocation(String userId, final String methodName = "updateLocation"; final String guidParameter = "locationGUID"; final String propertiesParameter = "locationProperties"; - final String qualifiedNameParameter = "locationProperties.qualifiedName"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(locationGUID, guidParameter, methodName); - invalidParameterHandler.validateObject(locationProperties, propertiesParameter, methodName); - - if (! isMergeUpdate) - { - invalidParameterHandler.validateName(locationProperties.getQualifiedName(), qualifiedNameParameter, methodName); - } - final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/locations/{2}/update?isMergeUpdate={3}"; - restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - locationProperties, - serverName, - userId, - locationGUID, - isMergeUpdate); + super.updateReferenceable(userId, + externalSourceGUID, + externalSourceName, + locationGUID, + guidParameter, + isMergeUpdate, + locationProperties, + propertiesParameter, + urlTemplate, + methodName); } @@ -295,46 +235,28 @@ public void updateLocation(String userId, * Classify the location to indicate that it represents a fixed physical location. * * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller * @param locationGUID unique identifier of the metadata element to classify - * @param coordinates position of the location - * @param mapProjection map projection used to define the coordinates - * @param postalAddress postal address of the location (if appropriate) - * @param timeZone time zone for the location + * @param properties time zone and position of the location * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ @Override - public void setLocationAsFixedPhysical(String userId, - String locationGUID, - String coordinates, - String mapProjection, - String postalAddress, - String timeZone) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + public void setLocationAsFixedPhysical(String userId, + String externalSourceGUID, + String externalSourceName, + String locationGUID, + FixedLocationProperties properties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { final String methodName = "setLocationAsFixedPhysical"; final String locationGUIDParameter = "locationGUID"; + final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/locations/{2}/classify-as-fixed-location"; - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(locationGUID, locationGUIDParameter, methodName); - - final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/locations/{2}/classify-as-fixed-location"; - - FixedLocationRequestBody requestBody = new FixedLocationRequestBody(); - - requestBody.setCoordinates(coordinates); - requestBody.setMapProjection(mapProjection); - requestBody.setPostalAddress(postalAddress); - requestBody.setTimeZone(timeZone); - - restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - requestBody, - serverName, - userId, - locationGUID); + super.setReferenceableClassification(userId, externalSourceGUID, externalSourceName, locationGUID, locationGUIDParameter, properties, urlTemplate, methodName); } @@ -342,6 +264,8 @@ public void setLocationAsFixedPhysical(String userId, * Remove the fixed physical location designation from the location. * * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller * @param locationGUID unique identifier of the metadata element to unclassify * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request @@ -349,24 +273,17 @@ public void setLocationAsFixedPhysical(String userId, */ @Override public void clearLocationAsFixedPhysical(String userId, + String externalSourceGUID, + String externalSourceName, String locationGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException { final String methodName = "clearLocationAsFixedPhysical"; final String locationGUIDParameter = "locationGUID"; + final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/locations/classify-as-fixed-location/delete"; - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(locationGUID, locationGUIDParameter, methodName); - - final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/locations/classify-as-fixed-location/delete"; - - restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - nullRequestBody, - serverName, - userId, - locationGUID); + super.removeReferenceableClassification(userId, externalSourceGUID, externalSourceName, locationGUID, locationGUIDParameter, urlTemplate, methodName); } @@ -374,41 +291,29 @@ public void clearLocationAsFixedPhysical(String userId, * Classify the location to indicate that it represents a secure location. * * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller * @param locationGUID unique identifier of the metadata element to classify - * @param description description of security at the site - * @param level level of security + * @param properties properties of security at the site * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ @Override - public void setLocationAsSecure(String userId, - String locationGUID, - String description, - String level) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + public void setLocationAsSecure(String userId, + String externalSourceGUID, + String externalSourceName, + String locationGUID, + SecureLocationProperties properties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { final String methodName = "setLocationAsSecure"; final String locationGUIDParameter = "locationGUID"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(locationGUID, locationGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/locations/classify-as-secure-location"; - SecureLocationRequestBody requestBody = new SecureLocationRequestBody(); - - requestBody.setDescription(description); - requestBody.setLevel(level); - - restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - requestBody, - serverName, - userId, - locationGUID); + super.setReferenceableClassification(userId, externalSourceGUID, externalSourceName, locationGUID, locationGUIDParameter, properties, urlTemplate, methodName); } @@ -416,6 +321,8 @@ public void setLocationAsSecure(String userId, * Remove the secure location designation from the location. * * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller * @param locationGUID unique identifier of the metadata element to unclassify * * @throws InvalidParameterException one of the parameters is invalid @@ -424,24 +331,17 @@ public void setLocationAsSecure(String userId, */ @Override public void clearLocationAsSecure(String userId, + String externalSourceGUID, + String externalSourceName, String locationGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException { final String methodName = "clearLocationAsSecure"; final String locationGUIDParameter = "locationGUID"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(locationGUID, locationGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/locations/classify-as-secure-location/delete"; - restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - nullRequestBody, - serverName, - userId, - locationGUID); + super.removeReferenceableClassification(userId, externalSourceGUID, externalSourceName, locationGUID, locationGUIDParameter, urlTemplate, methodName); } @@ -449,38 +349,29 @@ public void clearLocationAsSecure(String userId, * Classify the location to indicate that it represents a digital/cyber location. * * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller * @param locationGUID unique identifier of the metadata element to classify - * @param networkAddress position of the location + * @param properties network address of the location * * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ @Override - public void setLocationAsDigital(String userId, - String locationGUID, - String networkAddress) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + public void setLocationAsDigital(String userId, + String externalSourceGUID, + String externalSourceName, + String locationGUID, + DigitalLocationProperties properties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { final String methodName = "setLocationAsDigital"; final String locationGUIDParameter = "locationGUID"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(locationGUID, locationGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/locations/classify-as-digital-location"; - DigitalLocationRequestBody requestBody = new DigitalLocationRequestBody(); - - requestBody.setNetworkAddress(networkAddress); - - restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - requestBody, - serverName, - userId, - locationGUID); + super.setReferenceableClassification(userId, externalSourceGUID, externalSourceName, locationGUID, locationGUIDParameter, properties, urlTemplate, methodName); } @@ -488,6 +379,8 @@ public void setLocationAsDigital(String userId, * Remove the digital/cyber location designation from the location. * * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller * @param locationGUID unique identifier of the metadata element to unclassify * * @throws InvalidParameterException one of the parameters is invalid @@ -496,24 +389,17 @@ public void setLocationAsDigital(String userId, */ @Override public void clearLocationAsDigital(String userId, + String externalSourceGUID, + String externalSourceName, String locationGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException { final String methodName = "clearLocationAsDigital"; final String locationGUIDParameter = "locationGUID"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(locationGUID, locationGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/locations/classify-as-digital-location/delete"; - restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - nullRequestBody, - serverName, - userId, - locationGUID); + super.removeReferenceableClassification(userId, externalSourceGUID, externalSourceName, locationGUID, locationGUIDParameter, urlTemplate, methodName); } @@ -521,6 +407,8 @@ public void clearLocationAsDigital(String userId, * Remove the metadata element representing a location. * * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller * @param locationGUID unique identifier of the metadata element to remove * * @throws InvalidParameterException one of the parameters is invalid @@ -529,24 +417,17 @@ public void clearLocationAsDigital(String userId, */ @Override public void removeLocation(String userId, + String externalSourceGUID, + String externalSourceName, String locationGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException { - final String methodName = "removeLocation"; - final String guidParameter = "locationGUID"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(locationGUID, guidParameter, methodName); - - final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/locations/{2}/delete"; + final String methodName = "removeLocation"; + final String guidParameter = "locationGUID"; + final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/locations/{2}/delete"; - restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - nullRequestBody, - serverName, - userId, - locationGUID); + super.removeReferenceable(userId, externalSourceGUID, externalSourceName, locationGUID, guidParameter, urlTemplate, methodName); } @@ -554,37 +435,32 @@ public void removeLocation(String userId, * Create a parent-child relationship between two locations. * * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller * @param parentLocationGUID unique identifier of the location that is the broader location * @param childLocationGUID unique identifier of the location that is the smaller, nested location + * @param properties relationship properties * * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ @Override - public void setupNestedLocation(String userId, - String parentLocationGUID, - String childLocationGUID) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + public void setupNestedLocation(String userId, + String externalSourceGUID, + String externalSourceName, + String parentLocationGUID, + String childLocationGUID, + NestedLocationProperties properties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { final String methodName = "setupNestedLocation"; final String parentLocationGUIDParameter = "parentLocationGUID"; final String childLocationGUIDParameter = "childLocationGUID"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(parentLocationGUID, parentLocationGUIDParameter, methodName); - invalidParameterHandler.validateGUID(childLocationGUID, childLocationGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/locations/{2}/has-nested-location/{3}"; - restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - nullRequestBody, - serverName, - userId, - parentLocationGUID, - childLocationGUID); + super.setupRelationship(userId, externalSourceGUID, externalSourceName, parentLocationGUID, parentLocationGUIDParameter, properties, childLocationGUID, childLocationGUIDParameter, urlTemplate, methodName); } @@ -592,6 +468,8 @@ public void setupNestedLocation(String userId, * Remove a parent-child relationship between two locations. * * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller * @param parentLocationGUID unique identifier of the location that is the broader location * @param childLocationGUID unique identifier of the location that is the smaller, nested location * @@ -601,6 +479,8 @@ public void setupNestedLocation(String userId, */ @Override public void clearNestedLocation(String userId, + String externalSourceGUID, + String externalSourceName, String parentLocationGUID, String childLocationGUID) throws InvalidParameterException, UserNotAuthorizedException, @@ -609,20 +489,9 @@ public void clearNestedLocation(String userId, final String methodName = "clearNestedLocation"; final String parentLocationGUIDParameter = "parentLocationGUID"; final String childLocationGUIDParameter = "childLocationGUID"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(parentLocationGUID, parentLocationGUIDParameter, methodName); - invalidParameterHandler.validateGUID(childLocationGUID, childLocationGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/locations/{2}/has-nested-location/{3}/delete"; - restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - nullRequestBody, - serverName, - userId, - parentLocationGUID, - childLocationGUID); + super.clearRelationship(userId, externalSourceGUID, externalSourceName, parentLocationGUID, parentLocationGUIDParameter, childLocationGUID, childLocationGUIDParameter, urlTemplate, methodName); } @@ -630,37 +499,32 @@ public void clearNestedLocation(String userId, * Create a peer-to-peer relationship between two locations. * * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller * @param locationOneGUID unique identifier of the first location * @param locationTwoGUID unique identifier of the second location + * @param properties relationship properties * * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ @Override - public void setupAdjacentLocation(String userId, - String locationOneGUID, - String locationTwoGUID) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + public void setupAdjacentLocation(String userId, + String externalSourceGUID, + String externalSourceName, + String locationOneGUID, + String locationTwoGUID, + AdjacentLocationProperties properties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { final String methodName = "setupAdjacentLocation"; final String locationOneGUIDParameter = "locationOneGUID"; final String locationTwoGUIDParameter = "locationTwoGUID"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(locationOneGUID, locationOneGUIDParameter, methodName); - invalidParameterHandler.validateGUID(locationTwoGUID, locationTwoGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/locations/{2}/linked-to-peer-location/{3}"; - restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - nullRequestBody, - serverName, - userId, - locationOneGUID, - locationTwoGUID); + super.setupRelationship(userId, externalSourceGUID, externalSourceName, locationOneGUID, locationOneGUIDParameter, properties, locationTwoGUID, locationTwoGUIDParameter, urlTemplate, methodName); } @@ -668,6 +532,8 @@ public void setupAdjacentLocation(String userId, * Remove a peer-to-peer relationship between two locations. * * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller * @param locationOneGUID unique identifier of the first location * @param locationTwoGUID unique identifier of the second location * @@ -677,6 +543,8 @@ public void setupAdjacentLocation(String userId, */ @Override public void clearAdjacentLocation(String userId, + String externalSourceGUID, + String externalSourceName, String locationOneGUID, String locationTwoGUID) throws InvalidParameterException, UserNotAuthorizedException, @@ -685,23 +553,157 @@ public void clearAdjacentLocation(String userId, final String methodName = "clearAdjacentLocation"; final String locationOneGUIDParameter = "locationOneGUID"; final String locationTwoGUIDParameter = "locationTwoGUID"; + final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/locations/{2}/linked-to-peer-location/{3}/delete"; - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(locationOneGUID, locationOneGUIDParameter, methodName); - invalidParameterHandler.validateGUID(locationTwoGUID, locationTwoGUIDParameter, methodName); + super.clearRelationship(userId, externalSourceGUID, externalSourceName, locationOneGUID, locationOneGUIDParameter, locationTwoGUID, locationTwoGUIDParameter, urlTemplate, methodName); + } - final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/locations/{2}/linked-to-peer-location/{3}/delete"; - restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - nullRequestBody, - serverName, - userId, - locationOneGUID, - locationTwoGUID); + /** + * Create a profile location relationship between an actor profile and a location. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param actorProfileGUID unique identifier of the actor profile + * @param locationGUID unique identifier of the location + * @param properties type of association with the location + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void setupProfileLocation(String userId, + String externalSourceGUID, + String externalSourceName, + String actorProfileGUID, + String locationGUID, + ProfileLocationProperties properties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "setupProfileLocation"; + final String actorGUIDParameter = "actorProfileGUID"; + final String locationGUIDParameter = "locationGUID"; + final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/locations/{2}/linked-to-actor-profiles/{3}"; + + super.setupRelationship(userId, + externalSourceGUID, + externalSourceName, + locationGUID, + locationGUIDParameter, + properties, + actorProfileGUID, + actorGUIDParameter, + urlTemplate, + methodName); + } + + + /** + * Remove a profile location relationship between an actor profile and a location. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param actorProfileGUID unique identifier of the actor profile + * @param locationGUID unique identifier of the location + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void clearProfileLocation(String userId, + String externalSourceGUID, + String externalSourceName, + String actorProfileGUID, + String locationGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "clearProfileLocation"; + final String actorGUIDParameter = "actorProfileGUID"; + final String locationGUIDParameter = "locationGUID"; + final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/locations/{2}/linked-to-actor-profiles/{3}/delete"; + + super.clearRelationship(userId, externalSourceGUID, externalSourceName, locationGUID, locationGUIDParameter, actorProfileGUID, actorGUIDParameter, urlTemplate, methodName); } + /** + * Create an asset location relationship between an asset and a location. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param assetGUID unique identifier of the asset + * @param locationGUID unique identifier of the location + * @param properties type of association with the location + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void setupAssetLocation(String userId, + String externalSourceGUID, + String externalSourceName, + String assetGUID, + String locationGUID, + AssetLocationProperties properties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "setupAssetLocation"; + final String actorGUIDParameter = "assetGUID"; + final String locationGUIDParameter = "locationGUID"; + final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/locations/{2}/linked-to-assets/{3}"; + + super.setupRelationship(userId, + externalSourceGUID, + externalSourceName, + locationGUID, + locationGUIDParameter, + properties, + assetGUID, + actorGUIDParameter, + urlTemplate, + methodName); + } + + + /** + * Remove an asset location relationship between an asset and a location. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param assetGUID unique identifier of the asset + * @param locationGUID unique identifier of the location + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void clearAssetLocation(String userId, + String externalSourceGUID, + String externalSourceName, + String assetGUID, + String locationGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "clearAssetLocation"; + final String actorGUIDParameter = "assetGUID"; + final String locationGUIDParameter = "locationGUID"; + final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/locations/{2}/linked-to-assets/{3}/delete"; + + super.clearRelationship(userId, externalSourceGUID, externalSourceName, locationGUID, locationGUIDParameter, assetGUID, actorGUIDParameter, urlTemplate, methodName); + } + /** * Retrieve the list of location metadata elements that contain the search string. @@ -741,20 +743,20 @@ public List findLocations(String userId, requestBody.setSearchString(searchString); requestBody.setSearchStringParameterName(parameterName); - LocationsResponse restResult = restClient.callLocationsPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - requestBody, - serverName, - userId, - startFrom, - validatedPageSize); + LocationListResponse restResult = restClient.callLocationsPostRESTCall(methodName, + serverPlatformURLRoot + urlTemplate, + requestBody, + serverName, + userId, + startFrom, + validatedPageSize); - return restResult.getElementList(); + return restResult.getElements(); } /** - * Retrieve the list of location metadata elements with a matching qualified or display name. + * Retrieve the list of location metadata elements with a matching qualified name, identifier or display name. * There are no wildcards supported on this request. * * @param userId calling user @@ -790,15 +792,271 @@ public List getLocationsByName(String userId, requestBody.setName(name); requestBody.setNamePropertyName(nameParameter); - LocationsResponse restResult = restClient.callLocationsPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - requestBody, - serverName, - userId, - startFrom, - validatedPageSize); + LocationListResponse restResult = restClient.callLocationsPostRESTCall(methodName, + serverPlatformURLRoot + urlTemplate, + requestBody, + serverName, + userId, + startFrom, + validatedPageSize); + + return restResult.getElements(); + } + + + /** + * Retrieve the list of adjacent location metadata elements linked to locationGUID. + * + * @param userId calling user + * @param locationGUID locationGUID to search for + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public List getAdjacentLocations(String userId, + String locationGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getAdjacentLocations"; + + final String guidParameter = "actorProfileGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(locationGUID, guidParameter, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/locations/{2}/has-peer-locations?startFrom={3}&pageSize={4}"; + + LocationListResponse restResult = restClient.callLocationsGetRESTCall(methodName, + serverPlatformURLRoot + urlTemplate, + serverName, + userId, + locationGUID, + startFrom, + validatedPageSize); + + return restResult.getElements(); + } + + + /** + * Retrieve the list of nested location metadata elements linked to locationGUID. + * + * @param userId calling user + * @param locationGUID locationGUID to search for + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public List getNestedLocations(String userId, + String locationGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getNestedLocations"; + final String guidParameter = "locationGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(locationGUID, guidParameter, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/locations/{2}/has-nested-locations?startFrom={3}&pageSize={4}"; + + LocationListResponse restResult = restClient.callLocationsGetRESTCall(methodName, + serverPlatformURLRoot + urlTemplate, + serverName, + userId, + locationGUID, + startFrom, + validatedPageSize); + + return restResult.getElements(); + } + + + /** + * Retrieve the list of location metadata elements that has the location identifier with locationGUID nested inside it. + * + * @param userId calling user + * @param locationGUID locationGUID to search for + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public List getGroupingLocations(String userId, + String locationGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getNestedLocations"; + final String guidParameter = "locationGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(locationGUID, guidParameter, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/locations/{2}/has-grouping-locations?startFrom={3}&pageSize={4}"; + + LocationListResponse restResult = restClient.callLocationsGetRESTCall(methodName, + serverPlatformURLRoot + urlTemplate, + serverName, + userId, + locationGUID, + startFrom, + validatedPageSize); + + return restResult.getElements(); + } + + + /** + * Retrieve the list of location metadata elements with linked to the actorProfileGUID. + * + * @param userId calling user + * @param actorProfileGUID actorProfileGUID to search for + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public List getLocationsByProfile(String userId, + String actorProfileGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getLocationsByProfile"; + final String guidParameter = "actorProfileGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(actorProfileGUID, guidParameter, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/locations/by-actor-profile/{2}?startFrom={3}&pageSize={4}"; + + LocationListResponse restResult = restClient.callLocationsGetRESTCall(methodName, + serverPlatformURLRoot + urlTemplate, + serverName, + userId, + actorProfileGUID, + startFrom, + validatedPageSize); + + return restResult.getElements(); + } + + + + /** + * Retrieve the list of location metadata elements linked to assetGUID. + * + * @param userId calling user + * @param assetGUID assetGUID to search for + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public List getKnownLocationsForAsset(String userId, + String assetGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getKnownLocationsForAsset"; + final String guidParameter = "assetGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(assetGUID, guidParameter, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/locations/by-asset/{2}?startFrom={3}&pageSize={4}"; + + LocationListResponse restResult = restClient.callLocationsGetRESTCall(methodName, + serverPlatformURLRoot + urlTemplate, + serverName, + userId, + assetGUID, + startFrom, + validatedPageSize); + + return restResult.getElements(); + } + + + /** + * Retrieve the list of location metadata elements. + * + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public List getLocations(String userId, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getLocations"; + + invalidParameterHandler.validateUserId(userId, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/locations?startFrom={2}&pageSize={3}"; + + + LocationListResponse restResult = restClient.callLocationsGetRESTCall(methodName, + serverPlatformURLRoot + urlTemplate, + serverName, + userId, + startFrom, + validatedPageSize); - return restResult.getElementList(); + return restResult.getElements(); } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/MetadataSourceClient.java b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/MetadataSourceClient.java index 82c45182f57..ea8aee142aa 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/MetadataSourceClient.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/MetadataSourceClient.java @@ -32,12 +32,12 @@ */ public class MetadataSourceClient implements MetadataSourceInterface { - private String serverName; /* Initialized in constructor */ - private String serverPlatformURLRoot; /* Initialized in constructor */ - private CommunityProfileRESTClient restClient; /* Initialized in constructor */ + private final String serverName; /* Initialized in constructor */ + private final String serverPlatformURLRoot; /* Initialized in constructor */ + private final CommunityProfileRESTClient restClient; /* Initialized in constructor */ - private InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); - private NullRequestBody nullRequestBody = new NullRequestBody(); + private final InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); + private final NullRequestBody nullRequestBody = new NullRequestBody(); private final String urlTemplatePrefix = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/metadata-sources"; diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/MyProfileManagement.java b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/MyProfileManagement.java index 0a0a3bab188..7699d097eff 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/MyProfileManagement.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/MyProfileManagement.java @@ -24,11 +24,11 @@ */ public class MyProfileManagement implements MyPersonalProfileInterface { - private String serverName; /* Initialized in constructor */ - private String serverPlatformURLRoot; /* Initialized in constructor */ - private CommunityProfileRESTClient restClient; /* Initialized in constructor */ + private final String serverName; /* Initialized in constructor */ + private final String serverPlatformURLRoot; /* Initialized in constructor */ + private final CommunityProfileRESTClient restClient; /* Initialized in constructor */ - private InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); + private final InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); /** diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/OrganizationManagement.java b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/OrganizationManagement.java index 11dc23f04c7..1b9ca4b2bcb 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/OrganizationManagement.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/OrganizationManagement.java @@ -20,7 +20,7 @@ import org.odpi.openmetadata.accessservices.communityprofile.rest.ContactMethodRequestBody; import org.odpi.openmetadata.accessservices.communityprofile.rest.EffectiveDatesRequestBody; import org.odpi.openmetadata.accessservices.communityprofile.rest.EffectiveTimeRequestBody; -import org.odpi.openmetadata.accessservices.communityprofile.rest.MetadataSourceRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.rest.ExternalSourceRequestBody; import org.odpi.openmetadata.accessservices.communityprofile.rest.PersonRoleAppointeeListResponse; import org.odpi.openmetadata.accessservices.communityprofile.rest.PersonRoleListResponse; import org.odpi.openmetadata.accessservices.communityprofile.rest.PersonRoleRequestBody; @@ -45,11 +45,11 @@ */ public class OrganizationManagement implements OrganizationManagementInterface { - private String serverName; /* Initialized in constructor */ - private String serverPlatformURLRoot; /* Initialized in constructor */ - private CommunityProfileRESTClient restClient; /* Initialized in constructor */ + private final String serverName; /* Initialized in constructor */ + private final String serverPlatformURLRoot; /* Initialized in constructor */ + private final CommunityProfileRESTClient restClient; /* Initialized in constructor */ - private InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); + private final InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); private final String urlTemplatePrefix = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}"; @@ -304,7 +304,7 @@ public void deleteActorProfile(String userId, final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/profiles/{2}/delete"; - MetadataSourceRequestBody requestBody = new MetadataSourceRequestBody(); + ExternalSourceRequestBody requestBody = new ExternalSourceRequestBody(); requestBody.setExternalSourceGUID(externalSourceGUID); requestBody.setExternalSourceName(externalSourceName); @@ -390,7 +390,7 @@ public void deleteContactMethod(String userId, final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/profiles/contact-methods/{2}/delete"; - MetadataSourceRequestBody requestBody = new MetadataSourceRequestBody(); + ExternalSourceRequestBody requestBody = new ExternalSourceRequestBody(); requestBody.setExternalSourceGUID(externalSourceGUID); requestBody.setExternalSourceName(externalSourceName); @@ -481,7 +481,7 @@ public void unlinkTeamsInHierarchy(String userId, final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/profiles/{2}/sub-team-profiles/{3}/unlink"; - MetadataSourceRequestBody requestBody = new MetadataSourceRequestBody(); + ExternalSourceRequestBody requestBody = new ExternalSourceRequestBody(); requestBody.setExternalSourceGUID(externalSourceGUID); requestBody.setExternalSourceName(externalSourceName); @@ -577,14 +577,14 @@ public ActorProfileElement getActorProfileByUserId(String userId, * @throws UserNotAuthorizedException security access problem */ @Override - public List getActorProfileByName(String userId, - String name, - int startFrom, - int pageSize) throws InvalidParameterException, + public List getActorProfilesByName(String userId, + String name, + int startFrom, + int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException { - final String methodName = "getActorProfileByName"; + final String methodName = "getActorProfilesByName"; final String namePropertyName = "name"; final String nameParameterName = "name"; @@ -611,6 +611,86 @@ public List getActorProfileByName(String userId, } + /** + * Return information about all actor profiles. + * + * @param userId calling user + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching actor profiles (hopefully only one) + * + * @throws InvalidParameterException name or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public List getActorProfiles(String userId, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getActorProfiles"; + + invalidParameterHandler.validateUserId(userId, methodName); + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/profiles?startFrom={2}&pageSize={3}"; + + ActorProfileListResponse restResult = restClient.callActorProfileListGetRESTCall(methodName, + urlTemplate, + serverName, + userId, + Integer.toString(startFrom), + Integer.toString(pageSize)); + + return restResult.getElements(); + } + + + /** + * Return information about the actor profiles associated with a location. + * + * @param userId calling user + * @param locationGUID unique identifier for the location + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching actor profiles (hopefully only one) + * + * @throws InvalidParameterException locationGUID or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public List getActorProfilesByLocation(String userId, + String locationGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getActorProfileByName"; + final String guidParameterName = "locationGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(locationGUID, guidParameterName, methodName); + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/profiles/by-location/{2}?startFrom={3}&pageSize={4}"; + + + ActorProfileListResponse restResult = restClient.callActorProfileListGetRESTCall(methodName, + urlTemplate, + serverName, + userId, + locationGUID, + Integer.toString(startFrom), + Integer.toString(pageSize)); + + return restResult.getElements(); + } + + /** * Retrieve the list of matching profiles for the search string. * @@ -626,10 +706,10 @@ public List getActorProfileByName(String userId, * @throws UserNotAuthorizedException the calling user is not authorized to issue the call. */ @Override - public List findActorProfile(String userId, - String searchString, - int startFrom, - int pageSize) throws InvalidParameterException, + public List findActorProfiles(String userId, + String searchString, + int startFrom, + int pageSize) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException { @@ -779,7 +859,7 @@ public void deletePersonRole(String userId, final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/person-roles/{2}/delete"; - MetadataSourceRequestBody requestBody = new MetadataSourceRequestBody(); + ExternalSourceRequestBody requestBody = new ExternalSourceRequestBody(); requestBody.setExternalSourceGUID(externalSourceGUID); requestBody.setExternalSourceName(externalSourceName); @@ -956,7 +1036,7 @@ public void unlinkPersonRoleFromProfile(String userId, final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/person-roles/appointees/{2}/unlink"; - MetadataSourceRequestBody requestBody = new MetadataSourceRequestBody(); + ExternalSourceRequestBody requestBody = new ExternalSourceRequestBody(); requestBody.setExternalSourceGUID(externalSourceGUID); requestBody.setExternalSourceName(externalSourceName); @@ -1107,14 +1187,14 @@ public PersonRoleElement getPersonRoleByGUID(String userId, * @throws UserNotAuthorizedException security access problem */ @Override - public List getPersonRoleByName(String userId, - String name, - int startFrom, - int pageSize) throws InvalidParameterException, + public List getPersonRolesByName(String userId, + String name, + int startFrom, + int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException { - final String methodName = "getPersonRoleByName"; + final String methodName = "getPersonRolesByName"; final String namePropertyName = "name"; final String nameParameterName = "name"; @@ -1141,6 +1221,91 @@ public List getPersonRoleByName(String userId, } + /** + * Return information about the leadership person roles linked to a team. + * + * @param userId calling user + * @param teamGUID unique identifier for the Team actor profile + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching actor profiles (hopefully only one) + * + * @throws InvalidParameterException name or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public List getLeadershipRolesForTeam(String userId, + String teamGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getLeadershipRolesForTeam"; + final String guidPropertyName = "teamGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(teamGUID, guidPropertyName, methodName); + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/person-roles/by-team/{2}/leadership?startFrom={3}&pageSize={4}"; + + PersonRoleListResponse restResult = restClient.callPersonRoleListGetRESTCall(methodName, + urlTemplate, + serverName, + userId, + teamGUID, + Integer.toString(startFrom), + Integer.toString(pageSize)); + + return restResult.getElements(); + } + + + /** + * Return information about the membership person roles linked to a team. + * + * @param userId calling user + * @param teamGUID unique identifier for the Team actor profile + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching actor profiles (hopefully only one) + * + * @throws InvalidParameterException name or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public List getMembershipRolesForTeam(String userId, + String teamGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getMembershipRolesForTeam"; + final String guidPropertyName = "teamGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(teamGUID, guidPropertyName, methodName); + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/person-roles/by-team/{2}/membership?startFrom={3}&pageSize={4}"; + + PersonRoleListResponse restResult = restClient.callPersonRoleListGetRESTCall(methodName, + urlTemplate, + serverName, + userId, + teamGUID, + Integer.toString(startFrom), + Integer.toString(pageSize)); + + return restResult.getElements(); + } + + + /** * Retrieve the list of matching roles for the search string. * @@ -1156,14 +1321,14 @@ public List getPersonRoleByName(String userId, * @throws UserNotAuthorizedException the calling user is not authorized to issue the call. */ @Override - public List findPersonRole(String userId, - String searchString, - int startFrom, - int pageSize) throws InvalidParameterException, + public List findPersonRoles(String userId, + String searchString, + int startFrom, + int pageSize) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException { - final String methodName = "findPersonRole"; + final String methodName = "findPersonRoles"; final String searchStringParameterName = "searchString"; invalidParameterHandler.validateUserId(userId, methodName); diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/PersonalProfileManagement.java b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/PersonalProfileManagement.java index 0bb53116a64..07abfd147ad 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/PersonalProfileManagement.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/PersonalProfileManagement.java @@ -11,6 +11,7 @@ import org.odpi.openmetadata.accessservices.communityprofile.rest.*; import org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler; import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDResponse; +import org.odpi.openmetadata.commonservices.ffdc.rest.NameRequestBody; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; @@ -21,17 +22,17 @@ /** * CommunityProfileLeadership provides the client-side interface for the Governance Program Open Metadata Access Service (OMAS). - * This client, manages all of the interaction with an open metadata repository. It is initialized with the URL + * This client, manages all the interaction with an open metadata repository. It is initialized with the URL * of the server that is running the Open Metadata Access Services. This server is responsible for locating and * managing the governance program definitions exchanged with this client. */ public class PersonalProfileManagement implements PersonalProfileManagementInterface { - private String serverName; /* Initialized in constructor */ - private String serverPlatformURLRoot; /* Initialized in constructor */ - private CommunityProfileRESTClient restClient; /* Initialized in constructor */ + private final String serverName; /* Initialized in constructor */ + private final String serverPlatformURLRoot; /* Initialized in constructor */ + private final CommunityProfileRESTClient restClient; /* Initialized in constructor */ - private InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); + private final InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); /** @@ -377,8 +378,8 @@ public long getKarmaPoints(String userId, @Override public List getContactMethods(String userId, String profileUserId) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException + PropertyServerException, + UserNotAuthorizedException { return null; } @@ -530,8 +531,8 @@ public PersonalProfileUniverse getPersonalProfileForUser(String userId, @Override public PersonalProfileUniverse getPersonalProfileByQualifiedName(String userId, String qualifiedName) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException + PropertyServerException, + UserNotAuthorizedException { final String methodName = "getPersonalProfileByQualifiedName"; final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/personal-profiles/by-qualified-name"; @@ -542,8 +543,12 @@ public PersonalProfileUniverse getPersonalProfileByQualifiedName(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(qualifiedName, qualifiedNameParameterName, methodName); - PersonalProfileResponse restResult = restClient.callPersonalProfileGetRESTCall(methodName, + NameRequestBody requestBody = new NameRequestBody(); + requestBody.setName(qualifiedName); + + PersonalProfileResponse restResult = restClient.callPersonalProfilePostRESTCall(methodName, serverPlatformURLRoot + urlTemplate, + requestBody, serverName, userId, qualifiedName); @@ -566,10 +571,10 @@ public PersonalProfileUniverse getPersonalProfileByQualifiedName(String userId, * @throws UserNotAuthorizedException the calling user is not authorized to issue the call. */ @Override - public List getPersonalProfilesByName(String userId, - String name) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException + public List getPersonalProfilesByName(String userId, + String name) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException { final String methodName = "getPersonalProfilesByName"; final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/personal-profiles/by-name"; @@ -580,8 +585,12 @@ public List getPersonalProfilesByName(String use invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(name, nameParameterName, methodName); - PersonalProfileListResponse restResult = restClient.callPersonalProfileListGetRESTCall(methodName, + NameRequestBody requestBody = new NameRequestBody(); + requestBody.setName(name); + + PersonalProfileListResponse restResult = restClient.callPersonalProfileListPostRESTCall(methodName, serverPlatformURLRoot + urlTemplate, + requestBody, serverName, userId, name); diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/SecurityGroupManagement.java b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/SecurityGroupManagement.java index d0e2f26e6c7..181469f16fd 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/SecurityGroupManagement.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/SecurityGroupManagement.java @@ -29,12 +29,12 @@ */ public class SecurityGroupManagement implements SecurityGroupInterface { - private String serverName; /* Initialized in constructor */ - private String serverPlatformURLRoot; /* Initialized in constructor */ - private CommunityProfileRESTClient restClient; /* Initialized in constructor */ + private final String serverName; /* Initialized in constructor */ + private final String serverPlatformURLRoot; /* Initialized in constructor */ + private final CommunityProfileRESTClient restClient; /* Initialized in constructor */ - private InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); - private NullRequestBody nullRequestBody = new NullRequestBody(); + private final InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); + private final NullRequestBody nullRequestBody = new NullRequestBody(); private final String urlTemplatePrefix = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}"; @@ -289,7 +289,7 @@ public void deleteSecurityGroup(String userId, /** - * Return the list of security groups associated with a unique distinguishedName. In an ideal world, the should be only one. + * Return the list of security groups associated with a unique distinguishedName. In an ideal world, there should be only one. * * @param userId calling user * @param distinguishedName unique name of the security group diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/UserIdentityManagement.java b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/UserIdentityManagement.java index e0b0cec191c..8c6bd1aa3ab 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/UserIdentityManagement.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/UserIdentityManagement.java @@ -28,11 +28,11 @@ */ public class UserIdentityManagement implements UserIdentityManagementInterface { - private String serverName; /* Initialized in constructor */ - private String serverPlatformURLRoot; /* Initialized in constructor */ - private CommunityProfileRESTClient restClient; /* Initialized in constructor */ + private final String serverName; /* Initialized in constructor */ + private final String serverPlatformURLRoot; /* Initialized in constructor */ + private final CommunityProfileRESTClient restClient; /* Initialized in constructor */ - private InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); + private final InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); private final String urlTemplatePrefix = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/user-identities"; @@ -286,7 +286,7 @@ public void deleteUserIdentity(String userId, final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/{2}/delete"; - MetadataSourceRequestBody requestBody = new MetadataSourceRequestBody(); + ExternalSourceRequestBody requestBody = new ExternalSourceRequestBody(); requestBody.setExternalSourceGUID(externalSourceGUID); requestBody.setExternalSourceName(externalSourceName); @@ -419,7 +419,7 @@ public void removeIdentityFromProfile(String userId, final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/{2}/profiles/{3}/unlink"; - MetadataSourceRequestBody requestBody = new MetadataSourceRequestBody(); + ExternalSourceRequestBody requestBody = new ExternalSourceRequestBody(); requestBody.setExternalSourceGUID(externalSourceGUID); requestBody.setExternalSourceName(externalSourceName); diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/rest/CommunityProfileRESTClient.java b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/rest/CommunityProfileRESTClient.java index d35b74918d1..68d4a888fc3 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/rest/CommunityProfileRESTClient.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/rest/CommunityProfileRESTClient.java @@ -92,7 +92,7 @@ public CommunityProfileRESTClient(String serverName, * Issue a GET REST call that returns a MetadataSourceResponse object. * * @param methodName name of the method being called. - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters. + * @param urlTemplate REST API call URL template with place-holders for the parameters. * @param params a list of parameters that are slotted into the url template. * * @return MetadataSourceResponse @@ -118,7 +118,7 @@ public MetadataSourceResponse callMetadataSourceGetRESTCall(String methodName * Issue a GET REST call that returns a ActorProfileElement in a response object. * * @param methodName name of the method being called. - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters. + * @param urlTemplate REST API call URL template with place-holders for the parameters. * @param params a list of parameters that are slotted into the url template. * * @return response object @@ -144,7 +144,7 @@ public ActorProfileResponse callActorProfileGetRESTCall(String methodName, * Issue a GET REST call that returns a list of ActorProfileElements in a response object. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate REST API call URL template with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return response object * @throws InvalidParameterException one of the parameters is invalid. @@ -169,7 +169,7 @@ public ActorProfileListResponse callActorProfileListGetRESTCall(String method * Issue a GET REST call that returns a list of ActorProfileElements in a response object. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate REST API call URL template with place-holders for the parameters * @param requestBody request body for the request * @param params a list of parameters that are slotted into the url template * @return response object @@ -192,11 +192,89 @@ public ActorProfileListResponse callActorProfileListPostRESTCall(String metho } + /** + * Issue a GET REST call that returns a CommunityElement in a response object. + * + * @param methodName name of the method being called. + * @param urlTemplate REST API call URL template with place-holders for the parameters. + * @param params a list of parameters that are slotted into the url template. + * + * @return response object + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException something went wrong with the REST call stack. + */ + public CommunityResponse callCommunityGetRESTCall(String methodName, + String urlTemplate, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + CommunityResponse restResult = this.callGetRESTCall(methodName, CommunityResponse.class, urlTemplate, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + + /** + * Issue a GET REST call that returns a list of CommunityElements in a response object. + * + * @param methodName name of the method being called + * @param urlTemplate REST API call URL template with place-holders for the parameters + * @param params a list of parameters that are slotted into the url template + * @return response object + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException something went wrong with the REST call stack. + */ + public CommunityListResponse callCommunityListGetRESTCall(String methodName, + String urlTemplate, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + CommunityListResponse restResult = this.callGetRESTCall(methodName, CommunityListResponse.class, urlTemplate, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + + /** + * Issue a GET REST call that returns a list of CommunityElements in a response object. + * + * @param methodName name of the method being called + * @param urlTemplate REST API call URL template with place-holders for the parameters + * @param requestBody request body for the request + * @param params a list of parameters that are slotted into the url template + * @return response object + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException something went wrong with the REST call stack. + */ + public CommunityListResponse callCommunityListPostRESTCall(String methodName, + String urlTemplate, + Object requestBody, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + CommunityListResponse restResult = this.callPostRESTCall(methodName, CommunityListResponse.class, urlTemplate, requestBody, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + /** * Issue a GET REST call that returns a PersonRoleElement in a response object. * * @param methodName name of the method being called. - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters. + * @param urlTemplate REST API call URL template with place-holders for the parameters. * @param params a list of parameters that are slotted into the url template. * * @return response object @@ -222,7 +300,7 @@ public PersonRoleResponse callPersonRoleGetRESTCall(String methodName, * Issue a GET REST call that returns a list of PersonRoleElements in a response object. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate REST API call URL template with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return response object * @throws InvalidParameterException one of the parameters is invalid. @@ -247,7 +325,7 @@ public PersonRoleListResponse callPersonRoleListGetRESTCall(String methodName * Issue a POST REST call that returns a list of PersonRoleElements in a response object. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate REST API call URL template with place-holders for the parameters * @param requestBody request body for the request * @param params a list of parameters that are slotted into the url template * @return response object @@ -275,7 +353,7 @@ public PersonRoleListResponse callPersonRoleListPostRESTCall(String methodNam * Issue a POST REST call that returns a list of PersonRoleAppointees in a response object. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate REST API call URL template with place-holders for the parameters * @param requestBody request body for the request * @param params a list of parameters that are slotted into the url template * @return response object @@ -302,7 +380,7 @@ public PersonRoleAppointeeListResponse callPersonRoleAppointeeListPostRESTCall(S * Issue a GET REST call that returns a UserIdentityElement in a response object. * * @param methodName name of the method being called. - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters. + * @param urlTemplate REST API call URL template with place-holders for the parameters. * @param params a list of parameters that are slotted into the url template. * * @return UserIdentityResponse @@ -328,7 +406,7 @@ public UserIdentityResponse callUserIdentityGetRESTCall(String methodName, * Issue a GET REST call that returns a list of UserIdentityElements in a response object. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate REST API call URL template with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return UserIdentityListResponse * @throws InvalidParameterException one of the parameters is invalid. @@ -353,7 +431,7 @@ public UserIdentityListResponse callUserIdentityListGetRESTCall(String method * Issue a POST REST call that returns a list of UserIdentityElements in a response object. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate REST API call URL template with place-holders for the parameters * @param requestBody request body for the request * @param params a list of parameters that are slotted into the url template * @return UserIdentityListResponse @@ -380,7 +458,7 @@ public UserIdentityListResponse callUserIdentityListPostRESTCall(String metho * Issue a GET REST call that returns a PersonalProfileUniverse in a response object. * * @param methodName name of the method being called. - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters. + * @param urlTemplate REST API call URL template with place-holders for the parameters. * @param params a list of parameters that are slotted into the url template. * * @return PersonalProfileResponse @@ -402,11 +480,40 @@ public PersonalProfileResponse callPersonalProfileGetRESTCall(String methodNa } + + /** + * Issue a POST REST call that returns a PersonalProfileElement in a response object. + * + * @param methodName name of the method being called + * @param urlTemplate REST API call URL template with place-holders for the parameters + * @param requestBody request body for the request + * @param params a list of parameters that are slotted into the url template + * @return PersonalProfileResponse + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException something went wrong with the REST call stack. + */ + public PersonalProfileResponse callPersonalProfilePostRESTCall(String methodName, + String urlTemplate, + Object requestBody, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + PersonalProfileResponse restResult = this.callPostRESTCall(methodName, PersonalProfileResponse.class, urlTemplate, requestBody, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + + /** * Issue a GET REST call that returns a list of PersonalProfileElements in a response object. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate REST API call URL template with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return PersonalProfileListResponse * @throws InvalidParameterException one of the parameters is invalid. @@ -427,11 +534,40 @@ public PersonalProfileListResponse callPersonalProfileListGetRESTCall(String } + + /** + * Issue a POST REST call that returns a list of PersonalProfileElements in a response object. + * + * @param methodName name of the method being called + * @param urlTemplate REST API call URL template with place-holders for the parameters + * @param requestBody request body for the request + * @param params a list of parameters that are slotted into the url template + * @return PersonalProfileListResponse + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException something went wrong with the REST call stack. + */ + public PersonalProfileListResponse callPersonalProfileListPostRESTCall(String methodName, + String urlTemplate, + Object requestBody, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + PersonalProfileListResponse restResult = this.callPostRESTCall(methodName, PersonalProfileListResponse.class, urlTemplate, requestBody, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + + /** * Issue a GET REST call that returns an AssetListResponse object. * * @param methodName name of the method being called. - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters. + * @param urlTemplate REST API call URL template with place-holders for the parameters. * @param params a list of parameters that are slotted into the url template. * * @return AssetListResponse @@ -458,7 +594,7 @@ public AssetListResponse callAssetListGetRESTCall(String methodName, * Issue a GET REST call that returns a SecurityGroupResponse object. * * @param methodName name of the method being called. - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters. + * @param urlTemplate REST API call URL template with place-holders for the parameters. * @param params a list of parameters that are slotted into the url template. * * @return response object @@ -484,7 +620,7 @@ public SecurityGroupResponse callSecurityGroupGetRESTCall(String methodName, * Issue a POST REST call that returns a SecurityGroupResponse object. * * @param methodName name of the method being called. - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters. + * @param urlTemplate REST API call URL template with place-holders for the parameters. * @param requestBody object that passes additional parameters * @param params a list of parameters that are slotted into the url template. * @@ -512,7 +648,7 @@ public SecurityGroupResponse callSecurityGroupPostRESTCall(String methodName, * Issue a GET REST call that returns a SecurityGroupsResponse object. * * @param methodName name of the method being called. - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters. + * @param urlTemplate REST API call URL template with place-holders for the parameters. * @param params a list of parameters that are slotted into the url template. * * @return response object @@ -538,7 +674,7 @@ public SecurityGroupsResponse callSecurityGroupsGetRESTCall(String methodName * Issue a POST REST call that returns a SecurityGroupsResponse object. * * @param methodName name of the method being called. - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters. + * @param urlTemplate REST API call URL template with place-holders for the parameters. * @param requestBody object that passes additional parameters * @param params a list of parameters that are slotted into the url template. * @@ -566,7 +702,7 @@ public SecurityGroupsResponse callSecurityGroupsPostRESTCall(String methodNam * Issue a GET REST call that returns a ElementStubsResponse object. * * @param methodName name of the method being called. - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters. + * @param urlTemplate REST API call URL template with place-holders for the parameters. * @param params a list of parameters that are slotted into the url template. * * @return response object @@ -588,11 +724,38 @@ public ElementStubsResponse callElementStubsGetRESTCall(String methodName, } + + /** + * Issue a GET REST call that returns a RelatedElementListResponse object. + * + * @param methodName name of the method being called. + * @param urlTemplate REST API call URL template with place-holders for the parameters. + * @param params a list of parameters that are slotted into the url template. + * + * @return response object + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException the repository is not available or not working properly. + */ + public RelatedElementListResponse callRelatedElementListGetRESTCall(String methodName, + String urlTemplate, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + RelatedElementListResponse restResult = this.callGetRESTCall(methodName, RelatedElementListResponse.class, urlTemplate, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + /** * Issue a GET REST call that returns a LocationResponse object. * * @param methodName name of the method being called. - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters. + * @param urlTemplate REST API call URL template with place-holders for the parameters. * @param params a list of parameters that are slotted into the url template. * * @return LocationResponse @@ -615,26 +778,52 @@ public LocationResponse callLocationGetRESTCall(String methodName, /** - * Issue a POST REST call that returns a LocationsResponse object. + * Issue a GET REST call that returns a LocationListResponse object. + * + * @param methodName name of the method being called. + * @param urlTemplate REST API call URL template with place-holders for the parameters. + * @param params a list of parameters that are slotted into the url template. + * + * @return LocationListResponse + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException the repository is not available or not working properly. + */ + public LocationListResponse callLocationsGetRESTCall(String methodName, + String urlTemplate, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + LocationListResponse restResult = this.callGetRESTCall(methodName, LocationListResponse.class, urlTemplate, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + + /** + * Issue a POST REST call that returns a LocationListResponse object. * * @param methodName name of the method being called. - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters. + * @param urlTemplate REST API call URL template with place-holders for the parameters. * @param requestBody properties describing the valid value definition/set * @param params a list of parameters that are slotted into the url template. * - * @return LocationsResponse + * @return LocationListResponse * @throws InvalidParameterException one of the parameters is invalid. * @throws UserNotAuthorizedException the user is not authorized to make this request. * @throws PropertyServerException the repository is not available or not working properly. */ - public LocationsResponse callLocationsPostRESTCall(String methodName, - String urlTemplate, - Object requestBody, - Object... params) throws InvalidParameterException, + public LocationListResponse callLocationsPostRESTCall(String methodName, + String urlTemplate, + Object requestBody, + Object... params) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException { - LocationsResponse restResult = this.callPostRESTCall(methodName, LocationsResponse.class, urlTemplate, requestBody, params); + LocationListResponse restResult = this.callPostRESTCall(methodName, LocationListResponse.class, urlTemplate, requestBody, params); exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/ActorProfileConverter.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/ActorProfileConverter.java index 8e7d9a15688..5837e8a23af 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/ActorProfileConverter.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/ActorProfileConverter.java @@ -8,11 +8,13 @@ import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.ContributionRecordElement; import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.ElementStub; import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.ProfileIdentityElement; +import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.ProfileLocationElement; import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.UserIdentityElement; import org.odpi.openmetadata.accessservices.communityprofile.properties.ActorProfileProperties; import org.odpi.openmetadata.accessservices.communityprofile.properties.ContactMethodProperties; import org.odpi.openmetadata.accessservices.communityprofile.properties.ContributionRecord; import org.odpi.openmetadata.accessservices.communityprofile.properties.ProfileIdentityProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.ProfileLocationProperties; import org.odpi.openmetadata.accessservices.communityprofile.properties.UserIdentityProperties; import org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIMapper; import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; @@ -128,6 +130,7 @@ public B getNewComplexBean(Class beanClass, InstanceProperties entityProperties = new InstanceProperties(entity.getProperties()); userProperties.setQualifiedName(this.removeQualifiedName(entityProperties)); + userProperties.setUserId(this.removeUserId(instanceProperties)); userProperties.setDistinguishedName(this.removeDistinguishedName(instanceProperties)); userProperties.setAdditionalProperties(this.removeAdditionalProperties(entityProperties)); @@ -160,6 +163,9 @@ else if (repositoryHelper.isTypeOf(serviceName, entityTypeName, OpenMetadataAPIM contributionRecord.setIsPublic(this.removeIsPublic(entityProperties)); contributionRecord.setTypeName(bean.getElementHeader().getType().getTypeName()); contributionRecord.setExtendedProperties(this.getRemainingExtendedProperties(entityProperties)); + + contributionBean.setProperties(contributionRecord); + bean.setContributionRecord(contributionBean); } else if (repositoryHelper.isTypeOf(serviceName, entityTypeName, OpenMetadataAPIMapper.CONTACT_DETAILS_TYPE_NAME)) { @@ -170,9 +176,11 @@ else if (repositoryHelper.isTypeOf(serviceName, entityTypeName, OpenMetadataAPIM InstanceProperties entityProperties = new InstanceProperties(entity.getProperties()); - contactMethodProperties.setType(this.getContactMethodTypeFromProperties(entityProperties)); - contactMethodProperties.setService(this.removeContactMethodService(entityProperties)); - contactMethodProperties.setValue(this.removeContactMethodValue(entityProperties)); + contactMethodProperties.setName(this.removeName(entityProperties)); + contactMethodProperties.setContactType(this.removeContactType(entityProperties)); + contactMethodProperties.setContactMethodType(this.getContactMethodTypeFromProperties(entityProperties)); + contactMethodProperties.setContactMethodService(this.removeContactMethodService(entityProperties)); + contactMethodProperties.setContactMethodValue(this.removeContactMethodValue(entityProperties)); contactMethodProperties.setEffectiveFrom(entityProperties.getEffectiveFromTime()); contactMethodProperties.setEffectiveTo(entityProperties.getEffectiveToTime()); @@ -204,6 +212,7 @@ else if (repositoryHelper.isTypeOf(serviceName, entityTypeName, OpenMetadataAPIM List teamLeaders = new ArrayList<>(); List teamMembers = new ArrayList<>(); List profileIdentities = new ArrayList<>(); + List locations = new ArrayList<>(); List roles = new ArrayList<>(); List linkedInfrastructure = new ArrayList<>(); @@ -245,6 +254,21 @@ else if (repositoryHelper.isTypeOf(serviceName, relationshipTypeName, OpenMetada linkedInfrastructure.add(elementStub); } + else if (repositoryHelper.isTypeOf(serviceName, relationshipTypeName, OpenMetadataAPIMapper.PROFILE_LOCATION_TYPE_NAME)) + { + EntityProxy entityProxy = relationship.getEntityTwoProxy(); + + ElementStub elementStub = super.getElementStub(beanClass, entityProxy, methodName); + + ProfileLocationElement locationElement = new ProfileLocationElement(); + ProfileLocationProperties locationProperties = new ProfileLocationProperties(); + + locationProperties.setAssociationType(this.removeAssociationType(relationship.getProperties())); + + locationElement.setLocation(elementStub); + locationElement.setProperties(locationProperties); + locations.add(locationElement); + } else if (repositoryHelper.isTypeOf(serviceName, relationshipTypeName, OpenMetadataAPIMapper.PROFILE_IDENTITY_RELATIONSHIP_TYPE_NAME)) { EntityProxy entityProxy = repositoryHelper.getOtherEnd(serviceName, primaryEntity.getGUID(), relationship); @@ -270,7 +294,7 @@ else if (repositoryHelper.isTypeOf(serviceName, relationshipTypeName, OpenMetada if (primaryEntity.getGUID().equals(entityProxy.getGUID())) { /* - * The primary entity is the super team - save sub-team + * The primary entity is the super team - save subteam */ ElementStub elementStub = super.getElementStub(beanClass, relationship.getEntityTwoProxy(), methodName); subTeams.add(elementStub); @@ -313,6 +337,11 @@ else if (repositoryHelper.isTypeOf(serviceName, relationshipTypeName, OpenMetada bean.setPersonRoles(roles); } + if (! locations.isEmpty()) + { + bean.setLocations(locations); + } + if (! linkedInfrastructure.isEmpty()) { bean.setLinkedInfrastructure(linkedInfrastructure); diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/CollectionConverter.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/CollectionConverter.java index 0f05f91f4ec..7e28a8fb732 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/CollectionConverter.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/CollectionConverter.java @@ -4,6 +4,7 @@ import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.CollectionElement; +import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.PersonalRoleElement; import org.odpi.openmetadata.accessservices.communityprofile.properties.CollectionOrder; import org.odpi.openmetadata.accessservices.communityprofile.properties.CollectionProperties; @@ -22,7 +23,7 @@ /** - * CollectionConverter generates a CollectionElement from an Collection entity + * CollectionConverter generates a CollectionElement from a Collection entity */ public class CollectionConverter extends CommunityProfileOMASConverter { @@ -125,14 +126,21 @@ public B getNewBean(Class beanClass, * @return bean populated with properties from the instances supplied * @throws PropertyServerException there is a problem instantiating the bean */ - @SuppressWarnings(value = "unused") - @Override public B getNewBean(Class beanClass, EntityDetail entity, Relationship relationship, String methodName) throws PropertyServerException { - return this.getNewBean(beanClass, entity, methodName); + B returnBean = this.getNewBean(beanClass, entity, methodName); + + if (returnBean instanceof CollectionElement) + { + CollectionElement bean = (CollectionElement) returnBean; + + bean.setRelatedElement(super.getRelatedElement(beanClass, entity, relationship, methodName)); + } + + return returnBean; } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/CommentConverter.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/CommentConverter.java index 3b17ef74f23..cf3c451e973 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/CommentConverter.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/CommentConverter.java @@ -37,7 +37,7 @@ public CommentConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -106,6 +106,8 @@ public B getNewBean(Class beanClass, } bean.setProperties(commentProperties); + + bean.setRelatedElement(super.getRelatedElement(beanClass, entity, relationship, methodName)); } return returnBean; @@ -119,25 +121,6 @@ public B getNewBean(Class beanClass, } - /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have - * contain a combination of the properties from an entity and that of a connected relationship. - * - * @param beanClass name of the class to create - * @param entity entity containing the properties - * @param methodName calling method - * @return bean populated with properties from the instances supplied - * @throws PropertyServerException there is a problem instantiating the bean - */ - @Override - public B getNewBean(Class beanClass, - EntityDetail entity, - String methodName) throws PropertyServerException - { - return getNewBean(beanClass, entity, null, methodName); - } - - /** * Retrieve and delete the CommentType enum property from the instance properties of an entity * diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/CommunityConverter.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/CommunityConverter.java index 36fc85f52a6..e3a6564f42f 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/CommunityConverter.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/CommunityConverter.java @@ -3,6 +3,7 @@ package org.odpi.openmetadata.accessservices.communityprofile.converters; +import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.CollectionElement; import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.CommunityElement; import org.odpi.openmetadata.accessservices.communityprofile.properties.CommunityProperties; import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; @@ -109,8 +110,6 @@ public B getNewBean(Class beanClass, } - - /** * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. @@ -122,13 +121,20 @@ public B getNewBean(Class beanClass, * @return bean populated with properties from the instances supplied * @throws PropertyServerException there is a problem instantiating the bean */ - @SuppressWarnings(value = "unused") - @Override public B getNewBean(Class beanClass, EntityDetail entity, Relationship relationship, String methodName) throws PropertyServerException { - return this.getNewBean(beanClass, entity, methodName); + B returnBean = this.getNewBean(beanClass, entity, methodName); + + if (returnBean instanceof CollectionElement) + { + CollectionElement bean = (CollectionElement) returnBean; + + bean.setRelatedElement(super.getRelatedElement(beanClass, entity, relationship, methodName)); + } + + return returnBean; } } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/CommunityProfileOMASConverter.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/CommunityProfileOMASConverter.java index 61cdc5c070f..6e1b70caf09 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/CommunityProfileOMASConverter.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/CommunityProfileOMASConverter.java @@ -4,6 +4,7 @@ import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.*; import org.odpi.openmetadata.accessservices.communityprofile.properties.ContactMethodType; +import org.odpi.openmetadata.accessservices.communityprofile.properties.RelationshipProperties; import org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIGenericConverter; import org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIMapper; import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; @@ -539,6 +540,59 @@ ElementOriginCategory getElementOriginCategory(InstanceProvenanceType instance } + /** + * Using the supplied instances, return a new instance of a relatedElement bean. This is used for beans that + * contain a combination of the properties from an entity and that of a connected relationship. + * + * @param beanClass name of the class to create + * @param entity entity containing the properties + * @param relationship relationship containing the properties + * @param methodName calling method + * @return bean populated with properties from the instances supplied + * @throws PropertyServerException there is a problem instantiating the bean + */ + public RelatedElement getRelatedElement(Class beanClass, + EntityDetail entity, + Relationship relationship, + String methodName) throws PropertyServerException + { + RelatedElement relatedElement = new RelatedElement(); + + relatedElement.setRelationshipHeader(this.getMetadataElementHeader(beanClass, relationship, null, methodName)); + + if (relationship != null) + { + InstanceProperties instanceProperties = new InstanceProperties(relationship.getProperties()); + + RelationshipProperties relationshipProperties = new RelationshipProperties(); + + relationshipProperties.setEffectiveFrom(instanceProperties.getEffectiveFromTime()); + relationshipProperties.setEffectiveTo(instanceProperties.getEffectiveToTime()); + relationshipProperties.setExtendedProperties(this.getRemainingExtendedProperties(instanceProperties)); + + relatedElement.setRelationshipProperties(relationshipProperties); + } + else + { + handleMissingMetadataInstance(beanClass.getName(), TypeDefCategory.RELATIONSHIP_DEF, methodName); + } + + + if (entity != null) + { + ElementStub elementStub = this.getElementStub(beanClass, entity, methodName); + + relatedElement.setRelatedElement(elementStub); + } + else + { + handleMissingMetadataInstance(beanClass.getName(), TypeDefCategory.ENTITY_DEF, methodName); + } + + return relatedElement; + } + + /** * Retrieve the ContactMethodType enum property from the instance properties of an entity * diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/ContactMethodConverter.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/ContactMethodConverter.java index 8aecc77d545..59d0eed37d6 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/ContactMethodConverter.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/ContactMethodConverter.java @@ -73,9 +73,11 @@ public B getNewBean(Class beanClass, { entityProperties = new InstanceProperties(entity.getProperties()); - contactMethodProperties.setType(this.getContactMethodTypeFromProperties(entityProperties)); - contactMethodProperties.setService(this.removeContactMethodService(entityProperties)); - contactMethodProperties.setValue(this.removeContactMethodValue(entityProperties)); + contactMethodProperties.setName(this.removeName(entityProperties)); + contactMethodProperties.setContactType(this.removeContactType(entityProperties)); + contactMethodProperties.setContactMethodType(this.getContactMethodTypeFromProperties(entityProperties)); + contactMethodProperties.setContactMethodService(this.removeContactMethodService(entityProperties)); + contactMethodProperties.setContactMethodValue(this.removeContactMethodValue(entityProperties)); contactMethodProperties.setEffectiveFrom(entityProperties.getEffectiveFromTime()); contactMethodProperties.setEffectiveTo(entityProperties.getEffectiveToTime()); diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/ExternalReferenceConverter.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/ExternalReferenceConverter.java index 0bc7d8982b8..a8d724bff6f 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/ExternalReferenceConverter.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/ExternalReferenceConverter.java @@ -37,7 +37,7 @@ public ExternalReferenceConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -56,7 +56,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/InformalTagConverter.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/InformalTagConverter.java index 5384a9b98c7..d16ab2e3a95 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/InformalTagConverter.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/InformalTagConverter.java @@ -36,7 +36,7 @@ public InformalTagConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -107,7 +107,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/LikeConverter.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/LikeConverter.java index 2c684faa08e..2b8c04a5744 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/LikeConverter.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/LikeConverter.java @@ -36,7 +36,7 @@ public LikeConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -99,7 +99,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/LocationConverter.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/LocationConverter.java index 0e089f57ca5..b0985e25808 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/LocationConverter.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/LocationConverter.java @@ -36,7 +36,7 @@ public LocationConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -61,7 +61,11 @@ public B getNewBean(Class beanClass, if (returnBean instanceof LocationElement) { - this.updateSimpleMetadataElement(beanClass, (LocationElement) returnBean, entity, methodName); + LocationElement bean = (LocationElement) returnBean; + + this.updateSimpleMetadataElement(beanClass, bean, entity, methodName); + + bean.setRelatedElement(super.getRelatedElement(beanClass, entity, relationship, methodName)); } return returnBean; @@ -76,7 +80,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -99,7 +103,7 @@ public B getNewBean(Class beanClass, if (returnBean instanceof LocationElement) { - this.updateSimpleMetadataElement(beanClass, ( LocationElement) returnBean, entity, methodName); + this.updateSimpleMetadataElement(beanClass, (LocationElement) returnBean, entity, methodName); } return returnBean; @@ -137,7 +141,8 @@ void updateSimpleMetadataElement(Class beanClass, locationProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); locationProperties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); - locationProperties.setDisplayName(this.removeName(instanceProperties)); + locationProperties.setIdentifier(this.removeIdentifier(instanceProperties)); + locationProperties.setDisplayName(this.removeDisplayName(instanceProperties)); locationProperties.setDescription(this.removeDescription(instanceProperties)); /* diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/MetadataSourceConverter.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/MetadataSourceConverter.java index 99c24d4ea31..72798fe824a 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/MetadataSourceConverter.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/MetadataSourceConverter.java @@ -35,7 +35,7 @@ public MetadataSourceConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -109,7 +109,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/NoteLogHeaderConverter.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/NoteLogHeaderConverter.java index 94b43255e2d..78b99eca3fd 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/NoteLogHeaderConverter.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/NoteLogHeaderConverter.java @@ -34,7 +34,7 @@ public NoteLogHeaderConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/PersonRoleConverter.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/PersonRoleConverter.java index 5d23c357753..76754d7fbf3 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/PersonRoleConverter.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/PersonRoleConverter.java @@ -42,22 +42,18 @@ public PersonRoleConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. It is used for beans such as - * an Annotation or DataField bean which combine knowledge from the entity and its linked relationships. + * Using the supplied entity, return a new instance of the bean. This is used for most beans that have + * a one to one correspondence with the repository instances. * * @param beanClass name of the class to create - * @param primaryEntity entity that is the root of the cluster of entities that make up the - * content of the bean - * @param relationships relationships linking the entities + * @param entity entity containing the properties * @param methodName calling method - * @return bean populated with properties from the instances supplied + * @return bean populated with properties from the entity supplied * @throws PropertyServerException there is a problem instantiating the bean */ - @Override - public B getNewComplexBean(Class beanClass, - EntityDetail primaryEntity, - List relationships, - String methodName) throws PropertyServerException + public B getNewBean(Class beanClass, + EntityDetail entity, + String methodName) throws PropertyServerException { try { @@ -71,19 +67,21 @@ public B getNewComplexBean(Class beanClass, PersonRoleElement bean = (PersonRoleElement) returnBean; PersonRoleProperties roleProperties = new PersonRoleProperties(); - if (primaryEntity != null) + if (entity != null) { - bean.setElementHeader(this.getMetadataElementHeader(beanClass, primaryEntity, methodName)); + bean.setElementHeader(this.getMetadataElementHeader(beanClass, entity, methodName)); /* * The initial set of values come from the entity. */ - InstanceProperties instanceProperties = new InstanceProperties(primaryEntity.getProperties()); + InstanceProperties instanceProperties = new InstanceProperties(entity.getProperties()); - roleProperties.setRoleId(this.removeQualifiedName(instanceProperties)); + roleProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); + roleProperties.setRoleId(this.removeIdentifier(instanceProperties)); roleProperties.setTitle(this.removeTitle(instanceProperties)); roleProperties.setDescription(this.removeDescription(instanceProperties)); roleProperties.setScope(this.removeScope(instanceProperties)); + roleProperties.setDomainIdentifier(this.removeDomainIdentifier(instanceProperties)); roleProperties.setHeadCountLimitSet(instanceProperties.getPropertyValue(OpenMetadataAPIMapper.HEAD_COUNT_PROPERTY_NAME) != null); roleProperties.setHeadCount(this.removeHeadCount(instanceProperties)); @@ -99,38 +97,6 @@ public B getNewComplexBean(Class beanClass, roleProperties.setTypeName(bean.getElementHeader().getType().getTypeName()); roleProperties.setExtendedProperties(this.getRemainingExtendedProperties(instanceProperties)); - if (relationships != null) - { - List appointees = new ArrayList<>(); - - for (Relationship relationship : relationships) - { - if (relationship != null) - { - InstanceType instanceType = relationship.getType(); - - if (instanceType != null) - { - if (repositoryHelper.isTypeOf(serviceName, - instanceType.getTypeDefName(), - OpenMetadataAPIMapper.PERSON_ROLE_APPOINTMENT_RELATIONSHIP_TYPE_NAME)) - { - EntityProxy entityProxy = repositoryHelper.getOtherEnd(serviceName, primaryEntity.getGUID(), relationship); - - ElementStub elementStub = super.getElementStub(beanClass, entityProxy, methodName); - - appointees.add(elementStub); - } - } - } - } - - if (! appointees.isEmpty()) - { - bean.setAppointees(appointees); - } - } - bean.setProperties(roleProperties); } else @@ -148,4 +114,33 @@ public B getNewComplexBean(Class beanClass, return null; } + + + /** + * Using the supplied instances, return a new instance of the bean. This is used for beans that + * contain a combination of the properties from an entity and that of a connected relationship. + * + * @param beanClass name of the class to create + * @param entity entity containing the properties + * @param relationship relationship containing the properties + * @param methodName calling method + * @return bean populated with properties from the instances supplied + * @throws PropertyServerException there is a problem instantiating the bean + */ + public B getNewBean(Class beanClass, + EntityDetail entity, + Relationship relationship, + String methodName) throws PropertyServerException + { + B returnBean = this.getNewBean(beanClass, entity, methodName); + + if (returnBean instanceof PersonRoleElement) + { + PersonRoleElement bean = (PersonRoleElement) returnBean; + + bean.setRelatedElement(super.getRelatedElement(beanClass, entity, relationship, methodName)); + } + + return returnBean; + } } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/PersonalProfileConverter.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/PersonalProfileConverter.java index 2428f3174b3..b8bc897cde1 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/PersonalProfileConverter.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/PersonalProfileConverter.java @@ -88,6 +88,7 @@ public B getNewComplexBean(Class beanClass, profileProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); profileProperties.setKnownName(this.removeName(instanceProperties)); + profileProperties.setPronouns(this.removePronouns(instanceProperties)); profileProperties.setDescription(this.removeDescription(instanceProperties)); profileProperties.setTitle(this.removeTitle(instanceProperties)); profileProperties.setInitials(this.removeInitials(instanceProperties)); @@ -134,6 +135,7 @@ public B getNewComplexBean(Class beanClass, InstanceProperties entityProperties = new InstanceProperties(entity.getProperties()); userProperties.setQualifiedName(this.removeQualifiedName(entityProperties)); + userProperties.setUserId(this.removeUserId(instanceProperties)); userProperties.setDistinguishedName(this.removeDistinguishedName(instanceProperties)); userProperties.setAdditionalProperties(this.removeAdditionalProperties(entityProperties)); @@ -166,6 +168,10 @@ else if (repositoryHelper.isTypeOf(serviceName, entityTypeName, OpenMetadataAPIM contributionRecord.setIsPublic(this.removeIsPublic(entityProperties)); contributionRecord.setTypeName(bean.getElementHeader().getType().getTypeName()); contributionRecord.setExtendedProperties(this.getRemainingExtendedProperties(entityProperties)); + + contributionBean.setProperties(contributionRecord); + + bean.setContributionRecord(contributionBean); } else if (repositoryHelper.isTypeOf(serviceName, entityTypeName, OpenMetadataAPIMapper.CONTACT_DETAILS_TYPE_NAME)) { @@ -176,9 +182,11 @@ else if (repositoryHelper.isTypeOf(serviceName, entityTypeName, OpenMetadataAPIM InstanceProperties entityProperties = new InstanceProperties(entity.getProperties()); - contactMethodProperties.setType(this.getContactMethodTypeFromProperties(entityProperties)); - contactMethodProperties.setService(this.removeContactMethodService(entityProperties)); - contactMethodProperties.setValue(this.removeContactMethodValue(entityProperties)); + contactMethodProperties.setName(this.removeName(entityProperties)); + contactMethodProperties.setContactType(this.removeContactType(entityProperties)); + contactMethodProperties.setContactMethodType(this.getContactMethodTypeFromProperties(entityProperties)); + contactMethodProperties.setContactMethodService(this.removeContactMethodService(entityProperties)); + contactMethodProperties.setContactMethodValue(this.removeContactMethodValue(entityProperties)); contactMethodProperties.setEffectiveFrom(entityProperties.getEffectiveFromTime()); contactMethodProperties.setEffectiveTo(entityProperties.getEffectiveToTime()); diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/PersonalRoleConverter.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/PersonalRoleConverter.java index 925dc2a3823..59cb37d4bfd 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/PersonalRoleConverter.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/PersonalRoleConverter.java @@ -3,6 +3,7 @@ package org.odpi.openmetadata.accessservices.communityprofile.converters; +import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.PersonRoleElement; import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.PersonalRoleElement; import org.odpi.openmetadata.accessservices.communityprofile.properties.PersonalRoleProperties; import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; @@ -71,10 +72,12 @@ public B getNewBean(Class beanClass, */ InstanceProperties instanceProperties = new InstanceProperties(entity.getProperties()); - profileProperties.setRoleId(this.removeQualifiedName(instanceProperties)); + profileProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); + profileProperties.setRoleId(this.removeIdentifier(instanceProperties)); profileProperties.setTitle(this.removeTitle(instanceProperties)); profileProperties.setDescription(this.removeDescription(instanceProperties)); profileProperties.setScope(this.removeScope(instanceProperties)); + profileProperties.setDomainIdentifier(this.removeDomainIdentifier(instanceProperties)); profileProperties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); profileProperties.setEffectiveFrom(instanceProperties.getEffectiveFromTime()); profileProperties.setEffectiveTo(instanceProperties.getEffectiveToTime()); @@ -105,6 +108,8 @@ public B getNewBean(Class beanClass, } + + /** * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. @@ -116,13 +121,20 @@ public B getNewBean(Class beanClass, * @return bean populated with properties from the instances supplied * @throws PropertyServerException there is a problem instantiating the bean */ - @SuppressWarnings(value = "unused") - @Override public B getNewBean(Class beanClass, EntityDetail entity, Relationship relationship, String methodName) throws PropertyServerException { - return this.getNewBean(beanClass, entity, methodName); + B returnBean = this.getNewBean(beanClass, entity, methodName); + + if (returnBean instanceof PersonalRoleElement) + { + PersonalRoleElement bean = (PersonalRoleElement) returnBean; + + bean.setRelatedElement(super.getRelatedElement(beanClass, entity, relationship, methodName)); + } + + return returnBean; } } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/ProjectCollectionMemberConverter.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/ProjectCollectionMemberConverter.java index 68865548c6e..8b3aee47f77 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/ProjectCollectionMemberConverter.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/ProjectCollectionMemberConverter.java @@ -34,7 +34,7 @@ public ProjectCollectionMemberConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -78,6 +78,8 @@ public B getNewBean(Class beanClass, projectProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); projectProperties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); + + projectProperties.setIdentifier(this.removeIdentifier(instanceProperties)); projectProperties.setName(this.removeName(instanceProperties)); projectProperties.setDescription(this.removeDescription(instanceProperties)); projectProperties.setStartDate(this.removeStartDate(instanceProperties)); diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/RatingConverter.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/RatingConverter.java index 3cbb5789823..db6bcb7de91 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/RatingConverter.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/RatingConverter.java @@ -37,7 +37,7 @@ public RatingConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -107,7 +107,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/RelatedElementConverter.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/RelatedElementConverter.java new file mode 100644 index 00000000000..fb72d5a415e --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/RelatedElementConverter.java @@ -0,0 +1,156 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.communityprofile.converters; + + +import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.CollectionElement; +import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.ElementStub; +import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.RelatedElement; +import org.odpi.openmetadata.accessservices.communityprofile.properties.CollectionOrder; +import org.odpi.openmetadata.accessservices.communityprofile.properties.CollectionProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.RelationshipProperties; +import org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIMapper; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EnumPropertyValue; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstancePropertyValue; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefCategory; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper; + +import java.lang.reflect.InvocationTargetException; +import java.util.Map; + + +/** + * RelatedElementConverter generates a RelatedElement from a relationship and attached entity + */ +public class RelatedElementConverter extends CommunityProfileOMASConverter +{ + /** + * Constructor + * + * @param repositoryHelper helper object to parse entity + * @param serviceName name of this component + * @param serverName local server name + */ + public RelatedElementConverter(OMRSRepositoryHelper repositoryHelper, + String serviceName, + String serverName) + { + super(repositoryHelper, serviceName, serverName); + } + + + + /** + * Using the supplied instances, return a new instance of the bean. This is used for beans that + * contain a combination of the properties from an entity and that of a connected relationship. + * + * @param beanClass name of the class to create + * @param entity entity containing the properties + * @param relationship relationship containing the properties + * @param methodName calling method + * @return bean populated with properties from the instances supplied + * @throws PropertyServerException there is a problem instantiating the bean + */ + @Override + public B getNewBean(Class beanClass, + EntityDetail entity, + Relationship relationship, + String methodName) throws PropertyServerException + { + try + { + return (B)this.getRelatedElement(beanClass, entity, relationship, methodName); + } + catch (ClassCastException error) + { + super.handleInvalidBeanClass(beanClass.getName(), error, methodName); + } + + return null; + } + + /** + * Retrieve and delete the CollectionOrder enum property from the instance properties of an entity + * + * @param properties entity properties + * @return CollectionOrder enum value + */ + private CollectionOrder removeCollectionOrderFromProperties(InstanceProperties properties) + { + CollectionOrder collectionOrder = this.getCollectionOrderFromProperties(properties); + + if (properties != null) + { + Map instancePropertiesMap = properties.getInstanceProperties(); + + if (instancePropertiesMap != null) + { + instancePropertiesMap.remove(OpenMetadataAPIMapper.ORDER_BY_PROPERTY_NAME); + } + + properties.setInstanceProperties(instancePropertiesMap); + } + + return collectionOrder; + } + + + /** + * Retrieve the CollectionOrder enum property from the instance properties of an entity + * + * @param properties entity properties + * @return CollectionOrder enum value + */ + private CollectionOrder getCollectionOrderFromProperties(InstanceProperties properties) + { + CollectionOrder collectionOrder = CollectionOrder.NAME; + + if (properties != null) + { + Map instancePropertiesMap = properties.getInstanceProperties(); + + if (instancePropertiesMap != null) + { + InstancePropertyValue instancePropertyValue = instancePropertiesMap.get(OpenMetadataAPIMapper.ORDER_PROPERTY_NAME_PROPERTY_NAME); + + if (instancePropertyValue instanceof EnumPropertyValue) + { + EnumPropertyValue enumPropertyValue = (EnumPropertyValue) instancePropertyValue; + + switch (enumPropertyValue.getOrdinal()) + { + case 0: + collectionOrder = CollectionOrder.NAME; + break; + + case 1: + collectionOrder = CollectionOrder.OWNER; + break; + + case 2: + collectionOrder = CollectionOrder.DATE_ADDED; + break; + + case 3: + collectionOrder = CollectionOrder.DATE_UPDATED; + break; + + case 4: + collectionOrder = CollectionOrder.DATE_CREATED; + break; + + case 99: + collectionOrder = CollectionOrder.OTHER; + break; + } + } + } + } + + return collectionOrder; + } +} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/ResourceConverter.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/ResourceConverter.java index 94b5ff7ace8..5d2befb748d 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/ResourceConverter.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/ResourceConverter.java @@ -3,6 +3,7 @@ package org.odpi.openmetadata.accessservices.communityprofile.converters; +import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.CollectionElement; import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.ResourceElement; import org.odpi.openmetadata.accessservices.communityprofile.properties.ResourceProperties; import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; @@ -108,6 +109,8 @@ public B getNewBean(Class beanClass, } + + /** * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. @@ -119,13 +122,20 @@ public B getNewBean(Class beanClass, * @return bean populated with properties from the instances supplied * @throws PropertyServerException there is a problem instantiating the bean */ - @SuppressWarnings(value = "unused") - @Override public B getNewBean(Class beanClass, EntityDetail entity, Relationship relationship, String methodName) throws PropertyServerException { - return this.getNewBean(beanClass, entity, methodName); + B returnBean = this.getNewBean(beanClass, entity, methodName); + + if (returnBean instanceof CollectionElement) + { + CollectionElement bean = (CollectionElement) returnBean; + + bean.setRelatedElement(super.getRelatedElement(beanClass, entity, relationship, methodName)); + } + + return returnBean; } } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/SecurityGroupConverter.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/SecurityGroupConverter.java index 8cc7cff45aa..b54e759fc57 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/SecurityGroupConverter.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/SecurityGroupConverter.java @@ -3,6 +3,7 @@ package org.odpi.openmetadata.accessservices.communityprofile.converters; +import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.CollectionElement; import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.SecurityGroupElement; import org.odpi.openmetadata.accessservices.communityprofile.properties.SecurityGroupProperties; import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; @@ -113,4 +114,33 @@ public B getNewComplexBean(Class beanClass, return null; } + + + /** + * Using the supplied instances, return a new instance of the bean. This is used for beans that + * contain a combination of the properties from an entity and that of a connected relationship. + * + * @param beanClass name of the class to create + * @param entity entity containing the properties + * @param relationship relationship containing the properties + * @param methodName calling method + * @return bean populated with properties from the instances supplied + * @throws PropertyServerException there is a problem instantiating the bean + */ + public B getNewBean(Class beanClass, + EntityDetail entity, + Relationship relationship, + String methodName) throws PropertyServerException + { + B returnBean = this.getNewBean(beanClass, entity, methodName); + + if (returnBean instanceof SecurityGroupElement) + { + SecurityGroupElement bean = (SecurityGroupElement) returnBean; + + bean.setRelatedElement(super.getRelatedElement(beanClass, entity, relationship, methodName)); + } + + return returnBean; + } } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/ToDoConverter.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/ToDoConverter.java index daea89b6aa8..b2b6234db32 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/ToDoConverter.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/ToDoConverter.java @@ -3,6 +3,7 @@ package org.odpi.openmetadata.accessservices.communityprofile.converters; +import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.CollectionElement; import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.ToDoElement; import org.odpi.openmetadata.accessservices.communityprofile.properties.ToDoProperties; import org.odpi.openmetadata.accessservices.communityprofile.properties.ToDoStatus; @@ -117,6 +118,8 @@ public B getNewBean(Class beanClass, } + + /** * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. @@ -128,14 +131,21 @@ public B getNewBean(Class beanClass, * @return bean populated with properties from the instances supplied * @throws PropertyServerException there is a problem instantiating the bean */ - @SuppressWarnings(value = "unused") - @Override public B getNewBean(Class beanClass, EntityDetail entity, Relationship relationship, String methodName) throws PropertyServerException { - return this.getNewBean(beanClass, entity, methodName); + B returnBean = this.getNewBean(beanClass, entity, methodName); + + if (returnBean instanceof ToDoElement) + { + ToDoElement bean = (ToDoElement) returnBean; + + bean.setRelatedElement(super.getRelatedElement(beanClass, entity, relationship, methodName)); + } + + return returnBean; } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/UserIdentityConverter.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/UserIdentityConverter.java index 963376ba87d..22b62aabc31 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/UserIdentityConverter.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/UserIdentityConverter.java @@ -3,6 +3,7 @@ package org.odpi.openmetadata.accessservices.communityprofile.converters; +import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.CollectionElement; import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.UserIdentityElement; import org.odpi.openmetadata.accessservices.communityprofile.properties.UserIdentityProperties; import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; @@ -72,6 +73,7 @@ public B getNewBean(Class beanClass, InstanceProperties instanceProperties = new InstanceProperties(entity.getProperties()); properties.setQualifiedName(this.removeQualifiedName(instanceProperties)); + properties.setUserId(this.removeUserId(instanceProperties)); properties.setDistinguishedName(this.removeDistinguishedName(instanceProperties)); properties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); properties.setEffectiveFrom(instanceProperties.getEffectiveFromTime()); @@ -104,7 +106,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -114,12 +116,20 @@ public B getNewBean(Class beanClass, * @return bean populated with properties from the instances supplied * @throws PropertyServerException there is a problem instantiating the bean */ - @Override public B getNewBean(Class beanClass, EntityDetail entity, Relationship relationship, String methodName) throws PropertyServerException { - return getNewBean(beanClass, entity, methodName); + B returnBean = this.getNewBean(beanClass, entity, methodName); + + if (returnBean instanceof UserIdentityElement) + { + UserIdentityElement bean = (UserIdentityElement) returnBean; + + bean.setRelatedElement(super.getRelatedElement(beanClass, entity, relationship, methodName)); + } + + return returnBean; } } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/CommunityProfileInstanceHandler.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/CommunityProfileInstanceHandler.java index 384c6a4db72..b5a7867b23c 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/CommunityProfileInstanceHandler.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/CommunityProfileInstanceHandler.java @@ -28,6 +28,36 @@ class CommunityProfileInstanceHandler extends OMASServiceInstanceHandler } + /** + * Retrieve the specific handler for the access service. + * + * @param userId calling user + * @param serverName name of the server tied to the request + * @param serviceOperationName name of the REST API call (typically the top-level methodName) + * @return handler for use by the requested instance + * @throws InvalidParameterException no available instance for the requested server + * @throws UserNotAuthorizedException user does not have access to the requested server + * @throws PropertyServerException the service name is not known - indicating a logic error + */ + ReferenceableHandler getRelatedElementHandler(String userId, + String serverName, + String serviceOperationName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + CommunityProfileServicesInstance instance = (CommunityProfileServicesInstance)super.getServerServiceInstance(userId, + serverName, + serviceOperationName); + + if (instance != null) + { + return instance.getRelatedElementHandler(); + } + + return null; + } + + /** * Retrieve the specific handler for the access service. * @@ -148,6 +178,37 @@ PersonRoleHandler getPersonRoleHandler(String userId, } + + /** + * Retrieve the specific handler for the access service. + * + * @param userId calling user + * @param serverName name of the server tied to the request + * @param serviceOperationName name of the REST API call (typically the top-level methodName) + * @return handler for use by the requested instance + * @throws InvalidParameterException no available instance for the requested server + * @throws UserNotAuthorizedException user does not have access to the requested server + * @throws PropertyServerException the service name is not known - indicating a logic error + */ + CommunityHandler getCommunityHandler(String userId, + String serverName, + String serviceOperationName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + CommunityProfileServicesInstance instance = (CommunityProfileServicesInstance)super.getServerServiceInstance(userId, + serverName, + serviceOperationName); + + if (instance != null) + { + return instance.getCommunityHandler(); + } + + return null; + } + + /** * Retrieve the specific handler for the access service. * diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/CommunityProfileServicesInstance.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/CommunityProfileServicesInstance.java index 6e9058ae2d1..8c7ed079c93 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/CommunityProfileServicesInstance.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/CommunityProfileServicesInstance.java @@ -23,22 +23,24 @@ */ public class CommunityProfileServicesInstance extends OMASServiceInstance { - private static AccessServiceDescription myDescription = AccessServiceDescription.COMMUNITY_PROFILE_OMAS; - - private SoftwareCapabilityHandler metadataSourceHandler; - private UserIdentityHandler userIdentityHandler; - private ActorProfileHandler personalProfileHandler; - private ActorProfileHandler actorProfileHandler; - private PersonRoleHandler personRoleHandler; - private ContributionRecordHandler contributionRecordHandler; - private ContactDetailsHandler contactDetailsHandler; - private LocationHandler locationHandler; - private GovernanceDefinitionHandler securityGroupHandler; - - private CommentHandler commentHandler; - private InformalTagHandler informalTagHandler; - private LikeHandler likeHandler; - private RatingHandler ratingHandler; + private final static AccessServiceDescription myDescription = AccessServiceDescription.COMMUNITY_PROFILE_OMAS; + + private final ReferenceableHandler relatedElementHandler; + private final SoftwareCapabilityHandler metadataSourceHandler; + private final UserIdentityHandler userIdentityHandler; + private final ActorProfileHandler personalProfileHandler; + private final ActorProfileHandler actorProfileHandler; + private final PersonRoleHandler personRoleHandler; + private final CommunityHandler communityHandler; + private final ContributionRecordHandler contributionRecordHandler; + private final ContactDetailsHandler contactDetailsHandler; + private final LocationHandler locationHandler; + private final GovernanceDefinitionHandler securityGroupHandler; + + private final CommentHandler commentHandler; + private final InformalTagHandler informalTagHandler; + private final LikeHandler likeHandler; + private final RatingHandler ratingHandler; /** @@ -86,6 +88,20 @@ public CommunityProfileServicesInstance(OMRSRepositoryConnector repositoryConnec if (repositoryHandler != null) { + this.relatedElementHandler = new ReferenceableHandler<>(new RelatedElementConverter<>(repositoryHelper, serviceName,serverName), + RelatedElement.class, + serviceName, + serverName, + invalidParameterHandler, + repositoryHandler, + repositoryHelper, + localServerUserId, + securityVerifier, + supportedZones, + defaultZones, + publishZones, + auditLog); + this.metadataSourceHandler = new SoftwareCapabilityHandler<>(new MetadataSourceConverter<>(repositoryHelper, serviceName,serverName), MetadataSourceElement.class, serviceName, @@ -142,6 +158,20 @@ public CommunityProfileServicesInstance(OMRSRepositoryConnector repositoryConnec publishZones, auditLog); + this.communityHandler = new CommunityHandler<>(new CommunityConverter<>(repositoryHelper, serviceName,serverName), + CommunityElement.class, + serviceName, + serverName, + invalidParameterHandler, + repositoryHandler, + repositoryHelper, + localServerUserId, + securityVerifier, + supportedZones, + defaultZones, + publishZones, + auditLog); + this.userIdentityHandler = new UserIdentityHandler<>(new UserIdentityConverter<>(repositoryHelper, serviceName, serverName), UserIdentityElement.class, serviceName, @@ -279,6 +309,22 @@ public CommunityProfileServicesInstance(OMRSRepositoryConnector repositoryConnec } + /** + * Return the handler for related referenceables. + * + * @return handler object + * @throws PropertyServerException the instance has not been initialized successfully + */ + public ReferenceableHandler getRelatedElementHandler() throws PropertyServerException + { + final String methodName = "getRelatedElementHandler"; + + validateActiveRepository(methodName); + + return relatedElementHandler; + } + + /** * Return the handler for metadata source requests. * @@ -327,6 +373,23 @@ public PersonRoleHandler getPersonRoleHandler() throws Proper } + + /** + * Return the handler for community requests. + * + * @return handler object + * @throws PropertyServerException the instance has not been initialized successfully + */ + public CommunityHandler getCommunityHandler() throws PropertyServerException + { + final String methodName = "getCommunityHandler"; + + validateActiveRepository(methodName); + + return communityHandler; + } + + /** * Return the handler for personal profile requests. * diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/CommunityRESTServices.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/CommunityRESTServices.java new file mode 100644 index 00000000000..fb2182f2a74 --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/CommunityRESTServices.java @@ -0,0 +1,884 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.communityprofile.server; + +import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.CommunityElement; +import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.PersonRoleElement; +import org.odpi.openmetadata.accessservices.communityprofile.properties.CommunityMembershipProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.CommunityMembershipType; +import org.odpi.openmetadata.accessservices.communityprofile.properties.CommunityProperties; +import org.odpi.openmetadata.accessservices.communityprofile.rest.CommunityListResponse; +import org.odpi.openmetadata.accessservices.communityprofile.rest.CommunityResponse; +import org.odpi.openmetadata.accessservices.communityprofile.rest.ExternalSourceRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.rest.PersonRoleListResponse; +import org.odpi.openmetadata.accessservices.communityprofile.rest.ReferenceableRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.rest.RelationshipRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.rest.TemplateRequestBody; +import org.odpi.openmetadata.commonservices.ffdc.RESTCallLogger; +import org.odpi.openmetadata.commonservices.ffdc.RESTCallToken; +import org.odpi.openmetadata.commonservices.ffdc.RESTExceptionHandler; +import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDResponse; +import org.odpi.openmetadata.commonservices.ffdc.rest.NameRequestBody; +import org.odpi.openmetadata.commonservices.ffdc.rest.SearchStringRequestBody; +import org.odpi.openmetadata.commonservices.ffdc.rest.VoidResponse; +import org.odpi.openmetadata.commonservices.generichandlers.CommunityHandler; +import org.odpi.openmetadata.commonservices.generichandlers.PersonRoleHandler; +import org.odpi.openmetadata.frameworks.auditlog.AuditLog; +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; +import org.slf4j.LoggerFactory; + +import java.util.Date; +import java.util.List; + +/** + * CommunityRESTServices provides the API operations to create and maintain community information. + */ +public class CommunityRESTServices +{ + private static final CommunityProfileInstanceHandler instanceHandler = new CommunityProfileInstanceHandler(); + private static final RESTExceptionHandler restExceptionHandler = new RESTExceptionHandler(); + private static final RESTCallLogger restCallLogger = new RESTCallLogger(LoggerFactory.getLogger(CommunityRESTServices.class), + instanceHandler.getServiceName()); + + + /** + * Default constructor + */ + public CommunityRESTServices() + { + } + + + /** + * Create a new metadata element to represent a community. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param requestBody properties to store + * + * @return unique identifier of the new metadata element or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public GUIDResponse createCommunity(String serverName, + String userId, + ReferenceableRequestBody requestBody) + { + final String methodName = "createCommunity"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + GUIDResponse response = new GUIDResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + CommunityHandler handler = instanceHandler.getCommunityHandler(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof CommunityProperties) + { + CommunityProperties properties = (CommunityProperties)requestBody.getProperties(); + + String communityGUID = handler.createCommunity(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + properties.getQualifiedName(), + properties.getName(), + properties.getDescription(), + properties.getMission(), + properties.getAdditionalProperties(), + properties.getTypeName(), + properties.getExtendedProperties(), + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + new Date(), + methodName); + + if (communityGUID != null) + { + handler.setVendorProperties(userId, + communityGUID, + properties.getVendorProperties(), + false, + false, + new Date(), + methodName); + } + + response.setGUID(communityGUID); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(CommunityProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Create a new metadata element to represent a community using an existing metadata element as a template. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param templateGUID unique identifier of the metadata element to copy + * @param requestBody properties that override the template + * + * @return unique identifier of the new metadata element or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public GUIDResponse createCommunityFromTemplate(String serverName, + String userId, + String templateGUID, + TemplateRequestBody requestBody) + { + final String methodName = "createCommunityFromTemplate"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + GUIDResponse response = new GUIDResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + CommunityHandler handler = instanceHandler.getCommunityHandler(userId, serverName, methodName); + + if (requestBody != null) + { + String communityGUID; + + communityGUID = handler.createCommunityFromTemplate(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + templateGUID, + requestBody.getQualifiedName(), + requestBody.getDisplayName(), + requestBody.getDescription(), + methodName); + + response.setGUID(communityGUID); + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Update the metadata element representing a community. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param communityGUID unique identifier of the metadata element to update + * @param isMergeUpdate should the new properties be merged with the existing properties of overlay them? + * @param requestBody new properties for this element + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse updateCommunity(String serverName, + String userId, + String communityGUID, + boolean isMergeUpdate, + ReferenceableRequestBody requestBody) + { + final String methodName = "updateCommunity"; + final String communityGUIDParameterName = "communityGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + CommunityHandler handler = instanceHandler.getCommunityHandler(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof CommunityProperties) + { + CommunityProperties properties = (CommunityProperties) requestBody.getProperties(); + + handler.updateCommunity(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + communityGUID, + communityGUIDParameterName, + properties.getQualifiedName(), + properties.getName(), + properties.getDescription(), + properties.getMission(), + properties.getAdditionalProperties(), + properties.getTypeName(), + properties.getExtendedProperties(), + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + isMergeUpdate, + false, + false, + new Date(), + methodName); + + if ((! isMergeUpdate) || (properties.getVendorProperties() != null)) + { + handler.setVendorProperties(userId, + communityGUID, + properties.getVendorProperties(), + false, + false, + new Date(), + methodName); + } + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(CommunityProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + + /** + * Create a relationship between a community and a connector type. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param communityGUID unique identifier of the community in the external data manager + * @param communityRoleGUID unique identifier of the connector type in the external data manager + * @param requestBody relationship properties + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse setupCommunityRole(String serverName, + String userId, + String communityGUID, + String communityRoleGUID, + RelationshipRequestBody requestBody) + { + final String methodName = "setupCommunityRole"; + final String communityGUIDParameterName = "communityGUID"; + final String communityRoleGUIDParameterName = "communityRoleGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + CommunityHandler handler = instanceHandler.getCommunityHandler(userId, serverName, methodName); + + if (requestBody != null) + { + int ordinal = CommunityMembershipType.CONTRIBUTOR.getOrdinal(); + + if (requestBody.getProperties() instanceof CommunityMembershipProperties) + { + CommunityMembershipProperties properties = (CommunityMembershipProperties) requestBody.getProperties(); + + if (properties.getMembershipType() != null) + { + ordinal = properties.getMembershipType().getOrdinal(); + } + + handler.addRoleToCommunity(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + communityGUID, + communityGUIDParameterName, + communityRoleGUID, + communityRoleGUIDParameterName, + ordinal, + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + false, + false, + new Date(), + methodName); + } + else if (requestBody.getProperties() == null) + { + handler.addRoleToCommunity(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + communityGUID, + communityGUIDParameterName, + communityRoleGUID, + communityRoleGUIDParameterName, + ordinal, + null, + null, + false, + false, + new Date(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(CommunityMembershipProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Remove a relationship between a community and a connector type. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param communityGUID unique identifier of the community in the external data manager + * @param communityRoleGUID unique identifier of the connector type in the external data manager + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse clearCommunityRole(String serverName, + String userId, + String communityGUID, + String communityRoleGUID, + ExternalSourceRequestBody requestBody) + { + final String methodName = "clearCommunityRole"; + final String communityGUIDParameterName = "communityGUID"; + final String communityRoleGUIDParameterName = "communityRoleGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + CommunityHandler handler = instanceHandler.getCommunityHandler(userId, serverName, methodName); + + if (requestBody != null) + { + handler.removeRoleFromCommunity(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + communityGUID, + communityGUIDParameterName, + communityRoleGUID, + communityRoleGUIDParameterName, + false, + false, + new Date(), + methodName); + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Remove the metadata element representing a community. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param communityGUID unique identifier of the metadata element to remove + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse removeCommunity(String serverName, + String userId, + String communityGUID, + ExternalSourceRequestBody requestBody) + { + final String methodName = "removeCommunity"; + final String communityGUIDParameterName = "communityGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + if (requestBody != null) + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + CommunityHandler handler = instanceHandler.getCommunityHandler(userId, serverName, methodName); + + handler.removeCommunity(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + communityGUID, + communityGUIDParameterName, + false, + false, + new Date(), + methodName); + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Retrieve the list of community metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param requestBody string to find in the properties + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public CommunityListResponse findCommunities(String serverName, + String userId, + SearchStringRequestBody requestBody, + int startFrom, + int pageSize) + { + final String methodName = "findCommunities"; + final String searchStringParameterName = "searchString"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + CommunityListResponse response = new CommunityListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + if (requestBody != null) + { + CommunityHandler handler = instanceHandler.getCommunityHandler(userId, serverName, methodName); + + List communities = handler.findCommunities(userId, + requestBody.getSearchString(), + searchStringParameterName, + startFrom, + pageSize, + false, + false, + new Date(), + methodName); + + response.setElements(setUpVendorProperties(userId, communities, handler, methodName)); + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Retrieve the list of community metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param requestBody name to search for + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public CommunityListResponse getCommunitiesByName(String serverName, + String userId, + NameRequestBody requestBody, + int startFrom, + int pageSize) + { + final String methodName = "getCommunitiesByName"; + final String nameParameterName = "name"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + CommunityListResponse response = new CommunityListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + if (requestBody != null) + { + CommunityHandler handler = instanceHandler.getCommunityHandler(userId, serverName, methodName); + + List communities = handler.getCommunitiesByName(userId, + requestBody.getName(), + nameParameterName, + startFrom, + pageSize, + false, + false, + new Date(), + methodName); + + response.setElements(setUpVendorProperties(userId, communities, handler, methodName)); + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + + /** + * Return information about a person role connected to the named community. + * + * @param serverName called server + * @param userId calling user + * @param communityGUID unique identifier for the community + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching person roles + * + * InvalidParameterException name or userId is null + * PropertyServerException problem accessing property server + * UserNotAuthorizedException security access problem + */ + public PersonRoleListResponse getRolesForCommunity(String serverName, + String userId, + String communityGUID, + int startFrom, + int pageSize) + { + final String methodName = "getRolesForCommunity"; + final String guidParameterName = "communityGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + PersonRoleListResponse response = new PersonRoleListResponse(); + AuditLog auditLog = null; + + try + { + PersonRoleHandler handler = instanceHandler.getPersonRoleHandler(userId, serverName, methodName); + + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + response.setElements(handler.getCommunityRoles(userId, + communityGUID, + guidParameterName, + startFrom, + pageSize, + false, + false, + new Date(), + methodName)); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Retrieve the list of community metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public CommunityListResponse getCommunities(String serverName, + String userId, + int startFrom, + int pageSize) + { + final String methodName = "getCommunities"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + CommunityListResponse response = new CommunityListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + CommunityHandler handler = instanceHandler.getCommunityHandler(userId, serverName, methodName); + + List communities = handler.getCommunities(userId, + startFrom, + pageSize, + false, + false, + new Date(), + methodName); + + response.setElements(setUpVendorProperties(userId, communities, handler, methodName)); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Retrieve the community metadata element with the supplied unique identifier. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param guid unique identifier of the requested metadata element + * + * @return matching metadata element or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public CommunityResponse getCommunityByGUID(String serverName, + String userId, + String guid) + { + final String methodName = "getCommunityByGUID"; + final String guidParameterName = "communityGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + CommunityResponse response = new CommunityResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + CommunityHandler handler = instanceHandler.getCommunityHandler(userId, serverName, methodName); + + CommunityElement community = handler.getCommunityByGUID(userId, + guid, + guidParameterName, + false, + false, + new Date(), + methodName); + + response.setElement(setUpVendorProperties(userId, community, handler, methodName)); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + + /** + * Set up the vendor properties in the retrieved elements. + * + * @param userId calling user + * @param retrievedResults results from the repositories + * @param handler handler used to retrieve the vendor properties + * @param methodName calling method + * + * @return updated results + * + * @throws InvalidParameterException one of the parameters is null or invalid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + private List setUpVendorProperties(String userId, + List retrievedResults, + CommunityHandler handler, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + if (retrievedResults != null) + { + for (CommunityElement element : retrievedResults) + { + if (element != null) + { + setUpVendorProperties(userId, element, handler, methodName); + } + } + } + + return retrievedResults; + } + + + /** + * Set up the vendor properties in the retrieved element. + * + * @param userId calling user + * @param element results from the repositories + * @param handler handler used to retrieve the vendor properties + * @param methodName calling method + * + * @return updated results + * + * @throws InvalidParameterException one of the parameters is null or invalid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + private CommunityElement setUpVendorProperties(String userId, + CommunityElement element, + CommunityHandler handler, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String elementGUIDParameterName = "element.getElementHeader().getGUID()"; + + if (element != null) + { + CommunityProperties properties = element.getProperties(); + + properties.setVendorProperties(handler.getVendorProperties(userId, + element.getElementHeader().getGUID(), + elementGUIDParameterName, + false, + false, + new Date(), + methodName)); + } + + return element; + } +} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/LocationRESTServices.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/LocationRESTServices.java index 652120bf88c..059426ac7f6 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/LocationRESTServices.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/LocationRESTServices.java @@ -3,19 +3,27 @@ package org.odpi.openmetadata.accessservices.communityprofile.server; import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.LocationElement; +import org.odpi.openmetadata.accessservices.communityprofile.properties.AdjacentLocationProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.AssetLocationProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.CommunityProperties; import org.odpi.openmetadata.accessservices.communityprofile.properties.LocationProperties; -import org.odpi.openmetadata.accessservices.communityprofile.properties.TemplateProperties; -import org.odpi.openmetadata.accessservices.communityprofile.rest.DigitalLocationRequestBody; -import org.odpi.openmetadata.accessservices.communityprofile.rest.FixedLocationRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.properties.NestedLocationProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.ProfileLocationProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.DigitalLocationProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.FixedLocationProperties; +import org.odpi.openmetadata.accessservices.communityprofile.rest.ClassificationRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.rest.ExternalSourceRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.rest.LocationListResponse; import org.odpi.openmetadata.accessservices.communityprofile.rest.LocationResponse; -import org.odpi.openmetadata.accessservices.communityprofile.rest.LocationsResponse; -import org.odpi.openmetadata.accessservices.communityprofile.rest.SecureLocationRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.properties.SecureLocationProperties; +import org.odpi.openmetadata.accessservices.communityprofile.rest.ReferenceableRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.rest.RelationshipRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.rest.TemplateRequestBody; import org.odpi.openmetadata.commonservices.ffdc.RESTCallLogger; import org.odpi.openmetadata.commonservices.ffdc.RESTCallToken; import org.odpi.openmetadata.commonservices.ffdc.RESTExceptionHandler; import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDResponse; import org.odpi.openmetadata.commonservices.ffdc.rest.NameRequestBody; -import org.odpi.openmetadata.commonservices.ffdc.rest.NullRequestBody; import org.odpi.openmetadata.commonservices.ffdc.rest.SearchStringRequestBody; import org.odpi.openmetadata.commonservices.ffdc.rest.VoidResponse; import org.odpi.openmetadata.commonservices.generichandlers.LocationHandler; @@ -23,7 +31,6 @@ import org.odpi.openmetadata.frameworks.auditlog.AuditLog; import org.slf4j.LoggerFactory; -import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -59,15 +66,15 @@ public LocationRESTServices() * * @param serverName name of calling server * @param userId calling user - * @param locationProperties properties to store + * @param requestBody properties to store * @return unique identifier of the new metadata element * InvalidParameterException one of the parameters is invalid or * UserNotAuthorizedException the user is not authorized to make this request or * PropertyServerException the repository is not available or not working properly. */ - public GUIDResponse createLocation(String serverName, - String userId, - LocationProperties locationProperties) + public GUIDResponse createLocation(String serverName, + String userId, + ReferenceableRequestBody requestBody) { final String methodName = "createLocation"; @@ -80,23 +87,33 @@ public GUIDResponse createLocation(String serverName, { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - if (locationProperties != null) + if (requestBody != null) { LocationHandler handler = instanceHandler.getLocationHandler(userId, serverName, methodName); - response.setGUID(handler.createLocation(userId, - null, - null, - locationProperties.getQualifiedName(), - locationProperties.getDisplayName(), - locationProperties.getDescription(), - locationProperties.getAdditionalProperties(), - locationProperties.getTypeName(), - locationProperties.getExtendedProperties(), - null, - null, - new Date(), - methodName)); + if (requestBody.getProperties() instanceof LocationProperties) + { + LocationProperties locationProperties = (LocationProperties)requestBody.getProperties(); + + response.setGUID(handler.createLocation(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + locationProperties.getQualifiedName(), + locationProperties.getIdentifier(), + locationProperties.getDisplayName(), + locationProperties.getDescription(), + locationProperties.getAdditionalProperties(), + locationProperties.getTypeName(), + locationProperties.getExtendedProperties(), + locationProperties.getEffectiveFrom(), + locationProperties.getEffectiveTo(), + new Date(), + methodName)); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(LocationProperties.class.getName(), methodName); + } } else { @@ -120,16 +137,16 @@ public GUIDResponse createLocation(String serverName, * @param serverName name of calling server * @param userId calling user * @param templateGUID unique identifier of the metadata element to copy - * @param templateProperties properties that override the template + * @param requestBody properties that override the template * @return unique identifier of the new metadata element * InvalidParameterException one of the parameters is invalid or * UserNotAuthorizedException the user is not authorized to make this request or * PropertyServerException the repository is not available or not working properly. */ - public GUIDResponse createLocationFromTemplate(String serverName, - String userId, - String templateGUID, - TemplateProperties templateProperties) + public GUIDResponse createLocationFromTemplate(String serverName, + String userId, + String templateGUID, + TemplateRequestBody requestBody) { final String methodName = "createLocationFromTemplate"; @@ -142,17 +159,18 @@ public GUIDResponse createLocationFromTemplate(String serverName, { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - if (templateProperties != null) + if (requestBody != null) { LocationHandler handler = instanceHandler.getLocationHandler(userId, serverName, methodName); response.setGUID(handler.createLocationFromTemplate(userId, - null, - null, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), templateGUID, - templateProperties.getQualifiedName(), - templateProperties.getDisplayName(), - templateProperties.getDescription(), + requestBody.getQualifiedName(), + requestBody.getIdentifier(), + requestBody.getDisplayName(), + requestBody.getDescription(), methodName)); } else @@ -177,17 +195,17 @@ public GUIDResponse createLocationFromTemplate(String serverName, * @param userId calling user * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? * @param locationGUID unique identifier of the metadata element to update - * @param locationProperties new properties for this element + * @param requestBody new properties for this element * @return void or * InvalidParameterException one of the parameters is invalid or * UserNotAuthorizedException the user is not authorized to make this request or * PropertyServerException the repository is not available or not working properly. */ - public VoidResponse updateLocation(String serverName, - String userId, - String locationGUID, - boolean isMergeUpdate, - LocationProperties locationProperties) + public VoidResponse updateLocation(String serverName, + String userId, + String locationGUID, + boolean isMergeUpdate, + ReferenceableRequestBody requestBody) { final String methodName = "updateLocation"; final String guidParameter = "locationGUID"; @@ -201,28 +219,38 @@ public VoidResponse updateLocation(String serverName, { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - if (locationProperties != null) - { - LocationHandler handler = instanceHandler.getLocationHandler(userId, serverName, methodName); + LocationHandler handler = instanceHandler.getLocationHandler(userId, serverName, methodName); - handler.updateLocation(userId, - null, - null, - locationGUID, - guidParameter, - locationProperties.getQualifiedName(), - locationProperties.getDisplayName(), - locationProperties.getDescription(), - locationProperties.getAdditionalProperties(), - locationProperties.getTypeName(), - locationProperties.getExtendedProperties(), - isMergeUpdate, - null, - null, - false, - false, - new Date(), - methodName); + if (requestBody != null) + { + if (requestBody.getProperties() instanceof CommunityProperties) + { + LocationProperties locationProperties = (LocationProperties) requestBody.getProperties(); + + handler.updateLocation(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + locationGUID, + guidParameter, + locationProperties.getQualifiedName(), + locationProperties.getIdentifier(), + locationProperties.getDisplayName(), + locationProperties.getDescription(), + locationProperties.getAdditionalProperties(), + locationProperties.getTypeName(), + locationProperties.getExtendedProperties(), + isMergeUpdate, + locationProperties.getEffectiveFrom(), + locationProperties.getEffectiveTo(), + false, + false, + new Date(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(LocationProperties.class.getName(), methodName); + } } else { @@ -252,10 +280,10 @@ public VoidResponse updateLocation(String serverName, * UserNotAuthorizedException the user is not authorized to make this request or * PropertyServerException the repository is not available or not working properly. */ - public VoidResponse setLocationAsFixedPhysical(String serverName, - String userId, - String locationGUID, - FixedLocationRequestBody requestBody) + public VoidResponse setLocationAsFixedPhysical(String serverName, + String userId, + String locationGUID, + ClassificationRequestBody requestBody) { final String methodName = "setLocationAsFixedPhysical"; final String locationGUIDParameter = "locationGUID"; @@ -273,21 +301,30 @@ public VoidResponse setLocationAsFixedPhysical(String serverNa { LocationHandler handler = instanceHandler.getLocationHandler(userId, serverName, methodName); - handler.addFixedLocationClassification(userId, - null, - null, - locationGUID, - locationGUIDParameter, - requestBody.getCoordinates(), - requestBody.getMapProjection(), - requestBody.getPostalAddress(), - requestBody.getTimeZone(), - null, - null, - false, - false, - new Date(), - methodName); + if (requestBody.getProperties() instanceof FixedLocationProperties) + { + FixedLocationProperties properties = (FixedLocationProperties) requestBody.getProperties(); + + handler.addFixedLocationClassification(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + locationGUID, + locationGUIDParameter, + properties.getCoordinates(), + properties.getMapProjection(), + properties.getPostalAddress(), + properties.getTimeZone(), + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + false, + false, + new Date(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(FixedLocationProperties.class.getName(), methodName); + } } else { @@ -310,17 +347,16 @@ public VoidResponse setLocationAsFixedPhysical(String serverNa * @param serverName name of calling server * @param userId calling user * @param locationGUID unique identifier of the metadata element to unclassify - * @param requestBody null request body + * @param requestBody request body * @return void or * InvalidParameterException one of the parameters is invalid or * UserNotAuthorizedException the user is not authorized to make this request or * PropertyServerException the repository is not available or not working properly. */ - @SuppressWarnings(value = "unused") - public VoidResponse clearLocationAsFixedPhysical(String serverName, - String userId, - String locationGUID, - NullRequestBody requestBody) + public VoidResponse clearLocationAsFixedPhysical(String serverName, + String userId, + String locationGUID, + ExternalSourceRequestBody requestBody) { final String methodName = "clearLocationAsFixedPhysical"; final String locationGUIDParameter = "locationGUID"; @@ -336,16 +372,30 @@ public VoidResponse clearLocationAsFixedPhysical(String serverName, LocationHandler handler = instanceHandler.getLocationHandler(userId, serverName, methodName); - handler.removeFixedLocationClassification(userId, - null, - null, - locationGUID, - locationGUIDParameter, - false, - false, - new Date(), - methodName); - + if (requestBody == null) + { + handler.removeFixedLocationClassification(userId, + null, + null, + locationGUID, + locationGUIDParameter, + false, + false, + new Date(), + methodName); + } + else + { + handler.removeFixedLocationClassification(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + locationGUID, + locationGUIDParameter, + false, + false, + new Date(), + methodName); + } } catch (Exception error) { @@ -372,7 +422,7 @@ public VoidResponse clearLocationAsFixedPhysical(String serverName, public VoidResponse setLocationAsSecure(String serverName, String userId, String locationGUID, - SecureLocationRequestBody requestBody) + ClassificationRequestBody requestBody) { final String methodName = "setLocationAsSecure"; @@ -391,19 +441,27 @@ public VoidResponse setLocationAsSecure(String serverName, { LocationHandler handler = instanceHandler.getLocationHandler(userId, serverName, methodName); - handler.addSecureLocationClassification(userId, - null, - null, - locationGUID, - locationGUIDParameter, - requestBody.getDescription(), - requestBody.getLevel(), - null, - null, - false, - false, - new Date(), - methodName); + if (requestBody.getProperties() instanceof SecureLocationProperties) + { + SecureLocationProperties properties = (SecureLocationProperties) requestBody.getProperties(); + handler.addSecureLocationClassification(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + locationGUID, + locationGUIDParameter, + properties.getDescription(), + properties.getLevel(), + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + false, + false, + new Date(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(SecureLocationProperties.class.getName(), methodName); + } } else { @@ -426,18 +484,17 @@ public VoidResponse setLocationAsSecure(String serverName, * @param serverName name of calling server * @param userId calling user * @param locationGUID unique identifier of the metadata element to unclassify - * @param requestBody null request body + * @param requestBody request body * * @return void or * InvalidParameterException one of the parameters is invalid or * UserNotAuthorizedException the user is not authorized to make this request or * PropertyServerException the repository is not available or not working properly. */ - @SuppressWarnings(value = "unused") - public VoidResponse clearLocationAsSecure(String serverName, - String userId, - String locationGUID, - NullRequestBody requestBody) + public VoidResponse clearLocationAsSecure(String serverName, + String userId, + String locationGUID, + ExternalSourceRequestBody requestBody) { final String methodName = "clearLocationAsSecure"; final String locationGUIDParameter = "locationGUID"; @@ -453,15 +510,30 @@ public VoidResponse clearLocationAsSecure(String serverName, LocationHandler handler = instanceHandler.getLocationHandler(userId, serverName, methodName); - handler.removeSecureLocationClassification(userId, - null, - null, - locationGUID, - locationGUIDParameter, - false, - false, - new Date(), - methodName); + if (requestBody == null) + { + handler.removeSecureLocationClassification(userId, + null, + null, + locationGUID, + locationGUIDParameter, + false, + false, + new Date(), + methodName); + } + else + { + handler.removeSecureLocationClassification(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + locationGUID, + locationGUIDParameter, + false, + false, + new Date(), + methodName); + } } catch (Exception error) { @@ -486,10 +558,10 @@ public VoidResponse clearLocationAsSecure(String serverName, * UserNotAuthorizedException the user is not authorized to make this request or * PropertyServerException the repository is not available or not working properly. */ - public VoidResponse setLocationAsDigital(String serverName, - String userId, - String locationGUID, - DigitalLocationRequestBody requestBody) + public VoidResponse setLocationAsDigital(String serverName, + String userId, + String locationGUID, + ClassificationRequestBody requestBody) { final String methodName = "setLocationAsDigital"; final String locationGUIDParameter = "locationGUID"; @@ -507,18 +579,27 @@ public VoidResponse setLocationAsDigital(String serverName, { LocationHandler handler = instanceHandler.getLocationHandler(userId, serverName, methodName); - handler.addCyberLocationClassification(userId, - null, - null, - locationGUID, - locationGUIDParameter, - requestBody.getNetworkAddress(), - null, - null, - false, - false, - new Date(), - methodName); + if (requestBody.getProperties() instanceof DigitalLocationProperties) + { + DigitalLocationProperties properties = (DigitalLocationProperties)requestBody.getProperties(); + + handler.addCyberLocationClassification(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + locationGUID, + locationGUIDParameter, + properties.getNetworkAddress(), + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + false, + false, + new Date(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(DigitalLocationProperties.class.getName(), methodName); + } } else { @@ -548,11 +629,10 @@ public VoidResponse setLocationAsDigital(String serverName, * UserNotAuthorizedException the user is not authorized to make this request or * PropertyServerException the repository is not available or not working properly. */ - @SuppressWarnings(value = "unused") - public VoidResponse clearLocationAsDigital(String serverName, - String userId, - String locationGUID, - NullRequestBody requestBody) + public VoidResponse clearLocationAsDigital(String serverName, + String userId, + String locationGUID, + ExternalSourceRequestBody requestBody) { final String methodName = "clearLocationAsDigital"; final String locationGUIDParameter = "locationGUID"; @@ -568,15 +648,30 @@ public VoidResponse clearLocationAsDigital(String serverName, LocationHandler handler = instanceHandler.getLocationHandler(userId, serverName, methodName); - handler.removeCyberLocationClassification(userId, - null, - null, - locationGUID, - locationGUIDParameter, - false, - false, - new Date(), - methodName); + if (requestBody == null) + { + handler.removeCyberLocationClassification(userId, + null, + null, + locationGUID, + locationGUIDParameter, + false, + false, + new Date(), + methodName); + } + else + { + handler.removeCyberLocationClassification(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + locationGUID, + locationGUIDParameter, + false, + false, + new Date(), + methodName); + } } catch (Exception error) { @@ -601,11 +696,10 @@ public VoidResponse clearLocationAsDigital(String serverName, * UserNotAuthorizedException the user is not authorized to make this request or * PropertyServerException the repository is not available or not working properly. */ - @SuppressWarnings(value = "unused") - public VoidResponse removeLocation(String serverName, - String userId, - String locationGUID, - NullRequestBody requestBody) + public VoidResponse removeLocation(String serverName, + String userId, + String locationGUID, + ExternalSourceRequestBody requestBody) { final String methodName = "removeLocation"; final String guidParameter = "locationGUID"; @@ -621,15 +715,30 @@ public VoidResponse removeLocation(String serverName, LocationHandler handler = instanceHandler.getLocationHandler(userId, serverName, methodName); - handler.removeLocation(userId, - null, - null, - locationGUID, - guidParameter, - false, - false, - new Date(), - methodName); + if (requestBody == null) + { + handler.removeLocation(userId, + null, + null, + locationGUID, + guidParameter, + false, + false, + new Date(), + methodName); + } + else + { + handler.removeLocation(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + locationGUID, + guidParameter, + false, + false, + new Date(), + methodName); + } } catch (Exception error) { @@ -655,16 +764,15 @@ public VoidResponse removeLocation(String serverName, * UserNotAuthorizedException the user is not authorized to make this request or * PropertyServerException the repository is not available or not working properly. */ - @SuppressWarnings(value = "unused") - public VoidResponse setupNestedLocation(String serverName, - String userId, - String parentLocationGUID, - String childLocationGUID, - NullRequestBody requestBody) + public VoidResponse setupNestedLocation(String serverName, + String userId, + String parentLocationGUID, + String childLocationGUID, + RelationshipRequestBody requestBody) { - final String methodName = "setupNestedLocation"; + final String methodName = "setupNestedLocation"; final String parentLocationGUIDParameter = "parentLocationGUID"; - final String childLocationGUIDParameter = "childLocationGUID"; + final String childLocationGUIDParameter = "childLocationGUID"; RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); @@ -677,19 +785,33 @@ public VoidResponse setupNestedLocation(String serverName, LocationHandler handler = instanceHandler.getLocationHandler(userId, serverName, methodName); - handler.setupNestedLocation(userId, - null, - null, - parentLocationGUID, - parentLocationGUIDParameter, - childLocationGUID, - childLocationGUIDParameter, - null, - null, - false, - false, - new Date(), - methodName); + if (requestBody != null) + { + if (requestBody.getProperties() instanceof NestedLocationProperties) + { + handler.setupNestedLocation(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + parentLocationGUID, + parentLocationGUIDParameter, + childLocationGUID, + childLocationGUIDParameter, + null, + null, + false, + false, + new Date(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(NestedLocationProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } } catch (Exception error) { @@ -715,12 +837,11 @@ public VoidResponse setupNestedLocation(String serverName, * UserNotAuthorizedException the user is not authorized to make this request or * PropertyServerException the repository is not available or not working properly. */ - @SuppressWarnings(value = "unused") - public VoidResponse clearNestedLocation(String serverName, - String userId, - String parentLocationGUID, - String childLocationGUID, - NullRequestBody requestBody) + public VoidResponse clearNestedLocation(String serverName, + String userId, + String parentLocationGUID, + String childLocationGUID, + ExternalSourceRequestBody requestBody) { final String methodName = "clearNestedLocation"; final String parentLocationGUIDParameter = "parentLocationGUID"; @@ -737,17 +858,34 @@ public VoidResponse clearNestedLocation(String serverName, LocationHandler handler = instanceHandler.getLocationHandler(userId, serverName, methodName); - handler.clearNestedLocation(userId, - null, - null, - parentLocationGUID, - parentLocationGUIDParameter, - childLocationGUID, - childLocationGUIDParameter, - false, - false, - new Date(), - methodName); + if (requestBody == null) + { + handler.clearNestedLocation(userId, + null, + null, + parentLocationGUID, + parentLocationGUIDParameter, + childLocationGUID, + childLocationGUIDParameter, + false, + false, + new Date(), + methodName); + } + else + { + handler.clearNestedLocation(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + parentLocationGUID, + parentLocationGUIDParameter, + childLocationGUID, + childLocationGUIDParameter, + false, + false, + new Date(), + methodName); + } } catch (Exception error) { @@ -773,12 +911,11 @@ public VoidResponse clearNestedLocation(String serverName, * UserNotAuthorizedException the user is not authorized to make this request or * PropertyServerException the repository is not available or not working properly. */ - @SuppressWarnings(value = "unused") - public VoidResponse setupAdjacentLocation(String serverName, - String userId, - String locationOneGUID, - String locationTwoGUID, - NullRequestBody requestBody) + public VoidResponse setupAdjacentLocation(String serverName, + String userId, + String locationOneGUID, + String locationTwoGUID, + RelationshipRequestBody requestBody) { final String methodName = "setupAdjacentLocation"; final String locationOneGUIDParameter = "locationOneGUID"; @@ -795,19 +932,51 @@ public VoidResponse setupAdjacentLocation(String serverName, LocationHandler handler = instanceHandler.getLocationHandler(userId, serverName, methodName); - handler.setupPeerLocations(userId, - null, - null, - locationOneGUID, - locationOneGUIDParameter, - locationTwoGUID, - locationTwoGUIDParameter, - null, - null, - false, - false, - new Date(), - methodName); + if (requestBody != null) + { + if (requestBody.getProperties() == null) + { + handler.setupPeerLocations(userId, + null, + null, + locationOneGUID, + locationOneGUIDParameter, + locationTwoGUID, + locationTwoGUIDParameter, + null, + null, + false, + false, + new Date(), + methodName); + } + else if (requestBody.getProperties() instanceof AdjacentLocationProperties) + { + AdjacentLocationProperties properties = (AdjacentLocationProperties)requestBody.getProperties(); + + handler.setupPeerLocations(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + locationOneGUID, + locationOneGUIDParameter, + locationTwoGUID, + locationTwoGUIDParameter, + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + false, + false, + new Date(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(AdjacentLocationProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } } catch (Exception error) { @@ -833,12 +1002,11 @@ public VoidResponse setupAdjacentLocation(String serverName, * UserNotAuthorizedException the user is not authorized to make this request or * PropertyServerException the repository is not available or not working properly. */ - @SuppressWarnings(value = "unused") - public VoidResponse clearAdjacentLocation(String serverName, - String userId, - String locationOneGUID, - String locationTwoGUID, - NullRequestBody requestBody) + public VoidResponse clearAdjacentLocation(String serverName, + String userId, + String locationOneGUID, + String locationTwoGUID, + ExternalSourceRequestBody requestBody) { final String methodName = "clearAdjacentLocation"; final String locationOneGUIDParameter = "locationOneGUID"; @@ -855,17 +1023,184 @@ public VoidResponse clearAdjacentLocation(String serverName, LocationHandler handler = instanceHandler.getLocationHandler(userId, serverName, methodName); - handler.clearPeerLocations(userId, - null, - null, - locationOneGUID, - locationOneGUIDParameter, - locationTwoGUID, - locationTwoGUIDParameter, - false, - false, - new Date(), - methodName); + if (requestBody == null) + { + handler.clearPeerLocations(userId, + null, + null, + locationOneGUID, + locationOneGUIDParameter, + locationTwoGUID, + locationTwoGUIDParameter, + false, + false, + new Date(), + methodName); + } + else + { + handler.clearPeerLocations(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + locationOneGUID, + locationOneGUIDParameter, + locationTwoGUID, + locationTwoGUIDParameter, + false, + false, + new Date(), + methodName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Create a profile location relationship between an actor profile and a location. + * + * @param serverName name of calling server + * @param userId calling user + * @param actorProfileGUID unique identifier of the actor profile + * @param locationGUID unique identifier of the location + * @param requestBody profile location request body + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to make this request or + * PropertyServerException the repository is not available or not working properly. + */ + public VoidResponse setupProfileLocation(String serverName, + String userId, + String actorProfileGUID, + String locationGUID, + RelationshipRequestBody requestBody) + { + final String methodName = "setupProfileLocation"; + final String actorProfileGUIDParameter = "actorProfileGUID"; + final String locationGUIDParameter = "locationGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + LocationHandler handler = instanceHandler.getLocationHandler(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof ProfileLocationProperties) + { + ProfileLocationProperties properties = (ProfileLocationProperties)requestBody.getProperties(); + + handler.setupProfileLocation(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + actorProfileGUID, + actorProfileGUIDParameter, + locationGUID, + locationGUIDParameter, + properties.getAssociationType(), + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + false, + false, + new Date(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(ProfileLocationProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Remove a profile location relationship between an actor profile and a location. + * + * @param serverName name of calling server + * @param userId calling user + * @param actorProfileGUID unique identifier of the actor profile + * @param locationGUID unique identifier of the location + * @param requestBody null request body + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to make this request or + * PropertyServerException the repository is not available or not working properly. + */ + public VoidResponse clearProfileLocation(String serverName, + String userId, + String actorProfileGUID, + String locationGUID, + ExternalSourceRequestBody requestBody) + { + final String methodName = "clearProfileLocation"; + final String actorProfileGUIDParameter = "actorProfileGUID"; + final String locationGUIDParameter = "locationGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + LocationHandler handler = instanceHandler.getLocationHandler(userId, serverName, methodName); + + if (requestBody == null) + { + handler.clearProfileLocation(userId, + null, + null, + actorProfileGUID, + actorProfileGUIDParameter, + locationGUID, + locationGUIDParameter, + false, + false, + new Date(), + methodName); + } + else + { + handler.clearProfileLocation(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + actorProfileGUID, + actorProfileGUIDParameter, + locationGUID, + locationGUIDParameter, + false, + false, + new Date(), + methodName); + } } catch (Exception error) { @@ -878,6 +1213,155 @@ public VoidResponse clearAdjacentLocation(String serverName, + /** + * Create an asset location relationship between an asset and a location. + * + * @param serverName name of calling server + * @param userId calling user + * @param assetGUID unique identifier of the asset + * @param locationGUID unique identifier of the location + * @param requestBody profile location request body + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to make this request or + * PropertyServerException the repository is not available or not working properly. + */ + public VoidResponse setupAssetLocation(String serverName, + String userId, + String assetGUID, + String locationGUID, + RelationshipRequestBody requestBody) + { + final String methodName = "setupAssetLocation"; + final String assetGUIDParameter = "assetGUID"; + final String locationGUIDParameter = "locationGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + LocationHandler handler = instanceHandler.getLocationHandler(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof AssetLocationProperties) + { + AssetLocationProperties properties = (AssetLocationProperties)requestBody.getProperties(); + + handler.setupAssetLocation(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + locationGUID, + locationGUIDParameter, + assetGUID, + assetGUIDParameter, + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + false, + false, + new Date(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(AssetLocationProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Remove an asset location relationship between an asset and a location. + * + * @param serverName name of calling server + * @param userId calling user + * @param assetGUID unique identifier of the actor profile + * @param locationGUID unique identifier of the location + * @param requestBody null request body + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to make this request or + * PropertyServerException the repository is not available or not working properly. + */ + public VoidResponse clearAssetLocation(String serverName, + String userId, + String assetGUID, + String locationGUID, + ExternalSourceRequestBody requestBody) + { + final String methodName = "clearAssetLocation"; + final String assetGUIDParameter = "assetGUID"; + final String locationTwoGUIDParameter = "locationGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + LocationHandler handler = instanceHandler.getLocationHandler(userId, serverName, methodName); + + if (requestBody == null) + { + handler.clearAssetLocation(userId, + null, + null, + locationGUID, + locationTwoGUIDParameter, + assetGUID, + assetGUIDParameter, + false, + false, + new Date(), + methodName); + } + else + { + handler.clearAssetLocation(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + locationGUID, + locationTwoGUIDParameter, + assetGUID, + assetGUIDParameter, + false, + false, + new Date(), + methodName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + /** * Retrieve the list of location metadata elements that contain the search string. * The search string is treated as a regular expression. @@ -893,19 +1377,19 @@ public VoidResponse clearAdjacentLocation(String serverName, * UserNotAuthorizedException the user is not authorized to make this request or * PropertyServerException the repository is not available or not working properly. */ - public LocationsResponse findLocations(String serverName, - String userId, - SearchStringRequestBody requestBody, - int startFrom, - int pageSize) + public LocationListResponse findLocations(String serverName, + String userId, + SearchStringRequestBody requestBody, + int startFrom, + int pageSize) { final String methodName = "findLocations"; final String parameterName = "searchString"; RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); - LocationsResponse response = new LocationsResponse(); - AuditLog auditLog = null; + LocationListResponse response = new LocationListResponse(); + AuditLog auditLog = null; try { @@ -915,19 +1399,20 @@ public LocationsResponse findLocations(String serverName, { LocationHandler handler = instanceHandler.getLocationHandler(userId, serverName, methodName); - List locations = handler.findBeans(userId, - requestBody.getSearchString(), - parameterName, - OpenMetadataAPIMapper.LOCATION_TYPE_GUID, - OpenMetadataAPIMapper.LOCATION_TYPE_NAME, - null, - startFrom, - pageSize, - false, - false, - new Date(), - methodName); - response.setElementList(locations); + List locations = handler.findLocations(userId, + requestBody.getSearchString(), + parameterName, + startFrom, + pageSize, + false, + false, + new Date(), + methodName); + response.setElements(locations); + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); } } catch (Exception error) @@ -941,7 +1426,7 @@ public LocationsResponse findLocations(String serverName, /** - * Retrieve the list of location metadata elements with a matching qualified or display name. + * Retrieve the list of location metadata elements with a matching qualified name, identifier or display name. * There are no wildcards supported on this request. * * @param serverName name of calling server @@ -955,19 +1440,19 @@ public LocationsResponse findLocations(String serverName, * UserNotAuthorizedException the user is not authorized to make this request or * PropertyServerException the repository is not available or not working properly. */ - public LocationsResponse getLocationsByName(String serverName, - String userId, - NameRequestBody requestBody, - int startFrom, - int pageSize) + public LocationListResponse getLocationsByName(String serverName, + String userId, + NameRequestBody requestBody, + int startFrom, + int pageSize) { final String methodName = "getLocationsByName"; final String parameterName = "name"; RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); - LocationsResponse response = new LocationsResponse(); - AuditLog auditLog = null; + LocationListResponse response = new LocationListResponse(); + AuditLog auditLog = null; try { @@ -977,28 +1462,353 @@ public LocationsResponse getLocationsByName(String serverName, { LocationHandler handler = instanceHandler.getLocationHandler(userId, serverName, methodName); - List specificMatchPropertyNames = new ArrayList<>(); - specificMatchPropertyNames.add(OpenMetadataAPIMapper.QUALIFIED_NAME_PROPERTY_NAME); - specificMatchPropertyNames.add(OpenMetadataAPIMapper.DISPLAY_NAME_PROPERTY_NAME); + List locations = handler.getLocationsByName(userId, + requestBody.getName(), + parameterName, + startFrom, + pageSize, + false, + false, + new Date(), + methodName); + response.setElements(locations); + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Retrieve the list of adjacent location metadata elements linked to locationGUID. + * + * @param serverName name of calling server + * @param userId calling user + * @param locationGUID locationGUID to search for + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to make this request or + * PropertyServerException the repository is not available or not working properly. + */ + public LocationListResponse getAdjacentLocations(String serverName, + String userId, + String locationGUID, + int startFrom, + int pageSize) + { + final String methodName = "getAdjacentLocations"; + final String parameterName = "locationGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + LocationListResponse response = new LocationListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + LocationHandler handler = instanceHandler.getLocationHandler(userId, serverName, methodName); + + List locations = handler.getAdjacentLocations(userId, + locationGUID, + parameterName, + OpenMetadataAPIMapper.LOCATION_TYPE_NAME, + startFrom, + pageSize, + false, + false, + new Date(), + methodName); + response.setElements(locations); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + + /** + * Retrieve the list of nested location metadata elements linked to locationGUID. + * + * @param serverName name of calling server + * @param userId calling user + * @param locationGUID locationGUID to search for + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to make this request or + * PropertyServerException the repository is not available or not working properly. + */ + public LocationListResponse getNestedLocations(String serverName, + String userId, + String locationGUID, + int startFrom, + int pageSize) + { + final String methodName = "getNestedLocations"; + final String parameterName = "locationGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + LocationListResponse response = new LocationListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + LocationHandler handler = instanceHandler.getLocationHandler(userId, serverName, methodName); + + List locations = handler.getNestedLocations(userId, + locationGUID, + parameterName, + OpenMetadataAPIMapper.LOCATION_TYPE_NAME, + startFrom, + pageSize, + false, + false, + new Date(), + methodName); + response.setElements(locations); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + + /** + * Retrieve the list of location metadata elements that has the location identifier with locationGUID nested inside it. + * + * @param serverName name of calling server + * @param userId calling user + * @param locationGUID locationGUID to search for + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to make this request or + * PropertyServerException the repository is not available or not working properly. + */ + public LocationListResponse getGroupingLocations(String serverName, + String userId, + String locationGUID, + int startFrom, + int pageSize) + { + final String methodName = "getGroupingLocations"; + final String parameterName = "locationGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + LocationListResponse response = new LocationListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + LocationHandler handler = instanceHandler.getLocationHandler(userId, serverName, methodName); + + List locations = handler.getGroupingLocations(userId, + locationGUID, + parameterName, + OpenMetadataAPIMapper.LOCATION_TYPE_NAME, + startFrom, + pageSize, + false, + false, + new Date(), + methodName); + response.setElements(locations); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Retrieve the list of location metadata elements linked to the requested profile. + * + * @param serverName name of calling server + * @param userId calling user + * @param actorProfileGUID profile to search for + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to make this request or + * PropertyServerException the repository is not available or not working properly. + */ + public LocationListResponse getLocationsByProfile(String serverName, + String userId, + String actorProfileGUID, + int startFrom, + int pageSize) + { + final String methodName = "getLocationsByProfile"; + final String parameterName = "actorProfileGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + LocationListResponse response = new LocationListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + LocationHandler handler = instanceHandler.getLocationHandler(userId, serverName, methodName); - List locations = handler.getBeansByValue(userId, - requestBody.getName(), + List locations = handler.getProfileLocations(userId, + actorProfileGUID, parameterName, - OpenMetadataAPIMapper.LOCATION_TYPE_GUID, - OpenMetadataAPIMapper.LOCATION_TYPE_NAME, - specificMatchPropertyNames, - true, - null, - null, - false, - false, - null, + OpenMetadataAPIMapper.ACTOR_PROFILE_TYPE_NAME, startFrom, pageSize, + false, + false, new Date(), methodName); - response.setElementList(locations); - } + response.setElements(locations); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Retrieve the list of location metadata elements linked to assetGUID. + * + * @param serverName name of calling server + * @param userId calling user + * @param assetGUID asset to search for + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to make this request or + * PropertyServerException the repository is not available or not working properly. + */ + public LocationListResponse getKnownLocationsForAsset(String serverName, + String userId, + String assetGUID, + int startFrom, + int pageSize) + { + final String methodName = "getKnownLocationsForAsset"; + final String parameterName = "assetGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + LocationListResponse response = new LocationListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + LocationHandler handler = instanceHandler.getLocationHandler(userId, serverName, methodName); + + List locations = handler.getAssetLocations(userId, + assetGUID, + parameterName, + OpenMetadataAPIMapper.ASSET_TYPE_NAME, + startFrom, + pageSize, + false, + false, + new Date(), + methodName); + response.setElements(locations); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Retrieve the list of location metadata. + * + * @param serverName name of calling server + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to make this request or + * PropertyServerException the repository is not available or not working properly. + */ + public LocationListResponse getLocations(String serverName, + String userId, + int startFrom, + int pageSize) + { + final String methodName = "getLocations"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + LocationListResponse response = new LocationListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + LocationHandler handler = instanceHandler.getLocationHandler(userId, serverName, methodName); + + List locations = handler.getLocations(userId, + startFrom, + pageSize, + false, + false, + new Date(), + methodName); + response.setElements(locations); } catch (Exception error) { diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/OrganizationRESTServices.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/OrganizationRESTServices.java index a697089fb86..389ff493845 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/OrganizationRESTServices.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/OrganizationRESTServices.java @@ -17,7 +17,7 @@ import org.odpi.openmetadata.accessservices.communityprofile.rest.ContactMethodRequestBody; import org.odpi.openmetadata.accessservices.communityprofile.rest.EffectiveDatesRequestBody; import org.odpi.openmetadata.accessservices.communityprofile.rest.EffectiveTimeRequestBody; -import org.odpi.openmetadata.accessservices.communityprofile.rest.MetadataSourceRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.rest.ExternalSourceRequestBody; import org.odpi.openmetadata.accessservices.communityprofile.rest.PersonRoleAppointeeListResponse; import org.odpi.openmetadata.accessservices.communityprofile.rest.PersonRoleListResponse; import org.odpi.openmetadata.accessservices.communityprofile.rest.PersonRoleRequestBody; @@ -265,7 +265,7 @@ public VoidResponse updateActorProfile(String serverName, public VoidResponse deleteActorProfile(String serverName, String userId, String actorProfileGUID, - MetadataSourceRequestBody requestBody) + ExternalSourceRequestBody requestBody) { final String methodName = "deleteActorProfile"; final String guidParameterName = "actorProfileGUID"; @@ -342,11 +342,11 @@ public GUIDResponse addContactMethod(String serverName, auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - int contactType = 0; + int contactMethodTypeOrdinal = 0; - if (requestBody.getProperties().getType() != null) + if (requestBody.getProperties().getContactMethodType() != null) { - contactType = requestBody.getProperties().getType().getOpenTypeOrdinal(); + contactMethodTypeOrdinal = requestBody.getProperties().getContactMethodType().getOpenTypeOrdinal(); } handler.createContactMethod(userId, @@ -354,9 +354,11 @@ public GUIDResponse addContactMethod(String serverName, requestBody.getExternalSourceName(), actorProfileGUID, guidParameterName, - contactType, - requestBody.getProperties().getService(), - requestBody.getProperties().getValue(), + requestBody.getProperties().getName(), + requestBody.getProperties().getContactType(), + contactMethodTypeOrdinal, + requestBody.getProperties().getContactMethodService(), + requestBody.getProperties().getContactMethodValue(), null, null, false, @@ -396,7 +398,7 @@ public GUIDResponse addContactMethod(String serverName, public VoidResponse deleteContactMethod(String serverName, String userId, String contactMethodGUID, - MetadataSourceRequestBody requestBody) + ExternalSourceRequestBody requestBody) { final String methodName = "deleteContactMethod"; final String guidParameterName = "contactMethodGUID"; @@ -544,7 +546,7 @@ public VoidResponse unlinkTeamsInHierarchy(String serverName, String userId, String superTeamProfileGUID, String subTeamProfileGUID, - MetadataSourceRequestBody requestBody) + ExternalSourceRequestBody requestBody) { final String methodName = "unlinkTeamsInHierarchy"; final String profileGUIDParameterName = "superTeamProfileGUID"; @@ -688,7 +690,7 @@ public ActorProfileResponse getActorProfileByUserId(String serverName, /** - * Return information about a named actor profile. + * Return information about a named actor profiles. * * @param serverName called server * @param userId calling user @@ -702,11 +704,11 @@ public ActorProfileResponse getActorProfileByUserId(String serverName, * PropertyServerException problem accessing property server * UserNotAuthorizedException security access problem */ - public ActorProfileListResponse getActorProfileByName(String serverName, - String userId, - int startFrom, - int pageSize, - NameRequestBody requestBody) + public ActorProfileListResponse getActorProfilesByName(String serverName, + String userId, + int startFrom, + int pageSize, + NameRequestBody requestBody) { final String methodName = "getActorProfileByName"; final String nameParameterName = "name"; @@ -743,6 +745,112 @@ public ActorProfileListResponse getActorProfileByName(String serverName } + /** + * Return all actor profiles. + * + * @param serverName called server + * @param userId calling user + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching actor profiles (hopefully only one) + * + * InvalidParameterException name or userId is null + * PropertyServerException problem accessing property server + * UserNotAuthorizedException security access problem + */ + public ActorProfileListResponse getActorProfiles(String serverName, + String userId, + int startFrom, + int pageSize) + { + final String methodName = "getActorProfiles"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + ActorProfileListResponse response = new ActorProfileListResponse(); + AuditLog auditLog = null; + + try + { + ActorProfileHandler handler = instanceHandler.getActorProfileHandler(userId, serverName, methodName); + + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + response.setElements(handler.getActorProfiles(userId, + OpenMetadataAPIMapper.ACTOR_PROFILE_TYPE_GUID, + OpenMetadataAPIMapper.ACTOR_PROFILE_TYPE_NAME, + startFrom, + pageSize, + false, + false, + new Date(), + methodName)); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Return information about a named actor profiles. + * + * @param serverName called server + * @param userId calling user + * @param locationGUID unique identifier for the location + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching actor profiles (hopefully only one) + * + * InvalidParameterException name or userId is null + * PropertyServerException problem accessing property server + * UserNotAuthorizedException security access problem + */ + public ActorProfileListResponse getActorProfilesByLocation(String serverName, + String userId, + String locationGUID, + int startFrom, + int pageSize) + { + final String methodName = "getActorProfilesByLocation"; + final String guidParameterName = "locationGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + ActorProfileListResponse response = new ActorProfileListResponse(); + AuditLog auditLog = null; + + try + { + ActorProfileHandler handler = instanceHandler.getActorProfileHandler(userId, serverName, methodName); + + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + response.setElements(handler.getActorProfilesByLocation(userId, + locationGUID, + guidParameterName, + OpenMetadataAPIMapper.ACTOR_PROFILE_TYPE_NAME, + startFrom, + pageSize, + false, + false, + new Date(), + methodName)); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + /** * Retrieve the list of matching profiles for the search string. * @@ -758,13 +866,13 @@ public ActorProfileListResponse getActorProfileByName(String serverName * PropertyServerException the server is not available. * UserNotAuthorizedException the calling user is not authorized to issue the call. */ - public ActorProfileListResponse findActorProfile(String serverName, - String userId, - int startFrom, - int pageSize, - SearchStringRequestBody requestBody) + public ActorProfileListResponse findActorProfiles(String serverName, + String userId, + int startFrom, + int pageSize, + SearchStringRequestBody requestBody) { - final String methodName = "findActorProfile"; + final String methodName = "findActorProfiles"; final String searchStringParameterName = "searchString"; RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); @@ -816,7 +924,7 @@ public GUIDResponse createPersonRole(String serverName, String userId, PersonRoleRequestBody requestBody) { - final String methodName = "createPersonRole"; + final String methodName = "createPersonRole"; RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); @@ -834,12 +942,14 @@ public GUIDResponse createPersonRole(String serverName, String profileGUID = handler.createPersonRole(userId, requestBody.getExternalSourceGUID(), requestBody.getExternalSourceName(), + requestBody.getProperties().getQualifiedName(), requestBody.getProperties().getRoleId(), requestBody.getProperties().getTitle(), requestBody.getProperties().getDescription(), requestBody.getProperties().getScope(), requestBody.getProperties().getHeadCount(), requestBody.getProperties().getHeadCountLimitSet(), + requestBody.getProperties().getDomainIdentifier(), requestBody.getProperties().getAdditionalProperties(), requestBody.getProperties().getTypeName(), requestBody.getProperties().getExtendedProperties(), @@ -904,28 +1014,30 @@ public VoidResponse updatePersonRole(String serverName, auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); handler.updatePersonRole(userId, - requestBody.getExternalSourceGUID(), - requestBody.getExternalSourceName(), - personRoleGUID, - guidParameterName, - requestBody.getProperties().getRoleId(), - qualifiedNameParameterName, - requestBody.getProperties().getTitle(), - nameParameterName, - requestBody.getProperties().getDescription(), - requestBody.getProperties().getScope(), - requestBody.getProperties().getHeadCount(), - requestBody.getProperties().getHeadCountLimitSet(), - requestBody.getProperties().getAdditionalProperties(), - requestBody.getProperties().getTypeName(), - requestBody.getProperties().getExtendedProperties(), - isMergeUpdate, - null, - null, - false, - false, - new Date(), - methodName); + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + personRoleGUID, + guidParameterName, + requestBody.getProperties().getQualifiedName(), + qualifiedNameParameterName, + requestBody.getProperties().getRoleId(), + requestBody.getProperties().getTitle(), + nameParameterName, + requestBody.getProperties().getDescription(), + requestBody.getProperties().getScope(), + requestBody.getProperties().getHeadCount(), + requestBody.getProperties().getHeadCountLimitSet(), + requestBody.getProperties().getDomainIdentifier(), + requestBody.getProperties().getAdditionalProperties(), + requestBody.getProperties().getTypeName(), + requestBody.getProperties().getExtendedProperties(), + isMergeUpdate, + null, + null, + false, + false, + new Date(), + methodName); } else { @@ -959,7 +1071,7 @@ public VoidResponse updatePersonRole(String serverName, public VoidResponse deletePersonRole(String serverName, String userId, String personRoleGUID, - MetadataSourceRequestBody requestBody) + ExternalSourceRequestBody requestBody) { final String methodName = "deletePersonRole"; final String guidParameterName = "personRoleGUID"; @@ -1372,7 +1484,7 @@ false, false, new Date(), public VoidResponse unlinkPersonRoleFromProfile(String serverName, String userId, String appointmentGUID, - MetadataSourceRequestBody requestBody) + ExternalSourceRequestBody requestBody) { final String methodName = "unlinkPersonRoleFromProfile"; final String appointmentGUIDParameterName = "appointmentGUID"; @@ -1659,7 +1771,7 @@ public PersonRoleResponse getPersonRoleByGUID(String serverName, * @param pageSize maximum number of elements to return. * @param requestBody unique name for the actor profile * - * @return list of matching actor profiles (hopefully only one) + * @return list of matching person roles (hopefully only one) * * InvalidParameterException name or userId is null * PropertyServerException problem accessing property server @@ -1704,6 +1816,116 @@ public PersonRoleListResponse getPersonRoleByName(String serverName, } + /** + * Return information about a person role connected to the named team via the TeamLeadership relationship. + * + * @param serverName called server + * @param userId calling user + * @param teamGUID unique identifier for the Team actor profile + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching person roles + * + * InvalidParameterException name or userId is null + * PropertyServerException problem accessing property server + * UserNotAuthorizedException security access problem + */ + public PersonRoleListResponse getLeadershipRolesForTeam(String serverName, + String userId, + String teamGUID, + int startFrom, + int pageSize) + { + final String methodName = "getLeadershipRolesForTeam"; + final String guidParameterName = "teamGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + PersonRoleListResponse response = new PersonRoleListResponse(); + AuditLog auditLog = null; + + try + { + PersonRoleHandler handler = instanceHandler.getPersonRoleHandler(userId, serverName, methodName); + + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + response.setElements(handler.getTeamLeaderRoles(userId, + teamGUID, + guidParameterName, + startFrom, + pageSize, + false, + false, + new Date(), + methodName)); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Return information about a person role connected to the named team via the TeamMembership relationship. + * + * @param serverName called server + * @param userId calling user + * @param teamGUID unique identifier for the Team actor profile + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching person roles + * + * InvalidParameterException name or userId is null + * PropertyServerException problem accessing property server + * UserNotAuthorizedException security access problem + */ + public PersonRoleListResponse getMembershipRolesForTeam(String serverName, + String userId, + String teamGUID, + int startFrom, + int pageSize) + { + final String methodName = "getMembershipRolesForTeam"; + final String guidParameterName = "teamGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + PersonRoleListResponse response = new PersonRoleListResponse(); + AuditLog auditLog = null; + + try + { + PersonRoleHandler handler = instanceHandler.getPersonRoleHandler(userId, serverName, methodName); + + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + response.setElements(handler.getTeamMemberRoles(userId, + teamGUID, + guidParameterName, + startFrom, + pageSize, + false, + false, + new Date(), + methodName)); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + /** * Retrieve the list of matching roles for the search string. * @@ -1719,13 +1941,13 @@ public PersonRoleListResponse getPersonRoleByName(String serverName, * PropertyServerException the server is not available. * UserNotAuthorizedException the calling user is not authorized to issue the call. */ - public PersonRoleListResponse findPersonRole(String serverName, - String userId, - int startFrom, - int pageSize, - SearchStringRequestBody requestBody) + public PersonRoleListResponse findPersonRoles(String serverName, + String userId, + int startFrom, + int pageSize, + SearchStringRequestBody requestBody) { - final String methodName = "findPersonRole"; + final String methodName = "findPersonRoles"; final String searchStringParameterName = "searchString"; RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/PersonalProfileRESTServices.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/PersonalProfileRESTServices.java index 37655d00169..bd987c7a8d2 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/PersonalProfileRESTServices.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/PersonalProfileRESTServices.java @@ -96,10 +96,6 @@ public GUIDResponse createPersonalProfile(String serverName, new Date(), methodName); - - - - Map extendedProperties = new HashMap<>(); extendedProperties.put(OpenMetadataAPIMapper.FULL_NAME_PROPERTY_NAME, requestBody.getFullName()); @@ -125,6 +121,7 @@ public GUIDResponse createPersonalProfile(String serverName, requestBody.getOriginatingSystemName(), profileGUID, profileGUIDParameterName, + requestBody.getQualifiedName(), requestBody.getProfileUserId(), null, null, diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/RelatedElementRESTServices.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/RelatedElementRESTServices.java new file mode 100644 index 00000000000..d995577c13f --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/RelatedElementRESTServices.java @@ -0,0 +1,1160 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.communityprofile.server; + +import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.RelatedElement; +import org.odpi.openmetadata.accessservices.communityprofile.properties.AssignmentScopeProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.ResourceListProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.StakeholderProperties; +import org.odpi.openmetadata.accessservices.communityprofile.rest.ExternalSourceRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.rest.RelatedElementListResponse; +import org.odpi.openmetadata.accessservices.communityprofile.rest.RelationshipRequestBody; +import org.odpi.openmetadata.commonservices.ffdc.RESTCallLogger; +import org.odpi.openmetadata.commonservices.ffdc.RESTCallToken; +import org.odpi.openmetadata.commonservices.ffdc.RESTExceptionHandler; +import org.odpi.openmetadata.commonservices.ffdc.rest.VoidResponse; +import org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIMapper; +import org.odpi.openmetadata.commonservices.generichandlers.ReferenceableHandler; +import org.odpi.openmetadata.frameworks.auditlog.AuditLog; +import org.slf4j.LoggerFactory; + +import java.util.Date; + +/** + * RelatedElementRESTServices support requests about common Referenceable relationships. + * It is the server side for the RelatedElementsManagementInterface. + */ +public class RelatedElementRESTServices +{ + private static final CommunityProfileInstanceHandler instanceHandler = new CommunityProfileInstanceHandler(); + + private static final RESTExceptionHandler restExceptionHandler = new RESTExceptionHandler(); + private static final RESTCallLogger restCallLogger = new RESTCallLogger(LoggerFactory.getLogger(RelatedElementRESTServices.class), + instanceHandler.getServiceName()); + + + /** + * Create a "MoreInformation" relationship between an element that is descriptive and one that is providing the detail. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element that is descriptive + * @param detailGUID unique identifier of the element that provides the detail + * @param requestBody relationship properties + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse setupMoreInformation(String serverName, + String userId, + String elementGUID, + String detailGUID, + RelationshipRequestBody requestBody) + { + final String methodName = "setupMoreInformation"; + final String elementGUIDParameterName = "elementGUID"; + final String detailGUIDParameterName = "detailGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ReferenceableHandler handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() != null) + { + handler.addMoreInformation(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + elementGUID, + elementGUIDParameterName, + detailGUID, + detailGUIDParameterName, + requestBody.getProperties().getEffectiveFrom(), + requestBody.getProperties().getEffectiveTo(), + false, + false, + new Date(), + methodName); + } + else + { + handler.addMoreInformation(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + elementGUID, + elementGUIDParameterName, + detailGUID, + detailGUIDParameterName, + null, + null, + false, + false, + new Date(), + methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Remove a "MoreInformation" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element that is descriptive + * @param detailGUID unique identifier of the element that provides the detail + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse clearMoreInformation(String serverName, + String userId, + String elementGUID, + String detailGUID, + ExternalSourceRequestBody requestBody) + { + final String methodName = "clearMoreInformation"; + final String elementGUIDParameterName = "elementGUID"; + final String detailGUIDParameterName = "detailGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ReferenceableHandler handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); + + if (requestBody != null) + { + handler.removeMoreInformation(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + elementGUID, + elementGUIDParameterName, + detailGUID, + detailGUIDParameterName, + false, + false, + new Date(), + methodName); + } + else + { + handler.removeMoreInformation(userId, + null, + null, + elementGUID, + elementGUIDParameterName, + detailGUID, + detailGUIDParameterName, + false, + false, + new Date(), + methodName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Retrieve the detail elements linked via a "MoreInformation" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element that is descriptive + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public RelatedElementListResponse getMoreInformation(String serverName, + String userId, + String elementGUID, + int startFrom, + int pageSize) + { + final String methodName = "getMoreInformation"; + final String guidPropertyName = "elementGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + RelatedElementListResponse response = new RelatedElementListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ReferenceableHandler handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); + + handler.getMoreInformation(userId, + elementGUID, + guidPropertyName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + startFrom, + pageSize, + false, + false, + new Date(), + methodName); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Retrieve the descriptive elements linked via a "MoreInformation" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param detailGUID unique identifier of the element that provides the detail + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public RelatedElementListResponse getDescriptiveElements(String serverName, + String userId, + String detailGUID, + int startFrom, + int pageSize) + { + final String methodName = "getDescriptiveElements"; + final String guidPropertyName = "detailGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + RelatedElementListResponse response = new RelatedElementListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ReferenceableHandler handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); + + handler.getDescriptiveElements(userId, + detailGUID, + guidPropertyName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + startFrom, + pageSize, + false, + false, + new Date(), + methodName); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Create a "Stakeholder" relationship between an element and its stakeholder. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param stakeholderGUID unique identifier of the stakeholder + * @param requestBody relationship properties + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse setupStakeholder(String serverName, + String userId, + String elementGUID, + String stakeholderGUID, + RelationshipRequestBody requestBody) + { + final String methodName = "setupStakeholder"; + final String elementGUIDParameterName = "elementGUID"; + final String stakeholderGUIDParameterName = "stakeholderGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ReferenceableHandler handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof StakeholderProperties) + { + StakeholderProperties properties = (StakeholderProperties) requestBody.getProperties(); + + handler.addStakeholder(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + elementGUID, + elementGUIDParameterName, + stakeholderGUID, + stakeholderGUIDParameterName, + properties.getStakeholderRole(), + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + false, + false, + new Date(), + methodName); + } + else if (requestBody.getProperties() == null) + { + handler.addMoreInformation(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + elementGUID, + elementGUIDParameterName, + stakeholderGUID, + stakeholderGUIDParameterName, + null, + null, + false, + false, + new Date(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(StakeholderProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Remove a "Stakeholder" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param stakeholderGUID unique identifier of the stakeholder + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse clearStakeholder(String serverName, + String userId, + String elementGUID, + String stakeholderGUID, + ExternalSourceRequestBody requestBody) + { + final String methodName = "clearStakeholder"; + final String elementGUIDParameterName = "elementGUID"; + final String stakeholderGUIDParameterName = "stakeholderGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ReferenceableHandler handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); + + if (requestBody != null) + { + handler.removeStakeholder(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + elementGUID, + elementGUIDParameterName, + stakeholderGUID, + stakeholderGUIDParameterName, + false, + false, + new Date(), + methodName); + } + else + { + handler.removeStakeholder(userId, + null, + null, + elementGUID, + elementGUIDParameterName, + stakeholderGUID, + stakeholderGUIDParameterName, + false, + false, + new Date(), + methodName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Retrieve the stakeholder elements linked via the "Stakeholder" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public RelatedElementListResponse getStakeholders(String serverName, + String userId, + String elementGUID, + int startFrom, + int pageSize) + { + final String methodName = "getStakeholders"; + final String guidPropertyName = "elementGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + RelatedElementListResponse response = new RelatedElementListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ReferenceableHandler handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); + + handler.getStakeholders(userId, + elementGUID, + guidPropertyName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + startFrom, + pageSize, + false, + false, + new Date(), + methodName); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Retrieve the elements commissioned by a stakeholder, linked via the "Stakeholder" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param stakeholderGUID unique identifier of the stakeholder + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public RelatedElementListResponse getStakeholderCommissionedElements(String serverName, + String userId, + String stakeholderGUID, + int startFrom, + int pageSize) + { + final String methodName = "getStakeholderCommissionedElements"; + final String guidPropertyName = "stakeholderGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + RelatedElementListResponse response = new RelatedElementListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ReferenceableHandler handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); + + handler.getCommissionedByStakeholder(userId, + stakeholderGUID, + guidPropertyName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + startFrom, + pageSize, + false, + false, + new Date(), + methodName); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Create an "AssignmentScope" relationship between an element and its scope. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param scopeGUID unique identifier of the scope + * @param requestBody relationship properties + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse setupAssignmentScope(String serverName, + String userId, + String elementGUID, + String scopeGUID, + RelationshipRequestBody requestBody) + { + final String methodName = "setupAssignmentScope"; + final String elementGUIDParameterName = "elementGUID"; + final String scopeGUIDParameterName = "scopeGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ReferenceableHandler handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof AssignmentScopeProperties) + { + AssignmentScopeProperties properties = (AssignmentScopeProperties) requestBody.getProperties(); + + handler.addAssignmentScope(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + elementGUID, + elementGUIDParameterName, + scopeGUID, + scopeGUIDParameterName, + properties.getAssignmentType(), + properties.getDescription(), + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + false, + false, + new Date(), + methodName); + } + else if (requestBody.getProperties() == null) + { + handler.addAssignmentScope(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + elementGUID, + elementGUIDParameterName, + scopeGUID, + scopeGUIDParameterName, + null, + null, + null, + null, + false, + false, + new Date(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(AssignmentScopeProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Remove an "AssignmentScope" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param scopeGUID unique identifier of the scope + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse clearAssignmentScope(String serverName, + String userId, + String elementGUID, + String scopeGUID, + ExternalSourceRequestBody requestBody) + { + final String methodName = "clearAssignmentScope"; + final String elementGUIDParameterName = "elementGUID"; + final String scopeGUIDParameterName = "scopeGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ReferenceableHandler handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); + + if (requestBody != null) + { + handler.removeAssignmentScope(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + elementGUID, + elementGUIDParameterName, + scopeGUID, + scopeGUIDParameterName, + false, + false, + new Date(), + methodName); + } + else + { + handler.removeAssignmentScope(userId, + null, + null, + elementGUID, + elementGUIDParameterName, + scopeGUID, + scopeGUIDParameterName, + false, + false, + new Date(), + methodName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Retrieve the assigned scopes linked by the "AssignmentScope" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public RelatedElementListResponse getAssignedScopes(String serverName, + String userId, + String elementGUID, + int startFrom, + int pageSize) + { + final String methodName = "getAssignedScopes"; + final String guidPropertyName = "elementGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + RelatedElementListResponse response = new RelatedElementListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ReferenceableHandler handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); + + handler.getAssignmentScope(userId, + elementGUID, + guidPropertyName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + startFrom, + pageSize, + false, + false, + new Date(), + methodName); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Retrieve the assigned actors linked by the "AssignmentScope" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param scopeGUID unique identifier of the scope + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public RelatedElementListResponse getAssignedActors(String serverName, + String userId, + String scopeGUID, + int startFrom, + int pageSize) + { + final String methodName = "getAssignedActors"; + final String guidPropertyName = "scopeGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + RelatedElementListResponse response = new RelatedElementListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ReferenceableHandler handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); + + handler.getAssignedActors(userId, + scopeGUID, + guidPropertyName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + startFrom, + pageSize, + false, + false, + new Date(), + methodName); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Create a "ResourceList" relationship between a consuming element and an element that represents resources. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param resourceGUID unique identifier of the resource + * @param requestBody relationship properties + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse setupResource(String serverName, + String userId, + String elementGUID, + String resourceGUID, + RelationshipRequestBody requestBody) + { + final String methodName = "setupResource"; + final String elementGUIDParameterName = "elementGUID"; + final String resourceGUIDParameterName = "resourceGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ReferenceableHandler handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof ResourceListProperties) + { + ResourceListProperties properties = (ResourceListProperties) requestBody.getProperties(); + + handler.saveResourceListMember(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + elementGUID, + elementGUIDParameterName, + resourceGUID, + resourceGUIDParameterName, + properties.getResourceUse(), + properties.getWatchResource(), + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + false, + false, + new Date(), + methodName); + } + else if (requestBody.getProperties() == null) + { + handler.saveResourceListMember(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + elementGUID, + elementGUIDParameterName, + resourceGUID, + resourceGUIDParameterName, + null, + false, + null, + null, + false, + false, + new Date(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(ResourceListProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Remove a "ResourceList" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param resourceGUID unique identifier of the resource + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse clearResource(String serverName, + String userId, + String elementGUID, + String resourceGUID, + ExternalSourceRequestBody requestBody) + { + final String methodName = "clearResource"; + final String elementGUIDParameterName = "elementGUID"; + final String resourceGUIDParameterName = "resourceGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ReferenceableHandler handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); + + if (requestBody != null) + { + handler.removeResourceListMember(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + elementGUID, + elementGUIDParameterName, + resourceGUID, + resourceGUIDParameterName, + false, + false, + new Date(), + methodName); + } + else + { + handler.removeResourceListMember(userId, + null, + null, + elementGUID, + elementGUIDParameterName, + resourceGUID, + resourceGUIDParameterName, + false, + false, + new Date(), + methodName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Retrieve the list of resources assigned to an element via the "ResourceList" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public RelatedElementListResponse getResourceList(String serverName, + String userId, + String elementGUID, + int startFrom, + int pageSize) + { + final String methodName = "getResourceList"; + final String guidPropertyName = "elementGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + RelatedElementListResponse response = new RelatedElementListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ReferenceableHandler handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); + + handler.getResourceList(userId, + elementGUID, + guidPropertyName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + startFrom, + pageSize, + false, + false, + new Date(), + methodName); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Retrieve the list of elements assigned to a resource via the "ResourceList" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param resourceGUID unique identifier of the resource + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public RelatedElementListResponse getSupportedByResource(String serverName, + String userId, + String resourceGUID, + int startFrom, + int pageSize) + { + final String methodName = "getSupportedByResource"; + final String guidPropertyName = "resourceGUID"; + + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + RelatedElementListResponse response = new RelatedElementListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ReferenceableHandler handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); + + handler.getSupportedByResource(userId, + resourceGUID, + guidPropertyName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + startFrom, + pageSize, + false, + false, + new Date(), + methodName); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } +} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/UserIdentityRESTServices.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/UserIdentityRESTServices.java index c345adebb0c..4592812ccf4 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/UserIdentityRESTServices.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/UserIdentityRESTServices.java @@ -3,7 +3,7 @@ package org.odpi.openmetadata.accessservices.communityprofile.server; import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.UserIdentityElement; -import org.odpi.openmetadata.accessservices.communityprofile.rest.MetadataSourceRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.rest.ExternalSourceRequestBody; import org.odpi.openmetadata.accessservices.communityprofile.rest.UserIdentityListResponse; import org.odpi.openmetadata.accessservices.communityprofile.rest.UserIdentityRequestBody; import org.odpi.openmetadata.accessservices.communityprofile.rest.UserIdentityResponse; @@ -78,6 +78,7 @@ public GUIDResponse createUserIdentity(String serverName, null, null, requestBody.getProperties().getQualifiedName(), + requestBody.getProperties().getUserId(), requestBody.getProperties().getDistinguishedName(), requestBody.getProperties().getAdditionalProperties(), requestBody.getProperties().getTypeName(), @@ -145,6 +146,7 @@ public VoidResponse updateUserIdentity(String serverName, userIdentityGUID, guidParameterName, requestBody.getProperties().getQualifiedName(), + requestBody.getProperties().getUserId(), requestBody.getProperties().getDistinguishedName(), requestBody.getProperties().getAdditionalProperties(), requestBody.getProperties().getTypeName(), @@ -188,7 +190,7 @@ public VoidResponse updateUserIdentity(String serverName, public VoidResponse deleteUserIdentity(String serverName, String userId, String userIdentityGUID, - MetadataSourceRequestBody requestBody) + ExternalSourceRequestBody requestBody) { final String methodName = "deleteUserIdentity"; final String guidParameterName = "userIdentityGUID"; @@ -249,7 +251,7 @@ public VoidResponse addIdentityToProfile(String serverName, String userId, String userIdentityGUID, String profileGUID, - MetadataSourceRequestBody requestBody) + ExternalSourceRequestBody requestBody) { final String methodName = "addIdentityToProfile"; final String userIdentityGUIDParameterName = "userIdentityGUID"; @@ -314,7 +316,7 @@ public VoidResponse removeIdentityFromProfile(String serverNa String userId, String userIdentityGUID, String profileGUID, - MetadataSourceRequestBody requestBody) + ExternalSourceRequestBody requestBody) { final String methodName = "removeIdentityFromProfile"; final String userIdentityGUIDParameterName = "userIdentityGUID"; diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/CommunityProfileResource.java b/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/CommunityProfileResource.java index 5d0db855a6c..8b40e83f573 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/CommunityProfileResource.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/CommunityProfileResource.java @@ -25,7 +25,7 @@ public class CommunityProfileResource { - private CommunityProfileRESTServices restAPI = new CommunityProfileRESTServices(); + private final CommunityProfileRESTServices restAPI = new CommunityProfileRESTServices(); /** diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/CommunityResource.java b/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/CommunityResource.java new file mode 100644 index 00000000000..794b1227b96 --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/CommunityResource.java @@ -0,0 +1,326 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.communityprofile.server.spring; + +import io.swagger.v3.oas.annotations.ExternalDocumentation; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.odpi.openmetadata.accessservices.communityprofile.rest.CommunityListResponse; +import org.odpi.openmetadata.accessservices.communityprofile.rest.CommunityResponse; +import org.odpi.openmetadata.accessservices.communityprofile.rest.ExternalSourceRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.rest.PersonRoleListResponse; +import org.odpi.openmetadata.accessservices.communityprofile.rest.ReferenceableRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.rest.RelationshipRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.rest.TemplateRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.server.CommunityRESTServices; +import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDResponse; +import org.odpi.openmetadata.commonservices.ffdc.rest.NameRequestBody; +import org.odpi.openmetadata.commonservices.ffdc.rest.SearchStringRequestBody; +import org.odpi.openmetadata.commonservices.ffdc.rest.VoidResponse; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The CommunityResource provides a Spring based server-side REST API + * that supports the CommunityManagementInterface. It delegates each request to the + * CommunityRESTServices. This provides the server-side implementation of the Community Profile Open Metadata + * Assess Service (OMAS) which is used to manage information about people, roles and organizations. + */ +@RestController +@RequestMapping("/servers/{serverName}/open-metadata/access-services/community-profile/users/{userId}") + +@Tag(name="Community Profile OMAS", description="The Community Profile OMAS provides APIs and events for tools and applications that are managing information about people and the way they work together.", + externalDocs=@ExternalDocumentation(description="Community Profile Open Metadata Access Service (OMAS)", + url="https://egeria-project.org/services/omas/community-profile/overview/")) + +public class CommunityResource +{ + private final CommunityRESTServices restAPI = new CommunityRESTServices(); + + /** + * Default constructor + */ + public CommunityResource() + { + } + + + + /** + * Create a new metadata element to represent a community. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param requestBody properties to store + * + * @return unique identifier of the new metadata element or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/communities") + + public GUIDResponse createCommunity(@PathVariable String serverName, + @PathVariable String userId, + @RequestBody ReferenceableRequestBody requestBody) + { + return restAPI.createCommunity(serverName, userId, requestBody); + } + + + /** + * Create a new metadata element to represent a community using an existing metadata element as a template. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param templateGUID unique identifier of the metadata element to copy + * @param requestBody properties that override the template + * + * @return unique identifier of the new metadata element or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/communities/from-template/{templateGUID}") + + public GUIDResponse createCommunityFromTemplate(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String templateGUID, + @RequestBody TemplateRequestBody requestBody) + { + return restAPI.createCommunityFromTemplate(serverName, userId, templateGUID, requestBody); + } + + + /** + * Update the metadata element representing a community. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param communityGUID unique identifier of the metadata element to update + * @param isMergeUpdate should the new properties be merged with the existing properties of overlay them? + * @param requestBody new properties for this element + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/communities/{communityGUID}") + + public VoidResponse updateCommunity(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String communityGUID, + @RequestParam boolean isMergeUpdate, + @RequestBody ReferenceableRequestBody requestBody) + { + return restAPI.updateCommunity(serverName, userId, communityGUID, isMergeUpdate, requestBody); + } + + + + /** + * Create a relationship between a community and a person role. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param communityGUID unique identifier of the community in the external data manager + * @param communityRoleGUID unique identifier of the person role in the external data manager + * @param requestBody data manager identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/communities/{communityGUID}/community-roles/{communityRoleGUID}") + + public VoidResponse setupCommunityRole(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String communityGUID, + @PathVariable String communityRoleGUID, + @RequestBody RelationshipRequestBody requestBody) + { + return restAPI.setupCommunityRole(serverName, userId, communityGUID, communityRoleGUID, requestBody); + } + + + /** + * Remove a relationship between a community and a person role. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param communityGUID unique identifier of the community in the external data manager + * @param communityRoleGUID unique identifier of the person role in the external data manager + * @param requestBody data manager identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/communities/{communityGUID}/community-roles/{communityRoleGUID}/delete") + + public VoidResponse clearCommunityRole(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String communityGUID, + @PathVariable String communityRoleGUID, + @RequestBody ExternalSourceRequestBody requestBody) + { + return restAPI.clearCommunityRole(serverName, userId, communityGUID, communityRoleGUID, requestBody); + } + + + /** + * Remove the metadata element representing a community. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param communityGUID unique identifier of the metadata element to remove + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/communities/{communityGUID}/delete") + + public VoidResponse removeCommunity(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String communityGUID, + @RequestBody ExternalSourceRequestBody requestBody) + { + return restAPI.removeCommunity(serverName, userId, communityGUID, requestBody); + } + + + /** + * Retrieve the list of community metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param requestBody string to find in the properties + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/communities/by-search-string") + + public CommunityListResponse findCommunities(@PathVariable String serverName, + @PathVariable String userId, + @RequestBody SearchStringRequestBody requestBody, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.findCommunities(serverName, userId, requestBody, startFrom, pageSize); + } + + + /** + * Retrieve the list of community metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param requestBody name to search for + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/communities/by-name") + + public CommunityListResponse getCommunitiesByName(@PathVariable String serverName, + @PathVariable String userId, + @RequestBody NameRequestBody requestBody, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getCommunitiesByName(serverName, userId, requestBody, startFrom, pageSize); + } + + /** + * Return information about a person role connected to the named community. + * + * @param serverName called server + * @param userId calling user + * @param communityGUID unique identifier for the community + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching person roles + * + * InvalidParameterException name or userId is null + * PropertyServerException problem accessing property server + * UserNotAuthorizedException security access problem + */ + @GetMapping(path = "/person-roles/by-community/{communityGUID}") + + public PersonRoleListResponse getRolesForCommunity(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String communityGUID, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getRolesForCommunity(serverName, userId, communityGUID, startFrom, pageSize); + } + + + /** + * Retrieve the list of community metadata elements. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @GetMapping(path = "/communities") + + public CommunityListResponse getCommunitiesByName(@PathVariable String serverName, + @PathVariable String userId, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getCommunities(serverName, userId, startFrom, pageSize); + } + + + /** + * Retrieve the community metadata element with the supplied unique identifier. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param guid unique identifier of the requested metadata element + * + * @return matching metadata element or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @GetMapping(path = "/communities/{guid}") + + public CommunityResponse getCommunityByGUID(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String guid) + { + return restAPI.getCommunityByGUID(serverName, userId, guid); + } +} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/LocationManagementResource.java b/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/LocationManagementResource.java index e936ab589ab..4b62b9f7735 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/LocationManagementResource.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/LocationManagementResource.java @@ -4,17 +4,16 @@ import io.swagger.v3.oas.annotations.ExternalDocumentation; import io.swagger.v3.oas.annotations.tags.Tag; -import org.odpi.openmetadata.accessservices.communityprofile.properties.LocationProperties; -import org.odpi.openmetadata.accessservices.communityprofile.properties.TemplateProperties; -import org.odpi.openmetadata.accessservices.communityprofile.rest.DigitalLocationRequestBody; -import org.odpi.openmetadata.accessservices.communityprofile.rest.FixedLocationRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.rest.ClassificationRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.rest.ExternalSourceRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.rest.LocationListResponse; import org.odpi.openmetadata.accessservices.communityprofile.rest.LocationResponse; -import org.odpi.openmetadata.accessservices.communityprofile.rest.LocationsResponse; -import org.odpi.openmetadata.accessservices.communityprofile.rest.SecureLocationRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.rest.ReferenceableRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.rest.RelationshipRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.rest.TemplateRequestBody; import org.odpi.openmetadata.accessservices.communityprofile.server.LocationRESTServices; import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDResponse; import org.odpi.openmetadata.commonservices.ffdc.rest.NameRequestBody; -import org.odpi.openmetadata.commonservices.ffdc.rest.NullRequestBody; import org.odpi.openmetadata.commonservices.ffdc.rest.SearchStringRequestBody; import org.odpi.openmetadata.commonservices.ffdc.rest.VoidResponse; import org.springframework.web.bind.annotation.GetMapping; @@ -37,7 +36,7 @@ public class LocationManagementResource { - private LocationRESTServices restAPI = new LocationRESTServices(); + private final LocationRESTServices restAPI = new LocationRESTServices(); /** @@ -62,9 +61,9 @@ public LocationManagementResource() */ @PostMapping(path = "/locations") - public GUIDResponse createLocation(@PathVariable String serverName, - @PathVariable String userId, - @RequestBody LocationProperties locationProperties) + public GUIDResponse createLocation(@PathVariable String serverName, + @PathVariable String userId, + @RequestBody ReferenceableRequestBody locationProperties) { return restAPI.createLocation(serverName, userId, locationProperties); } @@ -85,10 +84,10 @@ public GUIDResponse createLocation(@PathVariable String serverName, */ @PostMapping(path = "/locations/from-template/{templateGUID}") - public GUIDResponse createLocationFromTemplate(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String templateGUID, - @RequestBody TemplateProperties templateProperties) + public GUIDResponse createLocationFromTemplate(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String templateGUID, + @RequestBody TemplateRequestBody templateProperties) { return restAPI.createLocationFromTemplate(serverName, userId, templateGUID, templateProperties); } @@ -109,11 +108,11 @@ public GUIDResponse createLocationFromTemplate(@PathVariable String */ @PostMapping(path = "/locations/{locationGUID}/update") - public VoidResponse updateLocation(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String locationGUID, - @RequestParam boolean isMergeUpdate, - @RequestBody LocationProperties locationProperties) + public VoidResponse updateLocation(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String locationGUID, + @RequestParam boolean isMergeUpdate, + @RequestBody ReferenceableRequestBody locationProperties) { return restAPI.updateLocation(serverName, userId, locationGUID, isMergeUpdate, locationProperties); } @@ -134,10 +133,10 @@ public VoidResponse updateLocation(@PathVariable String serverName, */ @PostMapping(path = "/locations/{locationGUID}/classify-as-fixed-location") - public VoidResponse setLocationAsFixedPhysical(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String locationGUID, - @RequestBody FixedLocationRequestBody requestBody) + public VoidResponse setLocationAsFixedPhysical(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String locationGUID, + @RequestBody ClassificationRequestBody requestBody) { return restAPI.setLocationAsFixedPhysical(serverName, userId, locationGUID, requestBody); } @@ -157,11 +156,11 @@ public VoidResponse setLocationAsFixedPhysical(@PathVariable String */ @PostMapping(path = "/locations/{locationGUID}/classify-as-fixed-location/delete") - public VoidResponse clearLocationAsFixedPhysical(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String locationGUID, + public VoidResponse clearLocationAsFixedPhysical(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String locationGUID, @RequestBody (required = false) - NullRequestBody requestBody) + ExternalSourceRequestBody requestBody) { return restAPI.clearLocationAsFixedPhysical(serverName, userId, locationGUID, requestBody); } @@ -184,7 +183,7 @@ public VoidResponse clearLocationAsFixedPhysical(@PathVariable String s public VoidResponse setLocationAsSecure(@PathVariable String serverName, @PathVariable String userId, @PathVariable String locationGUID, - @RequestBody SecureLocationRequestBody requestBody) + @RequestBody ClassificationRequestBody requestBody) { return restAPI.setLocationAsSecure(serverName, userId, locationGUID, requestBody); @@ -206,11 +205,11 @@ public VoidResponse setLocationAsSecure(@PathVariable String */ @PostMapping(path = "/locations/{locationGUID}/classify-as-secure-location/delete") - public VoidResponse clearLocationAsSecure(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String locationGUID, + public VoidResponse clearLocationAsSecure(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String locationGUID, @RequestBody (required = false) - NullRequestBody requestBody) + ExternalSourceRequestBody requestBody) { return restAPI.clearLocationAsSecure(serverName, userId, locationGUID, requestBody); } @@ -231,10 +230,10 @@ public VoidResponse clearLocationAsSecure(@PathVariable String serverNa */ @PostMapping(path = "/locations/{locationGUID}/classify-as-digital-location") - public VoidResponse setLocationAsDigital(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String locationGUID, - @RequestBody DigitalLocationRequestBody requestBody) + public VoidResponse setLocationAsDigital(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String locationGUID, + @RequestBody ClassificationRequestBody requestBody) { return restAPI.setLocationAsDigital(serverName, userId, locationGUID, requestBody); } @@ -255,11 +254,11 @@ public VoidResponse setLocationAsDigital(@PathVariable String */ @PostMapping(path = "/locations/{locationGUID}/classify-as-digital-location/delete") - public VoidResponse clearLocationAsDigital(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String locationGUID, + public VoidResponse clearLocationAsDigital(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String locationGUID, @RequestBody (required = false) - NullRequestBody requestBody) + ExternalSourceRequestBody requestBody) { return restAPI.clearLocationAsDigital(serverName, userId, locationGUID, requestBody); } @@ -280,11 +279,11 @@ public VoidResponse clearLocationAsDigital(@PathVariable String serverN */ @PostMapping(path = "/locations/{locationGUID}/delete") - public VoidResponse removeLocation(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String locationGUID, + public VoidResponse removeLocation(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String locationGUID, @RequestBody (required = false) - NullRequestBody requestBody) + ExternalSourceRequestBody requestBody) { return restAPI.removeLocation(serverName, userId, locationGUID, requestBody); } @@ -306,12 +305,12 @@ public VoidResponse removeLocation(@PathVariable String serverName, */ @PostMapping(path = "/locations/{parentLocationGUID}/has-nested-location/{childLocationGUID}") - public VoidResponse setupNestedLocation(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String parentLocationGUID, - @PathVariable String childLocationGUID, + public VoidResponse setupNestedLocation(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String parentLocationGUID, + @PathVariable String childLocationGUID, @RequestBody (required = false) - NullRequestBody requestBody) + RelationshipRequestBody requestBody) { return restAPI.setupNestedLocation(serverName, userId, parentLocationGUID, childLocationGUID, requestBody); } @@ -333,12 +332,12 @@ public VoidResponse setupNestedLocation(@PathVariable String serverName */ @PostMapping(path = "/locations/{parentLocationGUID}/has-nested-location/{childLocationGUID}/delete") - public VoidResponse clearNestedLocation(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String parentLocationGUID, - @PathVariable String childLocationGUID, + public VoidResponse clearNestedLocation(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String parentLocationGUID, + @PathVariable String childLocationGUID, @RequestBody (required = false) - NullRequestBody requestBody) + ExternalSourceRequestBody requestBody) { return restAPI.clearNestedLocation(serverName, userId, parentLocationGUID, childLocationGUID, requestBody); } @@ -360,12 +359,12 @@ public VoidResponse clearNestedLocation(@PathVariable String serverName */ @PostMapping(path = "/locations/{locationOneGUID}/linked-to-peer-location/{locationTwoGUID}") - public VoidResponse setupAdjacentLocation(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String locationOneGUID, - @PathVariable String locationTwoGUID, + public VoidResponse setupAdjacentLocation(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String locationOneGUID, + @PathVariable String locationTwoGUID, @RequestBody (required = false) - NullRequestBody requestBody) + RelationshipRequestBody requestBody) { return restAPI.setupAdjacentLocation(serverName, userId, locationOneGUID, locationTwoGUID, requestBody); } @@ -387,17 +386,123 @@ public VoidResponse setupAdjacentLocation(@PathVariable String serverNa */ @PostMapping(path = "/locations/{locationOneGUID}/linked-to-peer-location/{locationTwoGUID}/delete") - public VoidResponse clearAdjacentLocation(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String locationOneGUID, - @PathVariable String locationTwoGUID, + public VoidResponse clearAdjacentLocation(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String locationOneGUID, + @PathVariable String locationTwoGUID, @RequestBody (required = false) - NullRequestBody requestBody) + ExternalSourceRequestBody requestBody) { return restAPI.clearAdjacentLocation(serverName, userId, locationOneGUID, locationTwoGUID, requestBody); } + /** + * Create a profile location relationship between an actor profile and a location. + * + * @param serverName name of calling server + * @param userId calling user + * @param actorProfileGUID unique identifier of the actor profile + * @param locationGUID unique identifier of the location + * @param requestBody profile location request body + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to make this request or + * PropertyServerException the repository is not available or not working properly. + */ + @PostMapping(path = "/locations/{locationGUID}/linked-to-actor-profiles/{actorProfileGUID}") + + public VoidResponse setupProfileLocation(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String actorProfileGUID, + @PathVariable String locationGUID, + @RequestBody RelationshipRequestBody requestBody) + { + return restAPI.setupProfileLocation(serverName, userId, actorProfileGUID, locationGUID, requestBody); + } + + + /** + * Remove a profile location relationship between an actor profile and a location. + * + * @param serverName name of calling server + * @param userId calling user + * @param actorProfileGUID unique identifier of the actor profile + * @param locationGUID unique identifier of the location + * @param requestBody null request body + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to make this request or + * PropertyServerException the repository is not available or not working properly. + */ + @PostMapping(path = "/locations/{locationGUID}/linked-to-actor-profiles/{actorProfileGUID}/delete") + + public VoidResponse clearProfileLocation(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String actorProfileGUID, + @PathVariable String locationGUID, + @RequestBody(required = false) + ExternalSourceRequestBody requestBody) + { + return restAPI.clearProfileLocation(serverName, userId, actorProfileGUID, locationGUID, requestBody); + } + + + + /** + * Create an asset location relationship between an asset and a location. + * + * @param serverName name of calling server + * @param userId calling user + * @param assetGUID unique identifier of the asset + * @param locationGUID unique identifier of the location + * @param requestBody profile location request body + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to make this request or + * PropertyServerException the repository is not available or not working properly. + */ + @PostMapping(path = "/locations/{locationGUID}/linked-to-assets/{assetGUID}") + + public VoidResponse setupAssetLocation(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String assetGUID, + @PathVariable String locationGUID, + @RequestBody RelationshipRequestBody requestBody) + { + return restAPI.setupAssetLocation(serverName, userId, assetGUID, locationGUID, requestBody); + } + + + /** + * Remove an asset location relationship between an asset and a location. + * + * @param serverName name of calling server + * @param userId calling user + * @param assetGUID unique identifier of the asset + * @param locationGUID unique identifier of the location + * @param requestBody null request body + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to make this request or + * PropertyServerException the repository is not available or not working properly. + */ + @PostMapping(path = "/locations/{locationGUID}/linked-to-assets/{assetGUID}/delete") + + public VoidResponse clearAssetLocation(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String assetGUID, + @PathVariable String locationGUID, + @RequestBody(required = false) + ExternalSourceRequestBody requestBody) + { + return restAPI.clearAssetLocation(serverName, userId, assetGUID, locationGUID, requestBody); + } + /** * Retrieve the list of location metadata elements that contain the search string. @@ -416,18 +521,18 @@ public VoidResponse clearAdjacentLocation(@PathVariable String serverNa */ @PostMapping(path = "/locations/by-search-string") - public LocationsResponse findLocations(@PathVariable String serverName, - @PathVariable String userId, - @RequestParam int startFrom, - @RequestParam int pageSize, - @RequestBody SearchStringRequestBody requestBody) + public LocationListResponse findLocations(@PathVariable String serverName, + @PathVariable String userId, + @RequestParam int startFrom, + @RequestParam int pageSize, + @RequestBody SearchStringRequestBody requestBody) { return restAPI.findLocations(serverName, userId, requestBody, startFrom, pageSize); } /** - * Retrieve the list of location metadata elements with a matching qualified or display name. + * Retrieve the list of location metadata elements with a matching qualified name, identifier or display name. * There are no wildcards supported on this request. * * @param serverName name of calling server @@ -443,16 +548,171 @@ public LocationsResponse findLocations(@PathVariable String ser */ @PostMapping(path = "/locations/by-name") - public LocationsResponse getLocationsByName(@PathVariable String serverName, - @PathVariable String userId, - @RequestParam int startFrom, - @RequestParam int pageSize, - @RequestBody NameRequestBody requestBody) + public LocationListResponse getLocationsByName(@PathVariable String serverName, + @PathVariable String userId, + @RequestParam int startFrom, + @RequestParam int pageSize, + @RequestBody NameRequestBody requestBody) { return restAPI.getLocationsByName(serverName, userId, requestBody, startFrom, pageSize); } + /** + * Retrieve the list of adjacent location metadata elements linked to locationGUID. + * + * @param serverName name of calling server + * @param userId calling user + * @param locationGUID location to start from + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to make this request or + * PropertyServerException the repository is not available or not working properly. + */ + @GetMapping(path = "/locations/{locationGUID}/has-peer-locations") + + public LocationListResponse getAdjacentLocations(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String locationGUID, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getAdjacentLocations(serverName, userId, locationGUID, startFrom, pageSize); + } + + + /** + * Retrieve the list of nested location metadata elements linked to locationGUID. + * + * @param serverName name of calling server + * @param userId calling user + * @param locationGUID location to start from + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to make this request or + * PropertyServerException the repository is not available or not working properly. + */ + @GetMapping(path = "/locations/{locationGUID}/has-nested-locations") + + public LocationListResponse getNestedLocations(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String locationGUID, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getNestedLocations(serverName, userId, locationGUID, startFrom, pageSize); + } + + + /** + * Retrieve the list of location metadata elements that has the location identifier with locationGUID nested inside it. + * + * @param serverName name of calling server + * @param userId calling user + * @param locationGUID location to start from + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to make this request or + * PropertyServerException the repository is not available or not working properly. + */ + @GetMapping(path = "/locations/{locationGUID}/has-grouping-locations") + + public LocationListResponse getGroupingLocations(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String locationGUID, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getGroupingLocations(serverName, userId, locationGUID, startFrom, pageSize); + } + + + /** + * Retrieve the list of location metadata elements linked to the requested profile. + * + * @param serverName name of calling server + * @param userId calling user + * @param actorProfileGUID name to search for + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to make this request or + * PropertyServerException the repository is not available or not working properly. + */ + @GetMapping(path = "/locations/by-actor-profile/{actorProfileGUID}") + + public LocationListResponse getLocationsByProfile(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String actorProfileGUID, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getLocationsByProfile(serverName, userId, actorProfileGUID, startFrom, pageSize); + } + + + /** + * Retrieve the list of location metadata elements linked to the requested asset. + * + * @param serverName name of calling server + * @param userId calling user + * @param assetGUID name to search for + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to make this request or + * PropertyServerException the repository is not available or not working properly. + */ + @GetMapping(path = "/locations/by-asset/{assetGUID}") + + public LocationListResponse getKnownLocationsForAsset(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String assetGUID, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getKnownLocationsForAsset(serverName, userId, assetGUID, startFrom, pageSize); + } + + + + /** + * Retrieve the list of location metadata elements. + * + * @param serverName name of calling server + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to make this request or + * PropertyServerException the repository is not available or not working properly. + */ + @GetMapping(path = "/locations") + + public LocationListResponse getLocations(@PathVariable String serverName, + @PathVariable String userId, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getLocations(serverName, userId, startFrom, pageSize); + } + + /** * Retrieve the location metadata element with the supplied unique identifier. * diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/MyProfileResource.java b/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/MyProfileResource.java index 11c37bd8580..35c4aa9ca02 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/MyProfileResource.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/MyProfileResource.java @@ -27,7 +27,7 @@ public class MyProfileResource { - private MyProfileRESTServices restAPI = new MyProfileRESTServices(); + private final MyProfileRESTServices restAPI = new MyProfileRESTServices(); /** * Default constructor diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/OrganizationResource.java b/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/OrganizationResource.java index 0e67f1b4345..df243e45d97 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/OrganizationResource.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/OrganizationResource.java @@ -11,7 +11,7 @@ import org.odpi.openmetadata.accessservices.communityprofile.rest.ContactMethodRequestBody; import org.odpi.openmetadata.accessservices.communityprofile.rest.EffectiveDatesRequestBody; import org.odpi.openmetadata.accessservices.communityprofile.rest.EffectiveTimeRequestBody; -import org.odpi.openmetadata.accessservices.communityprofile.rest.MetadataSourceRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.rest.ExternalSourceRequestBody; import org.odpi.openmetadata.accessservices.communityprofile.rest.PersonRoleAppointeeListResponse; import org.odpi.openmetadata.accessservices.communityprofile.rest.PersonRoleListResponse; import org.odpi.openmetadata.accessservices.communityprofile.rest.PersonRoleRequestBody; @@ -31,6 +31,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; + /** * The OrganizationResource provides a Spring based server-side REST API * that supports the OrganizationManagementInterface. It delegates each request to the @@ -46,7 +47,7 @@ public class OrganizationResource { - private OrganizationRESTServices restAPI = new OrganizationRESTServices(); + private final OrganizationRESTServices restAPI = new OrganizationRESTServices(); /** * Default constructor @@ -57,7 +58,7 @@ public OrganizationResource() /** - * Create a definition of a actor profile. This could be for the whole organization, a team, a person or a system. + * Create a definition of an actor profile. This could be for the whole organization, a team, a person or a system. * * @param serverName called server * @param userId calling user @@ -125,7 +126,7 @@ public VoidResponse updateActorProfile(@PathVariable String ser public VoidResponse deleteActorProfile(@PathVariable String serverName, @PathVariable String userId, @PathVariable String actorProfileGUID, - @RequestBody MetadataSourceRequestBody requestBody) + @RequestBody ExternalSourceRequestBody requestBody) { return restAPI.deleteActorProfile(serverName, userId, actorProfileGUID, requestBody); } @@ -175,7 +176,7 @@ public GUIDResponse addContactMethod(@PathVariable String serv public VoidResponse deleteContactMethod(@PathVariable String serverName, @PathVariable String userId, @PathVariable String contactMethodGUID, - @RequestBody MetadataSourceRequestBody requestBody) + @RequestBody ExternalSourceRequestBody requestBody) { return restAPI.deleteContactMethod(serverName, userId, contactMethodGUID, requestBody); } @@ -232,7 +233,7 @@ public VoidResponse unlinkTeamsInHierarchy(@PathVariable String @PathVariable String userId, @PathVariable String superTeamProfileGUID, @PathVariable String subTeamProfileGUID, - @RequestBody MetadataSourceRequestBody requestBody) + @RequestBody ExternalSourceRequestBody requestBody) { return restAPI.unlinkTeamsInHierarchy(serverName, userId, superTeamProfileGUID, subTeamProfileGUID, requestBody); } @@ -266,7 +267,7 @@ public ActorProfileResponse getActorProfileByGUID(@PathVariable String serverNam * * @param serverName called server * @param userId calling user - * @param actorProfileUserId unique identifier for the actor profile + * @param actorProfileUserId unique identifier for the userId * * @return properties of the actor profile * @@ -284,6 +285,58 @@ public ActorProfileResponse getActorProfileByUserId(@PathVariable String serverN } + /** + * Return all actor profiles. + * + * @param serverName called server + * @param userId calling user + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of the actor profiles + * + * InvalidParameterException actorProfileUserId or userId is null + * PropertyServerException problem accessing property server + * UserNotAuthorizedException security access problem + */ + @GetMapping(path = "/profiles") + + public ActorProfileListResponse getActorProfiles(@PathVariable String serverName, + @PathVariable String userId, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getActorProfiles(serverName, userId, startFrom, pageSize); + } + + + /** + * Return information about a specific actor profile. + * + * @param serverName called server + * @param userId calling user + * @param locationGUID unique identifier for the location + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return properties of the actor profile + * + * InvalidParameterException actorProfileUserId or userId is null + * PropertyServerException problem accessing property server + * UserNotAuthorizedException security access problem + */ + @GetMapping(path = "/profiles/locations/{locationGUID}") + + public ActorProfileListResponse getActorProfilesByLocation(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String locationGUID, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getActorProfilesByLocation(serverName, userId, locationGUID, startFrom, pageSize); + } + + /** * Return information about a named actor profile. * @@ -301,13 +354,13 @@ public ActorProfileResponse getActorProfileByUserId(@PathVariable String serverN */ @PostMapping(path = "/profiles/by-name") - public ActorProfileListResponse getActorProfileByName(@PathVariable String serverName, - @PathVariable String userId, - @RequestParam int startFrom, - @RequestParam int pageSize, - @RequestBody NameRequestBody requestBody) + public ActorProfileListResponse getActorProfilesByName(@PathVariable String serverName, + @PathVariable String userId, + @RequestParam int startFrom, + @RequestParam int pageSize, + @RequestBody NameRequestBody requestBody) { - return restAPI.getActorProfileByName(serverName, userId, startFrom, pageSize, requestBody); + return restAPI.getActorProfilesByName(serverName, userId, startFrom, pageSize, requestBody); } @@ -334,7 +387,7 @@ public ActorProfileListResponse findActorProfile(@PathVariable String @RequestParam int pageSize, @RequestBody SearchStringRequestBody requestBody) { - return restAPI.findActorProfile(serverName, userId, startFrom, pageSize, requestBody); + return restAPI.findActorProfiles(serverName, userId, startFrom, pageSize, requestBody); } @@ -407,7 +460,7 @@ public VoidResponse updatePersonRole(@PathVariable String serverN public VoidResponse deletePersonRole(@PathVariable String serverName, @PathVariable String userId, @PathVariable String personRoleGUID, - @RequestBody MetadataSourceRequestBody requestBody) + @RequestBody ExternalSourceRequestBody requestBody) { return restAPI.deletePersonRole(serverName, userId, personRoleGUID, requestBody); } @@ -440,8 +493,6 @@ public GUIDResponse linkPersonRoleToProfile(@PathVariable String } - - /** * Return the list of people appointed to a particular role. * @@ -516,7 +567,7 @@ public VoidResponse updateAppointment(@PathVariable String serve public VoidResponse unlinkPersonRoleFromProfile(@PathVariable String serverName, @PathVariable String userId, @PathVariable String appointmentGUID, - @RequestBody MetadataSourceRequestBody requestBody) + @RequestBody ExternalSourceRequestBody requestBody) { return restAPI.unlinkPersonRoleFromProfile(serverName, userId, appointmentGUID, requestBody); } @@ -608,7 +659,7 @@ public PersonRoleResponse getPersonRoleByGUID(@PathVariable String serverName, * @param pageSize maximum number of elements to return. * @param requestBody unique name for the actor profile * - * @return list of matching actor profiles (hopefully only one) + * @return list of matching person roles * * InvalidParameterException name or userId is null * PropertyServerException problem accessing property server @@ -626,6 +677,60 @@ public PersonRoleListResponse getPersonRoleByName(@PathVariable String } + + /** + * Return information about a person role connected to the named team via the TeamLeadership relationship. + * + * @param serverName called server + * @param userId calling user + * @param teamGUID unique identifier for the Team actor profile + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching person roles + * + * InvalidParameterException name or userId is null + * PropertyServerException problem accessing property server + * UserNotAuthorizedException security access problem + */ + @GetMapping(path = "/person-roles/by-team/{teamGUID}/leadership") + + public PersonRoleListResponse getLeadershipRolesForTeam(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String teamGUID, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getLeadershipRolesForTeam(serverName, userId, teamGUID, startFrom, pageSize); + } + + + /** + * Return information about a person role connected to the named team via the TeamMembership relationship. + * + * @param serverName called server + * @param userId calling user + * @param teamGUID unique identifier for the Team actor profile + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching person roles + * + * InvalidParameterException name or userId is null + * PropertyServerException problem accessing property server + * UserNotAuthorizedException security access problem + */ + @GetMapping(path = "/person-roles/by-team/{teamGUID}/membership") + + public PersonRoleListResponse getMembershipRolesForTeam(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String teamGUID, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getMembershipRolesForTeam(serverName, userId, teamGUID, startFrom, pageSize); + } + /** * Retrieve the list of matching roles for the search string. * @@ -635,7 +740,7 @@ public PersonRoleListResponse getPersonRoleByName(@PathVariable String * @param pageSize maximum number of elements to return. * @param requestBody RegEx string to search for * - * @return list of matching actor profiles + * @return list of matching person roles * * InvalidParameterException guid invalid or the external references are not correctly specified, or are null. * PropertyServerException the server is not available. @@ -649,6 +754,6 @@ public PersonRoleListResponse findPersonRole(@PathVariable String @RequestParam int pageSize, @RequestBody SearchStringRequestBody requestBody) { - return restAPI.findPersonRole(serverName, userId, startFrom, pageSize, requestBody); + return restAPI.findPersonRoles(serverName, userId, startFrom, pageSize, requestBody); } } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/PersonalProfileResource.java b/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/PersonalProfileResource.java index f0b91ad7779..3fcf384aa75 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/PersonalProfileResource.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/PersonalProfileResource.java @@ -29,7 +29,7 @@ public class PersonalProfileResource { - private PersonalProfileRESTServices restAPI = new PersonalProfileRESTServices(); + private final PersonalProfileRESTServices restAPI = new PersonalProfileRESTServices(); /** * Default constructor diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/RelatedElementsResource.java b/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/RelatedElementsResource.java new file mode 100644 index 00000000000..ba7c14af3b8 --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/RelatedElementsResource.java @@ -0,0 +1,461 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.communityprofile.server.spring; + +import io.swagger.v3.oas.annotations.ExternalDocumentation; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.odpi.openmetadata.accessservices.communityprofile.rest.ExternalSourceRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.rest.RelatedElementListResponse; +import org.odpi.openmetadata.accessservices.communityprofile.rest.RelationshipRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.server.RelatedElementRESTServices; + +import org.odpi.openmetadata.commonservices.ffdc.rest.VoidResponse; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + + +/** + * The RelatedElementsResource provides a Spring based server-side REST API + * that supports the RelatedElementsManagementInterface. It delegates each request to the + * RelatedElementRESTServices. This provides the server-side implementation of the Community Profile Open Metadata + * Assess Service (OMAS) which is used to manage information about people, roles and organizations. + */ +@RestController +@RequestMapping("/servers/{serverName}/open-metadata/access-services/community-profile/users/{userId}") + +@Tag(name="Community Profile OMAS", description="The Community Profile OMAS provides APIs and events for tools and applications that are managing information about people and the way they work together.", + externalDocs=@ExternalDocumentation(description="Community Profile Open Metadata Access Service (OMAS)", + url="https://egeria-project.org/services/omas/community-profile/overview/")) + +public class RelatedElementsResource +{ + private final RelatedElementRESTServices restAPI = new RelatedElementRESTServices(); + + /** + * Default constructor + */ + public RelatedElementsResource() + { + } + + + /** + * Create a "MoreInformation" relationship between an element that is descriptive and one that is providing the detail. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element that is descriptive + * @param detailGUID unique identifier of the element that provides the detail + * @param requestBody relationship properties + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/related-elements/{elementGUID}/more-information/{detailGUID}") + + public VoidResponse setupMoreInformation(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @PathVariable String detailGUID, + @RequestBody RelationshipRequestBody requestBody) + { + return restAPI.setupMoreInformation(serverName, userId, elementGUID, detailGUID, requestBody); + } + + + /** + * Remove a "MoreInformation" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element that is descriptive + * @param detailGUID unique identifier of the element that provides the detail + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/related-elements/{elementGUID}/more-information/{detailGUID}/delete") + + public VoidResponse clearMoreInformation(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @PathVariable String detailGUID, + @RequestBody ExternalSourceRequestBody requestBody) + { + return restAPI.clearMoreInformation(serverName, userId, elementGUID, detailGUID, requestBody); + } + + + /** + * Retrieve the detail elements linked via a "MoreInformation" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element that is descriptive + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @GetMapping(path = "/related-elements/more-information/by-descriptive-element/{elementGUID}") + + public RelatedElementListResponse getMoreInformation(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getMoreInformation(serverName, userId, elementGUID, startFrom, pageSize); + } + + + /** + * Retrieve the descriptive elements linked via a "MoreInformation" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param detailGUID unique identifier of the element that provides the detail + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @GetMapping(path = "/related-elements/more-information/by-detail-element/{detailGUID}") + + public RelatedElementListResponse getDescriptiveElements(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String detailGUID, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getDescriptiveElements(serverName, userId, detailGUID, startFrom, pageSize); + } + + + /** + * Create a "Stakeholder" relationship between an element and its stakeholder. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param stakeholderGUID unique identifier of the stakeholder + * @param requestBody relationship properties + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/related-elements/{elementGUID}/stakeholders/{stakeholderGUID}") + + public VoidResponse setupStakeholder(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @PathVariable String stakeholderGUID, + @RequestBody RelationshipRequestBody requestBody) + { + return restAPI.setupStakeholder(serverName, userId, elementGUID, stakeholderGUID, requestBody); + } + + + /** + * Remove a "Stakeholder" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param stakeholderGUID unique identifier of the stakeholder + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/related-elements/{elementGUID}/stakeholders/{stakeholderGUID}/delete") + + public VoidResponse clearStakeholder(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @PathVariable String stakeholderGUID, + @RequestBody ExternalSourceRequestBody requestBody) + { + return restAPI.clearStakeholder(serverName, userId, elementGUID, stakeholderGUID, requestBody); + } + + + /** + * Retrieve the stakeholder elements linked via the "Stakeholder" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @GetMapping(path = "/related-elements/stakeholders/by-commissioned-element/{elementGUID}") + + public RelatedElementListResponse getStakeholders(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getStakeholders(serverName, userId, elementGUID, startFrom, pageSize); + } + + + /** + * Retrieve the elements commissioned by a stakeholder, linked via the "Stakeholder" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param stakeholderGUID unique identifier of the stakeholder + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @GetMapping(path = "/related-elements/stakeholders/by-stakeholder/{stakeholderGUID}") + + public RelatedElementListResponse getStakeholderCommissionedElements(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String stakeholderGUID, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getStakeholderCommissionedElements(serverName, userId, stakeholderGUID, startFrom, pageSize); + } + + + /** + * Create an "AssignmentScope" relationship between an element and its scope. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param scopeGUID unique identifier of the scope + * @param requestBody relationship properties + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/related-elements/{elementGUID}/assignment-scopes/{scopeGUID}") + + public VoidResponse setupAssignmentScope(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @PathVariable String scopeGUID, + @RequestBody RelationshipRequestBody requestBody) + { + return restAPI.setupAssignmentScope(serverName, userId, elementGUID, scopeGUID, requestBody); + } + + + /** + * Remove an "AssignmentScope" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param scopeGUID unique identifier of the scope + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/related-elements/{elementGUID}/assignment-scopes/{scopeGUID}/delete") + + public VoidResponse clearAssignmentScope(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @PathVariable String scopeGUID, + @RequestBody ExternalSourceRequestBody requestBody) + { + return restAPI.clearAssignmentScope(serverName, userId, elementGUID, scopeGUID, requestBody); + } + + + /** + * Retrieve the assigned scopes linked by the "AssignmentScope" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @GetMapping(path = "/related-elements/assignment-scopes/by-assigned-actor/{elementGUID}") + + public RelatedElementListResponse getAssignedScopes(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getAssignedScopes(serverName, userId, elementGUID, startFrom, pageSize); + } + + + /** + * Retrieve the assigned actors linked by the "AssignmentScope" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param scopeGUID unique identifier of the scope + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @GetMapping(path = "/related-elements/assignment-scopes/by-assigned-scope/{scopeGUID}") + + public RelatedElementListResponse getAssignedActors(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String scopeGUID, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getAssignedActors(serverName, userId, scopeGUID, startFrom, pageSize); + } + + + /** + * Create a "ResourceList" relationship between a consuming element and an element that represents resources. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param resourceGUID unique identifier of the resource + * @param requestBody relationship properties + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/related-elements/{elementGUID}/resource-list/{resourceGUID}") + + public VoidResponse setupResource(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @PathVariable String resourceGUID, + @RequestBody RelationshipRequestBody requestBody) + { + return restAPI.setupResource(serverName, userId, elementGUID, resourceGUID, requestBody); + } + + + /** + * Remove a "ResourceList" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param resourceGUID unique identifier of the resource + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/related-elements/{elementGUID}/resource-list/{resourceGUID}/delete") + + public VoidResponse clearResource(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @PathVariable String resourceGUID, + @RequestBody ExternalSourceRequestBody requestBody) + { + return restAPI.clearResource(serverName, userId, elementGUID, resourceGUID, requestBody); + } + + + /** + * Retrieve the list of resources assigned to an element via the "ResourceList" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @GetMapping(path = "/related-elements/resource-list/by-assignee/{elementGUID}") + + public RelatedElementListResponse getResourceList(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getResourceList(serverName, userId, elementGUID, startFrom, pageSize); + } + + + /** + * Retrieve the list of elements assigned to a resource via the "ResourceList" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param resourceGUID unique identifier of the resource + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @GetMapping(path = "/related-elements/resource-list/by-resource/{resourceGUID}") + + public RelatedElementListResponse getSupportedByResource(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String resourceGUID, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getSupportedByResource(serverName, userId, resourceGUID, startFrom, pageSize); + } +} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/SecurityGroupResource.java b/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/SecurityGroupResource.java index 29185346270..dd46e11a4d0 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/SecurityGroupResource.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/SecurityGroupResource.java @@ -37,7 +37,7 @@ public class SecurityGroupResource { - private SecurityGroupRESTServices restAPI = new SecurityGroupRESTServices(); + private final SecurityGroupRESTServices restAPI = new SecurityGroupRESTServices(); /** * Default constructor diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/UserIdentityResource.java b/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/UserIdentityResource.java index 19f50103b98..a79b89da3f3 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/UserIdentityResource.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/UserIdentityResource.java @@ -4,7 +4,7 @@ import io.swagger.v3.oas.annotations.ExternalDocumentation; import io.swagger.v3.oas.annotations.tags.Tag; -import org.odpi.openmetadata.accessservices.communityprofile.rest.MetadataSourceRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.rest.ExternalSourceRequestBody; import org.odpi.openmetadata.accessservices.communityprofile.rest.UserIdentityListResponse; import org.odpi.openmetadata.accessservices.communityprofile.rest.UserIdentityRequestBody; import org.odpi.openmetadata.accessservices.communityprofile.rest.UserIdentityResponse; @@ -27,7 +27,7 @@ public class UserIdentityResource { - private UserIdentityRESTServices restAPI = new UserIdentityRESTServices(); + private final UserIdentityRESTServices restAPI = new UserIdentityRESTServices(); /** * Create a UserIdentity. This is not connected to a profile. @@ -96,7 +96,7 @@ public VoidResponse updateUserIdentity(@PathVariable String ser public VoidResponse deleteUserIdentity(@PathVariable String serverName, @PathVariable String userId, @PathVariable String userIdentityGUID, - @RequestBody MetadataSourceRequestBody requestBody) + @RequestBody ExternalSourceRequestBody requestBody) { return restAPI.deleteUserIdentity(serverName, userId, userIdentityGUID, requestBody); } @@ -123,7 +123,7 @@ public VoidResponse addIdentityToProfile(@PathVariable String @PathVariable String userId, @PathVariable String userIdentityGUID, @PathVariable String profileGUID, - @RequestBody MetadataSourceRequestBody requestBody) + @RequestBody ExternalSourceRequestBody requestBody) { return restAPI.addIdentityToProfile(serverName, userId, userIdentityGUID, profileGUID, requestBody); } @@ -150,7 +150,7 @@ public VoidResponse removeIdentityFromProfile(@PathVariable String @PathVariable String userId, @PathVariable String userIdentityGUID, @PathVariable String profileGUID, - @RequestBody MetadataSourceRequestBody requestBody) + @RequestBody ExternalSourceRequestBody requestBody) { return restAPI.removeIdentityFromProfile(serverName, userId, userIdentityGUID, profileGUID, requestBody); } diff --git a/open-metadata-implementation/access-services/data-engine/data-engine-server/src/main/java/org/odpi/openmetadata/accessservices/dataengine/server/converters/ConnectorTypeConverter.java b/open-metadata-implementation/access-services/data-engine/data-engine-server/src/main/java/org/odpi/openmetadata/accessservices/dataengine/server/converters/ConnectorTypeConverter.java index 939c6729fb7..f7eb63b0b49 100644 --- a/open-metadata-implementation/access-services/data-engine/data-engine-server/src/main/java/org/odpi/openmetadata/accessservices/dataengine/server/converters/ConnectorTypeConverter.java +++ b/open-metadata-implementation/access-services/data-engine/data-engine-server/src/main/java/org/odpi/openmetadata/accessservices/dataengine/server/converters/ConnectorTypeConverter.java @@ -25,7 +25,7 @@ public ConnectorTypeConverter(OMRSRepositoryHelper repositoryHelper, String serv /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -82,7 +82,7 @@ public B getNewBean(Class beanClass, EntityDetail entity, String methodName) /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/metadataelements/ElementVersions.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/metadataelements/ElementVersions.java index 4798304d398..d5b6aa6e759 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/metadataelements/ElementVersions.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/metadataelements/ElementVersions.java @@ -17,7 +17,7 @@ /** * ElementVersions provides the version information for the element plus details of the creation time and last - * update time. Finally it lists all of the users that have made changes to this element. + * update time. Finally it lists all the users that have made changes to this element. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/DatabaseManagerClient.java b/open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/DatabaseManagerClient.java index 0c41a6b9cbf..8430cef38fe 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/DatabaseManagerClient.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/DatabaseManagerClient.java @@ -31,14 +31,14 @@ public class DatabaseManagerClient implements DatabaseManagerInterface private final String retrieveURLTemplatePrefix = "/servers/{0}/open-metadata/access-services/data-manager/users/{1}/databases"; private final String governanceURLTemplatePrefix = "/servers/{0}/open-metadata/access-services/data-manager/users/{1}/databases"; - private String serverName; /* Initialized in constructor */ - private String serverPlatformURLRoot; /* Initialized in constructor */ - private AuditLog auditLog = null; /* Initialized in constructor */ + private final String serverName; /* Initialized in constructor */ + private final String serverPlatformURLRoot; /* Initialized in constructor */ + private AuditLog auditLog = null; /* Initialized in constructor */ - private InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); - private DataManagerRESTClient restClient; /* Initialized in constructor */ + private final InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); + private final DataManagerRESTClient restClient; /* Initialized in constructor */ - private static NullRequestBody nullRequestBody = new NullRequestBody(); + private final static NullRequestBody nullRequestBody = new NullRequestBody(); /** diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/APIConverter.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/APIConverter.java index e044b9b8191..94deb1eb291 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/APIConverter.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/APIConverter.java @@ -35,7 +35,7 @@ public APIConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -102,7 +102,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/ConnectorTypeConverter.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/ConnectorTypeConverter.java index 34f21f3562a..169dfa62851 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/ConnectorTypeConverter.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/ConnectorTypeConverter.java @@ -36,7 +36,7 @@ public ConnectorTypeConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -116,7 +116,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/DataFileConverter.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/DataFileConverter.java index 8d5fdfef493..8e95ac9595b 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/DataFileConverter.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/DataFileConverter.java @@ -36,7 +36,7 @@ public DataFileConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -113,7 +113,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/DatabaseConverter.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/DatabaseConverter.java index 418618b9357..3e8d54015fd 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/DatabaseConverter.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/DatabaseConverter.java @@ -34,7 +34,7 @@ public DatabaseConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -116,7 +116,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/DatabaseManagerConverter.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/DatabaseManagerConverter.java index 063b362a4da..7f6ad5b1ea6 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/DatabaseManagerConverter.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/DatabaseManagerConverter.java @@ -35,7 +35,7 @@ public DatabaseManagerConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -105,7 +105,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/DatabaseSchemaConverter.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/DatabaseSchemaConverter.java index 2244749282b..27e9aa36f9b 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/DatabaseSchemaConverter.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/DatabaseSchemaConverter.java @@ -36,7 +36,7 @@ public DatabaseSchemaConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -103,7 +103,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/ElementStubConverter.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/ElementStubConverter.java index f262538b4e1..f7dd140e98f 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/ElementStubConverter.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/ElementStubConverter.java @@ -37,7 +37,7 @@ public ElementStubConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entityProxy and that of a connected relationship. * * @param beanClass name of the class to create @@ -77,7 +77,7 @@ private B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an relationship and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/EndpointConverter.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/EndpointConverter.java index 5b9ed78c655..72e4ae0d133 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/EndpointConverter.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/EndpointConverter.java @@ -35,7 +35,7 @@ public EndpointConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -106,7 +106,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/FileFolderConverter.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/FileFolderConverter.java index 88c58e8f558..aa463209935 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/FileFolderConverter.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/FileFolderConverter.java @@ -36,7 +36,7 @@ public FileFolderConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -115,7 +115,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/FileSystemConverter.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/FileSystemConverter.java index 0b16beca5f0..3bcb162df99 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/FileSystemConverter.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/FileSystemConverter.java @@ -36,7 +36,7 @@ public FileSystemConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -112,7 +112,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/FormConverter.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/FormConverter.java index acb63000fc7..92962b87d45 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/FormConverter.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/FormConverter.java @@ -35,7 +35,7 @@ public FormConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -102,7 +102,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/QueryConverter.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/QueryConverter.java index 802cf7de44b..ee8292d1bc2 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/QueryConverter.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/QueryConverter.java @@ -102,7 +102,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/ReportConverter.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/ReportConverter.java index 02366a5b00f..67eae08fcec 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/ReportConverter.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/ReportConverter.java @@ -35,7 +35,7 @@ public ReportConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -109,7 +109,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/TopicConverter.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/TopicConverter.java index 26c669b4002..bc91c31fe97 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/TopicConverter.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/TopicConverter.java @@ -35,7 +35,7 @@ public TopicConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -103,7 +103,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/ValidValueSetConverter.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/ValidValueSetConverter.java index 802f0ce0e70..11c8354814d 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/ValidValueSetConverter.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/ValidValueSetConverter.java @@ -36,7 +36,7 @@ public ValidValueSetConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -110,7 +110,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/listener/DataManagerOMRSTopicListener.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/listener/DataManagerOMRSTopicListener.java index 0e495dfe4ac..6456dbc8d28 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/listener/DataManagerOMRSTopicListener.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/listener/DataManagerOMRSTopicListener.java @@ -433,7 +433,7 @@ public void processUpdatedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entityProxy details of the entityProxy with the new classification added. No guarantee this is all of the classifications. + * @param entityProxy details of the entityProxy with the new classification added. No guarantee this is all the classifications. * @param classification new classification */ @Override @@ -474,7 +474,7 @@ public void processClassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity with the new classification added. No guarantee this is all of the classifications. + * @param entity details of the entity with the new classification added. No guarantee this is all the classifications. * @param classification new classification */ @Override @@ -555,7 +555,7 @@ public void processClassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entityProxy details of the entityProxy after the classification has been removed. No guarantee this is all of the classifications. + * @param entityProxy details of the entityProxy after the classification has been removed. No guarantee this is all the classifications. * @param originalClassification classification that was removed */ @Override @@ -596,7 +596,7 @@ public void processDeclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity after the classification has been removed. No guarantee this is all of the classifications. + * @param entity details of the entity after the classification has been removed. No guarantee this is all the classifications. * @param originalClassification classification that was removed */ @Override @@ -677,7 +677,7 @@ public void processDeclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entityProxy details of the entityProxy after the classification has been changed. No guarantee this is all of the classifications. + * @param entityProxy details of the entityProxy after the classification has been changed. No guarantee this is all the classifications. * @param originalClassification classification that was removed * @param classification new classification */ @@ -720,7 +720,7 @@ public void processReclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity after the classification has been changed. No guarantee this is all of the classifications. + * @param entity details of the entity after the classification has been changed. No guarantee this is all the classifications. * @param originalClassification classification that was removed * @param classification new classification */ diff --git a/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/metadataelements/ElementVersions.java b/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/metadataelements/ElementVersions.java index f6b874866aa..a26e1fc85e1 100644 --- a/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/metadataelements/ElementVersions.java +++ b/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/metadataelements/ElementVersions.java @@ -17,7 +17,7 @@ /** * ElementVersions provides the version information for the element plus details of the creation time and last - * update time. Finally it lists all of the users that have made changes to this element. + * update time. Finally it lists all the users that have made changes to this element. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/api/ManageValidValues.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/api/ManageValidValues.java index 15e4d7d2185..31b88a963c3 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/api/ManageValidValues.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/api/ManageValidValues.java @@ -13,7 +13,7 @@ /** * ManageValidValues provides the API operations to create and maintain lists of valid * value definitions grouped into a valid value set. Both valid value definitions and valid value sets have - * the same attributes and so inherit from ValidValue where all of the attributes are defined. + * the same attributes and so inherit from ValidValue where all the attributes are defined. * * A set is just grouping of valid values. Valid value definitions and set can be nested many times in other * valid value sets. @@ -58,6 +58,7 @@ String createValidValueSet(String userId, * * @param userId calling user. * @param setGUID unique identifier of the set to attach this to. + * @param isDefaultValue is this the default value for the set? * @param qualifiedName unique name. * @param displayName displayable descriptive name. * @param description further information. @@ -76,6 +77,7 @@ String createValidValueSet(String userId, */ String createValidValueDefinition(String userId, String setGUID, + boolean isDefaultValue, String qualifiedName, String displayName, String description, @@ -153,16 +155,18 @@ void deleteValidValue(String userId, * @param userId calling user. * @param setGUID unique identifier of the set. * @param validValueGUID unique identifier of the valid value to add to the set. + * @param isDefaultValue is this the default value for the set? * * @throws InvalidParameterException one of the parameters is invalid. * @throws UserNotAuthorizedException the user is not authorized to make this request. * @throws PropertyServerException the repository is not available or not working properly. */ - void attachValidValueToSet(String userId, - String setGUID, - String validValueGUID) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; + void attachValidValueToSet(String userId, + String setGUID, + String validValueGUID, + boolean isDefaultValue) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; /** diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/metadataelements/ElementVersions.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/metadataelements/ElementVersions.java index 1a2b1deb801..0cf9996b032 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/metadataelements/ElementVersions.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/metadataelements/ElementVersions.java @@ -17,7 +17,7 @@ /** * ElementVersions provides the version information for the element plus details of the creation time and last - * update time. Finally it lists all of the users that have made changes to this element. + * update time. Finally, it lists all the users that have made changes to this element. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/metadataelements/ValidValueElement.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/metadataelements/ValidValueElement.java index bfc05cd99e3..0541964849c 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/metadataelements/ValidValueElement.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/metadataelements/ValidValueElement.java @@ -26,6 +26,8 @@ public class ValidValueElement implements MetadataElement, Serializable private ElementHeader elementHeader = null; private ValidValueProperties validValueProperties = null; + private String setGUID = null; + private boolean isDefaultValue = false; /** @@ -48,6 +50,8 @@ public ValidValueElement(ValidValueElement template) { elementHeader = template.getElementHeader(); validValueProperties = template.getValidValueProperties(); + setGUID = template.setGUID; + isDefaultValue = getIsDefaultValue(); } } @@ -98,6 +102,49 @@ public void setValidValueProperties(ValidValueProperties validValueProperties) } + /** + * Return the set unique identifier if the valid value is retrieved via a set. + * + * @return string identifier + */ + public String getSetGUID() + { + return setGUID; + } + + + /** + * Set up the set unique identifier if the valid value is retrieved via a set. + * + * @param setGUID string identifier + */ + public void setSetGUID(String setGUID) + { + this.setGUID = setGUID; + } + + + /** + * Return whether this valid value is the default of the setGUID (if supplied) + * @return flag + */ + public boolean getIsDefaultValue() + { + return isDefaultValue; + } + + + /** + * Set up whether this valid value is the default of the setGUID (if supplied). + * + * @param defaultValue flag + */ + public void setIsDefaultValue(boolean defaultValue) + { + isDefaultValue = defaultValue; + } + + /** * JSON-style toString * @@ -107,9 +154,11 @@ public void setValidValueProperties(ValidValueProperties validValueProperties) public String toString() { return "ValidValueElement{" + - "elementHeader=" + elementHeader + - ", validValueProperties=" + validValueProperties + - '}'; + "elementHeader=" + elementHeader + + ", validValueProperties=" + validValueProperties + + ", setGUID='" + setGUID + '\'' + + ", isDefaultValue=" + isDefaultValue + + '}'; } @@ -130,13 +179,9 @@ public boolean equals(Object objectToCompare) { return false; } - if (!super.equals(objectToCompare)) - { - return false; - } ValidValueElement that = (ValidValueElement) objectToCompare; - return Objects.equals(elementHeader, that.elementHeader) && - Objects.equals(validValueProperties, that.validValueProperties); + return isDefaultValue == that.isDefaultValue && Objects.equals(elementHeader, that.elementHeader) && Objects.equals( + validValueProperties, that.validValueProperties) && Objects.equals(setGUID, that.setGUID); } @@ -148,6 +193,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), elementHeader, validValueProperties); + return Objects.hash(super.hashCode(), elementHeader, validValueProperties, setGUID, isDefaultValue); } } diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/properties/LocationProperties.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/properties/LocationProperties.java index 34419778bd1..8aa3e021f0c 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/properties/LocationProperties.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/properties/LocationProperties.java @@ -22,6 +22,7 @@ public class LocationProperties extends ReferenceableProperties { private static final long serialVersionUID = 1L; + private String identifier = null; private String displayName = null; private String description = null; @@ -46,12 +47,36 @@ public LocationProperties(LocationProperties template) if (template != null) { + identifier = template.getIdentifier(); displayName = template.getDisplayName(); description = template.getDescription(); } } + + /** + * Return the code value or symbol used to identify the location - typically unique. + * + * @return string identifier + */ + public String getIdentifier() + { + return identifier; + } + + + /** + * Set up the code value or symbol used to identify the location - typically unique. + * + * @param identifier string identifier + */ + public void setIdentifier(String identifier) + { + this.identifier = identifier; + } + + /** * Return a human memorable name for the location. * @@ -105,10 +130,12 @@ public void setDescription(String description) public String toString() { return "LocationProperties{" + - "displayName='" + displayName + '\'' + + "identifier='" + identifier + '\'' + + ", displayName='" + displayName + '\'' + ", description='" + description + '\'' + ", qualifiedName='" + getQualifiedName() + '\'' + ", additionalProperties=" + getAdditionalProperties() + + ", classifications=" + getClassifications() + ", typeName='" + getTypeName() + '\'' + ", extendedProperties=" + getExtendedProperties() + '}'; @@ -137,8 +164,9 @@ public boolean equals(Object objectToCompare) return false; } LocationProperties that = (LocationProperties) objectToCompare; - return Objects.equals(displayName, that.displayName) && - Objects.equals(description, that.description); + return Objects.equals(identifier, that.identifier) && + Objects.equals(displayName, that.displayName) && + Objects.equals(description, that.description); } @@ -150,6 +178,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), displayName, description); + return Objects.hash(super.hashCode(), identifier, displayName, description); } } diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/properties/ReferenceValueAssignmentProperties.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/properties/ReferenceValueAssignmentProperties.java index 918cc71021f..bb242af02e8 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/properties/ReferenceValueAssignmentProperties.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/properties/ReferenceValueAssignmentProperties.java @@ -16,7 +16,7 @@ /** * ReferenceValueAssignmentProperties is a java bean used to create a link between a valid value and a referenceable item - * to enable the valid value to be used as a semi-formal tag/classifier. + * to enable the valid value to be used as a semiformal tag/classifier. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @@ -27,6 +27,8 @@ public class ReferenceValueAssignmentProperties implements Serializable private int confidence = 0; private String steward = null; + private String stewardTypeName = null; + private String stewardPropertyName = null; private String notes = null; @@ -49,6 +51,8 @@ public ReferenceValueAssignmentProperties(ReferenceValueAssignmentProperties tem { confidence = template.getConfidence(); steward = template.getSteward(); + stewardTypeName = template.getStewardTypeName(); + stewardPropertyName = template.getStewardPropertyName(); notes = template.getNotes(); } } @@ -98,6 +102,49 @@ public void setSteward(String steward) } + /** + * Return the type of element that describes the steward. + * + * @return type name + */ + public String getStewardTypeName() + { + return stewardTypeName; + } + + + /** + * Set up the type of element that describes the steward. + * + * @param stewardTypeName type name + */ + public void setStewardTypeName(String stewardTypeName) + { + this.stewardTypeName = stewardTypeName; + } + + + /** + * Return the name of the property that holds the steward's identifier. + * + * @return property name + */ + public String getStewardPropertyName() + { + return stewardPropertyName; + } + + + /** + * Set up the name of the property that holds the steward's identifier. + * + * @param stewardPropertyName property name + */ + public void setStewardPropertyName(String stewardPropertyName) + { + this.stewardPropertyName = stewardPropertyName; + } + /** * Return the additional values associated with the symbolic name. @@ -130,10 +177,12 @@ public void setNotes(String notes) public String toString() { return "ReferenceValueAssignmentProperties{" + - ", confidence=" + confidence + - ", steward='" + steward + '\'' + - ", notes='" + notes + '\'' + - '}'; + "confidence=" + confidence + + ", steward='" + steward + '\'' + + ", stewardTypeName='" + stewardTypeName + '\'' + + ", stewardPropertyName='" + stewardPropertyName + '\'' + + ", notes='" + notes + '\'' + + '}'; } @@ -156,7 +205,9 @@ public boolean equals(Object objectToCompare) } ReferenceValueAssignmentProperties that = (ReferenceValueAssignmentProperties) objectToCompare; return confidence == that.confidence && - Objects.equals(steward, that.steward) && + Objects.equals(steward, that.steward) && + Objects.equals(stewardTypeName, that.stewardTypeName) && + Objects.equals(stewardPropertyName, that.stewardPropertyName) && Objects.equals(notes, that.notes); } @@ -169,6 +220,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(confidence, steward, notes); + return Objects.hash(confidence, steward, stewardTypeName, stewardPropertyName, notes); } } diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/properties/TemplateProperties.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/properties/TemplateProperties.java index 7cc956638ce..1ad439ddcd9 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/properties/TemplateProperties.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/properties/TemplateProperties.java @@ -25,6 +25,7 @@ public class TemplateProperties implements Serializable private static final long serialVersionUID = 1L; private String qualifiedName = null; + private String identifier = null; private String displayName = null; private String description = null; @@ -47,6 +48,7 @@ public TemplateProperties(TemplateProperties template) if (template != null) { qualifiedName = template.getQualifiedName(); + identifier = template.getIdentifier(); displayName = template.getDisplayName(); description = template.getDescription(); } @@ -76,6 +78,28 @@ public void setQualifiedName(String qualifiedName) } + /** + * Return the code value or symbol used to identify the element - typically unique. + * + * @return string identifier + */ + public String getIdentifier() + { + return identifier; + } + + + /** + * Set up the code value or symbol used to identify the element - typically unique. + * + * @param identifier string identifier + */ + public void setIdentifier(String identifier) + { + this.identifier = identifier; + } + + /** * Returns the stored display name property for the metadata entity. * If no display name is available then null is returned. @@ -121,6 +145,7 @@ public void setDescription(String description) this.description = description; } + /** * Standard toString method. * @@ -131,6 +156,7 @@ public String toString() { return "TemplateProperties{" + "qualifiedName='" + qualifiedName + '\'' + + ", identifier='" + identifier + '\'' + ", displayName='" + displayName + '\'' + ", description='" + description + '\'' + '}'; @@ -156,8 +182,9 @@ public boolean equals(Object objectToCompare) } TemplateProperties that = (TemplateProperties) objectToCompare; return Objects.equals(qualifiedName, that.qualifiedName) && - Objects.equals(displayName, that.displayName) && - Objects.equals(description, that.description); + Objects.equals(identifier, that.identifier) && + Objects.equals(displayName, that.displayName) && + Objects.equals(description, that.description); } @@ -169,6 +196,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(qualifiedName, displayName, description); + return Objects.hash(qualifiedName, identifier, displayName, description); } } diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/properties/ValidValuesMappingProperties.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/properties/ValidValuesMappingProperties.java index e342e2dcaf6..5134b1ba35c 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/properties/ValidValuesMappingProperties.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/properties/ValidValuesMappingProperties.java @@ -29,6 +29,8 @@ public class ValidValuesMappingProperties implements Serializable private String associationDescription = null; private int confidence = 0; private String steward = null; + private String stewardTypeName = null; + private String stewardPropertyName = null; private String notes = null; @@ -52,6 +54,8 @@ public ValidValuesMappingProperties(ValidValuesMappingProperties template) associationDescription = template.getAssociationDescription(); confidence = template.getConfidence(); steward = template.getSteward(); + stewardTypeName = template.getStewardTypeName(); + stewardPropertyName = template.getStewardPropertyName(); notes = template.getNotes(); } } @@ -124,6 +128,50 @@ public void setSteward(String steward) + /** + * Return the type of element that describes the steward. + * + * @return type name + */ + public String getStewardTypeName() + { + return stewardTypeName; + } + + + /** + * Set up the type of element that describes the steward. + * + * @param stewardTypeName type name + */ + public void setStewardTypeName(String stewardTypeName) + { + this.stewardTypeName = stewardTypeName; + } + + + /** + * Return the name of the property that holds the steward's identifier. + * + * @return property name + */ + public String getStewardPropertyName() + { + return stewardPropertyName; + } + + + /** + * Set up the name of the property that holds the steward's identifier. + * + * @param stewardPropertyName property name + */ + public void setStewardPropertyName(String stewardPropertyName) + { + this.stewardPropertyName = stewardPropertyName; + } + + /** * Return the additional values associated with the symbolic name. * @@ -155,11 +203,13 @@ public void setNotes(String notes) public String toString() { return "ValidValuesMappingProperties{" + - "associationDescription='" + associationDescription + '\'' + - ", confidence=" + confidence + - ", steward='" + steward + '\'' + - ", notes='" + notes + '\'' + - '}'; + "associationDescription='" + associationDescription + '\'' + + ", confidence=" + confidence + + ", steward='" + steward + '\'' + + ", stewardTypeName='" + stewardTypeName + '\'' + + ", stewardPropertyName='" + stewardPropertyName + '\'' + + ", notes='" + notes + '\'' + + '}'; } @@ -183,7 +233,9 @@ public boolean equals(Object objectToCompare) ValidValuesMappingProperties that = (ValidValuesMappingProperties) objectToCompare; return confidence == that.confidence && Objects.equals(associationDescription, that.associationDescription) && - Objects.equals(steward, that.steward) && + Objects.equals(steward, that.steward) && + Objects.equals(stewardTypeName, that.stewardTypeName) && + Objects.equals(getStewardPropertyName(), that.stewardPropertyName) && Objects.equals(notes, that.notes); } @@ -196,6 +248,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(associationDescription, confidence, steward, notes); + return Objects.hash(associationDescription, confidence, steward, stewardTypeName, stewardPropertyName, notes); } } diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-client/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/client/ValidValuesManager.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-client/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/client/ValidValuesManager.java index 5194a295679..7c272342f2e 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-client/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/client/ValidValuesManager.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-client/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/client/ValidValuesManager.java @@ -22,7 +22,7 @@ /** * ValidValuesManager provides the API operations to create and maintain lists of valid * value definitions grouped into a valid value set. Both valid value definitions and valid value sets have - * the same attributes and so inherit from ValidValue where all of the attributes are defined. + * the same attributes and so inherit from ValidValue where all the attributes are defined. * * A set is just grouping of valid values. Valid value definitions and set can be nested many times in other * valid value sets. @@ -198,6 +198,7 @@ public String createValidValueSet(String userId, * * @param userId calling user. * @param setGUID unique identifier of the set to attach this to. + * @param isDefaultValue is this the default value for the set? * @param qualifiedName unique name. * @param displayName displayable descriptive name. * @param description further information. @@ -216,6 +217,7 @@ public String createValidValueSet(String userId, @Override public String createValidValueDefinition(String userId, String setGUID, + boolean isDefaultValue, String qualifiedName, String displayName, String description, @@ -234,7 +236,7 @@ public String createValidValueDefinition(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(qualifiedName, nameParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/sets/{2}"; + final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/sets/{2}?isDefaultValue={3}"; ValidValueProperties requestBody = new ValidValueProperties(); requestBody.setQualifiedName(qualifiedName); @@ -252,7 +254,8 @@ public String createValidValueDefinition(String userId, requestBody, serverName, userId, - setGUID); + setGUID, + isDefaultValue); return restResult.getGUID(); } @@ -371,6 +374,7 @@ public void deleteValidValue(String userId, * @param userId calling user. * @param setGUID unique identifier of the set. * @param validValueGUID unique identifier of the valid value to add to the set. + * @param isDefaultValue is this the default value for the set? * * @throws InvalidParameterException one of the parameters is invalid. * @throws UserNotAuthorizedException the user is not authorized to make this request. @@ -379,7 +383,8 @@ public void deleteValidValue(String userId, @Override public void attachValidValueToSet(String userId, String setGUID, - String validValueGUID) throws InvalidParameterException, + String validValueGUID, + boolean isDefaultValue) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException { @@ -391,7 +396,7 @@ public void attachValidValueToSet(String userId, invalidParameterHandler.validateGUID(setGUID, setGUIDParameter, methodName); invalidParameterHandler.validateGUID(validValueGUID, validValueGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/sets/{2}/members/{3}"; + final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/sets/{2}/members/{3}?isDefaultValue={4}"; restClient.callVoidPostRESTCall(methodName, serverPlatformURLRoot + urlTemplate, @@ -399,7 +404,8 @@ public void attachValidValueToSet(String userId, serverName, userId, setGUID, - validValueGUID); + validValueGUID, + isDefaultValue); } diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ConnectorTypeConverter.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ConnectorTypeConverter.java index f20dab4d2ea..086dda0bd24 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ConnectorTypeConverter.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ConnectorTypeConverter.java @@ -35,7 +35,7 @@ public ConnectorTypeConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -115,7 +115,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ElementHeaderConverter.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ElementHeaderConverter.java index 5941e732d61..2b46d2d5ea8 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ElementHeaderConverter.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ElementHeaderConverter.java @@ -33,7 +33,7 @@ public ElementHeaderConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -79,7 +79,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/EndpointConverter.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/EndpointConverter.java index 23492f82dd1..20414d019e2 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/EndpointConverter.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/EndpointConverter.java @@ -35,7 +35,7 @@ public EndpointConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -106,7 +106,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/LocationConverter.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/LocationConverter.java index c5daafe429b..badd7515811 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/LocationConverter.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/LocationConverter.java @@ -36,7 +36,7 @@ public LocationConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -76,7 +76,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -137,6 +137,7 @@ void updateSimpleMetadataElement(Class beanClass, locationProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); locationProperties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); + locationProperties.setIdentifier(this.removeIdentifier(instanceProperties)); locationProperties.setDisplayName(this.removeDisplayName(instanceProperties)); locationProperties.setDescription(this.removeDescription(instanceProperties)); diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ReferenceDataAssetConverter.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ReferenceDataAssetConverter.java index 1342a44f0e6..2f621c64564 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ReferenceDataAssetConverter.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ReferenceDataAssetConverter.java @@ -35,7 +35,7 @@ public ReferenceDataAssetConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -77,7 +77,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ReferenceValueAssignmentDefinitionConverter.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ReferenceValueAssignmentDefinitionConverter.java index f0f6b62c7e7..43ace667b8a 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ReferenceValueAssignmentDefinitionConverter.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ReferenceValueAssignmentDefinitionConverter.java @@ -36,7 +36,7 @@ public ReferenceValueAssignmentDefinitionConverter(OMRSRepositoryHelper reposito /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -74,6 +74,8 @@ public B getNewBean(Class beanClass, bean.setConfidence(this.getConfidence(instanceProperties)); bean.setSteward(this.getSteward(instanceProperties)); + bean.setStewardTypeName(this.getStewardTypeName(instanceProperties)); + bean.setStewardPropertyName(this.getStewardPropertyName(instanceProperties)); bean.setNotes(this.getNotes(instanceProperties)); } else diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ReferenceValueAssignmentItemConverter.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ReferenceValueAssignmentItemConverter.java index 249b333e2f0..98dd13a64e0 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ReferenceValueAssignmentItemConverter.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ReferenceValueAssignmentItemConverter.java @@ -37,7 +37,7 @@ public ReferenceValueAssignmentItemConverter(OMRSRepositoryHelper repositoryHelp /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -94,6 +94,8 @@ public B getNewBean(Class beanClass, bean.setConfidence(this.getConfidence(instanceProperties)); bean.setSteward(this.getSteward(instanceProperties)); + bean.setStewardTypeName(this.getStewardTypeName(instanceProperties)); + bean.setStewardPropertyName(this.getStewardPropertyName(instanceProperties)); bean.setNotes(this.getNotes(instanceProperties)); } else diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ValidValueAssignmentConsumerConverter.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ValidValueAssignmentConsumerConverter.java index 45e695c6b2d..ba66dda0dd2 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ValidValueAssignmentConsumerConverter.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ValidValueAssignmentConsumerConverter.java @@ -39,7 +39,7 @@ public ValidValueAssignmentConsumerConverter(OMRSRepositoryHelper repositoryHelp /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ValidValueAssignmentDefinitionConverter.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ValidValueAssignmentDefinitionConverter.java index 63db887a35e..fee9d3aca69 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ValidValueAssignmentDefinitionConverter.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ValidValueAssignmentDefinitionConverter.java @@ -36,7 +36,7 @@ public ValidValueAssignmentDefinitionConverter(OMRSRepositoryHelper repositoryHe /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ValidValueConverter.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ValidValueConverter.java index 8bdf58bdd15..7c1dc098746 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ValidValueConverter.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ValidValueConverter.java @@ -4,6 +4,7 @@ import org.odpi.openmetadata.accessservices.digitalarchitecture.metadataelements.ValidValueElement; import org.odpi.openmetadata.accessservices.digitalarchitecture.properties.ValidValueProperties; +import org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIMapper; import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.*; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefCategory; @@ -35,7 +36,7 @@ public ValidValueConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -60,7 +61,17 @@ public B getNewBean(Class beanClass, if (returnBean instanceof ValidValueElement) { - this.updateSimpleMetadataElement(beanClass, (ValidValueElement) returnBean, entity, methodName); + ValidValueElement bean = (ValidValueElement) returnBean; + this.updateSimpleMetadataElement(beanClass, bean, entity, methodName); + + if (relationship != null) + { + if (repositoryHelper.isTypeOf(serviceName, relationship.getType().getTypeDefName(), OpenMetadataAPIMapper.VALID_VALUES_MEMBER_RELATIONSHIP_TYPE_NAME)) + { + bean.setSetGUID(relationship.getEntityOneProxy().getGUID()); + bean.setIsDefaultValue(this.removeIsDefaultValue(relationship.getProperties())); + } + } } return returnBean; @@ -75,7 +86,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ValidValueImplAssetConverter.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ValidValueImplAssetConverter.java index 5f56d05aabd..9eb2b233dc5 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ValidValueImplAssetConverter.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ValidValueImplAssetConverter.java @@ -35,7 +35,7 @@ public ValidValueImplAssetConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ValidValueImplDefinitionConverter.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ValidValueImplDefinitionConverter.java index 729f644bbff..a9fffe6151a 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ValidValueImplDefinitionConverter.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ValidValueImplDefinitionConverter.java @@ -36,7 +36,7 @@ public ValidValueImplDefinitionConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ValidValueMappingConverter.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ValidValueMappingConverter.java index cc1b931e917..6ae95286b11 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ValidValueMappingConverter.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ValidValueMappingConverter.java @@ -35,7 +35,7 @@ public ValidValueMappingConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -74,6 +74,8 @@ public B getNewBean(Class beanClass, bean.setAssociationDescription(this.getAssociationDescription(instanceProperties)); bean.setConfidence(this.getConfidence(instanceProperties)); bean.setSteward(this.getSteward(instanceProperties)); + bean.setStewardTypeName(this.getStewardTypeName(instanceProperties)); + bean.setStewardPropertyName(this.getStewardPropertyName(instanceProperties)); bean.setNotes(this.getNotes(instanceProperties)); } else diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/outtopic/DigitalArchitectureOMRSTopicListener.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/outtopic/DigitalArchitectureOMRSTopicListener.java index 34736faee42..45bd9a7113d 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/outtopic/DigitalArchitectureOMRSTopicListener.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/outtopic/DigitalArchitectureOMRSTopicListener.java @@ -146,7 +146,7 @@ public void processUpdatedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entityProxy details of the entityProxy with the new classification added. No guarantee this is all of the classifications. + * @param entityProxy details of the entityProxy with the new classification added. No guarantee this is all the classifications. * @param classification new classification */ @Override @@ -185,7 +185,7 @@ public void processClassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity with the new classification added. No guarantee this is all of the classifications. + * @param entity details of the entity with the new classification added. No guarantee this is all the classifications. * @param classification new classification */ @Override @@ -262,7 +262,7 @@ public void processClassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entityProxy details of the entityProxy after the classification has been removed. No guarantee this is all of the classifications. + * @param entityProxy details of the entityProxy after the classification has been removed. No guarantee this is all the classifications. * @param originalClassification classification that was removed */ @Override @@ -301,7 +301,7 @@ public void processDeclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity after the classification has been removed. No guarantee this is all of the classifications. + * @param entity details of the entity after the classification has been removed. No guarantee this is all the classifications. * @param originalClassification classification that was removed */ @Override @@ -378,7 +378,7 @@ public void processDeclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entityProxy details of the entityProxy after the classification has been changed. No guarantee this is all of the classifications. + * @param entityProxy details of the entityProxy after the classification has been changed. No guarantee this is all the classifications. * @param originalClassification classification that was removed * @param classification new classification */ @@ -419,7 +419,7 @@ public void processReclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity after the classification has been changed. No guarantee this is all of the classifications. + * @param entity details of the entity after the classification has been changed. No guarantee this is all the classifications. * @param originalClassification classification that was removed * @param classification new classification */ diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/LocationRESTServices.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/LocationRESTServices.java index f96b5a784e4..8a766d2e60f 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/LocationRESTServices.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/LocationRESTServices.java @@ -79,6 +79,7 @@ public GUIDResponse createLocation(String serverName, null, null, locationProperties.getQualifiedName(), + locationProperties.getIdentifier(), locationProperties.getDisplayName(), locationProperties.getDescription(), locationProperties.getAdditionalProperties(), @@ -142,6 +143,7 @@ public GUIDResponse createLocationFromTemplate(String serverName, null, templateGUID, templateProperties.getQualifiedName(), + templateProperties.getIdentifier(), templateProperties.getDisplayName(), templateProperties.getDescription(), methodName)); @@ -202,6 +204,7 @@ public VoidResponse updateLocation(String serverName, locationGUID, guidParameter, locationProperties.getQualifiedName(), + locationProperties.getIdentifier(), locationProperties.getDisplayName(), locationProperties.getDescription(), locationProperties.getAdditionalProperties(), diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/ValidValuesRESTServices.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/ValidValuesRESTServices.java index 68bfbcc53ea..a7a8ea23753 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/ValidValuesRESTServices.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/ValidValuesRESTServices.java @@ -125,6 +125,7 @@ public GUIDResponse createValidValueSet(String serverName, * @param serverName name of calling server * @param userId calling user. * @param setGUID unique identifier of the set to attach this to. + * @param isDefaultValue is this the default value for the set? * @param requestBody parameters to update. * * @return unique identifier for the new definition @@ -135,6 +136,7 @@ public GUIDResponse createValidValueSet(String serverName, public GUIDResponse createValidValueDefinition(String serverName, String userId, String setGUID, + boolean isDefaultValue, ValidValueProperties requestBody) { final String methodName = "createValidValueDefinition"; @@ -163,6 +165,7 @@ public GUIDResponse createValidValueDefinition(String serverName, null, null, setGUID, + isDefaultValue, requestBody.getQualifiedName(), requestBody.getDisplayName(), requestBody.getDescription(), @@ -345,6 +348,7 @@ public VoidResponse deleteValidValue(String serverName, * @param userId calling user. * @param setGUID unique identifier of the set. * @param validValueGUID unique identifier of the valid value to add to the set. + * @param isDefaultValue is this the default value for the set? * @param requestBody null request body supplied to satisfy REST protocol * * @return void or @@ -357,6 +361,7 @@ public VoidResponse attachValidValueToSet(String serverName, String userId, String setGUID, String validValueGUID, + boolean isDefaultValue, NullRequestBody requestBody) { final String methodName = "attachValidValueToSet"; @@ -384,6 +389,7 @@ public VoidResponse attachValidValueToSet(String serverName, null, setGUID, validValueGUID, + isDefaultValue, null, null, false, @@ -463,7 +469,7 @@ public VoidResponse detachValidValueFromSet(String serverName, /** - * Link a valid value to an asset that provides the implementation. Typically this method is + * Link a valid value to an asset that provides the implementation. Typically, this method is * used to link a valid value set to a code table. * * @param serverName name of calling server @@ -683,7 +689,7 @@ public VoidResponse declassifyAssetAsReferenceData(String serverName, { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - AssetHandler handler = instanceHandler.getAssetHandler(userId, serverName, methodName); + AssetHandler handler = instanceHandler.getAssetHandler(userId, serverName, methodName); handler.declassifyAssetAsReferenceData(userId, assetGUID, @@ -849,10 +855,10 @@ public VoidResponse unassignValidValueFromConsumer(String serverName, * UserNotAuthorizedException the user is not authorized to make this request or * PropertyServerException the repository is not available or not working properly. */ - public VoidResponse assignReferenceValueToItem(String serverName, - String userId, - String validValueGUID, - String referenceableGUID, + public VoidResponse assignReferenceValueToItem(String serverName, + String userId, + String validValueGUID, + String referenceableGUID, ReferenceValueAssignmentProperties requestBody) { final String methodName = "assignReferenceValueToItem"; @@ -863,13 +869,17 @@ public VoidResponse assignReferenceValueToItem(String serve AuditLog auditLog = null; int confidence = 0; String steward = null; + String stewardTypeName = null; + String stewardPropertyName = null; String notes = null; if (requestBody != null) { - confidence = requestBody.getConfidence(); - steward = requestBody.getSteward(); - notes = requestBody.getNotes(); + confidence = requestBody.getConfidence(); + steward = requestBody.getSteward(); + stewardTypeName = requestBody.getStewardTypeName(); + stewardPropertyName = requestBody.getStewardPropertyName(); + notes = requestBody.getNotes(); } try @@ -892,6 +902,8 @@ public VoidResponse assignReferenceValueToItem(String serve referenceableGUID, confidence, steward, + stewardTypeName, + stewardPropertyName, notes, null, null, @@ -1000,6 +1012,8 @@ public VoidResponse mapValidValues(String serverName, String associationDescription = null; int confidence = 0; String steward = null; + String stewardTypeName = null; + String stewardPropertyName = null; String notes = null; if (requestBody != null) @@ -1007,6 +1021,8 @@ public VoidResponse mapValidValues(String serverName, associationDescription = requestBody.getAssociationDescription(); confidence = requestBody.getConfidence(); steward = requestBody.getSteward(); + stewardTypeName = requestBody.getStewardTypeName(); + stewardPropertyName = requestBody.getStewardPropertyName(); notes = requestBody.getNotes(); } @@ -1031,6 +1047,8 @@ public VoidResponse mapValidValues(String serverName, associationDescription, confidence, steward, + stewardTypeName, + stewardPropertyName, notes, null, null, diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-spring/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/spring/ValidValuesResource.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-spring/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/spring/ValidValuesResource.java index ea9eba3bcd0..db0b45d46fa 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-spring/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/spring/ValidValuesResource.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-spring/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/spring/ValidValuesResource.java @@ -15,7 +15,7 @@ /** * ValidValuesResource provides the API operations to create and maintain lists of valid * value definitions grouped into a valid value set. Both valid value definitions and valid value sets have - * the same attributes and so inherit from ValidValue where all of the attributes are defined. + * the same attributes and so inherit from ValidValue where all the attributes are defined. * * A set is just grouping of valid values. Valid value definitions and set can be nested many times in other * valid value sets. @@ -70,6 +70,7 @@ public GUIDResponse createValidValueSet(@PathVariable String serve * @param serverName name of calling server * @param userId calling user. * @param setGUID unique identifier of the set to attach this to. + * @param isDefaultValue is this the default value for the set? * @param requestBody parameters for the new object. * * @return unique identifier for the new definition @@ -82,9 +83,12 @@ public GUIDResponse createValidValueSet(@PathVariable String serve public GUIDResponse createValidValueDefinition(@PathVariable String serverName, @PathVariable String userId, @PathVariable String setGUID, + @RequestParam + (required = false, defaultValue = "false") + boolean isDefaultValue, @RequestBody ValidValueProperties requestBody) { - return restAPI.createValidValueDefinition(serverName, userId, setGUID, requestBody); + return restAPI.createValidValueDefinition(serverName, userId, setGUID, isDefaultValue, requestBody); } @@ -159,9 +163,12 @@ public VoidResponse attachValidValueToSet(@PathVariable Stri @PathVariable String userId, @PathVariable String setGUID, @PathVariable String validValueGUID, + @RequestParam + (required = false, defaultValue = "false") + boolean isDefaultValue, @RequestBody(required = false) NullRequestBody requestBody) { - return restAPI.attachValidValueToSet(serverName, userId, setGUID, validValueGUID, requestBody); + return restAPI.attachValidValueToSet(serverName, userId, setGUID, validValueGUID, isDefaultValue, requestBody); } diff --git a/open-metadata-implementation/access-services/discovery-engine/discovery-engine-server/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/converters/DiscoveryEnginePropertiesConverter.java b/open-metadata-implementation/access-services/discovery-engine/discovery-engine-server/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/converters/DiscoveryEnginePropertiesConverter.java index e5af80b1edc..5a7e079050d 100644 --- a/open-metadata-implementation/access-services/discovery-engine/discovery-engine-server/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/converters/DiscoveryEnginePropertiesConverter.java +++ b/open-metadata-implementation/access-services/discovery-engine/discovery-engine-server/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/converters/DiscoveryEnginePropertiesConverter.java @@ -34,7 +34,7 @@ public DiscoveryEnginePropertiesConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -100,7 +100,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/discovery-engine/discovery-engine-server/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/server/DiscoveryEngineRESTServices.java b/open-metadata-implementation/access-services/discovery-engine/discovery-engine-server/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/server/DiscoveryEngineRESTServices.java index 4066f064e58..a636e40aab1 100644 --- a/open-metadata-implementation/access-services/discovery-engine/discovery-engine-server/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/server/DiscoveryEngineRESTServices.java +++ b/open-metadata-implementation/access-services/discovery-engine/discovery-engine-server/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/server/DiscoveryEngineRESTServices.java @@ -365,7 +365,7 @@ public VoidResponse logAssetAuditMessage(String serverName, * @param serverName name of server instance to route request to * @param userId calling user * @param assetGUID unique identifier of the asset being analysed - * @param requestBody all of the other parameters + * @param requestBody all the other parameters * * @return The unique identifier of the new discovery report or * diff --git a/open-metadata-implementation/access-services/discovery-engine/discovery-engine-spring/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/server/spring/DiscoveryMetadataStoreResource.java b/open-metadata-implementation/access-services/discovery-engine/discovery-engine-spring/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/server/spring/DiscoveryMetadataStoreResource.java index e6cd179b321..52000dc0f8e 100644 --- a/open-metadata-implementation/access-services/discovery-engine/discovery-engine-spring/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/server/spring/DiscoveryMetadataStoreResource.java +++ b/open-metadata-implementation/access-services/discovery-engine/discovery-engine-spring/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/server/spring/DiscoveryMetadataStoreResource.java @@ -201,7 +201,7 @@ public VoidResponse logAssetAuditMessage(@PathVariable String serverName, * @param serverName name of server instance to route request to * @param userId calling user * @param assetGUID unique identifier of the asset being analysed - * @param requestBody all of the other parameters + * @param requestBody all the other parameters * * @return the unique identifier of the new discovery report or * diff --git a/open-metadata-implementation/access-services/governance-engine/governance-engine-api/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/api/GovernanceProcessingInterface.java b/open-metadata-implementation/access-services/governance-engine/governance-engine-api/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/api/GovernanceProcessingInterface.java index 99a1777a64c..f7bd073d170 100644 --- a/open-metadata-implementation/access-services/governance-engine/governance-engine-api/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/api/GovernanceProcessingInterface.java +++ b/open-metadata-implementation/access-services/governance-engine/governance-engine-api/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/api/GovernanceProcessingInterface.java @@ -231,7 +231,7 @@ void updateGovernanceActionStatus(String userId, /** - * Declare that all of the processing for the governance action service is finished and the status of the work. + * Declare that all the processing for the governance action service is finished and the status of the work. * * @param userId caller's userId * @param governanceActionGUID unique identifier of the governance action to update diff --git a/open-metadata-implementation/access-services/governance-engine/governance-engine-api/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/api/MetadataElementInterface.java b/open-metadata-implementation/access-services/governance-engine/governance-engine-api/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/api/MetadataElementInterface.java index 2f95fc20e8a..c15d744e2c7 100644 --- a/open-metadata-implementation/access-services/governance-engine/governance-engine-api/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/api/MetadataElementInterface.java +++ b/open-metadata-implementation/access-services/governance-engine/governance-engine-api/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/api/MetadataElementInterface.java @@ -261,7 +261,7 @@ String createMetadataElementInStore(String userId, /** * Update the properties of a specific metadata element. The properties must match the type definition associated with the - * metadata element when it was created. However, it is possible to update a few properties, or replace all of them by + * metadata element when it was created. However, it is possible to update a few properties, or replace all them by * the value used in the replaceProperties flag. * * @param userId caller's userId diff --git a/open-metadata-implementation/access-services/governance-engine/governance-engine-api/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/ffdc/GovernanceEngineAuditCode.java b/open-metadata-implementation/access-services/governance-engine/governance-engine-api/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/ffdc/GovernanceEngineAuditCode.java index 31b415a6511..804fe460331 100644 --- a/open-metadata-implementation/access-services/governance-engine/governance-engine-api/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/ffdc/GovernanceEngineAuditCode.java +++ b/open-metadata-implementation/access-services/governance-engine/governance-engine-api/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/ffdc/GovernanceEngineAuditCode.java @@ -182,7 +182,7 @@ public enum GovernanceEngineAuditCode implements AuditLogMessageSet SKIPPING_INSTANCE("OMAS-GOVERNANCE-ENGINE-0021", OMRSAuditLogRecordSeverity.INFO, - "The Governance Engine Open Metadata Access Service (OMAS) is ignoring event from {0} of type {1} for instance {2} because it does not have access to all of the information for the instance. Error message is: {3}", + "The Governance Engine Open Metadata Access Service (OMAS) is ignoring event from {0} of type {1} for instance {2} because it does not have access to all the information for the instance. Error message is: {3}", "The event could not be processed because additional information, such as the anchor entity, is not available to this server. " + "This is not necessarily an error if the server is connected to a cohort where members are also connected to other cohorts, of there is strict security in place that is restricting what this server can see.", "Review the exception to reassure yourself that this is expected behavior."), diff --git a/open-metadata-implementation/access-services/governance-engine/governance-engine-api/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/metadataelements/ElementVersions.java b/open-metadata-implementation/access-services/governance-engine/governance-engine-api/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/metadataelements/ElementVersions.java index ecba4413ae0..e4deb1e1e08 100644 --- a/open-metadata-implementation/access-services/governance-engine/governance-engine-api/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/metadataelements/ElementVersions.java +++ b/open-metadata-implementation/access-services/governance-engine/governance-engine-api/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/metadataelements/ElementVersions.java @@ -17,7 +17,7 @@ /** * ElementVersions provides the version information for the element plus details of the creation time and last - * update time. Finally it lists all of the users that have made changes to this element. + * update time. Finally it lists all the users that have made changes to this element. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/open-metadata-implementation/access-services/governance-engine/governance-engine-client/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/client/GovernanceActionProcessClient.java b/open-metadata-implementation/access-services/governance-engine/governance-engine-client/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/client/GovernanceActionProcessClient.java index 691973730e3..dff7443e9d6 100644 --- a/open-metadata-implementation/access-services/governance-engine/governance-engine-client/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/client/GovernanceActionProcessClient.java +++ b/open-metadata-implementation/access-services/governance-engine/governance-engine-client/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/client/GovernanceActionProcessClient.java @@ -24,7 +24,7 @@ /** * GovernanceEngineClient sits in the governance context of a governance action service when it is running in the engine host OMAG server. - * It is however shared by all of the governance action services running in an engine service so that we only need one connector to the topic + * It is however shared by all the governance action services running in an engine service so that we only need one connector to the topic * listener for the watchdog governance services. */ public class GovernanceActionProcessClient implements GovernanceActionProcessInterface diff --git a/open-metadata-implementation/access-services/governance-engine/governance-engine-client/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/client/GovernanceEngineClient.java b/open-metadata-implementation/access-services/governance-engine/governance-engine-client/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/client/GovernanceEngineClient.java index aedd9610ee2..29dfcd79410 100644 --- a/open-metadata-implementation/access-services/governance-engine/governance-engine-client/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/client/GovernanceEngineClient.java +++ b/open-metadata-implementation/access-services/governance-engine/governance-engine-client/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/client/GovernanceEngineClient.java @@ -611,7 +611,7 @@ public String createMetadataElementInStore(String userId, /** * Update the properties of a specific metadata element. The properties must match the type definition associated with the - * metadata element when it was created. However, it is possible to update a few properties, or replace all of them by + * metadata element when it was created. However, it is possible to update a few properties, or replace all them by * the value used in the replaceProperties flag. * * @param userId caller's userId diff --git a/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/converters/GovernanceActionProcessConverter.java b/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/converters/GovernanceActionProcessConverter.java index 3741b0f0d53..993216a82c9 100644 --- a/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/converters/GovernanceActionProcessConverter.java +++ b/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/converters/GovernanceActionProcessConverter.java @@ -37,7 +37,7 @@ public GovernanceActionProcessConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -97,7 +97,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/converters/GovernanceActionTypeConverter.java b/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/converters/GovernanceActionTypeConverter.java index 3d4a315b72c..3c6ed2b250b 100644 --- a/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/converters/GovernanceActionTypeConverter.java +++ b/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/converters/GovernanceActionTypeConverter.java @@ -37,7 +37,7 @@ public GovernanceActionTypeConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -56,7 +56,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/converters/GovernanceEngineConverter.java b/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/converters/GovernanceEngineConverter.java index a019fd0240c..c0b316259f2 100644 --- a/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/converters/GovernanceEngineConverter.java +++ b/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/converters/GovernanceEngineConverter.java @@ -35,7 +35,7 @@ public GovernanceEngineConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -97,7 +97,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/converters/MetadataElementConverter.java b/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/converters/MetadataElementConverter.java index 0c0502f9445..7308390f8b5 100644 --- a/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/converters/MetadataElementConverter.java +++ b/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/converters/MetadataElementConverter.java @@ -35,7 +35,7 @@ public MetadataElementConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -75,7 +75,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/converters/RelatedElementConverter.java b/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/converters/RelatedElementConverter.java index f0af9b3d69f..37032c95df0 100644 --- a/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/converters/RelatedElementConverter.java +++ b/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/converters/RelatedElementConverter.java @@ -37,7 +37,7 @@ public RelatedElementConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/handlers/MetadataElementHandler.java b/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/handlers/MetadataElementHandler.java index cae6e049f89..79d622d96af 100644 --- a/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/handlers/MetadataElementHandler.java +++ b/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/handlers/MetadataElementHandler.java @@ -1319,7 +1319,7 @@ public String createMetadataElementInStore(String userId, /** * Update the properties of a specific metadata element. The properties must match the type definition associated with the - * metadata element when it was created. However, it is possible to update a few properties, or replace all of them by + * metadata element when it was created. However, it is possible to update a few properties, or replace all them by * the value used in the replaceProperties flag. * * @param userId caller's userId diff --git a/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/outtopic/GovernanceEngineOMRSTopicListener.java b/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/outtopic/GovernanceEngineOMRSTopicListener.java index 7a080acb936..9dc32fddab5 100644 --- a/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/outtopic/GovernanceEngineOMRSTopicListener.java +++ b/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/outtopic/GovernanceEngineOMRSTopicListener.java @@ -929,7 +929,7 @@ public void processUndoneEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity with the new classification added. No guarantee this is all of the classifications. + * @param entity details of the entity with the new classification added. No guarantee this is all the classifications. * @param classification new classification */ @Override @@ -962,7 +962,7 @@ public void processClassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity with the new classification added. No guarantee this is all of the classifications. + * @param entity details of the entity with the new classification added. No guarantee this is all the classifications. * @param classification new classification */ @Override @@ -995,7 +995,7 @@ public void processClassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity after the classification has been removed. No guarantee this is all of the classifications. + * @param entity details of the entity after the classification has been removed. No guarantee this is all the classifications. * @param originalClassification classification that was removed */ @Override @@ -1028,7 +1028,7 @@ public void processDeclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity after the classification has been removed. No guarantee this is all of the classifications. + * @param entity details of the entity after the classification has been removed. No guarantee this is all the classifications. * @param originalClassification classification that was removed */ @Override @@ -1061,7 +1061,7 @@ public void processDeclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity after the classification has been changed. No guarantee this is all of the classifications. + * @param entity details of the entity after the classification has been changed. No guarantee this is all the classifications. * @param originalClassification classification that was removed * @param classification new classification */ @@ -1097,7 +1097,7 @@ public void processReclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity after the classification has been changed. No guarantee this is all of the classifications. + * @param entity details of the entity after the classification has been changed. No guarantee this is all the classifications. * @param originalClassification classification that was removed * @param classification new classification */ diff --git a/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/server/GovernanceEngineRESTServices.java b/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/server/GovernanceEngineRESTServices.java index 23addc4fc4a..711289b7cdd 100644 --- a/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/server/GovernanceEngineRESTServices.java +++ b/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/server/GovernanceEngineRESTServices.java @@ -664,7 +664,7 @@ public GUIDResponse createMetadataElementInStore(String s /** * Update the properties of a specific metadata element. The properties must match the type definition associated with the - * metadata element when it was created. However, it is possible to update a few properties, or replace all of them by + * metadata element when it was created. However, it is possible to update a few properties, or replace all them by * the value used in the replaceProperties flag. * * @param serverName name of server instance to route request to diff --git a/open-metadata-implementation/access-services/governance-engine/governance-engine-spring/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/server/spring/GovernanceEngineOMASResource.java b/open-metadata-implementation/access-services/governance-engine/governance-engine-spring/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/server/spring/GovernanceEngineOMASResource.java index 089f33909b9..c604dfae4cf 100644 --- a/open-metadata-implementation/access-services/governance-engine/governance-engine-spring/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/server/spring/GovernanceEngineOMASResource.java +++ b/open-metadata-implementation/access-services/governance-engine/governance-engine-spring/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/server/spring/GovernanceEngineOMASResource.java @@ -343,7 +343,7 @@ public GUIDResponse createMetadataElementInStore(@PathVariable String /** * Update the properties of a specific metadata element. The properties must match the type definition associated with the - * metadata element when it was created. However, it is possible to update a few properties, or replace all of them by + * metadata element when it was created. However, it is possible to update a few properties, or replace all them by * the value used in the replaceProperties flag. * * @param serverName name of server instance to route request to @@ -711,7 +711,7 @@ public VoidResponse updateGovernanceActionStatus(@PathVariable String /** - * Declare that all of the processing for the governance action service is finished and the status of the work. + * Declare that all the processing for the governance action service is finished and the status of the work. * * @param serverName name of server instance to route request to * @param userId caller's userId diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/CertificationManagementInterface.java b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/CertificationManagementInterface.java index 8c86f556705..f2f58554b4f 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/CertificationManagementInterface.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/CertificationManagementInterface.java @@ -3,7 +3,6 @@ package org.odpi.openmetadata.accessservices.governanceprogram.api; import org.odpi.openmetadata.accessservices.governanceprogram.metadataelements.CertificationTypeElement; -import org.odpi.openmetadata.accessservices.governanceprogram.metadataelements.GovernanceRoleElement; import org.odpi.openmetadata.accessservices.governanceprogram.properties.CertificationProperties; import org.odpi.openmetadata.accessservices.governanceprogram.properties.CertificationTypeProperties; import org.odpi.openmetadata.accessservices.governanceprogram.properties.GovernanceDefinitionStatus; @@ -11,7 +10,6 @@ import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; -import java.util.Date; import java.util.List; /** @@ -116,7 +114,7 @@ CertificationTypeElement getCertificationTypeByDocId(String userId, /** - * Retrieve all of the certification types for a particular title. The title can include regEx wildcards. + * Retrieve all the certification types for a particular title. The title can include regEx wildcards. * * @param userId calling user * @param title identifier of role @@ -138,7 +136,7 @@ List getCertificationTypesByTitle(String userId, /** - * Retrieve all of the certification type definitions for a specific governance domain. + * Retrieve all the certification type definitions for a specific governance domain. * * @param userId calling user * @param domainIdentifier identifier to search for diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/ExternalReferencesInterface.java b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/ExternalReferencesInterface.java index 190eb58efdf..d16f44fcea1 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/ExternalReferencesInterface.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/ExternalReferencesInterface.java @@ -19,7 +19,7 @@ public interface ExternalReferencesInterface { /** - * Create a definition of a external reference. + * Create a definition of an external reference. * * @param userId calling user * @param anchorGUID optional element to link the external reference to that will act as an anchor - that is, this external reference @@ -40,7 +40,7 @@ String createExternalReference(String userId, /** - * Update the definition of a external reference. + * Update the definition of an external reference. * * @param userId calling user * @param externalReferenceGUID unique identifier of external reference @@ -60,7 +60,7 @@ void updateExternalReference(String userId, /** - * Remove the definition of a external reference. + * Remove the definition of an external reference. * * @param userId calling user * @param externalReferenceGUID unique identifier of external reference @@ -96,7 +96,7 @@ void linkExternalReferenceToElement(String userId, /** - * Remove the link between a external reference and an element. If the element is its anchor, the external reference is removed. + * Remove the link between an external reference and an element. If the element is its anchor, the external reference is removed. * * @param userId the name of the calling user. * @param attachedToGUID object linked to external references. diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/GovernanceDefinitionsInterface.java b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/GovernanceDefinitionsInterface.java index 14790fd768f..274e78024fd 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/GovernanceDefinitionsInterface.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/GovernanceDefinitionsInterface.java @@ -13,7 +13,7 @@ * that define the motivation, goals and implementation approach for the governance program. * * Governance drivers document of the business strategy and regulations that provide the motivation behind the governance program. They feed - * into the governance program's policy making phase ensuring the governance program is focused on activity that delivers value to the organization. + * into the governance program's policymaking phase ensuring the governance program is focused on activity that delivers value to the organization. * A governance driver could be a governance strategy statement, a business imperative, a regulation or a regulation's article. * * Governance policies define the goals and best practices for the governance program. There are three types of governance policies: diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/GovernanceDomainInterface.java b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/GovernanceDomainInterface.java index 1e696230291..88e06c2482d 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/GovernanceDomainInterface.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/GovernanceDomainInterface.java @@ -37,7 +37,6 @@ public interface GovernanceDomainInterface *
    • Software Development - The software development lifecycle (SDLC) governance domain.
    • *
    • Corporate - The corporate governance domain.
    • *
    • Asset Management - The physical asset management governance domain.
    • - *
    • Other - The governance domain is locally defined.
    • *
    * * @param userId calling user @@ -233,9 +232,44 @@ void deleteGovernanceDomain(String userId, PropertyServerException; + /** + * Create a parent-child relationship between a governance domain set and a governance domain. + * + * @param userId calling user + * @param governanceDomainSetGUID unique identifier of the governance domain set + * @param governanceDomainGUID unique identifier of the governance domain + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void addDomainToSet(String userId, + String governanceDomainSetGUID, + String governanceDomainGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove a parent-child relationship between a governance domain set and a governance domain. + * + * @param userId calling user + * @param governanceDomainSetGUID unique identifier of the governance domain set + * @param governanceDomainGUID unique identifier of the governance domain + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void removeDomainFromSet(String userId, + String governanceDomainSetGUID, + String governanceDomainGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + /** * Retrieve the list of Governance Domain metadata elements defined for the governance program. - * The search string is treated as a regular expression. * * @param userId calling user * @param startFrom paging start point diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/GovernanceMetricsInterface.java b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/GovernanceMetricsInterface.java index b3082a9fd47..0f5cf732d77 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/GovernanceMetricsInterface.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/GovernanceMetricsInterface.java @@ -12,7 +12,7 @@ import java.util.List; /** - * The GovernanceMetricsInterface supports the definition of the metrics that measure the success of the governance program. Typically a + * The GovernanceMetricsInterface supports the definition of the metrics that measure the success of the governance program. Typically, a * metric is associated with a governance definition. */ public interface GovernanceMetricsInterface diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/GovernanceProgramReviewInterface.java b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/GovernanceProgramReviewInterface.java index 745d4beabd4..90235ed1627 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/GovernanceProgramReviewInterface.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/GovernanceProgramReviewInterface.java @@ -40,7 +40,7 @@ List getGovernanceDefinitionsForDomain(String userI /** - * Return the list of governance definitions associated with a unique docId. In an ideal world, the should be only one. + * Return the list of governance definitions associated with a unique docId. In an ideal world, there should be only one. * * @param userId calling user * @param typeName option type name to restrict retrieval to a specific type diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/GovernanceRolesInterface.java b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/GovernanceRolesInterface.java index eadae1c9171..1ff1ce82131 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/GovernanceRolesInterface.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/GovernanceRolesInterface.java @@ -181,7 +181,7 @@ GovernanceRoleHistory getGovernanceRoleHistoryByGUID(String userId, /** * Retrieve the properties of a governance role using its unique name. The results are returned as a list * since it is possible that two roles have the same identifier due to the distributed nature of the - * open metadata ecosystem. By returning all of the search results here it is possible to manage the + * open metadata ecosystem. By returning all the search results here it is possible to manage the * duplicates through this interface. * * @param userId calling user @@ -200,7 +200,7 @@ List getGovernanceRoleByRoleId(String userId, /** - * Retrieve all of the governance roles for a particular governance domain. + * Retrieve all the governance roles for a particular governance domain. * * @param userId calling user * @param domainIdentifier identifier of domain - 0 means all @@ -222,7 +222,7 @@ List getGovernanceRolesByDomainId(String userId, /** - * Retrieve all of the governance roles for a particular title. The title can include regEx wildcards. + * Retrieve all the governance roles for a particular title. The title can include regEx wildcards. * * @param userId calling user * @param title identifier of role @@ -243,7 +243,7 @@ List getGovernanceRolesByTitle(String userId, PropertyServerException; /** - * Return all of the governance roles and their incumbents (if any). + * Return all the governance roles and their incumbents (if any). * * @param userId the name of the calling user. * @param domainIdentifier identifier of domain - 0 means all diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/GovernanceZonesInterface.java b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/GovernanceZonesInterface.java index b9040507c58..21d80c0a634 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/GovernanceZonesInterface.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/GovernanceZonesInterface.java @@ -22,7 +22,7 @@ public interface GovernanceZonesInterface /** * Create a definition of a governance zone. The qualified name of these governance zones can be added * to the supportedZones, publishedZones and defaultZones properties of an OMAS to control which assets are processed - * and how they are set up. In addition the qualified names of zones can be added to Asset definitions + * and how they are set up. In addition, the qualified names of zones can be added to Asset definitions * to indicate which zone(s) they belong to. * * @param userId calling user diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/RightsManagementInterface.java b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/RightsManagementInterface.java index b63e3db34dd..7e3e72053bb 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/RightsManagementInterface.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/RightsManagementInterface.java @@ -115,7 +115,7 @@ LicenseTypeElement getLicenseTypeByDocId(String userId, /** - * Retrieve all of the license types for a particular title. The title can include regEx wildcards. + * Retrieve all the license types for a particular title. The title can include regEx wildcards. * * @param userId calling user * @param title identifier of role @@ -137,7 +137,7 @@ List getLicenseTypesByTitle(String userId, /** - * Retrieve all of the license type definitions for a specific governance domain. + * Retrieve all the license type definitions for a specific governance domain. * * @param userId calling user * @param domainIdentifier identifier to search for diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/ffdc/GovernanceProgramErrorCode.java b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/ffdc/GovernanceProgramErrorCode.java index 61f8de2a23e..f46a70e389e 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/ffdc/GovernanceProgramErrorCode.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/ffdc/GovernanceProgramErrorCode.java @@ -57,7 +57,7 @@ public enum GovernanceProgramErrorCode implements ExceptionMessageSet DUPLICATE_GOVERNANCE_OFFICER_FOR_ROLE_ID(404, "OMAS-GOVERNANCE-PROGRAM-404-013", "The governance program OMAS has retrieved multiple governance officer records with an appointment id of {0}", "Multiple governance officer records are linked to a governance appointment in the property server.", - "Details of the duplicate records are stored in the exception. Use them to locate and correct some or all of the records so the employee number is a unique field."), + "Details of the duplicate records are stored in the exception. Use them to locate and correct some or all the records so the employee number is a unique field."), GOVERNANCE_OFFICER_NOT_DELETED(404, "OMAS-GOVERNANCE-PROGRAM-404-014", "The governance program OMAS is not able to delete a governance officer record with an guid of {0} since the supplied appointmentId of {1} and " + diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/metadataelements/ElementVersions.java b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/metadataelements/ElementVersions.java index 1eac85b34bd..19c65191785 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/metadataelements/ElementVersions.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/metadataelements/ElementVersions.java @@ -17,7 +17,7 @@ /** * ElementVersions provides the version information for the element plus details of the creation time and last - * update time. Finally it lists all of the users that have made changes to this element. + * update time. Finally it lists all the users that have made changes to this element. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/metadataelements/GovernanceDomainSetElement.java b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/metadataelements/GovernanceDomainSetElement.java index c1587e7a12b..a023bb1b454 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/metadataelements/GovernanceDomainSetElement.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/metadataelements/GovernanceDomainSetElement.java @@ -8,7 +8,6 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.governanceprogram.properties.GovernanceDomainSetProperties; -import org.odpi.openmetadata.accessservices.governanceprogram.properties.GovernanceZoneProperties; import java.io.Serializable; import java.util.List; diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/metadataelements/PersonalProfileUniverse.java b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/metadataelements/PersonalProfileUniverse.java deleted file mode 100644 index c781a05ec83..00000000000 --- a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/metadataelements/PersonalProfileUniverse.java +++ /dev/null @@ -1,173 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.governanceprogram.metadataelements; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import org.odpi.openmetadata.accessservices.governanceprogram.properties.PersonalProfileProperties; - -import java.io.Serializable; -import java.util.List; -import java.util.Objects; - -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; - - -/** - * The PersonalProfileDefinition extends PersonalProfileElement to include information about the related userId and contact information - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown=true) -public class PersonalProfileUniverse extends PersonalProfileElement -{ - private static final long serialVersionUID = 1L; - - private List userIdentities = null; - private List contactMethods = null; - - - /** - * Default Constructor - */ - public PersonalProfileUniverse() - { - } - - - /** - * Copy/clone Constructor - the resulting object. - * - * @param template object being copied - */ - public PersonalProfileUniverse(PersonalProfileUniverse template) - { - if (template != null) - { - userIdentities = template.getUserIdentities(); - contactMethods = template.getContactMethods(); - } - } - - - /** - * Return the list of user identities associated with the personal profile. - * - * @return list or null - */ - public List getUserIdentities() - { - if (userIdentities == null) - { - return null; - } - else if (userIdentities.isEmpty()) - { - return null; - } - - return userIdentities; - } - - - /** - * Set up the list of user identities associated with the personal profile. - * - * @param userIdentities list or null - */ - public void setUserIdentities(List userIdentities) - { - this.userIdentities = userIdentities; - } - - - /** - * Return the list of contact methods for the individual. - * - * @return list or null - */ - public List getContactMethods() - { - if (contactMethods == null) - { - return null; - } - - if (contactMethods.isEmpty()) - { - return null; - } - - return contactMethods; - } - - - /** - * Set up the list of contact methods for the individual. - * - * @param contactMethods list or null - */ - public void setContactMethods(List contactMethods) - { - this.contactMethods = contactMethods; - } - - - - /** - * JSON-style toString - * - * @return return string containing the property names and values - */ - @Override - public String toString() - { - return "PersonalProfileUniverse{" + - "userIdentities=" + userIdentities + - ", contactMethods=" + contactMethods + - ", elementHeader=" + getElementHeader() + - ", profileProperties=" + getProfileProperties() + - '}'; - } - - - /** - * Return comparison result based on the content of the properties. - * - * @param objectToCompare test object - * @return result of comparison - */ - @Override - public boolean equals(Object objectToCompare) - { - if (this == objectToCompare) - { - return true; - } - if (objectToCompare == null || getClass() != objectToCompare.getClass()) - { - return false; - } - if (!super.equals(objectToCompare)) - { - return false; - } - PersonalProfileUniverse that = (PersonalProfileUniverse) objectToCompare; - return Objects.equals(userIdentities, that.userIdentities) && - Objects.equals(contactMethods, that.contactMethods); - } - - - /** - * Return hash code for this object - * - * @return int hash code - */ - @Override - public int hashCode() - { - return Objects.hash(super.hashCode(), userIdentities, contactMethods); - } -} diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/ContactMethodProperties.java b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/ContactMethodProperties.java index 25791c8af0f..9964c5b8fa5 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/ContactMethodProperties.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/ContactMethodProperties.java @@ -6,6 +6,10 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; +import java.io.Serializable; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; @@ -17,13 +21,22 @@ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown=true) -public class ContactMethodProperties extends ReferenceableProperties +public class ContactMethodProperties implements Serializable { private static final long serialVersionUID = 1L; - private ContactMethodType type = null; - private String service = null; - private String value = null; + private String name = null; + private String contactType = null; + + private ContactMethodType contactMethodType = null; + private String contactMethodService = null; + private String contactMethodValue = null; + + private Date effectiveFrom = null; + private Date effectiveTo = null; + + private String typeName = null; + private Map extendedProperties = null; /** @@ -44,32 +57,80 @@ public ContactMethodProperties(ContactMethodProperties template) { if (template != null) { - type = template.getType(); - service = template.getService(); - value = template.getValue(); + contactMethodType = template.getContactMethodType(); + contactMethodService = template.getContactMethodService(); + contactMethodValue = template.getContactMethodValue(); + effectiveFrom = template.getEffectiveFrom(); + effectiveTo = template.getEffectiveTo(); + typeName = template.getTypeName(); + extendedProperties = template.getExtendedProperties(); } } + /** + * Return the name to give this contact method (imagine a list of contact methods). + * + * @return string + */ + public String getName() + { + return name; + } + + + /** + * Set up the name to give this contact method (imagine a list of contact methods). + * + * @param name string + */ + public void setName(String name) + { + this.name = name; + } + + + /** + * Return the type of contact - is it related to work or personal etc. + * + * @return string type name - often controlled by a valid value set + */ + public String getContactType() + { + return contactType; + } + + + /** + * Set up the type of contact - is it related to work or personal etc. + * + * @param contactType string type name - often controlled by a valid value set + */ + public void setContactType(String contactType) + { + this.contactType = contactType; + } + + /** * Return the type of the contact method. * * @return contact method type enum */ - public ContactMethodType getType() + public ContactMethodType getContactMethodType() { - return type; + return contactMethodType; } /** * Set up the type of the contact method. * - * @param type contact method type enum + * @param contactMethodType contact method type enum */ - public void setType(ContactMethodType type) + public void setContactMethodType(ContactMethodType contactMethodType) { - this.type = type; + this.contactMethodType = contactMethodType; } @@ -78,20 +139,20 @@ public void setType(ContactMethodType type) * * @return service URL */ - public String getService() + public String getContactMethodService() { - return service; + return contactMethodService; } /** * Set up theURL of the service used to contact the individual. * - * @param service service URL + * @param contactMethodService service URL */ - public void setService(String service) + public void setContactMethodService(String contactMethodService) { - this.service = service; + this.contactMethodService = contactMethodService; } @@ -100,20 +161,122 @@ public void setService(String service) * * @return value string */ - public String getValue() + public String getContactMethodValue() { - return value; + return contactMethodValue; } /** * Set up the account name or similar value used to direct the message to the individual. * - * @param value value string + * @param contactMethodValue value string + */ + public void setContactMethodValue(String contactMethodValue) + { + this.contactMethodValue = contactMethodValue; + } + + + + /** + * Return the date/time that this element is effective from (null means effective from the epoch). + * + * @return date object + */ + public Date getEffectiveFrom() + { + return effectiveFrom; + } + + + /** + * Set up the date/time that this element is effective from (null means effective from the epoch). + * + * @param effectiveFrom date object */ - public void setValue(String value) + public void setEffectiveFrom(Date effectiveFrom) { - this.value = value; + this.effectiveFrom = effectiveFrom; + } + + + /** + * Return the date/time that element is effective to (null means that it is effective indefinitely into the future). + * + * @return date object + */ + public Date getEffectiveTo() + { + return effectiveTo; + } + + + /** + * Set the date/time that element is effective to (null means that it is effective indefinitely into the future). + * + * @param effectiveTo date object + */ + public void setEffectiveTo(Date effectiveTo) + { + this.effectiveTo = effectiveTo; + } + + + /** + * Return the name of the open metadata type for this metadata element. + * + * @return string name + */ + public String getTypeName() + { + return typeName; + } + + + /** + * Set up the name of the open metadata type for this element. + * + * @param typeName string name + */ + public void setTypeName(String typeName) + { + this.typeName = typeName; + } + + + /** + * Return the properties that have been defined for a subtype of this object that are not supported explicitly + * by this bean. + * + * @return property map + */ + public Map getExtendedProperties() + { + if (extendedProperties == null) + { + return null; + } + else if (extendedProperties.isEmpty()) + { + return null; + } + else + { + return new HashMap<>(extendedProperties); + } + } + + + /** + * Set up the properties that have been defined for a subtype of this object that are not supported explicitly + * by this bean. + * + * @param extendedProperties property map + */ + public void setExtendedProperties(Map extendedProperties) + { + this.extendedProperties = extendedProperties; } @@ -126,13 +289,13 @@ public void setValue(String value) public String toString() { return "ContactMethodProperties{" + - "type=" + type + - ", service='" + service + '\'' + - ", value='" + value + '\'' + - ", qualifiedName='" + getQualifiedName() + '\'' + - ", additionalProperties=" + getAdditionalProperties() + - ", typeName='" + getTypeName() + '\'' + - ", extendedProperties=" + getExtendedProperties() + + "type=" + contactMethodType + + ", service='" + contactMethodService + '\'' + + ", value='" + contactMethodValue + '\'' + + ", effectiveFrom=" + effectiveFrom + + ", effectiveTo=" + effectiveTo + + ", typeName='" + typeName + '\'' + + ", extendedProperties=" + extendedProperties + '}'; } @@ -154,14 +317,14 @@ public boolean equals(Object objectToCompare) { return false; } - if (!super.equals(objectToCompare)) - { - return false; - } ContactMethodProperties that = (ContactMethodProperties) objectToCompare; - return getType() == that.getType() && - Objects.equals(getService(), that.getService()) && - Objects.equals(getValue(), that.getValue()); + return contactMethodType == that.contactMethodType && + Objects.equals(contactMethodService, that.contactMethodService) && + Objects.equals(contactMethodValue, that.contactMethodValue) && + Objects.equals(effectiveFrom, that.effectiveFrom) && + Objects.equals(effectiveTo, that.effectiveTo) && + Objects.equals(typeName, that.typeName) && + Objects.equals(extendedProperties, that.extendedProperties); } @@ -173,6 +336,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), getType(), getService(), getValue()); + return Objects.hash(contactMethodType, contactMethodService, contactMethodValue, effectiveFrom, effectiveTo, typeName, extendedProperties); } } diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/GovernanceRoleProperties.java b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/GovernanceRoleProperties.java index 2099ec82d98..bde325cd39c 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/GovernanceRoleProperties.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/GovernanceRoleProperties.java @@ -83,6 +83,7 @@ public String toString() { return "GovernanceRoleProperties{" + "domainIdentifier=" + domainIdentifier + + ", qualifiedName='" + getQualifiedName() + '\'' + ", roleId='" + getRoleId() + '\'' + ", scope='" + getScope() + '\'' + ", title='" + getTitle() + '\'' + diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/GovernanceZoneProperties.java b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/GovernanceZoneProperties.java index 976922d149e..9899ad85aad 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/GovernanceZoneProperties.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/GovernanceZoneProperties.java @@ -12,6 +12,7 @@ public class GovernanceZoneProperties extends ReferenceableProperties { private static final long serialVersionUID = 1L; + private String zoneName = null; private String displayName = null; private String description = null; private String criteria = null; @@ -39,6 +40,7 @@ public GovernanceZoneProperties(GovernanceZoneProperties template) if (template != null) { + this.zoneName = template.getZoneName(); this.displayName = template.getDisplayName(); this.description = template.getDescription(); this.criteria = template.getCriteria(); @@ -48,6 +50,28 @@ public GovernanceZoneProperties(GovernanceZoneProperties template) } + /** + * Return the unque name of the zone - this is the value configured in properties such as supportedZones and AssetZoneMembership. + * + * @return string name + */ + public String getZoneName() + { + return zoneName; + } + + + /** + * Set up unique name for the zone - this is the value configured in properties such as supportedZones and AssetZoneMembership. + * + * @param zoneName string name + */ + public void setZoneName(String zoneName) + { + this.zoneName = zoneName; + } + + /** * Return the short name for the governance zone. * @@ -167,7 +191,8 @@ public void setDomainIdentifier(int domainIdentifier) public String toString() { return "GovernanceZoneProperties{" + - "displayName='" + displayName + '\'' + + "zoneName='" + zoneName + '\'' + + ", displayName='" + displayName + '\'' + ", description='" + description + '\'' + ", criteria='" + criteria + '\'' + ", scope='" + scope + '\'' + @@ -203,6 +228,7 @@ public boolean equals(Object objectToCompare) } GovernanceZoneProperties that = (GovernanceZoneProperties) objectToCompare; return domainIdentifier == that.domainIdentifier && + Objects.equals(zoneName, that.zoneName) && Objects.equals(displayName, that.displayName) && Objects.equals(description, that.description) && Objects.equals(criteria, that.criteria) && @@ -218,6 +244,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), getDisplayName(), getDescription(), getCriteria(), getScope(), getDomainIdentifier()); + return Objects.hash(super.hashCode(), getZoneName(), getDisplayName(), getDescription(), getCriteria(), getScope(), getDomainIdentifier()); } } diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/PersonRoleProperties.java b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/PersonRoleProperties.java index 3e6ce857b04..aa192dcdfe7 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/PersonRoleProperties.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/PersonRoleProperties.java @@ -30,10 +30,11 @@ public abstract class PersonRoleProperties implements Serializable { private static final long serialVersionUID = 1L; - private String roleId = null; /* qualifiedName */ - private String scope = null; /* scope */ - private String title = null; /* name */ - private String description = null; /* description */ + private String qualifiedName = null; /* qualifiedName */ + private String roleId = null; /* identifier */ + private String scope = null; /* scope */ + private String title = null; /* name */ + private String description = null; /* description */ private boolean headCountLimitSet = false; private int headCount = 1; @@ -61,6 +62,7 @@ public PersonRoleProperties(PersonRoleProperties template) { if (template != null) { + this.qualifiedName = template.getQualifiedName(); this.roleId = template.getRoleId(); this.scope = template.getScope(); this.title = template.getTitle(); @@ -75,10 +77,32 @@ public PersonRoleProperties(PersonRoleProperties template) /** - * Return the unique identifier for this job role/appointment. + * Return the unique name for element in open metadata ecosystem. * * @return unique name */ + public String getQualifiedName() + { + return qualifiedName; + } + + + /** + * Set up the unique name for element in open metadata ecosystem. + * + * @param qualifiedName unique name + */ + public void setQualifiedName(String qualifiedName) + { + this.qualifiedName = qualifiedName; + } + + + /** + * Return the unique identifier for this job role/appointment typically from an HR system. + * + * @return unique identifier + */ public String getRoleId() { return roleId; @@ -88,7 +112,7 @@ public String getRoleId() /** * Set up the unique identifier for this job role/appointment. * - * @param roleId unique name + * @param roleId unique identifier */ public void setRoleId(String roleId) { @@ -315,7 +339,8 @@ public void setExtendedProperties(Map extendedProperties) public String toString() { return "PersonRoleProperties{" + - "roleId='" + roleId + '\'' + + "qualifiedName='" + qualifiedName + '\'' + + ", roleId='" + roleId + '\'' + ", scope='" + scope + '\'' + ", title='" + title + '\'' + ", description='" + description + '\'' + @@ -348,6 +373,7 @@ public boolean equals(Object objectToCompare) PersonRoleProperties that = (PersonRoleProperties) objectToCompare; return headCountLimitSet == that.headCountLimitSet && headCount == that.headCount && + Objects.equals(qualifiedName, that.qualifiedName) && Objects.equals(roleId, that.roleId) && Objects.equals(scope, that.scope) && Objects.equals(title, that.title) && @@ -366,6 +392,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(roleId, scope, title, description, headCountLimitSet, headCount, additionalProperties, typeName, extendedProperties); + return Objects.hash(qualifiedName, roleId, scope, title, description, headCountLimitSet, headCount, additionalProperties, typeName, extendedProperties); } } diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/SubjectAreaProperties.java b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/SubjectAreaProperties.java index f84179f943d..467c1e8bda4 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/SubjectAreaProperties.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/SubjectAreaProperties.java @@ -12,6 +12,7 @@ public class SubjectAreaProperties extends ReferenceableProperties { private static final long serialVersionUID = 1L; + private String subjectAreaName = null; private String displayName = null; private String description = null; private String usage = null; @@ -39,6 +40,7 @@ public SubjectAreaProperties(SubjectAreaProperties template) if (template != null) { + this.subjectAreaName = template.getSubjectAreaName(); this.displayName = template.getDisplayName(); this.description = template.getDescription(); this.usage = template.getUsage(); @@ -48,6 +50,28 @@ public SubjectAreaProperties(SubjectAreaProperties template) } + /** + * Return the name of the subject area - this is added to the SubjectArea classification. + * + * @return string name + */ + public String getSubjectAreaName() + { + return subjectAreaName; + } + + + /** + * Set up the name of the subject area - this is added to the SubjectArea classification. + * + * @param subjectAreaName string name + */ + public void setSubjectAreaName(String subjectAreaName) + { + this.subjectAreaName = subjectAreaName; + } + + /** * Return the short name for the governance zone. * @@ -166,16 +190,17 @@ public void setDomainIdentifier(int domainIdentifier) @Override public String toString() { - return "GovernanceZoneProperties{" + - "displayName='" + displayName + '\'' + - ", description='" + description + '\'' + - ", criteria='" + usage + '\'' + - ", scope='" + scope + '\'' + - ", domainIdentifier=" + domainIdentifier + - ", typeName='" + getTypeName() + '\'' + + return "SubjectAreaProperties{" + + "typeName='" + getTypeName() + '\'' + ", qualifiedName='" + getQualifiedName() + '\'' + ", additionalProperties=" + getAdditionalProperties() + ", extendedProperties=" + getExtendedProperties() + + ", subjectAreaName='" + subjectAreaName + '\'' + + ", displayName='" + displayName + '\'' + + ", description='" + description + '\'' + + ", usage='" + usage + '\'' + + ", scope='" + scope + '\'' + + ", domainIdentifier=" + domainIdentifier + '}'; } @@ -203,6 +228,7 @@ public boolean equals(Object objectToCompare) } SubjectAreaProperties that = (SubjectAreaProperties) objectToCompare; return domainIdentifier == that.domainIdentifier && + Objects.equals(subjectAreaName, that.subjectAreaName) && Objects.equals(displayName, that.displayName) && Objects.equals(description, that.description) && Objects.equals(usage, that.usage) && @@ -218,6 +244,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), getDisplayName(), getDescription(), getUsage(), getScope(), getDomainIdentifier()); + return Objects.hash(super.hashCode(), getSubjectAreaName(), getDisplayName(), getDescription(), getUsage(), getScope(), getDomainIdentifier()); } } diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/UserIdentityProperties.java b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/UserIdentityProperties.java index 151cdf0ad1e..811529a0f84 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/UserIdentityProperties.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/UserIdentityProperties.java @@ -21,6 +21,7 @@ public class UserIdentityProperties extends ReferenceableProperties { private static final long serialVersionUID = 1L; + private String userId = null; private String distinguishedName = null; @@ -41,6 +42,34 @@ public UserIdentityProperties() public UserIdentityProperties(UserIdentityProperties template) { super(template); + + if (template != null) + { + this.userId = template.getUserId(); + this.distinguishedName = template.getDistinguishedName(); + } + } + + + /** + * Return the identifier of the user's account + * + * @return string + */ + public String getUserId() + { + return userId; + } + + + /** + * Return the identifier of the user's account. + * + * @param userId string + */ + public void setUserId(String userId) + { + this.userId = userId; } @@ -75,11 +104,12 @@ public void setDistinguishedName(String distinguishedName) public String toString() { return "UserIdentityProperties{" + - "distinguishedName='" + distinguishedName + '\'' + - ", typeName='" + getTypeName() + '\'' + - ", qualifiedName='" + getQualifiedName() + '\'' + + "qualifiedName='" + getQualifiedName() + '\'' + ", additionalProperties=" + getAdditionalProperties() + + ", typeName='" + getTypeName() + '\'' + ", extendedProperties=" + getExtendedProperties() + + ", userId='" + userId + '\'' + + ", distinguishedName='" + distinguishedName + '\'' + '}'; } @@ -101,12 +131,13 @@ public boolean equals(Object objectToCompare) { return false; } - if (!super.equals(objectToCompare)) + if (! super.equals(objectToCompare)) { return false; } UserIdentityProperties that = (UserIdentityProperties) objectToCompare; - return Objects.equals(distinguishedName, that.distinguishedName); + return Objects.equals(userId, that.userId) && + Objects.equals(distinguishedName, that.distinguishedName); } @@ -118,6 +149,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), distinguishedName); + return Objects.hash(super.hashCode(), userId, distinguishedName); } } diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/rest/GovernanceProgramOMASAPIRequestBody.java b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/rest/GovernanceProgramOMASAPIRequestBody.java index 29ee1a21d5c..c382dbeedff 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/rest/GovernanceProgramOMASAPIRequestBody.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/rest/GovernanceProgramOMASAPIRequestBody.java @@ -19,7 +19,6 @@ @JsonSubTypes( { @JsonSubTypes.Type(value = AppointmentRequestBody.class, name = "AppointmentRequestBody"), - @JsonSubTypes.Type(value = PersonalProfileValidatorRequestBody.class, name = "PersonalProfileValidatorRequestBody"), }) public abstract class GovernanceProgramOMASAPIRequestBody implements java.io.Serializable { diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/rest/GovernanceProgramOMASAPIResponse.java b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/rest/GovernanceProgramOMASAPIResponse.java index 597af1caa19..df08a9eba67 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/rest/GovernanceProgramOMASAPIResponse.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/rest/GovernanceProgramOMASAPIResponse.java @@ -22,8 +22,6 @@ property = "class") @JsonSubTypes( { - @JsonSubTypes.Type(value = PersonalProfileResponse.class, name = "PersonalProfileResponse"), - @JsonSubTypes.Type(value = PersonalProfileListResponse.class, name = "PersonalProfileListResponse"), @JsonSubTypes.Type(value = GovernanceRoleResponse.class, name = "GovernanceRoleResponse"), @JsonSubTypes.Type(value = GovernanceRoleListResponse.class, name = "GovernanceRoleListResponse"), @JsonSubTypes.Type(value = SubjectAreaDefinitionResponse.class, name = "SubjectAreaDefinitionResponse"), diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/rest/PersonalProfileValidatorRequestBody.java b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/rest/PersonalProfileValidatorRequestBody.java deleted file mode 100644 index 176748a95d9..00000000000 --- a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/rest/PersonalProfileValidatorRequestBody.java +++ /dev/null @@ -1,120 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.governanceprogram.rest; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -import java.util.Objects; - -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; - -/** - * PersonalDetailsRequestBody provides a structure for passing personal details over a REST API. - * It is used for creating PersonalProfiles. - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown=true) -public class PersonalProfileValidatorRequestBody extends GovernanceProgramOMASAPIRequestBody -{ - private static final long serialVersionUID = 1L; - - private String employeeNumber = null; - - - /** - * Default constructor - */ - public PersonalProfileValidatorRequestBody() - { - } - - - /** - * Copy/clone constructor - * - * @param template object to copy - */ - public PersonalProfileValidatorRequestBody(PersonalProfileValidatorRequestBody template) - { - super(template); - - if (template != null) - { - this.employeeNumber = template.getEmployeeNumber(); - } - } - - - /** - * Return the unique employee number for this governance officer. - * - * @return String identifier - */ - public String getEmployeeNumber() - { - return employeeNumber; - } - - - /** - * Set up the unique employee number for this governance officer. - * - * @param employeeNumber String identifier - */ - public void setEmployeeNumber(String employeeNumber) - { - this.employeeNumber = employeeNumber; - } - - - /** - * JSON-style toString. - * - * @return list of properties and their values. - */ - @Override - public String toString() - { - return "PersonalDetailsRequestBody{" + - ", employeeNumber='" + employeeNumber + - '}'; - } - - - /** - * Equals method that returns true if containing properties are the same. - * - * @param objectToCompare object to compare - * @return boolean result of comparison - */ - @Override - public boolean equals(Object objectToCompare) - { - if (this == objectToCompare) - { - return true; - } - if (!(objectToCompare instanceof PersonalProfileValidatorRequestBody)) - { - return false; - } - PersonalProfileValidatorRequestBody that = (PersonalProfileValidatorRequestBody) objectToCompare; - return Objects.equals(getEmployeeNumber(), that.getEmployeeNumber()); - } - - - /** - * Return hash code for this object - * - * @return int hash code - */ - @Override - public int hashCode() - { - return Objects.hash(employeeNumber); - } -} diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/CertificationManager.java b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/CertificationManager.java index e5fe412c1f5..6c5cb69e065 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/CertificationManager.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/CertificationManager.java @@ -25,12 +25,12 @@ */ public class CertificationManager implements CertificationManagementInterface { - private String serverName; /* Initialized in constructor */ - private String serverPlatformURLRoot; /* Initialized in constructor */ - private GovernanceProgramRESTClient restClient; /* Initialized in constructor */ + private final String serverName; /* Initialized in constructor */ + private final String serverPlatformURLRoot; /* Initialized in constructor */ + private final GovernanceProgramRESTClient restClient; /* Initialized in constructor */ - private InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); - private NullRequestBody nullRequestBody = new NullRequestBody(); + private final InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); + private final NullRequestBody nullRequestBody = new NullRequestBody(); /** * Create a new client with no authentication embedded in the HTTP request. @@ -138,7 +138,7 @@ public CertificationManager(String serverName, /** - * Create a new client that uses the supplied rest client. This is typically used when called fro manother OMAG Server. + * Create a new client that uses the supplied rest client. This is typically used when called from another OMAG Server. * * @param serverName name of the server to connect to * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers @@ -367,7 +367,7 @@ public CertificationTypeElement getCertificationTypeByDocId(String userId, /** - * Retrieve all of the certification types for a particular title. The title can include regEx wildcards. + * Retrieve all the certification types for a particular title. The title can include regEx wildcards. * * @param userId calling user * @param title short description of the role @@ -415,7 +415,7 @@ public List getCertificationTypesByTitle(String userId /** - * Retrieve all of the certification type definitions for a specific governance domain. + * Retrieve all the certification type definitions for a specific governance domain. * * @param userId calling user * @param domainIdentifier identifier to search for diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/ExternalReferenceManager.java b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/ExternalReferenceManager.java index 382f5772bef..af6ec3df426 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/ExternalReferenceManager.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/ExternalReferenceManager.java @@ -25,12 +25,12 @@ */ public class ExternalReferenceManager implements ExternalReferencesInterface { - private String serverName; /* Initialized in constructor */ - private String serverPlatformURLRoot; /* Initialized in constructor */ - private GovernanceProgramRESTClient restClient; /* Initialized in constructor */ + private final String serverName; /* Initialized in constructor */ + private final String serverPlatformURLRoot; /* Initialized in constructor */ + private final GovernanceProgramRESTClient restClient; /* Initialized in constructor */ - private InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); - private NullRequestBody nullRequestBody = new NullRequestBody(); + private final InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); + private final NullRequestBody nullRequestBody = new NullRequestBody(); /** * Create a new client with no authentication embedded in the HTTP request. @@ -138,7 +138,7 @@ public ExternalReferenceManager(String serverName, /** - * Create a new client that uses the supplied rest client. This is typically used when called fro manother OMAG Server. + * Create a new client that uses the supplied rest client. This is typically used when called from another OMAG Server. * * @param serverName name of the server to connect to * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers @@ -164,7 +164,7 @@ public ExternalReferenceManager(String serverName, /** - * Create a definition of a external reference. + * Create a definition of an external reference. * * @param userId calling user * @param anchorGUID optional element to link the external reference to that will act as an anchor - that is, this external reference @@ -207,7 +207,7 @@ public String createExternalReference(String userId, /** - * Update the definition of a external reference. + * Update the definition of an external reference. * * @param userId calling user * @param externalReferenceGUID unique identifier of external reference @@ -254,7 +254,7 @@ public void updateExternalReference(String userId, /** - * Remove the definition of a external reference. + * Remove the definition of an external reference. * * @param userId calling user * @param externalReferenceGUID unique identifier of external reference @@ -327,7 +327,7 @@ public void linkExternalReferenceToElement(String userI /** - * Remove the link between a external reference and an element. If the element is its anchor, the external reference is removed. + * Remove the link between an external reference and an element. If the element is its anchor, the external reference is removed. * * @param userId the name of the calling user. * @param attachedToGUID object linked to external references. diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceClassificationLevelManager.java b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceClassificationLevelManager.java index e0e60a9edef..e1eef40775b 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceClassificationLevelManager.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceClassificationLevelManager.java @@ -25,12 +25,12 @@ */ public class GovernanceClassificationLevelManager implements GovernanceClassificationLevelInterface { - private String serverName; /* Initialized in constructor */ - private String serverPlatformURLRoot; /* Initialized in constructor */ - private GovernanceProgramRESTClient restClient; /* Initialized in constructor */ + private final String serverName; /* Initialized in constructor */ + private final String serverPlatformURLRoot; /* Initialized in constructor */ + private final GovernanceProgramRESTClient restClient; /* Initialized in constructor */ - private InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); - private NullRequestBody nullRequestBody = new NullRequestBody(); + private final InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); + private final NullRequestBody nullRequestBody = new NullRequestBody(); /** @@ -139,7 +139,7 @@ public GovernanceClassificationLevelManager(String serverName, /** - * Create a new client that uses the supplied rest client. This is typically used when called fro manother OMAG Server. + * Create a new client that uses the supplied rest client. This is typically used when called from another OMAG Server. * * @param serverName name of the server to connect to * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceDefinitionManager.java b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceDefinitionManager.java index 78a31598813..67ba08557fc 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceDefinitionManager.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceDefinitionManager.java @@ -22,7 +22,7 @@ * that define the motivation, goals and implementation approach for the governance program. * * Governance drivers document of the business strategy and regulations that provide the motivation behind the governance program. They feed - * into the governance program's policy making phase ensuring the governance program is focused on activity that delivers value to the organization. + * into the governance program's policymaking phase ensuring the governance program is focused on activity that delivers value to the organization. * A governance driver could be a governance strategy statement, a business imperative, a regulation or a regulation's article. * * Governance policies define the goals and best practices for the governance program. There are three types of governance policies: @@ -73,12 +73,12 @@ */ public class GovernanceDefinitionManager implements GovernanceDefinitionsInterface { - private String serverName; /* Initialized in constructor */ - private String serverPlatformURLRoot; /* Initialized in constructor */ - private GovernanceProgramRESTClient restClient; /* Initialized in constructor */ + private final String serverName; /* Initialized in constructor */ + private final String serverPlatformURLRoot; /* Initialized in constructor */ + private final GovernanceProgramRESTClient restClient; /* Initialized in constructor */ - private InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); - private NullRequestBody nullRequestBody = new NullRequestBody(); + private final InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); + private final NullRequestBody nullRequestBody = new NullRequestBody(); /** * Create a new client with no authentication embedded in the HTTP request. @@ -186,7 +186,7 @@ public GovernanceDefinitionManager(String serverName, /** - * Create a new client that uses the supplied rest client. This is typically used when called fro manother OMAG Server. + * Create a new client that uses the supplied rest client. This is typically used when called from another OMAG Server. * * @param serverName name of the server to connect to * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceDomainManager.java b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceDomainManager.java index f0fb44d8000..719dbfc010b 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceDomainManager.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceDomainManager.java @@ -7,12 +7,9 @@ import org.odpi.openmetadata.accessservices.governanceprogram.client.rest.GovernanceProgramRESTClient; import org.odpi.openmetadata.accessservices.governanceprogram.metadataelements.GovernanceDomainElement; import org.odpi.openmetadata.accessservices.governanceprogram.metadataelements.GovernanceDomainSetElement; -import org.odpi.openmetadata.accessservices.governanceprogram.metadataelements.GovernanceLevelIdentifierElement; -import org.odpi.openmetadata.accessservices.governanceprogram.metadataelements.GovernanceLevelIdentifierSetElement; +import org.odpi.openmetadata.accessservices.governanceprogram.properties.GovernanceDomain; import org.odpi.openmetadata.accessservices.governanceprogram.properties.GovernanceDomainProperties; import org.odpi.openmetadata.accessservices.governanceprogram.properties.GovernanceDomainSetProperties; -import org.odpi.openmetadata.accessservices.governanceprogram.properties.GovernanceLevelIdentifierProperties; -import org.odpi.openmetadata.accessservices.governanceprogram.properties.GovernanceLevelIdentifierSetProperties; import org.odpi.openmetadata.accessservices.governanceprogram.rest.*; import org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler; import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDResponse; @@ -28,18 +25,16 @@ /** * GovernanceDomainManager sets up the governance domains that are part of an organization governance. - * Each governance domain describes a focus for governance. The governance domain typically focuses on a particular set of activity - * within the organization. There is often overlap in the resources (assets) that each domain governs. As a result, there is - * often linkage between the governance definitions from different governance domains. + * Each governance domain describes a focus for governance. */ public class GovernanceDomainManager implements GovernanceDomainInterface { - private String serverName; /* Initialized in constructor */ - private String serverPlatformURLRoot; /* Initialized in constructor */ - private GovernanceProgramRESTClient restClient; /* Initialized in constructor */ + private final String serverName; /* Initialized in constructor */ + private final String serverPlatformURLRoot; /* Initialized in constructor */ + private final GovernanceProgramRESTClient restClient; /* Initialized in constructor */ - private InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); - private NullRequestBody nullRequestBody = new NullRequestBody(); + private final InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); + private final NullRequestBody nullRequestBody = new NullRequestBody(); /** @@ -148,7 +143,7 @@ public GovernanceDomainManager(String serverName, /** - * Create a new client that uses the supplied rest client. This is typically used when called fro manother OMAG Server. + * Create a new client that uses the supplied rest client. This is typically used when called from another OMAG Server. * * @param serverName name of the server to connect to * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers @@ -189,7 +184,6 @@ public GovernanceDomainManager(String serverName, *
  • Software Development - The software development lifecycle (SDLC) governance domain.
  • *
  • Corporate - The corporate governance domain.
  • *
  • Asset Management - The physical asset management governance domain.
  • - *
  • Other - The governance domain is locally defined.
  • *
* * @param userId calling user @@ -204,20 +198,44 @@ public String createStandardGovernanceDomains(String userId) throws InvalidParam UserNotAuthorizedException, PropertyServerException { - final String methodName = "createStandardGovernanceDomains"; - - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domain-sets/standard-set"; + final String methodName = "createStandardGovernanceDomains"; + final String setName = "EgeriaStandardDomains"; + final String setDescription = "Initial list of governance domain definitions for the following governance domains.\n" + + "\n" + + "* Unclassified - The governance domain is not specified - that is the definition applies to all domains - this is the default value for governance definitions within the governance program.\n" + + "* Data - The data (information) governance domain\n" + + "* Privacy - The data privacy governance domain\n" + + "* Security - The security governance domain.\n" + + "* IT Infrastructure - The IT infrastructure management governance domain.\n" + + "* Software Development - The software development lifecycle (SDLC) governance domain.\n" + + "* Corporate - The corporate governance domain.\n" + + "* Asset Management - The physical asset management governance domain.\n"; invalidParameterHandler.validateUserId(userId, methodName); - GUIDResponse response = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - nullRequestBody, - serverName, - userId); + GovernanceDomainSetProperties governanceDomainSetProperties = new GovernanceDomainSetProperties(); + governanceDomainSetProperties.setQualifiedName("GovernanceDomainSet:" + setName); + governanceDomainSetProperties.setDisplayName(setName); + governanceDomainSetProperties.setDescription(setDescription); - return response.getGUID(); + String setGUID = this.createGovernanceDomainSet(userId, governanceDomainSetProperties); + + for (GovernanceDomain governanceDomain : GovernanceDomain.values()) + { + if (governanceDomain != GovernanceDomain.OTHER) + { + GovernanceDomainProperties governanceDomainProperties = new GovernanceDomainProperties(); + + governanceDomainProperties.setQualifiedName("GovernanceDomain:" + governanceDomain.getName()); + governanceDomainProperties.setDisplayName(governanceDomain.getName()); + governanceDomainProperties.setDomainIdentifier(governanceDomain.getOrdinal()); + governanceDomainProperties.setDescription(governanceDomain.getDescription()); + this.createGovernanceDomain(userId, setGUID, governanceDomainProperties); + } + } + + return setGUID; } @@ -540,7 +558,7 @@ public void updateGovernanceDomain(String userId, final String guidParameter = "governanceDomainGUID"; final String qualifiedNameParameter = "qualifiedName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domain-sets/governance-domains/{2}/update"; + final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domains/{2}/update"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(governanceDomainGUID, guidParameter, methodName); @@ -575,7 +593,7 @@ public void deleteGovernanceDomain(String userId, final String methodName = "deleteGovernanceDomain"; final String guidParameter = "governanceDomainGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domain-sets/governance-domains/{2}/delete"; + final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domains/{2}/delete"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(governanceDomainGUID, guidParameter, methodName); @@ -589,9 +607,84 @@ public void deleteGovernanceDomain(String userId, } + /** + * Create a parent-child relationship between a governance domain set and a governance domain. + * + * @param userId calling user + * @param governanceDomainSetGUID unique identifier of the governance domain set + * @param governanceDomainGUID unique identifier of the governance domain + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void addDomainToSet(String userId, + String governanceDomainSetGUID, + String governanceDomainGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "addDomainToSet"; + + final String guid1Parameter = "governanceDomainSetGUID"; + final String guid2Parameter = "governanceDomainGUID"; + final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domain-sets/{2}/governance-domains/{3}"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(governanceDomainSetGUID, guid1Parameter, methodName); + invalidParameterHandler.validateGUID(governanceDomainGUID, guid2Parameter, methodName); + + restClient.callVoidPostRESTCall(methodName, + serverPlatformURLRoot + urlTemplate, + nullRequestBody, + serverName, + userId, + governanceDomainSetGUID, + governanceDomainGUID); + } + + + /** + * Remove a parent-child relationship between a governance domain set and a governance domain. + * + * @param userId calling user + * @param governanceDomainSetGUID unique identifier of the governance domain set + * @param governanceDomainGUID unique identifier of the governance domain + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void removeDomainFromSet(String userId, + String governanceDomainSetGUID, + String governanceDomainGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "removeDomainFromSet"; + + final String guid1Parameter = "governanceDomainSetGUID"; + final String guid2Parameter = "governanceDomainGUID"; + final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domain-sets/{2}/governance-domains/{3}/delete"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(governanceDomainSetGUID, guid1Parameter, methodName); + invalidParameterHandler.validateGUID(governanceDomainGUID, guid2Parameter, methodName); + + restClient.callVoidPostRESTCall(methodName, + serverPlatformURLRoot + urlTemplate, + nullRequestBody, + serverName, + userId, + governanceDomainSetGUID, + governanceDomainGUID); + } + + /** * Retrieve the list of Governance Domain metadata elements defined for the governance program. - * The search string is treated as a regular expression. * * @param userId calling user * @param startFrom paging start point @@ -611,7 +704,7 @@ public List getGovernanceDomains(String userId, PropertyServerException { final String methodName = "getGovernanceDomains"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domain-sets/governance-domains?startFrom={2}&pageSize={3}"; + final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domains?startFrom={2}&pageSize={3}"; invalidParameterHandler.validateUserId(userId, methodName); @@ -653,7 +746,7 @@ public List findGovernanceDomains(String userId, final String methodName = "findGovernanceDomains"; final String searchStringParameterName = "searchString"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domain-sets/governance-domains/by-search-string?startFrom={2}&pageSize={3}"; + final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domains/by-search-string?startFrom={2}&pageSize={3}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateSearchString(searchString, searchStringParameterName, methodName); @@ -701,14 +794,14 @@ public List getSetsForGovernanceDomain(String userId final String methodName = "getSetsForGovernanceDomain"; final String guidParameterName = "governanceDomainGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domain-sets/governance-domains/{2}?startFrom={3}&pageSize={4}"; + final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domain-sets/by-governance-domains/{2}?startFrom={3}&pageSize={4}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(governanceDomainGUID, guidParameterName, methodName); int queryPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); - GovernanceDomainSetListResponse restResult = restClient.callGovernanceDomainSetListPostRESTCall(methodName, + GovernanceDomainSetListResponse restResult = restClient.callGovernanceDomainSetListGetRESTCall(methodName, serverPlatformURLRoot + urlTemplate, serverName, userId, @@ -745,7 +838,7 @@ public List getGovernanceDomainsByName(String userId, final String methodName = "getGovernanceDomainsByName"; final String nameParameterName = "name"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domain-sets/governance-domains/by-name?startFrom={2}&pageSize={3}"; + final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domains/by-name?startFrom={2}&pageSize={3}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(name, nameParameterName, methodName); diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceMetricsManager.java b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceMetricsManager.java index eedee4b4456..69f5fbfce9f 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceMetricsManager.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceMetricsManager.java @@ -22,12 +22,12 @@ */ public class GovernanceMetricsManager implements GovernanceMetricsInterface { - private String serverName; /* Initialized in constructor */ - private String serverPlatformURLRoot; /* Initialized in constructor */ - private GovernanceProgramRESTClient restClient; /* Initialized in constructor */ + private final String serverName; /* Initialized in constructor */ + private final String serverPlatformURLRoot; /* Initialized in constructor */ + private final GovernanceProgramRESTClient restClient; /* Initialized in constructor */ - private InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); - private NullRequestBody nullRequestBody = new NullRequestBody(); + private final InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); + private final NullRequestBody nullRequestBody = new NullRequestBody(); /** * Create a new client with no authentication embedded in the HTTP request. @@ -135,7 +135,7 @@ public GovernanceMetricsManager(String serverName, /** - * Create a new client that uses the supplied rest client. This is typically used when called fro manother OMAG Server. + * Create a new client that uses the supplied rest client. This is typically used when called from another OMAG Server. * * @param serverName name of the server to connect to * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceProgramReviewManager.java b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceProgramReviewManager.java index b654115d20e..4645cac444a 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceProgramReviewManager.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceProgramReviewManager.java @@ -22,11 +22,11 @@ */ public class GovernanceProgramReviewManager implements GovernanceProgramReviewInterface { - private String serverName; /* Initialized in constructor */ - private String serverPlatformURLRoot; /* Initialized in constructor */ - private GovernanceProgramRESTClient restClient; /* Initialized in constructor */ + private final String serverName; /* Initialized in constructor */ + private final String serverPlatformURLRoot; /* Initialized in constructor */ + private final GovernanceProgramRESTClient restClient; /* Initialized in constructor */ - private InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); + private final InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); /** * Create a new client with no authentication embedded in the HTTP request. @@ -134,7 +134,7 @@ public GovernanceProgramReviewManager(String serverName, /** - * Create a new client that uses the supplied rest client. This is typically used when called fro manother OMAG Server. + * Create a new client that uses the supplied rest client. This is typically used when called from another OMAG Server. * * @param serverName name of the server to connect to * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers @@ -205,7 +205,7 @@ public List getGovernanceDefinitionsForDomain(Strin /** - * Return the list of governance definitions associated with a unique docId. In an ideal world, the should be only one. + * Return the list of governance definitions associated with a unique docId. In an ideal world, there should be only one. * * @param userId calling user * @param typeName option types name to restrict retrieval to a specific type diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceRoleManager.java b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceRoleManager.java index 422efea9bfd..34ae9e0c9c2 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceRoleManager.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceRoleManager.java @@ -23,18 +23,18 @@ /** * GovernanceRoleManager provides one of the client-side interface for the Governance Program Open Metadata Access Service (OMAS). - * This client manages all of the interaction with an open metadata repository. It is initialized with the URL + * This client manages all the interaction with an open metadata repository. It is initialized with the URL * of the server that is running the Open Metadata Access Services. This server is responsible for locating and * managing the governance program definitions exchanged with this client. */ public class GovernanceRoleManager implements GovernanceRolesInterface { - private String serverName; /* Initialized in constructor */ - private String serverPlatformURLRoot; /* Initialized in constructor */ - private GovernanceProgramRESTClient restClient; /* Initialized in constructor */ + private final String serverName; /* Initialized in constructor */ + private final String serverPlatformURLRoot; /* Initialized in constructor */ + private final GovernanceProgramRESTClient restClient; /* Initialized in constructor */ - private InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); - private NullRequestBody nullRequestBody = new NullRequestBody(); + private final InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); + private final NullRequestBody nullRequestBody = new NullRequestBody(); /** * Create a new client with no authentication embedded in the HTTP request. @@ -142,7 +142,7 @@ public GovernanceRoleManager(String serverName, /** - * Create a new client that uses the supplied rest client. This is typically used when called fro manother OMAG Server. + * Create a new client that uses the supplied rest client. This is typically used when called from another OMAG Server. * * @param serverName name of the server to connect to * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers @@ -188,13 +188,13 @@ public String createGovernanceRole(String userId, final String methodName = "createGovernanceRole"; final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-roles"; - final String roleIdParameterName = "roleId"; + final String qualifiedNameParameterName = "qualifiedName"; final String titleParameterName = "title"; final String propertiesParameterName = "properties"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateObject(properties, propertiesParameterName, methodName); - invalidParameterHandler.validateName(properties.getRoleId(), roleIdParameterName, methodName); + invalidParameterHandler.validateName(properties.getQualifiedName(), qualifiedNameParameterName, methodName); invalidParameterHandler.validateName(properties.getTitle(), titleParameterName, methodName); GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, @@ -215,7 +215,7 @@ public String createGovernanceRole(String userId, * @param isMergeUpdate are unspecified properties unchanged (true) or replaced with null? * @param properties the description of the governance role * - * @throws InvalidParameterException the title is null or the governanceDomain/appointmentId does not match the + * @throws InvalidParameterException the title is null or the governanceDomain/appointmentId does not match * the existing values associated with the governanceRoleGUID. * @throws PropertyServerException the server is not available. * @throws UserNotAuthorizedException the calling user is not authorized to issue the call. @@ -513,7 +513,7 @@ public GovernanceRoleHistory getGovernanceRoleHistoryByGUID(String userId, /** * Retrieve the properties of a governance role using its unique name. The results are returned as a list * since it is possible that two roles have the same identifier due to the distributed nature of the - * open metadata ecosystem. By returning all of the search results here it is possible to manage the + * open metadata ecosystem. By returning all the search results here it is possible to manage the * duplicates through this interface. * * @param userId calling user @@ -550,7 +550,7 @@ public List getGovernanceRoleByRoleId(String userId, /** - * Return all of the defined governance roles for a specific governance domain. + * Return all the defined governance roles for a specific governance domain. * * @param userId the name of the calling user * @param domainIdentifier domain of interest - 0 means all domains @@ -592,7 +592,7 @@ public List getGovernanceRolesByDomainId(String userId, /** - * Retrieve all of the governance roles for a particular title. The title can include regEx wildcards. + * Retrieve all the governance roles for a particular title. The title can include regEx wildcards. * * @param userId calling user * @param title short description of the role @@ -640,7 +640,7 @@ public List getGovernanceRolesByTitle(String userId, /** - * Return all of the governance roles and their incumbents (if any). + * Return all the governance roles and their incumbents (if any). * * @param userId the name of the calling user * @param domainIdentifier identifier of domain - 0 means all diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceZoneManager.java b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceZoneManager.java index 59546e96710..a89f802b58b 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceZoneManager.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceZoneManager.java @@ -26,12 +26,12 @@ */ public class GovernanceZoneManager implements GovernanceZonesInterface { - private String serverName; /* Initialized in constructor */ - private String serverPlatformURLRoot; /* Initialized in constructor */ - private GovernanceProgramRESTClient restClient; /* Initialized in constructor */ + private final String serverName; /* Initialized in constructor */ + private final String serverPlatformURLRoot; /* Initialized in constructor */ + private final GovernanceProgramRESTClient restClient; /* Initialized in constructor */ - private InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); - private NullRequestBody nullRequestBody = new NullRequestBody(); + private final InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); + private final NullRequestBody nullRequestBody = new NullRequestBody(); /** @@ -140,7 +140,7 @@ public GovernanceZoneManager(String serverName, /** - * Create a new client that uses the supplied rest client. This is typically used when called fro manother OMAG Server. + * Create a new client that uses the supplied rest client. This is typically used when called from another OMAG Server. * * @param serverName name of the server to connect to * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers @@ -168,7 +168,7 @@ public GovernanceZoneManager(String serverName, /** * Create a definition of a governance zone. The qualified name of these governance zones can be added * to the supportedZones, publishedZones and defaultZones properties of an OMAS to control which assets are processed - * and how they are set up. In addition the qualified names of zones can be added to Asset definitions + * and how they are set up. In addition, the qualified names of zones can be added to Asset definitions * to indicate which zone(s) they belong to. * * @param userId calling user diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/RightsManager.java b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/RightsManager.java index 01c2918864c..82dd7a6d1d7 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/RightsManager.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/RightsManager.java @@ -28,12 +28,12 @@ */ public class RightsManager implements RightsManagementInterface { - private String serverName; /* Initialized in constructor */ - private String serverPlatformURLRoot; /* Initialized in constructor */ - private GovernanceProgramRESTClient restClient; /* Initialized in constructor */ + private final String serverName; /* Initialized in constructor */ + private final String serverPlatformURLRoot; /* Initialized in constructor */ + private final GovernanceProgramRESTClient restClient; /* Initialized in constructor */ - private InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); - private NullRequestBody nullRequestBody = new NullRequestBody(); + private final InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); + private final NullRequestBody nullRequestBody = new NullRequestBody(); /** * Create a new client with no authentication embedded in the HTTP request. @@ -141,7 +141,7 @@ public RightsManager(String serverName, /** - * Create a new client that uses the supplied rest client. This is typically used when called fro manother OMAG Server. + * Create a new client that uses the supplied rest client. This is typically used when called from another OMAG Server. * * @param serverName name of the server to connect to * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers @@ -370,7 +370,7 @@ public LicenseTypeElement getLicenseTypeByDocId(String userId, /** - * Retrieve all of the license types for a particular title. The title can include regEx wildcards. + * Retrieve all the license types for a particular title. The title can include regEx wildcards. * * @param userId calling user * @param title short description of the role @@ -418,7 +418,7 @@ public List getLicenseTypesByTitle(String userId, /** - * Retrieve all of the license type definitions for a specific governance domain. + * Retrieve all the license type definitions for a specific governance domain. * * @param userId calling user * @param domainIdentifier identifier to search for diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/SubjectAreaManager.java b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/SubjectAreaManager.java index b02c3f4bded..4fb046aa3ad 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/SubjectAreaManager.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/SubjectAreaManager.java @@ -25,12 +25,12 @@ */ public class SubjectAreaManager implements SubjectAreasInterface { - private String serverName; /* Initialized in constructor */ - private String serverPlatformURLRoot; /* Initialized in constructor */ - private GovernanceProgramRESTClient restClient; /* Initialized in constructor */ + private final String serverName; /* Initialized in constructor */ + private final String serverPlatformURLRoot; /* Initialized in constructor */ + private final GovernanceProgramRESTClient restClient; /* Initialized in constructor */ - private InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); - private NullRequestBody nullRequestBody = new NullRequestBody(); + private final InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); + private final NullRequestBody nullRequestBody = new NullRequestBody(); /** @@ -139,7 +139,7 @@ public SubjectAreaManager(String serverName, /** - * Create a new client that uses the supplied rest client. This is typically used when called fro manother OMAG Server. + * Create a new client that uses the supplied rest client. This is typically used when called from another OMAG Server. * * @param serverName name of the server to connect to * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers @@ -184,11 +184,12 @@ public String createSubjectArea(String userId, { final String methodName = "createSubjectArea"; + final String propertiesParameter = "properties"; final String qualifiedNameParameter = "qualifiedName"; final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/subject-areas"; invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateObject(properties, qualifiedNameParameter, methodName); + invalidParameterHandler.validateObject(properties, propertiesParameter, methodName); invalidParameterHandler.validateName(properties.getQualifiedName(), qualifiedNameParameter, methodName); GUIDResponse response = restClient.callGUIDPostRESTCall(methodName, @@ -225,7 +226,7 @@ public void updateSubjectArea(String userId, final String guidParameter = "subjectAreaGUID"; final String qualifiedNameParameter = "qualifiedName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-zones/{2}?isMergeUpdate={3}"; + final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/subject-areas/{2}?isMergeUpdate={3}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(subjectAreaGUID, guidParameter, methodName); @@ -302,7 +303,7 @@ public void linkSubjectAreasInHierarchy(String userId, final String parentSubjectAreaGUIDParameterName = "parentSubjectAreaGUID"; final String childSubjectAreaGUIDParameterName = "childSubjectAreaGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/subject-areas/{2}/nested-area/{3}/link"; + final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/subject-areas/{2}/nested-subject-area/{3}/link"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(parentSubjectAreaGUID, parentSubjectAreaGUIDParameterName, methodName); @@ -340,7 +341,7 @@ public void unlinkSubjectAreasInHierarchy(String userId, final String parentSubjectAreaGUIDParameterName = "parentSubjectAreaGUID"; final String childSubjectAreaGUIDParameterName = "childSubjectAreaGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/subject-areas/{2}/nested-area/{3}/unlink"; + final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/subject-areas/{2}/nested-subject-area/{3}/unlink"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(parentSubjectAreaGUID, parentSubjectAreaGUIDParameterName, methodName); @@ -416,7 +417,7 @@ public void unlinkSubjectAreaFromGovernanceDefinition(String userId, final String subjectAreaGUIDParameterName = "subjectAreaGUID"; final String definitionGUIDParameterName = "definitionGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-zones/{2}/governed-by/{3}/unlink"; + final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/subject-areas/{2}/governed-by/{3}/unlink"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(subjectAreaGUID, subjectAreaGUIDParameterName, methodName); diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/package-info.java b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/package-info.java index 1a11b0cd1c3..063f0864091 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/package-info.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/package-info.java @@ -3,7 +3,7 @@ /** * These classes provides the Java clients for the Governance Program Open Metadata Access Service (OMAS). - * These clients manage all of the interaction with an open metadata repository. They are initialized with the URL + * These clients manage all the interaction with an open metadata repository. They are initialized with the URL * of the server that is running the Open Metadata Access Services. This server is responsible for locating and * managing the governance program definitions exchanged with this client. */ diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/rest/GovernanceProgramRESTClient.java b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/rest/GovernanceProgramRESTClient.java index 6a77c1e91c4..3c3d521e8c8 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/rest/GovernanceProgramRESTClient.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/rest/GovernanceProgramRESTClient.java @@ -87,57 +87,6 @@ public GovernanceProgramRESTClient(String serverName, } - /** - * Issue a GET REST call that returns a PersonalProfileResponse object. - * - * @param methodName name of the method being called. - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters. - * @param params a list of parameters that are slotted into the url template. - * - * @return PersonalProfileResponse - * @throws InvalidParameterException the unique identifier of the governance officer is either null or invalid. - * @throws PropertyServerException the server is not available. - * @throws UserNotAuthorizedException the calling user is not authorized to issue the call. - */ - public PersonalProfileResponse callPersonalProfileGetRESTCall(String methodName, - String urlTemplate, - Object... params) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - PersonalProfileResponse restResult = this.callGetRESTCall(methodName, PersonalProfileResponse.class, urlTemplate, params); - - exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); - - return restResult; - } - - - /** - * Issue a GET REST call that returns a list of PersonalProfileElement objects. - * - * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters - * @param params a list of parameters that are slotted into the url template - * @return PersonalProfileListResponse - * @throws InvalidParameterException one of the parameters is invalid. - * @throws UserNotAuthorizedException the user is not authorized to make this request. - * @throws PropertyServerException the repository is not available or not working properly. - */ - public PersonalProfileListResponse callPersonalProfileListGetRESTCall(String methodName, - String urlTemplate, - Object... params) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - PersonalProfileListResponse restResult = this.callGetRESTCall(methodName, PersonalProfileListResponse.class, urlTemplate, params); - - exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); - - return restResult; - } - - /** * Issue a GET REST call that returns a CertificationTypeResponse object. * @@ -446,6 +395,32 @@ public GovernanceDomainSetListResponse callGovernanceDomainSetListPostRESTCall(S } + /** + * Issue a GET REST call that returns a GovernanceDomainSetListResponse object. + * + * @param methodName name of the method being called + * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param params a list of parameters that are slotted into the url template + * @return GovernanceDomainSetResponse + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException the repository is not available or not working properly. + */ + public GovernanceDomainSetListResponse callGovernanceDomainSetListGetRESTCall(String methodName, + String urlTemplate, + Object... params) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + GovernanceDomainSetListResponse restResult = this.callGetRESTCall(methodName, GovernanceDomainSetListResponse.class, urlTemplate, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + + /** * Issue a GET REST call that returns a GovernanceDomainSetResponse object. * diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/AssetConverter.java b/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/AssetConverter.java index d9a8c09a9dd..56cceae4d56 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/AssetConverter.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/AssetConverter.java @@ -39,7 +39,7 @@ public AssetConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -58,7 +58,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/ElementStubConverter.java b/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/ElementStubConverter.java index 3a4dad2d9b2..0dbfe1b7cbb 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/ElementStubConverter.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/ElementStubConverter.java @@ -37,7 +37,7 @@ public ElementStubConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entityProxy and that of a connected relationship. * * @param beanClass name of the class to create @@ -77,7 +77,7 @@ private B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an relationship and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/ExternalReferenceConverter.java b/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/ExternalReferenceConverter.java index 308a6892ee8..13d2bb4f972 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/ExternalReferenceConverter.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/ExternalReferenceConverter.java @@ -37,7 +37,7 @@ public ExternalReferenceConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -56,7 +56,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/GovernanceDefinitionConverter.java b/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/GovernanceDefinitionConverter.java index 6c67b00ada5..752fa2e0030 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/GovernanceDefinitionConverter.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/GovernanceDefinitionConverter.java @@ -19,7 +19,7 @@ /** * GovernanceDefinitionConverter provides common methods for transferring relevant properties from an Open Metadata Repository Services (OMRS) - * EntityDetail object into a bean that inherits from GovernanceDefinition. + * EntityDetail object into a bean that inherits from GovernanceDefinitionElement. */ public class GovernanceDefinitionConverter extends GovernanceProgramOMASConverter { diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/GovernanceDomainConverter.java b/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/GovernanceDomainConverter.java new file mode 100644 index 00000000000..d10d2450e79 --- /dev/null +++ b/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/GovernanceDomainConverter.java @@ -0,0 +1,126 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.governanceprogram.converters; + + +import org.odpi.openmetadata.accessservices.governanceprogram.metadataelements.GovernanceDomainElement; +import org.odpi.openmetadata.accessservices.governanceprogram.properties.GovernanceDomainProperties; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefCategory; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper; + +import java.lang.reflect.InvocationTargetException; + + +/** + * GovernanceDomainConverter provides common methods for transferring relevant properties from an Open Metadata Repository Services (OMRS) + * EntityDetail object into a bean that inherits from GovernanceDomainElement. + */ +public class GovernanceDomainConverter extends GovernanceProgramOMASConverter +{ + /** + * Constructor + * + * @param repositoryHelper helper object to parse entity + * @param serviceName name of this component + * @param serverName local server name + */ + public GovernanceDomainConverter(OMRSRepositoryHelper repositoryHelper, + String serviceName, + String serverName) + { + super(repositoryHelper, serviceName, serverName); + } + + + /** + * Using the supplied instances, return a new instance of the bean. This is used for beans that + * contain a combination of the properties from an entity and that of a connected relationship. + * + * @param beanClass name of the class to create + * @param entity entity containing the properties + * @param methodName calling method + * @return bean populated with properties from the instances supplied + * @throws PropertyServerException there is a problem instantiating the bean + */ + @Override + public B getNewBean(Class beanClass, + EntityDetail entity, + String methodName) throws PropertyServerException + { + try + { + /* + * This is initial confirmation that the generic converter has been initialized with an appropriate bean class. + */ + B returnBean = beanClass.getDeclaredConstructor().newInstance(); + + if (returnBean instanceof GovernanceDomainElement) + { + GovernanceDomainElement bean = (GovernanceDomainElement) returnBean; + + if (entity != null) + { + bean.setElementHeader(this.getMetadataElementHeader(beanClass, entity, entity.getClassifications(), methodName)); + GovernanceDomainProperties governanceDomainProperties = new GovernanceDomainProperties(); + + /* + * The initial set of values come from the entity. + */ + InstanceProperties instanceProperties = new InstanceProperties(entity.getProperties()); + + governanceDomainProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); + governanceDomainProperties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); + governanceDomainProperties.setDisplayName(this.removeDisplayName(instanceProperties)); + governanceDomainProperties.setDescription(this.removeDescription(instanceProperties)); + governanceDomainProperties.setDomainIdentifier(this.removeDomainIdentifier(instanceProperties)); + + /* + * Any remaining properties are returned in the extended properties. They are + * assumed to be defined in a subtype. + */ + governanceDomainProperties.setTypeName(bean.getElementHeader().getType().getTypeName()); + governanceDomainProperties.setExtendedProperties(this.getRemainingExtendedProperties(instanceProperties)); + + bean.setProperties(governanceDomainProperties); + } + else + { + handleMissingMetadataInstance(beanClass.getName(), TypeDefCategory.ENTITY_DEF, methodName); + } + } + + return returnBean; + } + catch (IllegalAccessException | InstantiationException | ClassCastException | NoSuchMethodException | InvocationTargetException error) + { + super.handleInvalidBeanClass(beanClass.getName(), error, methodName); + } + + return null; + } + + + /** + * Using the supplied instances, return a new instance of the bean. This is used for beans that + * contain a combination of the properties from an entity and that of a connected relationship. + * + * @param beanClass name of the class to create + * @param entity entity containing the properties + * @param relationship relationship containing the properties + * @param methodName calling method + * @return bean populated with properties from the instances supplied + * @throws PropertyServerException there is a problem instantiating the bean + */ + @Override + public B getNewBean(Class beanClass, + EntityDetail entity, + Relationship relationship, + String methodName) throws PropertyServerException + { + return getNewBean(beanClass, entity, methodName); + } +} diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/GovernanceDomainSetConverter.java b/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/GovernanceDomainSetConverter.java new file mode 100644 index 00000000000..f1bffbe79b1 --- /dev/null +++ b/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/GovernanceDomainSetConverter.java @@ -0,0 +1,104 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.governanceprogram.converters; + + +import org.odpi.openmetadata.accessservices.governanceprogram.metadataelements.GovernanceDomainSetElement; +import org.odpi.openmetadata.accessservices.governanceprogram.properties.GovernanceDomainSetProperties; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefCategory; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper; + +import java.lang.reflect.InvocationTargetException; + + +/** + * GovernanceDomainSetConverter provides common methods for transferring relevant properties from an Open Metadata Repository Services (OMRS) + * EntityDetail object into a bean that inherits from GovernanceDomainSetElement. + */ +public class GovernanceDomainSetConverter extends GovernanceProgramOMASConverter +{ + /** + * Constructor + * + * @param repositoryHelper helper object to parse entity + * @param serviceName name of this component + * @param serverName local server name + */ + public GovernanceDomainSetConverter(OMRSRepositoryHelper repositoryHelper, + String serviceName, + String serverName) + { + super(repositoryHelper, serviceName, serverName); + } + + + /** + * Using the supplied entity, return a new instance of the bean. This is used for most beans that have + * a one to one correspondence with the repository instances. + * + * @param beanClass name of the class to create + * @param entity entity containing the properties + * @param methodName calling method + * @return bean populated with properties from the entity supplied + * @throws PropertyServerException there is a problem instantiating the bean + */ + @SuppressWarnings(value = "unused") + public B getNewBean(Class beanClass, + EntityDetail entity, + String methodName) throws PropertyServerException + { + try + { + /* + * This is initial confirmation that the generic converter has been initialized with an appropriate bean class. + */ + B returnBean = beanClass.getDeclaredConstructor().newInstance(); + + if (returnBean instanceof GovernanceDomainSetElement) + { + GovernanceDomainSetElement bean = (GovernanceDomainSetElement) returnBean; + + if (entity != null) + { + bean.setElementHeader(this.getMetadataElementHeader(beanClass, entity, entity.getClassifications(), methodName)); + + /* + * The initial set of values come from the entity. + */ + InstanceProperties instanceProperties = new InstanceProperties(entity.getProperties()); + + GovernanceDomainSetProperties governanceDomainSetProperties = new GovernanceDomainSetProperties(); + + governanceDomainSetProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); + governanceDomainSetProperties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); + governanceDomainSetProperties.setDisplayName(this.removeName(instanceProperties)); + governanceDomainSetProperties.setDescription(this.removeDescription(instanceProperties)); + + /* + * Any remaining properties are returned in the extended properties. They are + * assumed to be defined in a subtype. + */ + governanceDomainSetProperties.setTypeName(bean.getElementHeader().getType().getTypeName()); + governanceDomainSetProperties.setExtendedProperties(this.getRemainingExtendedProperties(instanceProperties)); + + bean.setProperties(governanceDomainSetProperties); + } + else + { + handleMissingMetadataInstance(beanClass.getName(), TypeDefCategory.ENTITY_DEF, methodName); + } + } + + return returnBean; + } + catch (IllegalAccessException | InstantiationException | ClassCastException | NoSuchMethodException | InvocationTargetException error) + { + super.handleInvalidBeanClass(beanClass.getName(), error, methodName); + } + + return null; + } +} diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/GovernanceRoleConverter.java b/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/GovernanceRoleConverter.java index 415a8c909b6..3daeaa6a6ea 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/GovernanceRoleConverter.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/GovernanceRoleConverter.java @@ -38,7 +38,7 @@ public GovernanceRoleConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -74,7 +74,8 @@ public B getNewBean(Class beanClass, InstanceProperties instanceProperties = new InstanceProperties(entity.getProperties()); governanceRoleProperties.setDomainIdentifier(this.removeDomainIdentifier(instanceProperties)); - governanceRoleProperties.setRoleId(this.removeQualifiedName(instanceProperties)); + governanceRoleProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); + governanceRoleProperties.setRoleId(this.removeIdentifier(instanceProperties)); governanceRoleProperties.setScope(this.removeScope(instanceProperties)); governanceRoleProperties.setTitle(this.removeName(instanceProperties)); governanceRoleProperties.setDescription(this.removeDescription(instanceProperties)); diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/GovernanceZoneConverter.java b/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/GovernanceZoneConverter.java index 573c18dc687..f5dfcdb64ab 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/GovernanceZoneConverter.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/GovernanceZoneConverter.java @@ -35,7 +35,7 @@ public GovernanceZoneConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -71,6 +71,7 @@ public B getNewBean(Class beanClass, InstanceProperties instanceProperties = new InstanceProperties(entity.getProperties()); governanceZoneProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); + governanceZoneProperties.setZoneName(this.removeZoneName(instanceProperties)); governanceZoneProperties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); governanceZoneProperties.setDisplayName(this.removeDisplayName(instanceProperties)); governanceZoneProperties.setDescription(this.removeDescription(instanceProperties)); @@ -105,7 +106,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/ProfileConverter.java b/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/ProfileConverter.java index fce71353f85..7db1adaf85e 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/ProfileConverter.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/ProfileConverter.java @@ -23,7 +23,7 @@ import java.util.List; /** - * PersonalProfileConverter generates a PersonalProfileProperties bean from a PersonalProfileProperties entity. + * ProfileConverter generates a ProfileElement bean from a ActorProfileProperties entity. */ public class ProfileConverter extends GovernanceProgramOMASConverter { @@ -71,7 +71,7 @@ public B getNewComplexBean(Class beanClass, if (returnBean instanceof ProfileElement) { - ProfileElement bean = (ProfileElement) returnBean; + ProfileElement bean = (ProfileElement) returnBean; ActorProfileProperties profileProperties = new ActorProfileProperties(); if (primaryEntity != null) @@ -118,6 +118,7 @@ public B getNewComplexBean(Class beanClass, InstanceProperties entityProperties = new InstanceProperties(entity.getProperties()); userProperties.setQualifiedName(this.removeQualifiedName(entityProperties)); + userProperties.setUserId(this.removeUserId(entityProperties)); userProperties.setDistinguishedName(this.removeDistinguishedName(entityProperties)); userProperties.setAdditionalProperties(this.removeAdditionalProperties(entityProperties)); @@ -137,11 +138,14 @@ else if (repositoryHelper.isTypeOf(serviceName, entityTypeName, OpenMetadataAPIM InstanceProperties entityProperties = new InstanceProperties(entity.getProperties()); - contactMethodProperties.setQualifiedName(this.removeQualifiedName(entityProperties)); - contactMethodProperties.setAdditionalProperties(this.removeAdditionalProperties(entityProperties)); - contactMethodProperties.setType(this.getContactMethodTypeFromProperties(entityProperties)); - contactMethodProperties.setService(this.removeContactMethodService(entityProperties)); - contactMethodProperties.setValue(this.removeContactMethodValue(entityProperties)); + contactMethodProperties.setName(this.removeName(entityProperties)); + contactMethodProperties.setContactType(this.removeContactType(entityProperties)); + contactMethodProperties.setContactMethodType(this.getContactMethodTypeFromProperties(entityProperties)); + contactMethodProperties.setContactMethodService(this.removeContactMethodService(entityProperties)); + contactMethodProperties.setContactMethodValue(this.removeContactMethodValue(entityProperties)); + + contactMethodProperties.setEffectiveFrom(entityProperties.getEffectiveFromTime()); + contactMethodProperties.setEffectiveTo(entityProperties.getEffectiveToTime()); contactMethodProperties.setTypeName(bean.getElementHeader().getType().getTypeName()); contactMethodProperties.setExtendedProperties(this.getRemainingExtendedProperties(entityProperties)); diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/SubjectAreaConverter.java b/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/SubjectAreaConverter.java index dff0875dc5e..7c91669f2ea 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/SubjectAreaConverter.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/converters/SubjectAreaConverter.java @@ -37,7 +37,7 @@ public SubjectAreaConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -73,6 +73,7 @@ public B getNewBean(Class beanClass, InstanceProperties instanceProperties = new InstanceProperties(entity.getProperties()); subjectAreaProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); + subjectAreaProperties.setSubjectAreaName(this.removeSubjectAreaName(instanceProperties)); subjectAreaProperties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); subjectAreaProperties.setDisplayName(this.removeDisplayName(instanceProperties)); subjectAreaProperties.setDescription(this.removeDescription(instanceProperties)); @@ -107,7 +108,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/GovernanceDomainRESTServices.java b/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/GovernanceDomainRESTServices.java new file mode 100644 index 00000000000..493a642bf65 --- /dev/null +++ b/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/GovernanceDomainRESTServices.java @@ -0,0 +1,1117 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.governanceprogram.server; + +import org.odpi.openmetadata.accessservices.governanceprogram.metadataelements.GovernanceDomainElement; +import org.odpi.openmetadata.accessservices.governanceprogram.metadataelements.GovernanceDomainSetElement; +import org.odpi.openmetadata.accessservices.governanceprogram.properties.GovernanceDomainProperties; +import org.odpi.openmetadata.accessservices.governanceprogram.properties.GovernanceDomainSetProperties; +import org.odpi.openmetadata.accessservices.governanceprogram.rest.GovernanceDomainListResponse; +import org.odpi.openmetadata.accessservices.governanceprogram.rest.GovernanceDomainResponse; +import org.odpi.openmetadata.accessservices.governanceprogram.rest.GovernanceDomainSetListResponse; +import org.odpi.openmetadata.accessservices.governanceprogram.rest.GovernanceDomainSetResponse; +import org.odpi.openmetadata.commonservices.ffdc.RESTCallLogger; +import org.odpi.openmetadata.commonservices.ffdc.RESTCallToken; +import org.odpi.openmetadata.commonservices.ffdc.RESTExceptionHandler; +import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDResponse; +import org.odpi.openmetadata.commonservices.ffdc.rest.NameRequestBody; +import org.odpi.openmetadata.commonservices.ffdc.rest.NullRequestBody; +import org.odpi.openmetadata.commonservices.ffdc.rest.SearchStringRequestBody; +import org.odpi.openmetadata.commonservices.ffdc.rest.VoidResponse; + +import org.odpi.openmetadata.commonservices.generichandlers.CollectionHandler; +import org.odpi.openmetadata.commonservices.generichandlers.GovernanceDomainHandler; +import org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIMapper; +import org.odpi.openmetadata.frameworks.auditlog.AuditLog; +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; +import org.slf4j.LoggerFactory; + +import java.util.Date; +import java.util.List; + + +/** + * GovernanceDomainRESTServices sets up the governance domains that are part of an organization governance. + * Each governance domain describes a focus for governance. + */ +public class GovernanceDomainRESTServices +{ + private static final GovernanceProgramInstanceHandler instanceHandler = new GovernanceProgramInstanceHandler(); + + private static final RESTCallLogger restCallLogger = new RESTCallLogger(LoggerFactory.getLogger(GovernanceDomainRESTServices.class), + instanceHandler.getServiceName()); + + private final RESTExceptionHandler restExceptionHandler = new RESTExceptionHandler(); + + /** + * Default constructor + */ + public GovernanceDomainRESTServices() + { + } + + + /* ===================================================================================================================== + * The GovernanceDomainSet entity is the top level element in a collection of related governance domains. + */ + + + /** + * Create a new metadata element to represent the root of a Governance Domain Set. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param properties properties to store + * + * @return unique identifier of the new metadata element or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public GUIDResponse createGovernanceDomainSet(String serverName, + String userId, + GovernanceDomainSetProperties properties) + { + final String methodName = "createGovernanceDomainSet"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + GUIDResponse response = new GUIDResponse(); + AuditLog auditLog = null; + + try + { + if (properties != null) + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + CollectionHandler handler = instanceHandler.getGovernanceDomainSetHandler(userId, serverName, methodName); + + String setGUID = handler.createCollection(userId, + null, + null, + properties.getQualifiedName(), + properties.getDisplayName(), + properties.getDescription(), + properties.getAdditionalProperties(), + properties.getTypeName(), + properties.getExtendedProperties(), + OpenMetadataAPIMapper.GOVERNANCE_DOMAIN_SET_CLASSIFICATION_NAME, + null, + null, + new Date(), + methodName); + + response.setGUID(setGUID); + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Update the metadata element representing a Governance Domain Set. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param governanceDomainSetGUID unique identifier of the metadata element to remove + * @param properties new properties for this element + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse updateGovernanceDomainSet(String serverName, + String userId, + String governanceDomainSetGUID, + GovernanceDomainSetProperties properties) + { + final String methodName = "updateGovernanceDomainSet"; + final String guidParameter = "governanceDomainSetGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + if (properties != null) + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + CollectionHandler handler = instanceHandler.getGovernanceDomainSetHandler(userId, serverName, methodName); + + handler.updateCollection(userId, + null, + null, + governanceDomainSetGUID, + guidParameter, + properties.getQualifiedName(), + properties.getDisplayName(), + properties.getDescription(), + properties.getAdditionalProperties(), + properties.getTypeName(), + properties.getExtendedProperties(), + null, + null, + false, + false, + false, + new Date(), + methodName); + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Remove the metadata element representing a governanceDomainSet. The governance domains are not deleted. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param governanceDomainSetGUID unique identifier of the metadata element to remove + * @param requestBody null request body + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @SuppressWarnings(value = "unused") + public VoidResponse removeGovernanceDomainSet(String serverName, + String userId, + String governanceDomainSetGUID, + NullRequestBody requestBody) + { + final String methodName = "removeGovernanceDomainSet"; + final String guidParameter = "governanceDomainSetGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + CollectionHandler setHandler = instanceHandler.getGovernanceDomainSetHandler(userId, serverName, methodName); + + setHandler.removeCollection(userId, + null, + null, + governanceDomainSetGUID, + guidParameter, + false, + false, + new Date(), + methodName); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Retrieve the list of governanceDomainSet metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param requestBody string to find in the properties + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public GovernanceDomainSetListResponse findGovernanceDomainSets(String serverName, + String userId, + int startFrom, + int pageSize, + SearchStringRequestBody requestBody) + { + final String methodName = "findGovernanceDomainSets"; + final String searchStringParameterName = "searchString"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + GovernanceDomainSetListResponse response = new GovernanceDomainSetListResponse(); + AuditLog auditLog = null; + + try + { + if (requestBody != null) + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + CollectionHandler handler = instanceHandler.getGovernanceDomainSetHandler(userId, serverName, methodName); + + List sets = handler.findCollections(userId, + requestBody.getSearchString(), + searchStringParameterName, + startFrom, + pageSize, + false, + false, + new Date(), + methodName); + + this.addDomainsToSets(userId, sets, instanceHandler.getGovernanceDomainHandler(userId, serverName, methodName), methodName); + + response.setElements(sets); + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Retrieve the list of governanceDomainSet metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param requestBody name to search for + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public GovernanceDomainSetListResponse getGovernanceDomainSetsByName(String serverName, + String userId, + int startFrom, + int pageSize, + NameRequestBody requestBody) + { + final String methodName = "getGovernanceDomainSetsByName"; + final String nameParameterName = "name"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + GovernanceDomainSetListResponse response = new GovernanceDomainSetListResponse(); + AuditLog auditLog = null; + + try + { + if (requestBody != null) + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + CollectionHandler handler = instanceHandler.getGovernanceDomainSetHandler(userId, serverName, methodName); + + List sets = handler.findCollections(userId, + requestBody.getName(), + nameParameterName, + startFrom, + pageSize, + false, + false, + new Date(), + methodName); + + this.addDomainsToSets(userId, sets, instanceHandler.getGovernanceDomainHandler(userId, serverName, methodName), methodName); + + response.setElements(sets); + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Retrieve the governanceDomainSet metadata element with the supplied unique identifier. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param governanceDomainSetGUID unique identifier of the requested metadata element + * + * @return matching metadata element or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public GovernanceDomainSetResponse getGovernanceDomainSetByGUID(String serverName, + String userId, + String governanceDomainSetGUID) + { + final String methodName = "getGovernanceDomainSetByGUID"; + final String guidParameterName = "governanceDomainSetGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + GovernanceDomainSetResponse response = new GovernanceDomainSetResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + CollectionHandler handler = instanceHandler.getGovernanceDomainSetHandler(userId, serverName, methodName); + + GovernanceDomainSetElement set = handler.getCollectionByGUID(userId, + governanceDomainSetGUID, + guidParameterName, + false, + false, + new Date(), + methodName); + + this.addDomainsToSet(userId, set, instanceHandler.getGovernanceDomainHandler(userId, serverName, methodName), methodName); + + response.setElement(set); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /* ===================================================================================================================== + * A Governance Domain describes an area of focus in the governance program. + */ + + /** + * Create a new metadata element to represent a governance domain. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param setGUID unique identifier of the set that this identifier belongs + * @param properties properties about the Governance Domain to store + * + * @return unique identifier of the new Governance Domain or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public GUIDResponse createGovernanceDomain(String serverName, + String userId, + String setGUID, + GovernanceDomainProperties properties) + { + final String methodName = "createGovernanceDomain"; + final String setGUIDParameter = "setGUID"; + final String domainGUIDParameter = "domainGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + GUIDResponse response = new GUIDResponse(); + AuditLog auditLog = null; + + try + { + if (properties != null) + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + GovernanceDomainHandler domainHandler = instanceHandler.getGovernanceDomainHandler(userId, serverName, methodName); + + String domainGUID = domainHandler.createGovernanceDomain(userId, + properties.getQualifiedName(), + properties.getDisplayName(), + properties.getDescription(), + properties.getDomainIdentifier(), + properties.getAdditionalProperties(), + properties.getTypeName(), + properties.getExtendedProperties(), + new Date(), + methodName); + + if (domainGUID != null) + { + CollectionHandler setHandler = instanceHandler.getGovernanceDomainSetHandler(userId, serverName, methodName); + + setHandler.addMemberToCollection(userId, + null, + null, + setGUID, + setGUIDParameter, + domainGUID, + domainGUIDParameter, + null, + null, + null, + false, + false, + new Date(), + methodName); + } + + response.setGUID(domainGUID); + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Update the metadata element representing a Governance Domain. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param governanceDomainGUID unique identifier of the metadata element to update + * @param properties new properties for the metadata element + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse updateGovernanceDomain(String serverName, + String userId, + String governanceDomainGUID, + GovernanceDomainProperties properties) + { + final String methodName = "updateGovernanceDomain"; + final String guidParameter = "governanceDomainGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + if (properties != null) + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + GovernanceDomainHandler domainHandler = instanceHandler.getGovernanceDomainHandler(userId, serverName, methodName); + + domainHandler.updateGovernanceDomain(userId, + governanceDomainGUID, + guidParameter, + properties.getQualifiedName(), + properties.getDisplayName(), + properties.getDescription(), + properties.getDomainIdentifier(), + properties.getAdditionalProperties(), + properties.getTypeName(), + properties.getExtendedProperties(), + methodName); + + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Remove the metadata element representing a Governance Domain. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param governanceDomainGUID unique identifier of the metadata element to remove + * @param requestBody null request body + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @SuppressWarnings(value = "unused") + public VoidResponse deleteGovernanceDomain(String serverName, + String userId, + String governanceDomainGUID, + NullRequestBody requestBody) + { + final String methodName = "deleteGovernanceDomain"; + + final String guidParameter = "governanceDomainGUID"; + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + GovernanceDomainHandler domainHandler = instanceHandler.getGovernanceDomainHandler(userId, serverName, methodName); + + domainHandler.removeGovernanceDomain(userId, governanceDomainGUID, guidParameter, methodName); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + + /** + * Create a parent-child relationship between a governance domain set and a governance domain. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param governanceDomainSetGUID unique identifier of the governance domain set + * @param governanceDomainGUID unique identifier of the governance domain + * @param requestBody null request body + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @SuppressWarnings(value = "unused") + + public VoidResponse addDomainToSet(String serverName, + String userId, + String governanceDomainSetGUID, + String governanceDomainGUID, + NullRequestBody requestBody) + { + final String methodName = "addDomainToSet"; + + final String guid1Parameter = "governanceDomainSetGUID"; + final String guid2Parameter = "governanceDomainGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + CollectionHandler setHandler = instanceHandler.getGovernanceDomainSetHandler(userId, serverName, methodName); + + setHandler.addMemberToCollection(userId, + null, + null, + governanceDomainSetGUID, + guid1Parameter, + governanceDomainGUID, + guid2Parameter, + null, + null, + null, + false, + false, + new Date(), + methodName); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Remove a parent-child relationship between a governance domain set and a governance domain. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param governanceDomainSetGUID unique identifier of the governance domain set + * @param governanceDomainGUID unique identifier of the governance domain + * @param requestBody null request body + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @SuppressWarnings(value = "unused") + public VoidResponse removeDomainFromSet(String serverName, + String userId, + String governanceDomainSetGUID, + String governanceDomainGUID, + NullRequestBody requestBody) + { + final String methodName = "removeDomainFromSet"; + + final String guid1Parameter = "governanceDomainSetGUID"; + final String guid2Parameter = "governanceDomainGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + CollectionHandler setHandler = instanceHandler.getGovernanceDomainSetHandler(userId, serverName, methodName); + + setHandler.removeMemberFromCollection(userId, + null, + null, + governanceDomainSetGUID, + guid1Parameter, + governanceDomainGUID, + guid2Parameter, + false, + false, + new Date(), + methodName); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Retrieve the list of Governance Domain metadata elements defined for the governance program. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public GovernanceDomainListResponse getGovernanceDomains(String serverName, + String userId, + int startFrom, + int pageSize) + { + final String methodName = "getGovernanceDomains"; + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + GovernanceDomainListResponse response = new GovernanceDomainListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + GovernanceDomainHandler domainHandler = instanceHandler.getGovernanceDomainHandler(userId, + serverName, + methodName); + + response.setElements(domainHandler.getBeansByType(userId, + OpenMetadataAPIMapper.GOVERNANCE_DOMAIN_TYPE_GUID, + OpenMetadataAPIMapper.GOVERNANCE_DOMAIN_TYPE_NAME, + null, + startFrom, + pageSize, + false, + false, + new Date(), + methodName)); + + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Retrieve the list of Governance Domain metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param requestBody string to find in the properties + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public GovernanceDomainListResponse findGovernanceDomains(String serverName, + String userId, + int startFrom, + int pageSize, + SearchStringRequestBody requestBody) + { + final String methodName = "findGovernanceDomains"; + final String searchStringParameterName = "searchString"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + GovernanceDomainListResponse response = new GovernanceDomainListResponse(); + AuditLog auditLog = null; + + try + { + if (requestBody != null) + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + GovernanceDomainHandler domainHandler = instanceHandler.getGovernanceDomainHandler(userId, + serverName, + methodName); + + response.setElements(domainHandler.findGovernanceDomains(userId, + requestBody.getSearchString(), + searchStringParameterName, + startFrom, + pageSize, + methodName)); + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Return the list of governance domain sets that a governance domain belong. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param governanceDomainGUID unique identifier of the governance domain to query + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of metadata elements describing the sets associated with the requested governanceDomainSet or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public GovernanceDomainSetListResponse getSetsForGovernanceDomain(String serverName, + String userId, + String governanceDomainGUID, + int startFrom, + int pageSize) + { + final String methodName = "getSetsForGovernanceDomain"; + + final String guidParameterName = "governanceDomainGUID"; + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + GovernanceDomainSetListResponse response = new GovernanceDomainSetListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + CollectionHandler handler = instanceHandler.getGovernanceDomainSetHandler(userId, serverName, methodName); + + List sets = handler.getAttachedElements(userId, + governanceDomainGUID, + guidParameterName, + OpenMetadataAPIMapper.GOVERNANCE_DOMAIN_TYPE_NAME, + OpenMetadataAPIMapper.COLLECTION_MEMBERSHIP_TYPE_GUID, + OpenMetadataAPIMapper.COLLECTION_MEMBERSHIP_TYPE_NAME, + OpenMetadataAPIMapper.COLLECTION_TYPE_NAME, + null, + null, + 1, + false, + false, + startFrom, + pageSize, + new Date(), + methodName); + + this.addDomainsToSets(userId, sets, instanceHandler.getGovernanceDomainHandler(userId, serverName, methodName), methodName); + + response.setElements(sets); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Add the linked domains to each Governance Domain Set in the list. + * + * @param userId calling user + * @param sets sets to update + * @param domainHandler handler to request the domain information from + * @param methodName calling method + * + * @throws InvalidParameterException the input properties are invalid + * @throws UserNotAuthorizedException user not authorized to issue this request + * @throws PropertyServerException problem accessing the property server + */ + private void addDomainsToSets(String userId, + List sets, + GovernanceDomainHandler domainHandler, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + if (sets != null) + { + for (GovernanceDomainSetElement setElement : sets) + { + addDomainsToSet(userId, setElement, domainHandler, methodName); + } + } + } + + + /** + * Add the linked domains to a Governance Domain Set. + * + * @param userId calling user + * @param set set to update + * @param domainHandler handler to request the domain information from + * @param methodName calling method + * + * @throws InvalidParameterException the input properties are invalid + * @throws UserNotAuthorizedException user not authorized to issue this request + * @throws PropertyServerException problem accessing the property server + */ + private void addDomainsToSet(String userId, + GovernanceDomainSetElement set, + GovernanceDomainHandler domainHandler, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + final String guidParameterName = "set.getElementHeader().getGUID()"; + + List domains = domainHandler.getDomainsInSet(userId, + set.getElementHeader().getGUID(), + guidParameterName, + 0, + 0, + false, + false, + new Date(), + methodName); + + set.setDomains(domains); + } + + + /** + * Retrieve the list of Governance Domain metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param requestBody name to search for + * + * @return list of matching metadata elements + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public GovernanceDomainListResponse getGovernanceDomainsByName(String serverName, + String userId, + int startFrom, + int pageSize, + NameRequestBody requestBody) + { + final String methodName = "getGovernanceDomainsByName"; + final String nameParameterName = "name"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + GovernanceDomainListResponse response = new GovernanceDomainListResponse(); + AuditLog auditLog = null; + + try + { + if (requestBody != null) + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + GovernanceDomainHandler domainHandler = instanceHandler.getGovernanceDomainHandler(userId, + serverName, + methodName); + + response.setElements(domainHandler.getGovernanceDomainsByName(userId, + requestBody.getName(), + nameParameterName, + startFrom, + pageSize, + methodName)); + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Retrieve the Governance Domain metadata element with the supplied unique identifier assigned when the domain description was stored in + * the metadata repository. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param governanceDomainGUID unique identifier of the requested metadata element + * + * @return requested metadata element or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public GovernanceDomainResponse getGovernanceDomainByGUID(String serverName, + String userId, + String governanceDomainGUID) + { + final String methodName = "getGovernanceDomainByGUID"; + final String guidParameterName = "governanceDomainGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + GovernanceDomainResponse response = new GovernanceDomainResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + GovernanceDomainHandler domainHandler = instanceHandler.getGovernanceDomainHandler(userId, serverName, methodName); + + response.setElement(domainHandler.getGovernanceDomainByGUID(userId, governanceDomainGUID, guidParameterName, methodName)); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Retrieve the Governance Domain metadata element with the supplied domain identifier. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param domainIdentifier identifier used to identify the domain + * + * @return requested metadata element or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public GovernanceDomainResponse getGovernanceDomainByIdentifier(String serverName, + String userId, + int domainIdentifier) + { + final String methodName = "getGovernanceDomainByIdentifier"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + GovernanceDomainResponse response = new GovernanceDomainResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + GovernanceDomainHandler domainHandler = instanceHandler.getGovernanceDomainHandler(userId, serverName, methodName); + + response.setElement(domainHandler.getGovernanceDomainByDomainIdentifier(userId, domainIdentifier, methodName)); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } +} diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/GovernanceProgramInstanceHandler.java b/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/GovernanceProgramInstanceHandler.java index c0695b6842f..ed1798d9b10 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/GovernanceProgramInstanceHandler.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/GovernanceProgramInstanceHandler.java @@ -148,6 +148,64 @@ GovernanceDefinitionHandler getGovernanceDefinition } + + /** + * Retrieve a specific handler for the access service. + * + * @param userId calling user + * @param serverName name of the server tied to the request + * @param serviceOperationName name of the REST API call (typically the top-level methodName) + * @return handler for use by the requested instance + * @throws InvalidParameterException no available instance for the requested server + * @throws UserNotAuthorizedException user does not have access to the requested server + * @throws PropertyServerException the service name is not known - indicating a logic error + */ + GovernanceDomainHandler getGovernanceDomainHandler(String userId, + String serverName, + String serviceOperationName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + GovernanceProgramServicesInstance instance = (GovernanceProgramServicesInstance) super.getServerServiceInstance(userId, serverName, serviceOperationName); + + if (instance != null) + { + return instance.getGovernanceDomainHandler(); + } + + return null; + } + + + + /** + * Retrieve a specific handler for the access service. + * + * @param userId calling user + * @param serverName name of the server tied to the request + * @param serviceOperationName name of the REST API call (typically the top-level methodName) + * @return handler for use by the requested instance + * @throws InvalidParameterException no available instance for the requested server + * @throws UserNotAuthorizedException user does not have access to the requested server + * @throws PropertyServerException the service name is not known - indicating a logic error + */ + CollectionHandler getGovernanceDomainSetHandler(String userId, + String serverName, + String serviceOperationName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + GovernanceProgramServicesInstance instance = (GovernanceProgramServicesInstance) super.getServerServiceInstance(userId, serverName, serviceOperationName); + + if (instance != null) + { + return instance.getGovernanceDomainSetHandler(); + } + + return null; + } + + /** * Retrieve a specific handler for the access service. * diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/GovernanceProgramServicesInstance.java b/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/GovernanceProgramServicesInstance.java index a35a14d80ba..3f6245df173 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/GovernanceProgramServicesInstance.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/GovernanceProgramServicesInstance.java @@ -21,15 +21,17 @@ */ public class GovernanceProgramServicesInstance extends OMASServiceInstance { - private static AccessServiceDescription myDescription = AccessServiceDescription.GOVERNANCE_PROGRAM_OMAS; - - private ElementStubConverter elementStubConverter; - private GovernanceZoneHandler governanceZoneHandler; - private PersonRoleHandler governanceRoleHandler; - private ActorProfileHandler profileHandler; - private ExternalReferenceHandler externalReferenceHandler; - private GovernanceDefinitionHandler governanceDefinitionHandler; - private SubjectAreaHandler subjectAreaHandler; + private final static AccessServiceDescription myDescription = AccessServiceDescription.GOVERNANCE_PROGRAM_OMAS; + + private final ElementStubConverter elementStubConverter; + private final GovernanceZoneHandler governanceZoneHandler; + private final PersonRoleHandler governanceRoleHandler; + private final ActorProfileHandler profileHandler; + private final ExternalReferenceHandler externalReferenceHandler; + private final GovernanceDefinitionHandler governanceDefinitionHandler; + private final CollectionHandler governanceDomainSetHandler; + private final GovernanceDomainHandler governanceDomainHandler; + private final SubjectAreaHandler subjectAreaHandler; private AppointmentHandler appointmentHandler; @@ -117,6 +119,34 @@ public GovernanceProgramServicesInstance(OMRSRepositoryConnector repositoryConne publishZones, auditLog); + this.governanceDomainHandler = new GovernanceDomainHandler<>(new GovernanceDomainConverter<>(repositoryHelper, serviceName, serverName), + GovernanceDomainElement.class, + serviceName, + serverName, + invalidParameterHandler, + repositoryHandler, + repositoryHelper, + localServerUserId, + securityVerifier, + supportedZones, + defaultZones, + publishZones, + auditLog); + + this.governanceDomainSetHandler = new CollectionHandler<>(new GovernanceDomainSetConverter<>(repositoryHelper, serviceName, serverName), + GovernanceDomainSetElement.class, + serviceName, + serverName, + invalidParameterHandler, + repositoryHandler, + repositoryHelper, + localServerUserId, + securityVerifier, + supportedZones, + defaultZones, + publishZones, + auditLog); + this.subjectAreaHandler = new SubjectAreaHandler<>(new SubjectAreaConverter<>(repositoryHelper, serviceName, serverName), SubjectAreaElement.class, serviceName, @@ -228,6 +258,28 @@ GovernanceDefinitionHandler getGovernanceDefinition } + /** + * Return the handler for governance domains requests. + * + * @return handler object + */ + GovernanceDomainHandler getGovernanceDomainHandler() + { + return governanceDomainHandler; + } + + + /** + * Return the handler for governance domain sets requests. + * + * @return handler object + */ + CollectionHandler getGovernanceDomainSetHandler() + { + return governanceDomainSetHandler; + } + + /** * Return the handler for governance definition requests. * diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/GovernanceRolesRESTServices.java b/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/GovernanceRolesRESTServices.java index 42b7139ebe5..d2bfbd17469 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/GovernanceRolesRESTServices.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/GovernanceRolesRESTServices.java @@ -97,12 +97,14 @@ public GUIDResponse createGovernanceRole(String serverName, response.setGUID(handler.createPersonRole(userId, null, null, + requestBody.getQualifiedName(), requestBody.getRoleId(), requestBody.getTitle(), requestBody.getDescription(), requestBody.getScope(), requestBody.getHeadCount(), requestBody.getHeadCountLimitSet(), + requestBody.getDomainIdentifier(), requestBody.getAdditionalProperties(), typeName, extendedProperties, @@ -182,14 +184,16 @@ public VoidResponse updateGovernanceRole(String serverName, null, governanceRoleGUID, governanceRoleGUIDParameterName, - requestBody.getRoleId(), + requestBody.getQualifiedName(), roleIdParameterName, + requestBody.getRoleId(), requestBody.getTitle(), titleParameterName, requestBody.getDescription(), requestBody.getScope(), requestBody.getHeadCount(), requestBody.getHeadCountLimitSet(), + requestBody.getDomainIdentifier(), requestBody.getAdditionalProperties(), requestBody.getTypeName(), extendedProperties, diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/GovernanceZoneRESTServices.java b/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/GovernanceZoneRESTServices.java index d9af3ad589b..9756a6ed3a9 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/GovernanceZoneRESTServices.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/GovernanceZoneRESTServices.java @@ -88,6 +88,7 @@ public GUIDResponse createGovernanceZone(String serverName, null, null, requestBody.getQualifiedName(), + requestBody.getZoneName(), requestBody.getDisplayName(), requestBody.getDescription(), requestBody.getCriteria(), @@ -157,6 +158,7 @@ public VoidResponse updateGovernanceZone(String serverName, zoneGUID, guidParameter, requestBody.getQualifiedName(), + requestBody.getZoneName(), requestBody.getDisplayName(), requestBody.getDescription(), requestBody.getCriteria(), diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/SubjectAreaRESTServices.java b/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/SubjectAreaRESTServices.java index c56114bb062..b7501712a3f 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/SubjectAreaRESTServices.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-server/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/SubjectAreaRESTServices.java @@ -85,6 +85,7 @@ public GUIDResponse createSubjectArea(String serverName, null, null, requestBody.getQualifiedName(), + requestBody.getSubjectAreaName(), requestBody.getDisplayName(), requestBody.getDescription(), requestBody.getUsage(), @@ -154,6 +155,7 @@ public VoidResponse updateSubjectArea(String serverName, subjectAreaGUID, guidParameter, requestBody.getQualifiedName(), + requestBody.getSubjectAreaName(), requestBody.getDisplayName(), requestBody.getDescription(), requestBody.getUsage(), diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-spring/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/spring/GovernanceDomainsResource.java b/open-metadata-implementation/access-services/governance-program/governance-program-spring/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/spring/GovernanceDomainsResource.java new file mode 100644 index 00000000000..be56f296b4d --- /dev/null +++ b/open-metadata-implementation/access-services/governance-program/governance-program-spring/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/spring/GovernanceDomainsResource.java @@ -0,0 +1,488 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.governanceprogram.server.spring; + +import io.swagger.v3.oas.annotations.ExternalDocumentation; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.odpi.openmetadata.accessservices.governanceprogram.properties.GovernanceDomainProperties; +import org.odpi.openmetadata.accessservices.governanceprogram.properties.GovernanceDomainSetProperties; +import org.odpi.openmetadata.accessservices.governanceprogram.rest.GovernanceDomainListResponse; +import org.odpi.openmetadata.accessservices.governanceprogram.rest.GovernanceDomainResponse; +import org.odpi.openmetadata.accessservices.governanceprogram.rest.GovernanceDomainSetListResponse; +import org.odpi.openmetadata.accessservices.governanceprogram.rest.GovernanceDomainSetResponse; +import org.odpi.openmetadata.accessservices.governanceprogram.server.GovernanceDomainRESTServices; +import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDResponse; +import org.odpi.openmetadata.commonservices.ffdc.rest.NameRequestBody; +import org.odpi.openmetadata.commonservices.ffdc.rest.NullRequestBody; +import org.odpi.openmetadata.commonservices.ffdc.rest.SearchStringRequestBody; +import org.odpi.openmetadata.commonservices.ffdc.rest.VoidResponse; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.RequestBody; + + +/** + * GovernanceDomainRESTServices sets up the governance domains that are part of an organization governance. + * Each governance domain describes a focus for governance. + */ +@RestController +@RequestMapping("/servers/{serverName}/open-metadata/access-services/governance-program/users/{userId}") + +@Tag(name="Governance Program OMAS", description="The Governance Program OMAS provides APIs and events for tools and applications focused on defining a data strategy, planning support for a regulation and/or developing a governance program for the data landscape." + + "\n", + externalDocs=@ExternalDocumentation(description="Governance Program Open Metadata Access Service (OMAS)", + url="https://egeria-project.org/services/omas/governance-program/overview/")) + +public class GovernanceDomainsResource +{ + private final GovernanceDomainRESTServices restAPI = new GovernanceDomainRESTServices(); + + /** + * Default constructor + */ + public GovernanceDomainsResource() + { + } + + + /* ===================================================================================================================== + * The GovernanceDomainSet entity is the top level element in a collection of related governance domains. + */ + + + /** + * Create a new metadata element to represent the root of a Governance Domain Set. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param properties properties to store + * + * @return unique identifier of the new metadata element or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/governance-domain-sets") + + public GUIDResponse createGovernanceDomainSet(@PathVariable String serverName, + @PathVariable String userId, + @RequestBody GovernanceDomainSetProperties properties) + { + return restAPI.createGovernanceDomainSet(serverName, userId, properties); + } + + + /** + * Update the metadata element representing a Governance Domain Set. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param governanceDomainSetGUID unique identifier of the metadata element to remove + * @param properties new properties for this element + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/governance-domain-sets/{governanceDomainSetGUID}/update") + + public VoidResponse updateGovernanceDomainSet(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String governanceDomainSetGUID, + @RequestBody GovernanceDomainSetProperties properties) + { + return restAPI.updateGovernanceDomainSet(serverName, userId, governanceDomainSetGUID, properties); + } + + + /** + * Remove the metadata element representing a governanceDomainSet. The governance domains are not deleted. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param governanceDomainSetGUID unique identifier of the metadata element to remove + * @param requestBody null request body + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/governance-domain-sets/{governanceDomainSetGUID}/delete") + + public VoidResponse removeGovernanceDomainSet(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String governanceDomainSetGUID, + @RequestBody(required = false) + NullRequestBody requestBody) + { + return restAPI.removeGovernanceDomainSet(serverName, userId, governanceDomainSetGUID, requestBody); + } + + + /** + * Retrieve the list of governanceDomainSet metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param requestBody string to find in the properties + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/governance-domain-sets/by-search-string") + + public GovernanceDomainSetListResponse findGovernanceDomainSets(@PathVariable String serverName, + @PathVariable String userId, + @RequestParam int startFrom, + @RequestParam int pageSize, + @RequestBody SearchStringRequestBody requestBody) + { + return restAPI.findGovernanceDomainSets(serverName, userId, startFrom, pageSize, requestBody); + } + + + /** + * Retrieve the list of governanceDomainSet metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param requestBody name to search for + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/governance-domain-sets/by-name") + + public GovernanceDomainSetListResponse getGovernanceDomainSetsByName(@PathVariable String serverName, + @PathVariable String userId, + @RequestParam int startFrom, + @RequestParam int pageSize, + @RequestBody NameRequestBody requestBody) + { + return restAPI.getGovernanceDomainSetsByName(serverName, userId, startFrom, pageSize, requestBody); + } + + + + + /** + * Retrieve the governanceDomainSet metadata element with the supplied unique identifier. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param governanceDomainSetGUID unique identifier of the requested metadata element + * + * @return matching metadata element or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @GetMapping(path = "/governance-domain-sets/{governanceDomainSetGUID}") + + public GovernanceDomainSetResponse getGovernanceDomainSetByGUID(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String governanceDomainSetGUID) + { + return restAPI.getGovernanceDomainSetByGUID(serverName, userId, governanceDomainSetGUID); + } + + + /* ===================================================================================================================== + * A Governance Domain describes an area of focus in the governance program. + */ + + /** + * Create a new metadata element to represent a governance domain. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param setGUID unique identifier of the set that this identifier belongs + * @param properties properties about the Governance Domain to store + * + * @return unique identifier of the new Governance Domain or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/governance-domain-sets/{setGUID}/governance-domains") + + public GUIDResponse createGovernanceDomain(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String setGUID, + @RequestBody GovernanceDomainProperties properties) + { + return restAPI.createGovernanceDomain(serverName, userId, setGUID, properties); + } + + + /** + * Update the metadata element representing a Governance Domain. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param governanceDomainGUID unique identifier of the metadata element to update + * @param properties new properties for the metadata element + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/governance-domains/{governanceDomainGUID}/update") + + public VoidResponse updateGovernanceDomain(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String governanceDomainGUID, + @RequestBody GovernanceDomainProperties properties) + { + return restAPI.updateGovernanceDomain(serverName, userId, governanceDomainGUID, properties); + } + + + /** + * Remove the metadata element representing a Governance Domain. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param governanceDomainGUID unique identifier of the metadata element to remove + * @param requestBody null request body + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/governance-domains/{governanceDomainGUID}/delete") + + public VoidResponse deleteGovernanceDomain(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String governanceDomainGUID, + @RequestBody(required = false) + NullRequestBody requestBody) + { + return restAPI.deleteGovernanceDomain(serverName, userId, governanceDomainGUID, requestBody); + } + + + + /** + * Create a parent-child relationship between a governance domain set and a governance domain. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param governanceDomainSetGUID unique identifier of the governance domain set + * @param governanceDomainGUID unique identifier of the governance domain + * @param requestBody null request body + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/governance-domain-sets/{governanceDomainSetGUID}/governance-domains/{governanceDomainGUID}") + + public VoidResponse addDomainToSet(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String governanceDomainSetGUID, + @PathVariable String governanceDomainGUID, + @RequestBody(required = false) + NullRequestBody requestBody) + { + return restAPI.addDomainToSet(serverName, userId, governanceDomainSetGUID, governanceDomainGUID, requestBody); + } + + + + /** + * Remove a parent-child relationship between a governance domain set and a governance domain. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param governanceDomainSetGUID unique identifier of the governance domain set + * @param governanceDomainGUID unique identifier of the governance domain + * @param requestBody null request body + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/governance-domain-sets/{governanceDomainSetGUID}/governance-domains/{governanceDomainGUID}/delete") + + public VoidResponse removeDomainFromSet(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String governanceDomainSetGUID, + @PathVariable String governanceDomainGUID, + @RequestBody(required = false) + NullRequestBody requestBody) + { + return restAPI.removeDomainFromSet(serverName, userId, governanceDomainSetGUID, governanceDomainGUID, requestBody); + + } + + + /** + * Retrieve the list of Governance Domain metadata elements defined for the governance program. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @GetMapping(path = "/governance-domains") + + public GovernanceDomainListResponse getGovernanceDomains(@PathVariable String serverName, + @PathVariable String userId, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getGovernanceDomains(serverName, userId, startFrom, pageSize); + } + + + /** + * Retrieve the list of Governance Domain metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param requestBody string to find in the properties + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/governance-domain/by-search-string") + + public GovernanceDomainListResponse findGovernanceDomains(@PathVariable String serverName, + @PathVariable String userId, + @RequestParam int startFrom, + @RequestParam int pageSize, + @RequestBody SearchStringRequestBody requestBody) + { + return restAPI.findGovernanceDomains(serverName, userId, startFrom, pageSize, requestBody); + } + + + /** + * Return the list of governance domain sets that a governance domain belong. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param governanceDomainGUID unique identifier of the governance domain to query + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of metadata elements describing the sets associated with the requested governanceDomainSet or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @GetMapping(path = "/governance-domain-sets/by-governance-domains/{governanceDomainGUID}") + + public GovernanceDomainSetListResponse getSetsForGovernanceDomain(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String governanceDomainGUID, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getSetsForGovernanceDomain(serverName, userId, governanceDomainGUID, startFrom, pageSize); + } + + + /** + * Retrieve the list of Governance Domain metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param requestBody name to search for + * + * @return list of matching metadata elements + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/governance-domain/by-name") + + public GovernanceDomainListResponse getGovernanceDomainsByName(@PathVariable String serverName, + @PathVariable String userId, + @RequestParam int startFrom, + @RequestParam int pageSize, + @RequestBody NameRequestBody requestBody) + { + return restAPI.getGovernanceDomainsByName(serverName, userId, startFrom, pageSize, requestBody); + } + + + /** + * Retrieve the Governance Domain metadata element with the supplied unique identifier assigned when the domain description was stored in + * the metadata repository. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param governanceDomainGUID unique identifier of the requested metadata element + * + * @return requested metadata element or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @GetMapping(path = "/governance-domains/{governanceDomainGUID}") + + public GovernanceDomainResponse getGovernanceDomainByGUID(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String governanceDomainGUID) + { + return restAPI.getGovernanceDomainByGUID(serverName, userId, governanceDomainGUID); + } + + + /** + * Retrieve the Governance Domain metadata element with the supplied domain identifier. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param domainIdentifier identifier used to identify the domain + * + * @return requested metadata element or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @GetMapping(path = "/governance-domains/by-identifier/{domainIdentifier}") + + public GovernanceDomainResponse getGovernanceDomainByIdentifier(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable int domainIdentifier) + { + return restAPI.getGovernanceDomainByIdentifier(serverName, userId, domainIdentifier); + } +} diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-spring/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/spring/GovernanceRolesResource.java b/open-metadata-implementation/access-services/governance-program/governance-program-spring/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/spring/GovernanceRolesResource.java index 5baab8d800b..1bb2a8491ad 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-spring/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/spring/GovernanceRolesResource.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-spring/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/spring/GovernanceRolesResource.java @@ -269,7 +269,7 @@ public GovernanceRoleHistoryResponse getGovernanceRoleHistoryByGUID(@PathVariabl /** * Retrieve the properties of a governance role using its unique name. The results are returned as a list * since it is possible that two roles have the same identifier due to the distributed nature of the - * open metadata ecosystem. By returning all of the search results here it is possible to manage the + * open metadata ecosystem. By returning all the search results here it is possible to manage the * duplicates through this interface. * * @param serverName name of server instance to call @@ -292,7 +292,7 @@ public GovernanceRoleListResponse getGovernanceRoleByRoleId(@PathVariable String /** - * Return all of the defined governance roles. + * Return all the defined governance roles. * * @param serverName name of server instance to call * @param userId the name of the calling user. @@ -318,7 +318,7 @@ public GovernanceRoleListResponse getGovernanceRolesByDomainId(@PathVariable St /** - * Retrieve all of the governance roles for a particular title. The title can include regEx wildcards. + * Retrieve all the governance roles for a particular title. The title can include regEx wildcards. * * @param serverName name of server instance to call * @param userId calling user @@ -344,7 +344,7 @@ public GovernanceRoleListResponse getGovernanceRolesByTitle(@PathVariable Strin /** - * Return all of the governance roles and their incumbents (if any). + * Return all the governance roles and their incumbents (if any). * * @param serverName name of server instance to call * @param userId the name of the calling user diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-spring/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/spring/GovernanceZonesResource.java b/open-metadata-implementation/access-services/governance-program/governance-program-spring/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/spring/GovernanceZonesResource.java index f6654d299ff..b9ced30480a 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-spring/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/spring/GovernanceZonesResource.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-spring/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/spring/GovernanceZonesResource.java @@ -29,7 +29,7 @@ public class GovernanceZonesResource { - private GovernanceZoneRESTServices restAPI = new GovernanceZoneRESTServices(); + private final GovernanceZoneRESTServices restAPI = new GovernanceZoneRESTServices(); /** * Default constructor @@ -42,7 +42,7 @@ public GovernanceZonesResource() /** * Create a definition of a governance zone. The qualified name of these governance zones can be added * to the supportedZones and defaultZones properties of an OMAS to control which assets are processed - * and how they are set up. In addition the qualified names of zones can be added to Asset definitions + * and how they are set up. In addition, the qualified names of zones can be added to Asset definitions * to indicate which zone(s) they belong to. * * @param serverName name of the server instance to connect to diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-spring/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/spring/SubjectAreaResource.java b/open-metadata-implementation/access-services/governance-program/governance-program-spring/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/spring/SubjectAreaResource.java index 98c3b6b1692..34cf12d0ec2 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-spring/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/spring/SubjectAreaResource.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-spring/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/server/spring/SubjectAreaResource.java @@ -126,7 +126,7 @@ public VoidResponse deleteSubjectArea(@PathVariable String serverName, * PropertyServerException problem accessing property server * UserNotAuthorizedException security access problem */ - @PostMapping(path = "/subject-areas/{parentSubjectAreaGUID}/nested-subject area/{childSubjectAreaGUID}/link") + @PostMapping(path = "/subject-areas/{parentSubjectAreaGUID}/nested-subject-area/{childSubjectAreaGUID}/link") public VoidResponse linkSubjectAreasInHierarchy(@PathVariable String serverName, @PathVariable String userId, @@ -153,7 +153,7 @@ public VoidResponse linkSubjectAreasInHierarchy(@PathVariable String se * PropertyServerException problem accessing property server * UserNotAuthorizedException security access problem */ - @PostMapping(path = "/subject-areas/{parentSubjectAreaGUID}/nested-subject area/{childSubjectAreaGUID}/unlink") + @PostMapping(path = "/subject-areas/{parentSubjectAreaGUID}/nested-subject-area/{childSubjectAreaGUID}/unlink") public VoidResponse unlinkSubjectAreasInHierarchy(@PathVariable String serverName, @PathVariable String userId, diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/api/ConnectionsManagerInterface.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/api/ConnectionsManagerInterface.java index f1e103bbc77..c05fe9a7d1b 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/api/ConnectionsManagerInterface.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/api/ConnectionsManagerInterface.java @@ -47,7 +47,7 @@ String createConnection(String userId, /** * Create a new metadata element to represent a connection using an existing metadata element as a template. - * The template defines additional classifications and relationships that should be added to the new asset. + * The template defines additional classifications and relationships that should be added to the new connection. * * @param userId calling user * @param infrastructureManagerGUID unique identifier of software server capability representing the caller diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/events/ITInfrastructureOutTopicEvent.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/events/ITInfrastructureOutTopicEvent.java index 4758f9e932e..732198ce69a 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/events/ITInfrastructureOutTopicEvent.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/events/ITInfrastructureOutTopicEvent.java @@ -17,7 +17,7 @@ /** * ITInfrastructureOutTopicEvent provides the structure of the IT Infrastructure OMAS's OutTopic events. The values for elements and their classifications * come from the events. They are not guaranteed to be current. If the latest values are required, the element should be queried from the repository - * using its GUID. The event values are useful if the third party catalog needs to maintain an exact record of all of the versions. + * using its GUID. The event values are useful if the third party catalog needs to maintain an exact record of all the versions. */ @JsonAutoDetect(getterVisibility = PUBLIC_ONLY, setterVisibility = PUBLIC_ONLY, fieldVisibility = NONE) @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/metadataelements/ElementVersions.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/metadataelements/ElementVersions.java index 33827b4b645..1c25acacc75 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/metadataelements/ElementVersions.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/metadataelements/ElementVersions.java @@ -17,7 +17,7 @@ /** * ElementVersions provides the version information for the element plus details of the creation time and last - * update time. Finally it lists all of the users that have made changes to this element. + * update time. Finally it lists all the users that have made changes to this element. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/ContactMethodProperties.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/ContactMethodProperties.java index 477e7356585..8d3e28e1ed3 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/ContactMethodProperties.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/ContactMethodProperties.java @@ -25,9 +25,12 @@ public class ContactMethodProperties implements Serializable { private static final long serialVersionUID = 1L; - private ContactMethodType type = null; - private String service = null; - private String value = null; + private String name = null; + private String contactType = null; + + private ContactMethodType contactMethodType = null; + private String contactMethodService = null; + private String contactMethodValue = null; private Date effectiveFrom = null; private Date effectiveTo = null; @@ -54,9 +57,9 @@ public ContactMethodProperties(ContactMethodProperties template) { if (template != null) { - type = template.getType(); - service = template.getService(); - value = template.getValue(); + contactMethodType = template.getContactMethodType(); + contactMethodService = template.getContactMethodService(); + contactMethodValue = template.getContactMethodValue(); effectiveFrom = template.getEffectiveFrom(); effectiveTo = template.getEffectiveTo(); typeName = template.getTypeName(); @@ -65,25 +68,69 @@ public ContactMethodProperties(ContactMethodProperties template) } + /** + * Return the name to give this contact method (imagine a list of contact methods). + * + * @return string + */ + public String getName() + { + return name; + } + + + /** + * Set up the name to give this contact method (imagine a list of contact methods). + * + * @param name string + */ + public void setName(String name) + { + this.name = name; + } + + + /** + * Return the type of contact - is it related to work or personal etc. + * + * @return string type name - often controlled by a valid value set + */ + public String getContactType() + { + return contactType; + } + + + /** + * Set up the type of contact - is it related to work or personal etc. + * + * @param contactType string type name - often controlled by a valid value set + */ + public void setContactType(String contactType) + { + this.contactType = contactType; + } + + /** * Return the type of the contact method. * * @return contact method type enum */ - public ContactMethodType getType() + public ContactMethodType getContactMethodType() { - return type; + return contactMethodType; } /** * Set up the type of the contact method. * - * @param type contact method type enum + * @param contactMethodType contact method type enum */ - public void setType(ContactMethodType type) + public void setContactMethodType(ContactMethodType contactMethodType) { - this.type = type; + this.contactMethodType = contactMethodType; } @@ -92,20 +139,20 @@ public void setType(ContactMethodType type) * * @return service URL */ - public String getService() + public String getContactMethodService() { - return service; + return contactMethodService; } /** * Set up theURL of the service used to contact the individual. * - * @param service service URL + * @param contactMethodService service URL */ - public void setService(String service) + public void setContactMethodService(String contactMethodService) { - this.service = service; + this.contactMethodService = contactMethodService; } @@ -114,20 +161,20 @@ public void setService(String service) * * @return value string */ - public String getValue() + public String getContactMethodValue() { - return value; + return contactMethodValue; } /** * Set up the account name or similar value used to direct the message to the individual. * - * @param value value string + * @param contactMethodValue value string */ - public void setValue(String value) + public void setContactMethodValue(String contactMethodValue) { - this.value = value; + this.contactMethodValue = contactMethodValue; } @@ -242,9 +289,9 @@ public void setExtendedProperties(Map extendedProperties) public String toString() { return "ContactMethodProperties{" + - "type=" + type + - ", service='" + service + '\'' + - ", value='" + value + '\'' + + "type=" + contactMethodType + + ", service='" + contactMethodService + '\'' + + ", value='" + contactMethodValue + '\'' + ", effectiveFrom=" + effectiveFrom + ", effectiveTo=" + effectiveTo + ", typeName='" + typeName + '\'' + @@ -271,9 +318,9 @@ public boolean equals(Object objectToCompare) return false; } ContactMethodProperties that = (ContactMethodProperties) objectToCompare; - return type == that.type && - Objects.equals(service, that.service) && - Objects.equals(value, that.value) && + return contactMethodType == that.contactMethodType && + Objects.equals(contactMethodService, that.contactMethodService) && + Objects.equals(contactMethodValue, that.contactMethodValue) && Objects.equals(effectiveFrom, that.effectiveFrom) && Objects.equals(effectiveTo, that.effectiveTo) && Objects.equals(typeName, that.typeName) && @@ -289,6 +336,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(type, service, value, effectiveFrom, effectiveTo, typeName, extendedProperties); + return Objects.hash(contactMethodType, contactMethodService, contactMethodValue, effectiveFrom, effectiveTo, typeName, extendedProperties); } } diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/UserIdentityProperties.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/UserIdentityProperties.java index 2bfd206a9be..1df5179c54a 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/UserIdentityProperties.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/UserIdentityProperties.java @@ -21,6 +21,7 @@ public class UserIdentityProperties extends ReferenceableProperties { private static final long serialVersionUID = 1L; + private String userId = null; private String distinguishedName = null; @@ -41,6 +42,34 @@ public UserIdentityProperties() public UserIdentityProperties(UserIdentityProperties template) { super(template); + + if (template != null) + { + this.userId = template.getUserId(); + this.distinguishedName = template.getDistinguishedName(); + } + } + + + /** + * Return the identifier of the user's account + * + * @return string + */ + public String getUserId() + { + return userId; + } + + + /** + * Return the identifier of the user's account. + * + * @param userId string + */ + public void setUserId(String userId) + { + this.userId = userId; } @@ -75,12 +104,13 @@ public void setDistinguishedName(String distinguishedName) public String toString() { return "UserIdentityProperties{" + - "distinguishedName='" + distinguishedName + '\'' + - ", qualifiedName='" + getQualifiedName() + '\'' + + "qualifiedName='" + getQualifiedName() + '\'' + ", additionalProperties=" + getAdditionalProperties() + ", vendorProperties=" + getVendorProperties() + ", typeName='" + getTypeName() + '\'' + ", extendedProperties=" + getExtendedProperties() + + ", userId='" + userId + '\'' + + ", distinguishedName='" + distinguishedName + '\'' + '}'; } @@ -102,12 +132,13 @@ public boolean equals(Object objectToCompare) { return false; } - if (!super.equals(objectToCompare)) + if (! super.equals(objectToCompare)) { return false; } UserIdentityProperties that = (UserIdentityProperties) objectToCompare; - return Objects.equals(distinguishedName, that.distinguishedName); + return Objects.equals(userId, that.userId) && + Objects.equals(distinguishedName, that.distinguishedName); } @@ -119,6 +150,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), distinguishedName); + return Objects.hash(super.hashCode(), userId, distinguishedName); } } diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/AssetConverter.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/AssetConverter.java index b7dd92be669..3d57971c0ea 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/AssetConverter.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/AssetConverter.java @@ -36,7 +36,7 @@ public AssetConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -104,7 +104,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/ConnectorTypeConverter.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/ConnectorTypeConverter.java index a54d22d1ee2..47ce0634170 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/ConnectorTypeConverter.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/ConnectorTypeConverter.java @@ -35,7 +35,7 @@ public ConnectorTypeConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -115,7 +115,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/ContactMethodConverter.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/ContactMethodConverter.java index c8e04c23b4c..cc5d786f6c9 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/ContactMethodConverter.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/ContactMethodConverter.java @@ -73,13 +73,14 @@ public B getNewBean(Class beanClass, { entityProperties = new InstanceProperties(entity.getProperties()); - contactMethodProperties.setType(this.getContactMethodTypeFromProperties(entityProperties)); - contactMethodProperties.setService(this.removeContactMethodService(entityProperties)); - contactMethodProperties.setValue(this.removeContactMethodValue(entityProperties)); + contactMethodProperties.setName(this.removeName(entityProperties)); + contactMethodProperties.setContactType(this.removeContactType(entityProperties)); + contactMethodProperties.setContactMethodType(this.getContactMethodTypeFromProperties(entityProperties)); + contactMethodProperties.setContactMethodService(this.removeContactMethodService(entityProperties)); + contactMethodProperties.setContactMethodValue(this.removeContactMethodValue(entityProperties)); contactMethodProperties.setEffectiveFrom(entityProperties.getEffectiveFromTime()); contactMethodProperties.setEffectiveTo(entityProperties.getEffectiveToTime()); - /* * Any remaining properties are returned in the extended properties. They are * assumed to be defined in a subtype. diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/ElementHeaderConverter.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/ElementHeaderConverter.java index 3dbbb5e057c..b397e568dae 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/ElementHeaderConverter.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/ElementHeaderConverter.java @@ -33,7 +33,7 @@ public ElementHeaderConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -79,7 +79,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/ElementStubConverter.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/ElementStubConverter.java index a3742b8405c..69f520680d3 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/ElementStubConverter.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/ElementStubConverter.java @@ -37,7 +37,7 @@ public ElementStubConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entityProxy and that of a connected relationship. * * @param beanClass name of the class to create @@ -77,7 +77,7 @@ private B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an relationship and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/EndpointConverter.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/EndpointConverter.java index 81d4b085cae..3082319cbe1 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/EndpointConverter.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/EndpointConverter.java @@ -35,7 +35,7 @@ public EndpointConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -106,7 +106,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/ITProfileConverter.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/ITProfileConverter.java index ef9c967407a..99108899e9e 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/ITProfileConverter.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/ITProfileConverter.java @@ -124,6 +124,7 @@ public B getNewComplexBean(Class beanClass, InstanceProperties entityProperties = new InstanceProperties(entity.getProperties()); userProperties.setQualifiedName(this.removeQualifiedName(entityProperties)); + userProperties.setUserId(this.removeUserId(entityProperties)); userProperties.setDistinguishedName(this.removeDistinguishedName(instanceProperties)); userProperties.setAdditionalProperties(this.removeAdditionalProperties(entityProperties)); @@ -143,9 +144,11 @@ else if (repositoryHelper.isTypeOf(serviceName, entityTypeName, OpenMetadataAPIM InstanceProperties entityProperties = new InstanceProperties(entity.getProperties()); - contactMethodProperties.setType(this.getContactMethodTypeFromProperties(entityProperties)); - contactMethodProperties.setService(this.removeContactMethodService(entityProperties)); - contactMethodProperties.setValue(this.removeContactMethodValue(entityProperties)); + contactMethodProperties.setName(this.removeName(entityProperties)); + contactMethodProperties.setContactType(this.removeContactType(entityProperties)); + contactMethodProperties.setContactMethodType(this.getContactMethodTypeFromProperties(entityProperties)); + contactMethodProperties.setContactMethodService(this.removeContactMethodService(entityProperties)); + contactMethodProperties.setContactMethodValue(this.removeContactMethodValue(entityProperties)); contactMethodProperties.setEffectiveFrom(entityProperties.getEffectiveFromTime()); contactMethodProperties.setEffectiveTo(entityProperties.getEffectiveToTime()); diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/PortConverter.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/PortConverter.java index e16c5215cfb..86ccfa9463a 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/PortConverter.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/PortConverter.java @@ -36,7 +36,7 @@ public PortConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -103,7 +103,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/ProcessConverter.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/ProcessConverter.java index 69c9ae75eb3..f6609213cd3 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/ProcessConverter.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/ProcessConverter.java @@ -36,7 +36,7 @@ public ProcessConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -106,7 +106,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/RelatedAssetConverter.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/RelatedAssetConverter.java index 00c86ca21f7..a9e74d905b8 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/RelatedAssetConverter.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/RelatedAssetConverter.java @@ -37,7 +37,7 @@ public RelatedAssetConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/SoftwareCapabilityConverter.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/SoftwareCapabilityConverter.java index db53be2ea51..73967318ea0 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/SoftwareCapabilityConverter.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/SoftwareCapabilityConverter.java @@ -106,7 +106,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/UserIdentityConverter.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/UserIdentityConverter.java index 166720a209d..6a52586e718 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/UserIdentityConverter.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/UserIdentityConverter.java @@ -36,7 +36,7 @@ public UserIdentityConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -72,6 +72,7 @@ public B getNewBean(Class beanClass, InstanceProperties instanceProperties = new InstanceProperties(entity.getProperties()); properties.setQualifiedName(this.removeQualifiedName(instanceProperties)); + properties.setUserId(this.removeUserId(instanceProperties)); properties.setDistinguishedName(this.removeDistinguishedName(instanceProperties)); properties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); @@ -102,7 +103,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/listener/ITInfrastructureOMRSTopicListener.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/listener/ITInfrastructureOMRSTopicListener.java index 255a7387176..10ecf90dc75 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/listener/ITInfrastructureOMRSTopicListener.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/listener/ITInfrastructureOMRSTopicListener.java @@ -145,7 +145,7 @@ public void processUpdatedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entityProxy details of the entityProxy with the new classification added. No guarantee this is all of the classifications. + * @param entityProxy details of the entityProxy with the new classification added. No guarantee this is all the classifications. * @param classification new classification */ @Override @@ -184,7 +184,7 @@ public void processClassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity with the new classification added. No guarantee this is all of the classifications. + * @param entity details of the entity with the new classification added. No guarantee this is all the classifications. * @param classification new classification */ @Override @@ -261,7 +261,7 @@ public void processClassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entityProxy details of the entityProxy after the classification has been removed. No guarantee this is all of the classifications. + * @param entityProxy details of the entityProxy after the classification has been removed. No guarantee this is all the classifications. * @param originalClassification classification that was removed */ @Override @@ -300,7 +300,7 @@ public void processDeclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity after the classification has been removed. No guarantee this is all of the classifications. + * @param entity details of the entity after the classification has been removed. No guarantee this is all the classifications. * @param originalClassification classification that was removed */ @Override @@ -377,7 +377,7 @@ public void processDeclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entityProxy details of the entityProxy after the classification has been changed. No guarantee this is all of the classifications. + * @param entityProxy details of the entityProxy after the classification has been changed. No guarantee this is all the classifications. * @param originalClassification classification that was removed * @param classification new classification */ @@ -418,7 +418,7 @@ public void processReclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity after the classification has been changed. No guarantee this is all of the classifications. + * @param entity details of the entity after the classification has been changed. No guarantee this is all the classifications. * @param originalClassification classification that was removed * @param classification new classification */ diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/ITProfileRESTServices.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/ITProfileRESTServices.java index 9dfac46945e..9b3739fe855 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/ITProfileRESTServices.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/ITProfileRESTServices.java @@ -136,6 +136,7 @@ public GUIDResponse createITProfile(String serverName, requestBody.getExternalSourceName(), profileGUID, profileGUIDParameterName, + "UserIdentity:" + requestBody.getItUserId(), requestBody.getItUserId(), null, null, @@ -372,11 +373,11 @@ public GUIDResponse addContactMethod(String serverName, auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - int contactType = 0; + int contactMethodTypeOrdinal = 0; - if (requestBody.getProperties().getType() != null) + if (requestBody.getProperties().getContactMethodType() != null) { - contactType = requestBody.getProperties().getType().getOpenTypeOrdinal(); + contactMethodTypeOrdinal = requestBody.getProperties().getContactMethodType().getOpenTypeOrdinal(); } handler.createContactMethod(userId, @@ -384,9 +385,11 @@ public GUIDResponse addContactMethod(String serverName, requestBody.getExternalSourceName(), itProfileGUID, guidParameterName, - contactType, - requestBody.getProperties().getService(), - requestBody.getProperties().getValue(), + requestBody.getProperties().getName(), + requestBody.getProperties().getContactType(), + contactMethodTypeOrdinal, + requestBody.getProperties().getContactMethodService(), + requestBody.getProperties().getContactMethodValue(), null, null, false, @@ -731,6 +734,7 @@ public GUIDResponse createUserIdentity(String serverName, null, null, requestBody.getProperties().getQualifiedName(), + requestBody.getProperties().getUserId(), requestBody.getProperties().getDistinguishedName(), requestBody.getProperties().getAdditionalProperties(), requestBody.getProperties().getTypeName(), @@ -798,6 +802,7 @@ public VoidResponse updateUserIdentity(String serverName, userIdentityGUID, guidParameterName, requestBody.getProperties().getQualifiedName(), + requestBody.getProperties().getUserId(), requestBody.getProperties().getDistinguishedName(), requestBody.getProperties().getAdditionalProperties(), requestBody.getProperties().getTypeName(), diff --git a/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/events/SecurityManagerOutTopicEvent.java b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/events/SecurityManagerOutTopicEvent.java index 75417edf8a6..a1e22dd8a7b 100644 --- a/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/events/SecurityManagerOutTopicEvent.java +++ b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/events/SecurityManagerOutTopicEvent.java @@ -17,7 +17,7 @@ /** * SecurityManagerOutTopicEvent provides the structure of the Security Manager OMAS's OutTopic events. The values for elements and their classifications * come from the events. They are not guaranteed to be current. If the latest values are required, the element should be queried from the repository - * using its GUID. The event values are useful if the third party security manager needs to maintain an exact record of all of the versions. + * using its GUID. The event values are useful if the third party security manager needs to maintain an exact record of all the versions. */ @JsonAutoDetect(getterVisibility = PUBLIC_ONLY, setterVisibility = PUBLIC_ONLY, fieldVisibility = NONE) @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/metadataelements/ActorProfileElement.java b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/metadataelements/ActorProfileElement.java index 54d0df04f25..46e963ece02 100644 --- a/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/metadataelements/ActorProfileElement.java +++ b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/metadataelements/ActorProfileElement.java @@ -25,10 +25,11 @@ public class ActorProfileElement implements Serializable, MetadataElement { private static final long serialVersionUID = 1L; - private ElementHeader elementHeader = null; - private ActorProfileProperties profileProperties = null; - private List contactMethods = null; + private ElementHeader elementHeader = null; + private ActorProfileProperties profileProperties = null; + private List contactMethods = null; private List personRoles = null; /* Person only */ + private List locations = null; private List userIdentities = null; private ElementStub superTeam = null; /* Team only */ private List subTeams = null; /* Team only */ @@ -58,6 +59,7 @@ public ActorProfileElement(ActorProfileElement template) profileProperties = template.getProfileProperties(); contactMethods = template.getContactMethods(); personRoles = template.getPersonRoles(); + locations = template.getLocations(); userIdentities = template.getUserIdentities(); superTeam = template.getSuperTeam(); subTeams = template.getSubTeams(); @@ -137,7 +139,7 @@ public void setContactMethods(List contactMethods) /** * Return the headers of the person roles that this actor is appointed to. * - * @return role stub + * @return role stubs */ public List getPersonRoles() { @@ -156,6 +158,29 @@ public void setPersonRoles(List personRoles) } + + /** + * Return the headers of the location that this actor is linked to. + * + * @return location stubs + */ + public List getLocations() + { + return locations; + } + + + /** + * Set up the headers of the person roles that this actor is linked to. + * + * @param locations location stubs + */ + public void setLocations(List locations) + { + this.locations = locations; + } + + /** * Return the list of user identities for this profile. * @@ -301,6 +326,7 @@ public String toString() ", profileProperties=" + profileProperties + ", contactMethods=" + contactMethods + ", personRoles=" + personRoles + + ", locations=" + locations + ", userIdentities=" + userIdentities + ", superTeam=" + superTeam + ", subTeams=" + subTeams + @@ -333,6 +359,7 @@ public boolean equals(Object objectToCompare) Objects.equals(profileProperties, that.profileProperties) && Objects.equals(contactMethods, that.contactMethods) && Objects.equals(personRoles, that.personRoles) && + Objects.equals(locations, that.locations) && Objects.equals(userIdentities, that.userIdentities) && Objects.equals(superTeam, that.superTeam) && Objects.equals(subTeams, that.subTeams) && @@ -351,6 +378,6 @@ public boolean equals(Object objectToCompare) public int hashCode() { return Objects.hash(elementHeader, profileProperties, contactMethods, userIdentities, superTeam, subTeams, - teamLeaderRoles, personRoles, teamMemberRoles, linkedInfrastructure); + teamLeaderRoles, personRoles, locations, teamMemberRoles, linkedInfrastructure); } } diff --git a/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/metadataelements/ElementVersions.java b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/metadataelements/ElementVersions.java index 4205cb44869..70c3c5b5179 100644 --- a/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/metadataelements/ElementVersions.java +++ b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/metadataelements/ElementVersions.java @@ -17,7 +17,7 @@ /** * ElementVersions provides the version information for the element plus details of the creation time and last - * update time. Finally it lists all of the users that have made changes to this element. + * update time. Finally it lists all the users that have made changes to this element. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/metadataelements/ProfileLocationElement.java b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/metadataelements/ProfileLocationElement.java new file mode 100644 index 00000000000..12559b39958 --- /dev/null +++ b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/metadataelements/ProfileLocationElement.java @@ -0,0 +1,148 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.securitymanager.metadataelements; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.securitymanager.properties.ProfileLocationProperties; + +import java.io.Serializable; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ProfileLocationElement contains the properties and header for a relationship between a profile and a user identity retrieved + * from the metadata repository. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ProfileLocationElement implements Serializable +{ + private static final long serialVersionUID = 1L; + + private ProfileLocationProperties properties = null; + private ElementStub location = null; + + + /** + * Default constructor + */ + public ProfileLocationElement() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ProfileLocationElement(ProfileLocationElement template) + { + if (template != null) + { + properties = template.getProperties(); + location = template.getLocation(); + } + } + + + /** + * Return the properties from the profile location relationship. + * + * @return profile identity + */ + public ProfileLocationProperties getProperties() + { + return properties; + } + + + /** + * Set up the properties from the profile location relationship. + * + * @param properties profile identity + */ + public void setProperties(ProfileLocationProperties properties) + { + this.properties = properties; + } + + + /** + * Return the properties of the location. + * + * @return properties + */ + public ElementStub getLocation() + { + return location; + } + + + /** + * Set up the userId properties. + * + * @param location properties + */ + public void setLocation(ElementStub location) + { + this.location = location; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ProfileLocationElement{" + + "properties=" + properties + + ", location=" + location + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + ProfileLocationElement that = (ProfileLocationElement) objectToCompare; + return Objects.equals(properties, that.properties) && + Objects.equals(location, that.location); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), properties, location); + } +} diff --git a/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/ContactMethodProperties.java b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/ContactMethodProperties.java index e0636281808..cb744ef4034 100644 --- a/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/ContactMethodProperties.java +++ b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/ContactMethodProperties.java @@ -25,9 +25,12 @@ public class ContactMethodProperties implements Serializable { private static final long serialVersionUID = 1L; - private ContactMethodType type = null; - private String service = null; - private String value = null; + private String name = null; + private String contactType = null; + + private ContactMethodType contactMethodType = null; + private String contactMethodService = null; + private String contactMethodValue = null; private Date effectiveFrom = null; private Date effectiveTo = null; @@ -54,9 +57,9 @@ public ContactMethodProperties(ContactMethodProperties template) { if (template != null) { - type = template.getType(); - service = template.getService(); - value = template.getValue(); + contactMethodType = template.getContactMethodType(); + contactMethodService = template.getContactMethodService(); + contactMethodValue = template.getContactMethodValue(); effectiveFrom = template.getEffectiveFrom(); effectiveTo = template.getEffectiveTo(); typeName = template.getTypeName(); @@ -65,25 +68,69 @@ public ContactMethodProperties(ContactMethodProperties template) } + /** + * Return the name to give this contact method (imagine a list of contact methods). + * + * @return string + */ + public String getName() + { + return name; + } + + + /** + * Set up the name to give this contact method (imagine a list of contact methods). + * + * @param name string + */ + public void setName(String name) + { + this.name = name; + } + + + /** + * Return the type of contact - is it related to work or personal etc. + * + * @return string type name - often controlled by a valid value set + */ + public String getContactType() + { + return contactType; + } + + + /** + * Set up the type of contact - is it related to work or personal etc. + * + * @param contactType string type name - often controlled by a valid value set + */ + public void setContactType(String contactType) + { + this.contactType = contactType; + } + + /** * Return the type of the contact method. * * @return contact method type enum */ - public ContactMethodType getType() + public ContactMethodType getContactMethodType() { - return type; + return contactMethodType; } /** * Set up the type of the contact method. * - * @param type contact method type enum + * @param contactMethodType contact method type enum */ - public void setType(ContactMethodType type) + public void setContactMethodType(ContactMethodType contactMethodType) { - this.type = type; + this.contactMethodType = contactMethodType; } @@ -92,20 +139,20 @@ public void setType(ContactMethodType type) * * @return service URL */ - public String getService() + public String getContactMethodService() { - return service; + return contactMethodService; } /** * Set up theURL of the service used to contact the individual. * - * @param service service URL + * @param contactMethodService service URL */ - public void setService(String service) + public void setContactMethodService(String contactMethodService) { - this.service = service; + this.contactMethodService = contactMethodService; } @@ -114,20 +161,20 @@ public void setService(String service) * * @return value string */ - public String getValue() + public String getContactMethodValue() { - return value; + return contactMethodValue; } /** * Set up the account name or similar value used to direct the message to the individual. * - * @param value value string + * @param contactMethodValue value string */ - public void setValue(String value) + public void setContactMethodValue(String contactMethodValue) { - this.value = value; + this.contactMethodValue = contactMethodValue; } @@ -242,9 +289,9 @@ public void setExtendedProperties(Map extendedProperties) public String toString() { return "ContactMethodProperties{" + - "type=" + type + - ", service='" + service + '\'' + - ", value='" + value + '\'' + + "type=" + contactMethodType + + ", service='" + contactMethodService + '\'' + + ", value='" + contactMethodValue + '\'' + ", effectiveFrom=" + effectiveFrom + ", effectiveTo=" + effectiveTo + ", typeName='" + typeName + '\'' + @@ -271,9 +318,9 @@ public boolean equals(Object objectToCompare) return false; } ContactMethodProperties that = (ContactMethodProperties) objectToCompare; - return type == that.type && - Objects.equals(service, that.service) && - Objects.equals(value, that.value) && + return contactMethodType == that.contactMethodType && + Objects.equals(contactMethodService, that.contactMethodService) && + Objects.equals(contactMethodValue, that.contactMethodValue) && Objects.equals(effectiveFrom, that.effectiveFrom) && Objects.equals(effectiveTo, that.effectiveTo) && Objects.equals(typeName, that.typeName) && @@ -289,6 +336,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(type, service, value, effectiveFrom, effectiveTo, typeName, extendedProperties); + return Objects.hash(contactMethodType, contactMethodService, contactMethodValue, effectiveFrom, effectiveTo, typeName, extendedProperties); } } diff --git a/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/PersonRoleProperties.java b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/PersonRoleProperties.java index f49a36f9d85..894c03b27ea 100644 --- a/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/PersonRoleProperties.java +++ b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/PersonRoleProperties.java @@ -98,7 +98,6 @@ public void setHeadCount(int headCount) } - /** * JSON-style toString * @@ -110,10 +109,12 @@ public String toString() return "PersonRoleProperties{" + "headCountLimitSet=" + headCountLimitSet + ", headCount=" + headCount + + ", qualifiedName='" + getQualifiedName() + '\'' + ", roleId='" + getRoleId() + '\'' + ", scope='" + getScope() + '\'' + ", title='" + getTitle() + '\'' + ", description='" + getDescription() + '\'' + + ", domainIdentifier=" + getDomainIdentifier() + ", additionalProperties=" + getAdditionalProperties() + ", effectiveFrom=" + getEffectiveFrom() + ", effectiveTo=" + getEffectiveTo() + diff --git a/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/PersonalRoleProperties.java b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/PersonalRoleProperties.java index 71cfdfbbf1e..b1a24cf124a 100644 --- a/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/PersonalRoleProperties.java +++ b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/PersonalRoleProperties.java @@ -26,10 +26,13 @@ public class PersonalRoleProperties implements Serializable { private static final long serialVersionUID = 1L; - private String roleId = null; /* qualifiedName */ - private String scope = null; /* scope */ - private String title = null; /* name */ - private String description = null; /* description */ + private String qualifiedName = null; /* qualifiedName */ + private String roleId = null; /* identifier */ + private String scope = null; /* scope */ + private String title = null; /* name */ + private String description = null; /* description */ + + private int domainIdentifier = 0; /* Zero means not specific to a governance domain */ private Map additionalProperties = null; @@ -57,10 +60,12 @@ public PersonalRoleProperties(PersonalRoleProperties template) { if (template != null) { + this.qualifiedName = template.getQualifiedName(); this.roleId = template.getRoleId(); this.scope = template.getScope(); this.title = template.getTitle(); this.description = template.getDescription(); + this.domainIdentifier = template.getDomainIdentifier(); this.additionalProperties = template.getAdditionalProperties(); this.effectiveFrom = template.getEffectiveFrom(); this.effectiveTo = template.getEffectiveTo(); @@ -71,10 +76,32 @@ public PersonalRoleProperties(PersonalRoleProperties template) /** - * Return the unique identifier for this job role/appointment. + * Return the unique name for element in open metadata ecosystem. * * @return unique name */ + public String getQualifiedName() + { + return qualifiedName; + } + + + /** + * Set up the unique name for element in open metadata ecosystem. + * + * @param qualifiedName unique name + */ + public void setQualifiedName(String qualifiedName) + { + this.qualifiedName = qualifiedName; + } + + + /** + * Return the unique identifier for this job role/appointment typically from an HR system. + * + * @return unique identifier + */ public String getRoleId() { return roleId; @@ -84,7 +111,7 @@ public String getRoleId() /** * Set up the unique identifier for this job role/appointment. * - * @param roleId unique name + * @param roleId unique identifier */ public void setRoleId(String roleId) { @@ -92,8 +119,9 @@ public void setRoleId(String roleId) } + /** - * Return the context in which the governance officer is appointed. This may be an organizational scope, + * Return the context in which the person is appointed. This may be an organizational scope, * location, or scope of assets. * * @return string description @@ -105,7 +133,7 @@ public String getScope() /** - * Set up the context in which the governance officer is appointed. This may be an organizational scope, + * Set up the context in which the person is appointed. This may be an organizational scope, * location, or scope of assets. * * @param scope string description @@ -139,9 +167,7 @@ public void setTitle(String title) /** - * Return the description of the job role for this governance appointment. This may relate to the specific - * governance responsibilities, or may be their main role if the governance responsibilities are - * just an adjunct to their main role. + * Return the description of the job role. * * @return string description */ @@ -152,9 +178,7 @@ public String getDescription() /** - * Set up the description of the job role for this governance officer. This may relate to the specific - * governance responsibilities, or may be their main role if the governance responsibilities are - * just an adjunct to their main role. + * Set up the description of the job role. * * @param description string description */ @@ -164,10 +188,34 @@ public void setDescription(String description) } + /** + * Return the identifier of the governance domain that this role belongs to. Zero means that the + * role is not specific to any domain. + * + * @return int + */ + public int getDomainIdentifier() + { + return domainIdentifier; + } + + + /** + * Set up the identifier of the governance domain that this role belongs to. Zero means that the + * role is not specific to any domain. + * + * @param domainIdentifier int + */ + public void setDomainIdentifier(int domainIdentifier) + { + this.domainIdentifier = domainIdentifier; + } + + /** * Return a copy of the additional properties. Null means no additional properties are available. * - * @return AdditionalProperties + * @return AdditionalProperties map */ public Map getAdditionalProperties() { @@ -189,7 +237,7 @@ else if (additionalProperties.isEmpty()) /** * Set up additional properties. * - * @param additionalProperties Additional properties object + * @param additionalProperties Additional properties map */ public void setAdditionalProperties(Map additionalProperties) { @@ -309,10 +357,12 @@ public void setExtendedProperties(Map extendedProperties) public String toString() { return "PersonalRoleProperties{" + - "roleId='" + roleId + '\'' + + "qualifiedName='" + qualifiedName + '\'' + + ", roleId='" + roleId + '\'' + ", scope='" + scope + '\'' + ", title='" + title + '\'' + ", description='" + description + '\'' + + ", domainIdentifier=" + domainIdentifier + ", additionalProperties=" + additionalProperties + ", effectiveFrom=" + effectiveFrom + ", effectiveTo=" + effectiveTo + @@ -340,7 +390,9 @@ public boolean equals(Object objectToCompare) return false; } PersonalRoleProperties that = (PersonalRoleProperties) objectToCompare; - return Objects.equals(roleId, that.roleId) && + return domainIdentifier == that.domainIdentifier && + Objects.equals(qualifiedName, that.qualifiedName) && + Objects.equals(roleId, that.roleId) && Objects.equals(scope, that.scope) && Objects.equals(title, that.title) && Objects.equals(description, that.description) && @@ -360,6 +412,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(roleId, scope, title, description, additionalProperties, effectiveFrom, effectiveTo, typeName, extendedProperties); + return Objects.hash(qualifiedName, roleId, scope, title, description, domainIdentifier, additionalProperties, effectiveFrom, effectiveTo, typeName, extendedProperties); } } diff --git a/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/ProfileLocationProperties.java b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/ProfileLocationProperties.java new file mode 100644 index 00000000000..4c95d9ff70f --- /dev/null +++ b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/ProfileLocationProperties.java @@ -0,0 +1,120 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.securitymanager.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.io.Serializable; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ProfileLocationProperties describes the properties for the ProfileLocation relationship between a profile + * and a location. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ProfileLocationProperties implements Serializable +{ + private static final long serialVersionUID = 1L; + + private String associationType = null; + + + /** + * Default constructor + */ + public ProfileLocationProperties() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ProfileLocationProperties(ProfileLocationProperties template) + { + if (template != null) + { + associationType = template.getAssociationType(); + } + } + + + /** + * Return the type of the association. + * + * @return string + */ + public String getAssociationType() + { + return associationType; + } + + + /** + * Set up the type of the association. + * + * @param associationType string + */ + public void setAssociationType(String associationType) + { + this.associationType = associationType; + } + + + /** + * JSON-style toString. + * + * @return list of properties and their values. + */ + @Override + public String toString() + { + return "ProfileLocationProperties{" + + "associationType='" + associationType + '\'' + + '}'; + } + + + /** + * Equals method that returns true if containing properties are the same. + * + * @param objectToCompare object to compare + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + ProfileLocationProperties that = (ProfileLocationProperties) objectToCompare; + return Objects.equals(associationType, that.associationType); + } + + + /** + * Hash code for this object + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(associationType); + } +} diff --git a/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/UserIdentityProperties.java b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/UserIdentityProperties.java index 1be7cc1053e..852e6d3025f 100644 --- a/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/UserIdentityProperties.java +++ b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/UserIdentityProperties.java @@ -21,6 +21,7 @@ public class UserIdentityProperties extends ReferenceableProperties { private static final long serialVersionUID = 1L; + private String userId = null; private String distinguishedName = null; @@ -41,6 +42,34 @@ public UserIdentityProperties() public UserIdentityProperties(UserIdentityProperties template) { super(template); + + if (template != null) + { + this.userId = template.getUserId(); + this.distinguishedName = template.getDistinguishedName(); + } + } + + + /** + * Return the identifier of the user's account + * + * @return string + */ + public String getUserId() + { + return userId; + } + + + /** + * Return the identifier of the user's account. + * + * @param userId string + */ + public void setUserId(String userId) + { + this.userId = userId; } @@ -75,14 +104,15 @@ public void setDistinguishedName(String distinguishedName) public String toString() { return "UserIdentityProperties{" + - "distinguishedName='" + distinguishedName + '\'' + - ", qualifiedName='" + getQualifiedName() + '\'' + + "qualifiedName='" + getQualifiedName() + '\'' + ", additionalProperties=" + getAdditionalProperties() + ", effectiveFrom=" + getEffectiveFrom() + ", effectiveTo=" + getEffectiveTo() + ", vendorProperties=" + getVendorProperties() + ", typeName='" + getTypeName() + '\'' + ", extendedProperties=" + getExtendedProperties() + + ", userId='" + userId + '\'' + + ", distinguishedName='" + distinguishedName + '\'' + '}'; } @@ -104,12 +134,13 @@ public boolean equals(Object objectToCompare) { return false; } - if (!super.equals(objectToCompare)) + if (! super.equals(objectToCompare)) { return false; } UserIdentityProperties that = (UserIdentityProperties) objectToCompare; - return Objects.equals(distinguishedName, that.distinguishedName); + return Objects.equals(userId, that.userId) && + Objects.equals(distinguishedName, that.distinguishedName); } @@ -121,6 +152,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), distinguishedName); + return Objects.hash(super.hashCode(), userId, distinguishedName); } } diff --git a/open-metadata-implementation/access-services/security-manager/security-manager-server/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/converters/ActorProfileConverter.java b/open-metadata-implementation/access-services/security-manager/security-manager-server/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/converters/ActorProfileConverter.java index 6d63b2ae1fe..a9247dd3a91 100644 --- a/open-metadata-implementation/access-services/security-manager/security-manager-server/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/converters/ActorProfileConverter.java +++ b/open-metadata-implementation/access-services/security-manager/security-manager-server/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/converters/ActorProfileConverter.java @@ -2,15 +2,16 @@ /* Copyright Contributors to the ODPi Egeria project. */ package org.odpi.openmetadata.accessservices.securitymanager.converters; - import org.odpi.openmetadata.accessservices.securitymanager.metadataelements.ActorProfileElement; import org.odpi.openmetadata.accessservices.securitymanager.metadataelements.ContactMethodElement; import org.odpi.openmetadata.accessservices.securitymanager.metadataelements.ElementStub; import org.odpi.openmetadata.accessservices.securitymanager.metadataelements.ProfileIdentityElement; +import org.odpi.openmetadata.accessservices.securitymanager.metadataelements.ProfileLocationElement; import org.odpi.openmetadata.accessservices.securitymanager.metadataelements.UserIdentityElement; import org.odpi.openmetadata.accessservices.securitymanager.properties.ActorProfileProperties; import org.odpi.openmetadata.accessservices.securitymanager.properties.ContactMethodProperties; import org.odpi.openmetadata.accessservices.securitymanager.properties.ProfileIdentityProperties; +import org.odpi.openmetadata.accessservices.securitymanager.properties.ProfileLocationProperties; import org.odpi.openmetadata.accessservices.securitymanager.properties.UserIdentityProperties; import org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIMapper; import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; @@ -126,6 +127,7 @@ public B getNewComplexBean(Class beanClass, InstanceProperties entityProperties = new InstanceProperties(entity.getProperties()); userProperties.setQualifiedName(this.removeQualifiedName(entityProperties)); + userProperties.setUserId(this.removeUserId(instanceProperties)); userProperties.setDistinguishedName(this.removeDistinguishedName(instanceProperties)); userProperties.setAdditionalProperties(this.removeAdditionalProperties(entityProperties)); @@ -148,9 +150,11 @@ else if (repositoryHelper.isTypeOf(serviceName, entityTypeName, OpenMetadataAPIM InstanceProperties entityProperties = new InstanceProperties(entity.getProperties()); - contactMethodProperties.setType(this.getContactMethodTypeFromProperties(entityProperties)); - contactMethodProperties.setService(this.removeContactMethodService(entityProperties)); - contactMethodProperties.setValue(this.removeContactMethodValue(entityProperties)); + contactMethodProperties.setName(this.removeName(entityProperties)); + contactMethodProperties.setContactType(this.removeContactType(entityProperties)); + contactMethodProperties.setContactMethodType(this.getContactMethodTypeFromProperties(entityProperties)); + contactMethodProperties.setContactMethodService(this.removeContactMethodService(entityProperties)); + contactMethodProperties.setContactMethodValue(this.removeContactMethodValue(entityProperties)); contactMethodProperties.setEffectiveFrom(entityProperties.getEffectiveFromTime()); contactMethodProperties.setEffectiveTo(entityProperties.getEffectiveToTime()); @@ -182,6 +186,7 @@ else if (repositoryHelper.isTypeOf(serviceName, entityTypeName, OpenMetadataAPIM List teamLeaders = new ArrayList<>(); List teamMembers = new ArrayList<>(); List profileIdentities = new ArrayList<>(); + List locations = new ArrayList<>(); List roles = new ArrayList<>(); List linkedInfrastructure = new ArrayList<>(); @@ -223,6 +228,21 @@ else if (repositoryHelper.isTypeOf(serviceName, relationshipTypeName, OpenMetada linkedInfrastructure.add(elementStub); } + else if (repositoryHelper.isTypeOf(serviceName, relationshipTypeName, OpenMetadataAPIMapper.PROFILE_LOCATION_TYPE_NAME)) + { + EntityProxy entityProxy = relationship.getEntityTwoProxy(); + + ElementStub elementStub = super.getElementStub(beanClass, entityProxy, methodName); + + ProfileLocationElement locationElement = new ProfileLocationElement(); + ProfileLocationProperties locationProperties = new ProfileLocationProperties(); + + locationProperties.setAssociationType(this.removeAssociationType(relationship.getProperties())); + + locationElement.setLocation(elementStub); + locationElement.setProperties(locationProperties); + locations.add(locationElement); + } else if (repositoryHelper.isTypeOf(serviceName, relationshipTypeName, OpenMetadataAPIMapper.PROFILE_IDENTITY_RELATIONSHIP_TYPE_NAME)) { EntityProxy entityProxy = repositoryHelper.getOtherEnd(serviceName, primaryEntity.getGUID(), relationship); @@ -248,7 +268,7 @@ else if (repositoryHelper.isTypeOf(serviceName, relationshipTypeName, OpenMetada if (primaryEntity.getGUID().equals(entityProxy.getGUID())) { /* - * The primary entity is the super team - save sub-team + * The primary entity is the super team - save subteam */ ElementStub elementStub = super.getElementStub(beanClass, relationship.getEntityTwoProxy(), methodName); subTeams.add(elementStub); @@ -291,6 +311,11 @@ else if (repositoryHelper.isTypeOf(serviceName, relationshipTypeName, OpenMetada bean.setPersonRoles(roles); } + if (! locations.isEmpty()) + { + bean.setLocations(locations); + } + if (! linkedInfrastructure.isEmpty()) { bean.setLinkedInfrastructure(linkedInfrastructure); diff --git a/open-metadata-implementation/access-services/security-manager/security-manager-server/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/converters/ContactMethodConverter.java b/open-metadata-implementation/access-services/security-manager/security-manager-server/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/converters/ContactMethodConverter.java index a07cd49e81a..1af192fb5d1 100644 --- a/open-metadata-implementation/access-services/security-manager/security-manager-server/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/converters/ContactMethodConverter.java +++ b/open-metadata-implementation/access-services/security-manager/security-manager-server/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/converters/ContactMethodConverter.java @@ -72,9 +72,11 @@ public B getNewBean(Class beanClass, { entityProperties = new InstanceProperties(entity.getProperties()); - contactMethodProperties.setType(this.getContactMethodTypeFromProperties(entityProperties)); - contactMethodProperties.setService(this.removeContactMethodService(entityProperties)); - contactMethodProperties.setValue(this.removeContactMethodValue(entityProperties)); + contactMethodProperties.setName(this.removeName(entityProperties)); + contactMethodProperties.setContactType(this.removeContactType(entityProperties)); + contactMethodProperties.setContactMethodType(this.getContactMethodTypeFromProperties(entityProperties)); + contactMethodProperties.setContactMethodService(this.removeContactMethodService(entityProperties)); + contactMethodProperties.setContactMethodValue(this.removeContactMethodValue(entityProperties)); contactMethodProperties.setEffectiveFrom(entityProperties.getEffectiveFromTime()); contactMethodProperties.setEffectiveTo(entityProperties.getEffectiveToTime()); diff --git a/open-metadata-implementation/access-services/security-manager/security-manager-server/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/converters/ElementHeaderConverter.java b/open-metadata-implementation/access-services/security-manager/security-manager-server/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/converters/ElementHeaderConverter.java index 0fa068944f3..33b3f82d0e1 100644 --- a/open-metadata-implementation/access-services/security-manager/security-manager-server/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/converters/ElementHeaderConverter.java +++ b/open-metadata-implementation/access-services/security-manager/security-manager-server/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/converters/ElementHeaderConverter.java @@ -33,7 +33,7 @@ public ElementHeaderConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -79,7 +79,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/security-manager/security-manager-server/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/converters/PersonRoleConverter.java b/open-metadata-implementation/access-services/security-manager/security-manager-server/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/converters/PersonRoleConverter.java index 4186a4117e4..e9b43f44d0b 100644 --- a/open-metadata-implementation/access-services/security-manager/security-manager-server/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/converters/PersonRoleConverter.java +++ b/open-metadata-implementation/access-services/security-manager/security-manager-server/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/converters/PersonRoleConverter.java @@ -79,10 +79,12 @@ public B getNewComplexBean(Class beanClass, */ InstanceProperties instanceProperties = new InstanceProperties(primaryEntity.getProperties()); - roleProperties.setRoleId(this.removeQualifiedName(instanceProperties)); + roleProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); + roleProperties.setRoleId(this.removeIdentifier(instanceProperties)); roleProperties.setTitle(this.removeTitle(instanceProperties)); roleProperties.setDescription(this.removeDescription(instanceProperties)); roleProperties.setScope(this.removeScope(instanceProperties)); + roleProperties.setDomainIdentifier(this.removeDomainIdentifier(instanceProperties)); roleProperties.setHeadCountLimitSet(instanceProperties.getPropertyValue(OpenMetadataAPIMapper.HEAD_COUNT_PROPERTY_NAME) != null); roleProperties.setHeadCount(this.removeHeadCount(instanceProperties)); diff --git a/open-metadata-implementation/access-services/security-manager/security-manager-server/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/converters/SecurityManagerConverter.java b/open-metadata-implementation/access-services/security-manager/security-manager-server/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/converters/SecurityManagerConverter.java index bdd017d7d25..78f1fcdb12a 100644 --- a/open-metadata-implementation/access-services/security-manager/security-manager-server/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/converters/SecurityManagerConverter.java +++ b/open-metadata-implementation/access-services/security-manager/security-manager-server/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/converters/SecurityManagerConverter.java @@ -35,7 +35,7 @@ public SecurityManagerConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -105,7 +105,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/security-manager/security-manager-server/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/converters/UserIdentityConverter.java b/open-metadata-implementation/access-services/security-manager/security-manager-server/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/converters/UserIdentityConverter.java index 936d8a51e43..6351a5e000d 100644 --- a/open-metadata-implementation/access-services/security-manager/security-manager-server/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/converters/UserIdentityConverter.java +++ b/open-metadata-implementation/access-services/security-manager/security-manager-server/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/converters/UserIdentityConverter.java @@ -36,7 +36,7 @@ public UserIdentityConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -72,6 +72,7 @@ public B getNewBean(Class beanClass, InstanceProperties instanceProperties = new InstanceProperties(entity.getProperties()); properties.setQualifiedName(this.removeQualifiedName(instanceProperties)); + properties.setUserId(this.removeUserId(instanceProperties)); properties.setDistinguishedName(this.removeDistinguishedName(instanceProperties)); properties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); @@ -102,7 +103,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/security-manager/security-manager-server/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/outtopic/SecurityManagerOMRSTopicListener.java b/open-metadata-implementation/access-services/security-manager/security-manager-server/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/outtopic/SecurityManagerOMRSTopicListener.java index 2290ae1e3c3..4ad5d86af59 100644 --- a/open-metadata-implementation/access-services/security-manager/security-manager-server/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/outtopic/SecurityManagerOMRSTopicListener.java +++ b/open-metadata-implementation/access-services/security-manager/security-manager-server/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/outtopic/SecurityManagerOMRSTopicListener.java @@ -145,7 +145,7 @@ public void processUpdatedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entityProxy details of the entityProxy with the new classification added. No guarantee this is all of the classifications. + * @param entityProxy details of the entityProxy with the new classification added. No guarantee this is all the classifications. * @param classification new classification */ @Override @@ -184,7 +184,7 @@ public void processClassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity with the new classification added. No guarantee this is all of the classifications. + * @param entity details of the entity with the new classification added. No guarantee this is all the classifications. * @param classification new classification */ @Override @@ -261,7 +261,7 @@ public void processClassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entityProxy details of the entityProxy after the classification has been removed. No guarantee this is all of the classifications. + * @param entityProxy details of the entityProxy after the classification has been removed. No guarantee this is all the classifications. * @param originalClassification classification that was removed */ @Override @@ -300,7 +300,7 @@ public void processDeclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity after the classification has been removed. No guarantee this is all of the classifications. + * @param entity details of the entity after the classification has been removed. No guarantee this is all the classifications. * @param originalClassification classification that was removed */ @Override @@ -377,7 +377,7 @@ public void processDeclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entityProxy details of the entityProxy after the classification has been changed. No guarantee this is all of the classifications. + * @param entityProxy details of the entityProxy after the classification has been changed. No guarantee this is all the classifications. * @param originalClassification classification that was removed * @param classification new classification */ @@ -418,7 +418,7 @@ public void processReclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity after the classification has been changed. No guarantee this is all of the classifications. + * @param entity details of the entity after the classification has been changed. No guarantee this is all the classifications. * @param originalClassification classification that was removed * @param classification new classification */ diff --git a/open-metadata-implementation/access-services/security-manager/security-manager-server/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/server/SecurityManagerRESTServices.java b/open-metadata-implementation/access-services/security-manager/security-manager-server/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/server/SecurityManagerRESTServices.java index 1bcc17084ed..b083d14e28f 100644 --- a/open-metadata-implementation/access-services/security-manager/security-manager-server/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/server/SecurityManagerRESTServices.java +++ b/open-metadata-implementation/access-services/security-manager/security-manager-server/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/server/SecurityManagerRESTServices.java @@ -686,6 +686,7 @@ public GUIDResponse createUserIdentity(String serverName, null, null, requestBody.getQualifiedName(), + requestBody.getUserId(), requestBody.getDistinguishedName(), requestBody.getAdditionalProperties(), requestBody.getTypeName(), @@ -753,6 +754,7 @@ public VoidResponse updateUserIdentity(String serverName, userIdentityGUID, guidParameterName, requestBody.getQualifiedName(), + requestBody.getUserId(), requestBody.getDistinguishedName(), requestBody.getAdditionalProperties(), requestBody.getTypeName(), diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/metadataelements/ElementVersions.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/metadataelements/ElementVersions.java index d839f0b1408..509e75000ca 100644 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/metadataelements/ElementVersions.java +++ b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/metadataelements/ElementVersions.java @@ -17,7 +17,7 @@ /** * ElementVersions provides the version information for the element plus details of the creation time and last - * update time. Finally it lists all of the users that have made changes to this element. + * update time. Finally it lists all the users that have made changes to this element. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-server/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/converters/ElementHeaderConverter.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-server/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/converters/ElementHeaderConverter.java index cac6d3787f1..a5cc94ede27 100644 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-server/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/converters/ElementHeaderConverter.java +++ b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-server/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/converters/ElementHeaderConverter.java @@ -33,7 +33,7 @@ public ElementHeaderConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create @@ -79,7 +79,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-server/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/converters/ElementStubConverter.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-server/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/converters/ElementStubConverter.java index 106fa91bf3d..5935e2ac0dd 100644 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-server/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/converters/ElementStubConverter.java +++ b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-server/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/converters/ElementStubConverter.java @@ -37,7 +37,7 @@ public ElementStubConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entityProxy and that of a connected relationship. * * @param beanClass name of the class to create @@ -77,7 +77,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an relationship and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-server/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/outtopic/StewardshipActionOMRSTopicListener.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-server/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/outtopic/StewardshipActionOMRSTopicListener.java index 09c57260361..bea4099cc0b 100644 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-server/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/outtopic/StewardshipActionOMRSTopicListener.java +++ b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-server/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/outtopic/StewardshipActionOMRSTopicListener.java @@ -145,7 +145,7 @@ public void processUpdatedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entityProxy details of the entityProxy with the new classification added. No guarantee this is all of the classifications. + * @param entityProxy details of the entityProxy with the new classification added. No guarantee this is all the classifications. * @param classification new classification */ @Override @@ -184,7 +184,7 @@ public void processClassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity with the new classification added. No guarantee this is all of the classifications. + * @param entity details of the entity with the new classification added. No guarantee this is all the classifications. * @param classification new classification */ @Override @@ -261,7 +261,7 @@ public void processClassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entityProxy details of the entityProxy after the classification has been removed. No guarantee this is all of the classifications. + * @param entityProxy details of the entityProxy after the classification has been removed. No guarantee this is all the classifications. * @param originalClassification classification that was removed */ @Override @@ -300,7 +300,7 @@ public void processDeclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity after the classification has been removed. No guarantee this is all of the classifications. + * @param entity details of the entity after the classification has been removed. No guarantee this is all the classifications. * @param originalClassification classification that was removed */ @Override @@ -377,7 +377,7 @@ public void processDeclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entityProxy details of the entityProxy after the classification has been changed. No guarantee this is all of the classifications. + * @param entityProxy details of the entityProxy after the classification has been changed. No guarantee this is all the classifications. * @param originalClassification classification that was removed * @param classification new classification */ @@ -418,7 +418,7 @@ public void processReclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity after the classification has been changed. No guarantee this is all of the classifications. + * @param entity details of the entity after the classification has been changed. No guarantee this is all the classifications. * @param originalClassification classification that was removed * @param classification new classification */ diff --git a/open-metadata-implementation/access-services/subject-area/subject-area-api/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/properties/objects/project/Project.java b/open-metadata-implementation/access-services/subject-area/subject-area-api/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/properties/objects/project/Project.java index 3eea499157e..659b4919392 100644 --- a/open-metadata-implementation/access-services/subject-area/subject-area-api/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/properties/objects/project/Project.java +++ b/open-metadata-implementation/access-services/subject-area/subject-area-api/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/properties/objects/project/Project.java @@ -34,10 +34,16 @@ public Project() { nodeType = NodeType.Project; } + private String identifier = null; private Date startDate = null; private Date plannedEndDate = null; private String status = null; + + public String getIdentifier() { return identifier; } + + public void setIdentifier(String identifier) { this.identifier = identifier;} + public Date getStartDate() { return startDate; } @@ -107,6 +113,7 @@ public boolean equals(Object o) { Project project = (Project) o; if (!(this.equals(o))) return false; + if (!Objects.equals(identifier, project.identifier)) return false; if (!Objects.equals(startDate, project.startDate)) return false; if (!Objects.equals(plannedEndDate, project.plannedEndDate)) return false; return Objects.equals(status, project.status); @@ -115,6 +122,7 @@ public boolean equals(Object o) { @Override public int hashCode() { int result = super.hashCode(); + result = 31 * result + (identifier != null ? identifier.hashCode() : 0); result = 31 * result + (startDate != null ? startDate.hashCode() : 0); result = 31 * result + (plannedEndDate != null ? plannedEndDate.hashCode() : 0); result = 31 * result + (status != null ? status.hashCode() : 0); diff --git a/open-metadata-implementation/access-services/subject-area/subject-area-server/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/handlers/SubjectAreaProjectHandler.java b/open-metadata-implementation/access-services/subject-area/subject-area-server/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/handlers/SubjectAreaProjectHandler.java index 942e14aeae9..bec282a4f14 100644 --- a/open-metadata-implementation/access-services/subject-area/subject-area-server/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/handlers/SubjectAreaProjectHandler.java +++ b/open-metadata-implementation/access-services/subject-area/subject-area-server/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/handlers/SubjectAreaProjectHandler.java @@ -98,8 +98,8 @@ public SubjectAreaOMASAPIResponse createProject(String userId, Project effectiveTo = new Date(suppliedProject.getEffectiveToTime()); } - ProjectBuilder builder = new ProjectBuilder( - suppliedProject.getQualifiedName(), + ProjectBuilder builder = new ProjectBuilder(suppliedProject.getQualifiedName(), + suppliedProject.getIdentifier(), suppliedProject.getName(), suppliedProject.getDescription(), suppliedProject.getStartDate(), diff --git a/open-metadata-implementation/adapters/open-connectors/dynamic-archiver-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/dynamicarchivers/DynamicArchiveService.java b/open-metadata-implementation/adapters/open-connectors/dynamic-archiver-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/dynamicarchivers/DynamicArchiveService.java index e13cb2b1eee..9a950bbaead 100644 --- a/open-metadata-implementation/adapters/open-connectors/dynamic-archiver-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/dynamicarchivers/DynamicArchiveService.java +++ b/open-metadata-implementation/adapters/open-connectors/dynamic-archiver-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/dynamicarchivers/DynamicArchiveService.java @@ -154,7 +154,7 @@ protected void validateContext(RepositoryGovernanceContext governanceContext) th /** * Once the content of the archive has been added to the archive builder, an archive object can be retrieved. * - * @return open metadata archive object with all of the supplied content in it. + * @return open metadata archive object with all the supplied content in it. */ public OpenMetadataArchive getOpenMetadataArchive() { @@ -720,7 +720,7 @@ protected ArchiveDestination(OpenMetadataArchiveStoreConnector store) /** * Once the content of the archive has been added to the archive builder, an archive object can be retrieved. * - * @return open metadata archive object with all of the supplied content in it. + * @return open metadata archive object with all the supplied content in it. */ @Override public OpenMetadataArchive getOpenMetadataArchive() diff --git a/open-metadata-implementation/adapters/open-connectors/dynamic-archiver-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/dynamicarchivers/ffdc/DynamicArchiverConnectorsAuditCode.java b/open-metadata-implementation/adapters/open-connectors/dynamic-archiver-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/dynamicarchivers/ffdc/DynamicArchiverConnectorsAuditCode.java index 4e257286ac8..0ffb730b9b3 100644 --- a/open-metadata-implementation/adapters/open-connectors/dynamic-archiver-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/dynamicarchivers/ffdc/DynamicArchiverConnectorsAuditCode.java +++ b/open-metadata-implementation/adapters/open-connectors/dynamic-archiver-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/dynamicarchivers/ffdc/DynamicArchiverConnectorsAuditCode.java @@ -62,7 +62,7 @@ public enum DynamicArchiverConnectorsAuditCode implements AuditLogMessageSet OMRSAuditLogRecordSeverity.ERROR, "The {0} governance action service is unable to provision file {1} to {2} destination folder using {3} file pattern.", "This message is logged and the governance action is marked as failed", - "Since no exception occurred it means that there are currently files already occupying all of the possible file names allowed by the file pattern. " + + "Since no exception occurred it means that there are currently files already occupying all the possible file names allowed by the file pattern. " + "Files in the destination folder need to be deleted or this connector needs to be reconfigured with a new destination folder or file pattern."), diff --git a/open-metadata-implementation/adapters/open-connectors/event-bus-connectors/open-metadata-topic-connectors/inmemory-open-metadata-topic-connector/src/main/java/org/odpi/openmetadata/adapters/eventbus/topic/inmemory/InMemoryOpenMetadataTopicConnector.java b/open-metadata-implementation/adapters/open-connectors/event-bus-connectors/open-metadata-topic-connectors/inmemory-open-metadata-topic-connector/src/main/java/org/odpi/openmetadata/adapters/eventbus/topic/inmemory/InMemoryOpenMetadataTopicConnector.java index d8c10db69f1..2ab06dd3f48 100644 --- a/open-metadata-implementation/adapters/open-connectors/event-bus-connectors/open-metadata-topic-connectors/inmemory-open-metadata-topic-connector/src/main/java/org/odpi/openmetadata/adapters/eventbus/topic/inmemory/InMemoryOpenMetadataTopicConnector.java +++ b/open-metadata-implementation/adapters/open-connectors/event-bus-connectors/open-metadata-topic-connectors/inmemory-open-metadata-topic-connector/src/main/java/org/odpi/openmetadata/adapters/eventbus/topic/inmemory/InMemoryOpenMetadataTopicConnector.java @@ -38,7 +38,7 @@ private synchronized void putEvent(String newEvent) /** - * Returns all of the events found on the in memory OMRS Topic. + * Returns all the events found on the in memory OMRS Topic. * * @return list of received events. */ diff --git a/open-metadata-implementation/adapters/open-connectors/event-bus-connectors/open-metadata-topic-connectors/kafka-open-metadata-topic-connector/src/main/java/org/odpi/openmetadata/adapters/eventbus/topic/kafka/KafkaOpenMetadataEventConsumer.java b/open-metadata-implementation/adapters/open-connectors/event-bus-connectors/open-metadata-topic-connectors/kafka-open-metadata-topic-connector/src/main/java/org/odpi/openmetadata/adapters/eventbus/topic/kafka/KafkaOpenMetadataEventConsumer.java index fefea991930..38ee10e4ddb 100644 --- a/open-metadata-implementation/adapters/open-connectors/event-bus-connectors/open-metadata-topic-connectors/kafka-open-metadata-topic-connector/src/main/java/org/odpi/openmetadata/adapters/eventbus/topic/kafka/KafkaOpenMetadataEventConsumer.java +++ b/open-metadata-implementation/adapters/open-connectors/event-bus-connectors/open-metadata-topic-connectors/kafka-open-metadata-topic-connector/src/main/java/org/odpi/openmetadata/adapters/eventbus/topic/kafka/KafkaOpenMetadataEventConsumer.java @@ -270,7 +270,7 @@ public void run() if (! changesCommitted) { //Figure out why no changes were committed. There are 3 possibilities: // 1) Auto commit is enabled - // 2) All of the unprocessed event queues are empty + // 2) all the unprocessed event queues are empty // 3) We are waiting for some event to finish processing if (! isAutoCommitEnabled) { diff --git a/open-metadata-implementation/adapters/open-connectors/event-bus-connectors/open-metadata-topic-connectors/kafka-open-metadata-topic-connector/src/main/java/org/odpi/openmetadata/adapters/eventbus/topic/kafka/KafkaOpenMetadataEventProducer.java b/open-metadata-implementation/adapters/open-connectors/event-bus-connectors/open-metadata-topic-connectors/kafka-open-metadata-topic-connector/src/main/java/org/odpi/openmetadata/adapters/eventbus/topic/kafka/KafkaOpenMetadataEventProducer.java index f927210d2d2..28f7f7fa3f3 100644 --- a/open-metadata-implementation/adapters/open-connectors/event-bus-connectors/open-metadata-topic-connectors/kafka-open-metadata-topic-connector/src/main/java/org/odpi/openmetadata/adapters/eventbus/topic/kafka/KafkaOpenMetadataEventProducer.java +++ b/open-metadata-implementation/adapters/open-connectors/event-bus-connectors/open-metadata-topic-connectors/kafka-open-metadata-topic-connector/src/main/java/org/odpi/openmetadata/adapters/eventbus/topic/kafka/KafkaOpenMetadataEventProducer.java @@ -282,7 +282,7 @@ private int getSendBufferSize() { /** - * Returns all of the events found on the in memory OMRS Topic. + * Returns all the events found on the in memory OMRS Topic. * * @return list of received events. */ diff --git a/open-metadata-implementation/adapters/open-connectors/governance-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/governanceactions/ffdc/GovernanceActionConnectorsAuditCode.java b/open-metadata-implementation/adapters/open-connectors/governance-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/governanceactions/ffdc/GovernanceActionConnectorsAuditCode.java index 348e41a131e..263fc42957b 100644 --- a/open-metadata-implementation/adapters/open-connectors/governance-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/governanceactions/ffdc/GovernanceActionConnectorsAuditCode.java +++ b/open-metadata-implementation/adapters/open-connectors/governance-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/governanceactions/ffdc/GovernanceActionConnectorsAuditCode.java @@ -62,7 +62,7 @@ public enum GovernanceActionConnectorsAuditCode implements AuditLogMessageSet OMRSAuditLogRecordSeverity.ERROR, "The {0} governance action service is unable to provision file {1} to {2} destination folder using {3} file pattern.", "This message is logged and the governance action is marked as failed", - "Since no exception occurred it means that there are currently files already occupying all of the possible file names allowed by the file pattern. " + + "Since no exception occurred it means that there are currently files already occupying all the possible file names allowed by the file pattern. " + "Files in the destination folder need to be deleted or this connector needs to be reconfigured with a new destination folder or file pattern."), diff --git a/open-metadata-implementation/adapters/open-connectors/integration-connectors/files-integration-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/basicfiles/DataFilesMonitorIntegrationConnector.java b/open-metadata-implementation/adapters/open-connectors/integration-connectors/files-integration-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/basicfiles/DataFilesMonitorIntegrationConnector.java index 07d6603cf97..a16086dc22b 100644 --- a/open-metadata-implementation/adapters/open-connectors/integration-connectors/files-integration-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/basicfiles/DataFilesMonitorIntegrationConnector.java +++ b/open-metadata-implementation/adapters/open-connectors/integration-connectors/files-integration-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/basicfiles/DataFilesMonitorIntegrationConnector.java @@ -105,7 +105,7 @@ public void onDirectoryDelete(File directory) * as well as any external REST API calls to explicitly refresh the connector. * * This method performs two sweeps. It first retrieves the files in the directory and validates that are in the - * catalog - adding or updating them if necessary. The second sweep is to ensure that all of the assets catalogued + * catalog - adding or updating them if necessary. The second sweep is to ensure that all the assets catalogued * in this directory actually exist on the file system. * * @throws ConnectorCheckedException there is a problem with the connector. It is not able to refresh the metadata. diff --git a/open-metadata-implementation/adapters/open-connectors/integration-connectors/kafka-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/kafka/KafkaMonitorIntegrationConnector.java b/open-metadata-implementation/adapters/open-connectors/integration-connectors/kafka-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/kafka/KafkaMonitorIntegrationConnector.java index 1f8314487eb..52e7a921c5b 100644 --- a/open-metadata-implementation/adapters/open-connectors/integration-connectors/kafka-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/kafka/KafkaMonitorIntegrationConnector.java +++ b/open-metadata-implementation/adapters/open-connectors/integration-connectors/kafka-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/kafka/KafkaMonitorIntegrationConnector.java @@ -118,7 +118,7 @@ public void start() throws ConnectorCheckedException * as well as any external REST API calls to explicitly refresh the connector. * * This method performs two sweeps. It first retrieves the topics from the event broker (Kafka) and validates that are in the - * catalog - adding or updating them if necessary. The second sweep is to ensure that all of the topics catalogued + * catalog - adding or updating them if necessary. The second sweep is to ensure that all the topics catalogued * actually exist in the event broker. * * @throws ConnectorCheckedException there is a problem with the connector. It is not able to refresh the metadata. diff --git a/open-metadata-implementation/adapters/open-connectors/integration-connectors/openapi-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/openapis/OpenAPIMonitorIntegrationConnector.java b/open-metadata-implementation/adapters/open-connectors/integration-connectors/openapi-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/openapis/OpenAPIMonitorIntegrationConnector.java index b5a7cbd161d..f88f5924396 100644 --- a/open-metadata-implementation/adapters/open-connectors/integration-connectors/openapi-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/openapis/OpenAPIMonitorIntegrationConnector.java +++ b/open-metadata-implementation/adapters/open-connectors/integration-connectors/openapi-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/openapis/OpenAPIMonitorIntegrationConnector.java @@ -182,7 +182,7 @@ public void processEvent(DataManagerOutboundEvent event) /** - * Retrieve all of the Endpoints + * Retrieve all the Endpoints */ private void getRESTClients() { @@ -358,7 +358,7 @@ public void refresh() throws ConnectorCheckedException } /* - * All of the discovered APIs are added to the server's endpoint. + * all the discovered APIs are added to the server's endpoint. */ String endpointGUID = this.getEndpointGUID(url, openAPISpecification); diff --git a/open-metadata-implementation/adapters/open-connectors/integration-connectors/openapi-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/openapis/ffdc/OpenAPIIntegrationConnectorAuditCode.java b/open-metadata-implementation/adapters/open-connectors/integration-connectors/openapi-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/openapis/ffdc/OpenAPIIntegrationConnectorAuditCode.java index 7279443b388..5e5dcd2195d 100644 --- a/open-metadata-implementation/adapters/open-connectors/integration-connectors/openapi-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/openapis/ffdc/OpenAPIIntegrationConnectorAuditCode.java +++ b/open-metadata-implementation/adapters/open-connectors/integration-connectors/openapi-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/openapis/ffdc/OpenAPIIntegrationConnectorAuditCode.java @@ -72,7 +72,7 @@ public enum OpenAPIIntegrationConnectorAuditCode implements AuditLogMessageSet OMRSAuditLogRecordSeverity.INFO, "The {0} integration connector retrieved the Open API Specification from URL {1} ({2} ({3})) and catalogued {4} APIs with a total of {5} operations.", "The connector extracted the content of the Open API, retrieved/created the endpoint for it and created a DeployedAPI asset for each 'tag' linked to an APIOperation for each 'path/operation' pair", - "Validate that the connector is extracting all of the required information for your use case."), + "Validate that the connector is extracting all the required information for your use case."), UNABLE_TO_RETRIEVE_OPEN_API_SPEC("OPEN-API-INTEGRATION-CONNECTOR-0008", OMRSAuditLogRecordSeverity.EXCEPTION, diff --git a/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/cohort-registry-store-connectors/cohort-registry-file-store-connector/src/main/java/org/odpi/openmetadata/adapters/repositoryservices/cohortregistrystore/file/FileBasedRegistryStoreConnector.java b/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/cohort-registry-store-connectors/cohort-registry-file-store-connector/src/main/java/org/odpi/openmetadata/adapters/repositoryservices/cohortregistrystore/file/FileBasedRegistryStoreConnector.java index 649b3167958..8372147729e 100644 --- a/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/cohort-registry-store-connectors/cohort-registry-file-store-connector/src/main/java/org/odpi/openmetadata/adapters/repositoryservices/cohortregistrystore/file/FileBasedRegistryStoreConnector.java +++ b/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/cohort-registry-store-connectors/cohort-registry-file-store-connector/src/main/java/org/odpi/openmetadata/adapters/repositoryservices/cohortregistrystore/file/FileBasedRegistryStoreConnector.java @@ -141,7 +141,7 @@ public synchronized MemberRegistration retrieveLocalRegistration() * Remove details of the local registration from the cohort registry store. This is used when the local * repository unregisters from the open metadata repository cohort. * - * There is a side-effect that all of the remote registrations are removed to since the local repository is + * There is a side-effect that all the remote registrations are removed to since the local repository is * no longer a member of this cohort. */ @Override @@ -234,7 +234,7 @@ public synchronized void saveRemoteRegistration(MemberRegistration remoteRegist /** - * Return a list of all of the remote metadata repositories registered in the metadata repository cohort. + * Return a list of all the remote metadata repositories registered in the metadata repository cohort. * * @return Remote registrations list */ diff --git a/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/graph-repository-connector/src/main/java/org/odpi/openmetadata/adapters/repositoryservices/graphrepository/repositoryconnector/GraphOMRSMetadataCollection.java b/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/graph-repository-connector/src/main/java/org/odpi/openmetadata/adapters/repositoryservices/graphrepository/repositoryconnector/GraphOMRSMetadataCollection.java index afd5d4818c0..7eea960e379 100644 --- a/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/graph-repository-connector/src/main/java/org/odpi/openmetadata/adapters/repositoryservices/graphrepository/repositoryconnector/GraphOMRSMetadataCollection.java +++ b/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/graph-repository-connector/src/main/java/org/odpi/openmetadata/adapters/repositoryservices/graphrepository/repositoryconnector/GraphOMRSMetadataCollection.java @@ -4488,7 +4488,7 @@ public List getRelatedEntities(String userId, } - // Return all of the relationships and intermediate entities that connect the startEntity with the endEntity. + // Return all the relationships and intermediate entities that connect the startEntity with the endEntity. @Override public InstanceGraph getLinkingEntities(String userId, String startEntityGUID, diff --git a/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/graph-repository-connector/src/main/java/org/odpi/openmetadata/adapters/repositoryservices/graphrepository/repositoryconnector/GraphOMRSMetadataStore.java b/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/graph-repository-connector/src/main/java/org/odpi/openmetadata/adapters/repositoryservices/graphrepository/repositoryconnector/GraphOMRSMetadataStore.java index 3e9c8b09f49..6f28327d855 100644 --- a/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/graph-repository-connector/src/main/java/org/odpi/openmetadata/adapters/repositoryservices/graphrepository/repositoryconnector/GraphOMRSMetadataStore.java +++ b/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/graph-repository-connector/src/main/java/org/odpi/openmetadata/adapters/repositoryservices/graphrepository/repositoryconnector/GraphOMRSMetadataStore.java @@ -8491,7 +8491,7 @@ private GraphTraversal parseEntityInOperatorToCriterion(String /* * The strategy is to: * - * a) check the supplied value is an Array and that it contains primitive elements that are all of the same primitive category + * a) check the supplied value is an Array and that it contains primitive elements that are all the same primitive category * * b) determine whether the specified property is a core or type-defined attribute and check that it is a primitive and has * the same primitive category as the elements in the array. @@ -8502,7 +8502,7 @@ private GraphTraversal parseEntityInOperatorToCriterion(String /* * a) Validate the supplied match value is an array property and has elements that are primitive - * and all of the same primitive category. Remember the primitive category. + * and all the same primitive category. Remember the primitive category. * * If any condition fails, throw InvalidParameterException naming the property. * @@ -8510,7 +8510,7 @@ private GraphTraversal parseEntityInOperatorToCriterion(String * compare the named primitive property. * * Before going much further, validate that the parameter is an array and that it has - * only primitive elements and they are all of the same primitive category. + * only primitive elements and they are all the same primitive category. */ ArrayPropertyValue apv = (ArrayPropertyValue)value; @@ -8962,7 +8962,7 @@ private GraphTraversal parseRelationshipInOperatorToCriterion(Stri /* * The strategy is to: * - * a) check the supplied value is an Array and that it contains primitive elements that are all of the same primitive category + * a) check the supplied value is an Array and that it contains primitive elements that are all the same primitive category * * b) determine whether the specified property is a core or type-defined attribute and check that it is a primitive and has * the same primitive category as the elements in the array. @@ -8973,7 +8973,7 @@ private GraphTraversal parseRelationshipInOperatorToCriterion(Stri /* * a) Validate the supplied match value is an array property and has elements that are primitive - * and all of the same primitive category. Remember the primitive category. + * and all the same primitive category. Remember the primitive category. * * If any condition fails, throw InvalidParameterException naming the property. * @@ -8981,7 +8981,7 @@ private GraphTraversal parseRelationshipInOperatorToCriterion(Stri * compare the named primitive property. * * Before going much further, validate that the parameter is an array and that it has - * only primitive elements and they are all of the same primitive category. + * only primitive elements and they are all the same primitive category. */ ArrayPropertyValue apv = (ArrayPropertyValue)value; diff --git a/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/inmemory-repository-connector/src/main/java/org/odpi/openmetadata/adapters/repositoryservices/inmemory/repositoryconnector/InMemoryOMRSMetadataCollection.java b/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/inmemory-repository-connector/src/main/java/org/odpi/openmetadata/adapters/repositoryservices/inmemory/repositoryconnector/InMemoryOMRSMetadataCollection.java index d31e980dd59..34a6fe22132 100644 --- a/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/inmemory-repository-connector/src/main/java/org/odpi/openmetadata/adapters/repositoryservices/inmemory/repositoryconnector/InMemoryOMRSMetadataCollection.java +++ b/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/inmemory-repository-connector/src/main/java/org/odpi/openmetadata/adapters/repositoryservices/inmemory/repositoryconnector/InMemoryOMRSMetadataCollection.java @@ -4036,7 +4036,7 @@ public void saveEntityReferenceCopy(String userId, * * @param userId unique identifier for requesting user. * @param entityGUID unique identifier of the entity with classifications to retrieve - * @return list of all of the classifications for this entity that are homed in this repository + * @return list of all the classifications for this entity that are homed in this repository * @throws InvalidParameterException the entity is null. * @throws RepositoryErrorException there is a problem communicating with the metadata repository where * the metadata collection is stored. diff --git a/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/inmemory-repository-connector/src/main/java/org/odpi/openmetadata/adapters/repositoryservices/inmemory/repositoryconnector/InMemoryOMRSMetadataStore.java b/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/inmemory-repository-connector/src/main/java/org/odpi/openmetadata/adapters/repositoryservices/inmemory/repositoryconnector/InMemoryOMRSMetadataStore.java index 1177464816c..97448043623 100644 --- a/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/inmemory-repository-connector/src/main/java/org/odpi/openmetadata/adapters/repositoryservices/inmemory/repositoryconnector/InMemoryOMRSMetadataStore.java +++ b/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/inmemory-repository-connector/src/main/java/org/odpi/openmetadata/adapters/repositoryservices/inmemory/repositoryconnector/InMemoryOMRSMetadataStore.java @@ -93,7 +93,7 @@ synchronized Map timeWarpEntityStore(Date asOfTim Map timeWarpedEntityStore = new HashMap<>(); /* - * First step through the current relationship store and extract all of the relationships that were + * First step through the current relationship store and extract all the relationships that were * last updated before the asOfTime. */ for (EntityDetail entity : entityStore.values()) @@ -200,7 +200,7 @@ synchronized Map timeWarpRelationshipStore(Date a /* - * First step through the current relationship store and extract all of the relationships that were + * First step through the current relationship store and extract all the relationships that were * last updated before the asOfTime. */ for (Relationship relationship : relationshipStore.values()) diff --git a/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/omrs-rest-repository-connector/src/main/java/org/odpi/openmetadata/adapters/repositoryservices/rest/repositoryconnector/OMRSRESTMetadataCollection.java b/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/omrs-rest-repository-connector/src/main/java/org/odpi/openmetadata/adapters/repositoryservices/rest/repositoryconnector/OMRSRESTMetadataCollection.java index 1b9e07ccd33..bd9620881ee 100644 --- a/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/omrs-rest-repository-connector/src/main/java/org/odpi/openmetadata/adapters/repositoryservices/rest/repositoryconnector/OMRSRESTMetadataCollection.java +++ b/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/omrs-rest-repository-connector/src/main/java/org/odpi/openmetadata/adapters/repositoryservices/rest/repositoryconnector/OMRSRESTMetadataCollection.java @@ -276,7 +276,7 @@ public TypeDefGallery findTypesByName(String userId, /** - * Returns all of the TypeDefs for a specific category. + * Returns all the TypeDefs for a specific category. * * @param userId unique identifier for requesting user. * @param category enum value for the category of TypeDef to return. @@ -299,7 +299,7 @@ public List findTypeDefsByCategory(String userId, /** - * Returns all of the AttributeTypeDefs for a specific category. + * Returns all the AttributeTypeDefs for a specific category. * * @param userId unique identifier for requesting user. * @param category enum value for the category of an AttributeTypeDef to return. @@ -1683,7 +1683,7 @@ public List findRelationshipsByPropertyValue(String /** - * Return all of the relationships and intermediate entities that connect the startEntity with the endEntity. + * Return all the relationships and intermediate entities that connect the startEntity with the endEntity. * * @param userId unique identifier for requesting user. * @param startEntityGUID The entity that is used to anchor the query. @@ -2943,7 +2943,7 @@ public void saveEntityReferenceCopy(String userId, * * @param userId unique identifier for requesting user. * @param entityGUID unique identifier of the entity with classifications to retrieve - * @return list of all of the classifications for this entity that are homed in this repository + * @return list of all the classifications for this entity that are homed in this repository * @throws InvalidParameterException the entity is null. * @throws RepositoryErrorException there is a problem communicating with the metadata repository where * the metadata collection is stored. @@ -2988,7 +2988,7 @@ public List getHomeClassifications(String userId, * @param userId unique identifier for requesting user. * @param entityGUID unique identifier of the entity with classifications to retrieve * @param asOfTime the time used to determine which version of the entity that is desired. - * @return list of all of the classifications for this entity that are homed in this repository + * @return list of all the classifications for this entity that are homed in this repository * @throws InvalidParameterException the entity is null. * @throws RepositoryErrorException there is a problem communicating with the metadata repository where * the metadata collection is stored. diff --git a/open-metadata-implementation/admin-services/admin-services-api/src/main/java/org/odpi/openmetadata/adminservices/ffdc/OMAGAdminAuditCode.java b/open-metadata-implementation/admin-services/admin-services-api/src/main/java/org/odpi/openmetadata/adminservices/ffdc/OMAGAdminAuditCode.java index d85a4842412..1a58d01baf7 100644 --- a/open-metadata-implementation/admin-services/admin-services-api/src/main/java/org/odpi/openmetadata/adminservices/ffdc/OMAGAdminAuditCode.java +++ b/open-metadata-implementation/admin-services/admin-services-api/src/main/java/org/odpi/openmetadata/adminservices/ffdc/OMAGAdminAuditCode.java @@ -56,7 +56,7 @@ public enum OMAGAdminAuditCode implements AuditLogMessageSet OMRSAuditLogRecordSeverity.STARTUP, "The {0} server has successfully completed start up. The following services are running: {1}", "The request to start the server returns with a list of the services that were started.", - "Review the start up messages to ensure that all of the correct services have been started and the " + + "Review the start up messages to ensure that all the correct services have been started and the " + "are operating without errors."), SERVER_SHUTDOWN_STARTED("OMAG-ADMIN-0005", @@ -65,14 +65,14 @@ public enum OMAGAdminAuditCode implements AuditLogMessageSet "The request to stop the server has been issued, either through an explicit command, or because the" + "OMAG Server Platform is shutting down. The operational admin services will sequentially shutdown " + "each of the server's running subsystems.", - "Review the shutdown messages to ensure that all of the services are shutting down without errors."), + "Review the shutdown messages to ensure that all the services are shutting down without errors."), SERVER_SHUTDOWN_SUCCESS("OMAG-ADMIN-0006", OMRSAuditLogRecordSeverity.SHUTDOWN, "The {0} server has completed shutdown", "The request to shutdown the server has completed. No REST API calls nor events will be " + "processed by this server until it is restarted.", - "Review the shutdown messages to ensure that all of the subsystems have successfully released the" + + "Review the shutdown messages to ensure that all the subsystems have successfully released the" + "resources that they were using."), SERVER_SHUTDOWN_ERROR("OMAG-ADMIN-0007", @@ -80,7 +80,7 @@ public enum OMAGAdminAuditCode implements AuditLogMessageSet "The {0} server has detected an {1} exception during server shutdown. The error message was {2}", "The request to shutdown the server has failed with an exception. The server is in an " + "undetermined state.", - "Review the shutdown messages to ensure that all of the subsystems have successfully released the" + + "Review the shutdown messages to ensure that all the subsystems have successfully released the" + "resources that they were using. Restart the server whenever its services are needed again."), STARTING_ACCESS_SERVICES("OMAG-ADMIN-0010", @@ -107,13 +107,13 @@ public enum OMAGAdminAuditCode implements AuditLogMessageSet ALL_ACCESS_SERVICES_STARTED("OMAG-ADMIN-0012", OMRSAuditLogRecordSeverity.STARTUP, "{0} out of {1} configured Open Metadata Access Services (OMASs) have started.", - "The operational admin services have completed the initialization of all of the access service subsystems " + + "The operational admin services have completed the initialization of all the access service subsystems " + "enabled in the metadata server. They are ready for use. An access services is configured by adding " + "its configuration to the server's configuration document. By default a newly configured access " + "service is also ENABLED. A configured access service may be temporarily disabled in the configuration" + "document. In which case the start up sequence skips it and the number of started access services" + "is less than the number of configured access services.", - "Review the start up messages to ensure that all of the correct access services have been started " + + "Review the start up messages to ensure that all the correct access services have been started " + "and they are operating without errors."), STOPPING_ACCESS_SERVICES("OMAG-ADMIN-0013", @@ -189,13 +189,13 @@ public enum OMAGAdminAuditCode implements AuditLogMessageSet ALL_VIEW_SERVICES_STARTED("OMAG-ADMIN-0022", OMRSAuditLogRecordSeverity.STARTUP, "{0} out of {1} configured Open Metadata View Services (OMVSs) have started.", - "The operational admin services have completed the initialization of all of the view service subsystems " + + "The operational admin services have completed the initialization of all the view service subsystems " + "enabled in the view server. They are ready for use. An view service is configured by adding " + "its configuration to the server's configuration document. By default a newly configured view " + "service is also ENABLED. A configured view service may be temporarily disabled in the configuration" + "document. In which case the start up sequence skips it and the number of started view services" + "is less than the number of configured view services.", - "Review the start up messages to ensure that all of the correct view services have been started " + + "Review the start up messages to ensure that all the correct view services have been started " + "and they are operating without errors."), STOPPING_VIEW_SERVICES("OMAG-ADMIN-0023", @@ -272,13 +272,13 @@ public enum OMAGAdminAuditCode implements AuditLogMessageSet ALL_ENGINE_SERVICES_STARTED("OMAG-ADMIN-0042", OMRSAuditLogRecordSeverity.STARTUP, "{0} out of {1} configured Open Metadata Engine Services (OMESs) have started.", - "The operational admin services have completed the initialization of all of the engine service subsystems " + + "The operational admin services have completed the initialization of all the engine service subsystems " + "enabled in the engine host server. They are ready for use. An engine service is configured by adding " + "its configuration to the server's configuration document. By default a newly configured engine " + "service is also ENABLED. A configured engine service may be temporarily disabled in the configuration" + "document. In which case the start up sequence skips it and the number of started engine services" + "is less than the number of configured engine services.", - "Review the start up messages to ensure that all of the correct engine services have been started " + + "Review the start up messages to ensure that all the correct engine services have been started " + "and they are operating without errors."), STOPPING_ENGINE_SERVICES("OMAG-ADMIN-0043", diff --git a/open-metadata-implementation/admin-services/admin-services-client/src/main/java/org/odpi/openmetadata/adminservices/client/EngineHostConfigurationClient.java b/open-metadata-implementation/admin-services/admin-services-client/src/main/java/org/odpi/openmetadata/adminservices/client/EngineHostConfigurationClient.java index 6e7ed2d7d9b..db435fce068 100644 --- a/open-metadata-implementation/admin-services/admin-services-client/src/main/java/org/odpi/openmetadata/adminservices/client/EngineHostConfigurationClient.java +++ b/open-metadata-implementation/admin-services/admin-services-client/src/main/java/org/odpi/openmetadata/adminservices/client/EngineHostConfigurationClient.java @@ -329,7 +329,7 @@ public void configureEngineService(EngineServiceConfig serviceConfig) throws OMA /** - * Set up the configuration for all of the open metadata engine services (OMESs). This overrides + * Set up the configuration for all the open metadata engine services (OMESs). This overrides * the current values. * * @param engineServicesConfig list of configuration properties for each engine service. diff --git a/open-metadata-implementation/admin-services/admin-services-client/src/main/java/org/odpi/openmetadata/adminservices/client/IntegrationDaemonConfigurationClient.java b/open-metadata-implementation/admin-services/admin-services-client/src/main/java/org/odpi/openmetadata/adminservices/client/IntegrationDaemonConfigurationClient.java index f6f1b8ed27f..1c81299daa6 100644 --- a/open-metadata-implementation/admin-services/admin-services-client/src/main/java/org/odpi/openmetadata/adminservices/client/IntegrationDaemonConfigurationClient.java +++ b/open-metadata-implementation/admin-services/admin-services-client/src/main/java/org/odpi/openmetadata/adminservices/client/IntegrationDaemonConfigurationClient.java @@ -293,7 +293,7 @@ public void configureIntegrationService(IntegrationServiceConfig serviceConfig) /** - * Set up the configuration for all of the open metadata integration services (OMISs). This overrides + * Set up the configuration for all the open metadata integration services (OMISs). This overrides * the current values. * * @param integrationServicesConfig list of configuration properties for each integration service. diff --git a/open-metadata-implementation/admin-services/admin-services-client/src/main/java/org/odpi/openmetadata/adminservices/client/MetadataAccessServerConfigurationClient.java b/open-metadata-implementation/admin-services/admin-services-client/src/main/java/org/odpi/openmetadata/adminservices/client/MetadataAccessServerConfigurationClient.java index e6ac44c94d1..e9ef5ee293f 100644 --- a/open-metadata-implementation/admin-services/admin-services-client/src/main/java/org/odpi/openmetadata/adminservices/client/MetadataAccessServerConfigurationClient.java +++ b/open-metadata-implementation/admin-services/admin-services-client/src/main/java/org/odpi/openmetadata/adminservices/client/MetadataAccessServerConfigurationClient.java @@ -507,7 +507,7 @@ public void clearAllAccessServices() throws OMAGNotAuthorizedException, */ /** - * Set up the configuration for all of the open metadata access services (OMASs). This overrides + * Set up the configuration for all the open metadata access services (OMASs). This overrides * the current values. * * @param accessServicesConfig - list of configuration properties for each access service. diff --git a/open-metadata-implementation/admin-services/admin-services-client/src/main/java/org/odpi/openmetadata/adminservices/client/ViewServerConfigurationClient.java b/open-metadata-implementation/admin-services/admin-services-client/src/main/java/org/odpi/openmetadata/adminservices/client/ViewServerConfigurationClient.java index 4878a7155b9..4bc08fee8b1 100644 --- a/open-metadata-implementation/admin-services/admin-services-client/src/main/java/org/odpi/openmetadata/adminservices/client/ViewServerConfigurationClient.java +++ b/open-metadata-implementation/admin-services/admin-services-client/src/main/java/org/odpi/openmetadata/adminservices/client/ViewServerConfigurationClient.java @@ -259,7 +259,7 @@ public void configureAllViewService(String partnerOMASServerURLRoot /** - * Set up the configuration for all of the open metadata view services (OMVSs). This overrides + * Set up the configuration for all the open metadata view services (OMVSs). This overrides * the current values. * * @param viewServicesConfig list of configuration properties for each view service. diff --git a/open-metadata-implementation/admin-services/admin-services-server/src/main/java/org/odpi/openmetadata/adminservices/OMAGConformanceSuiteConfigServices.java b/open-metadata-implementation/admin-services/admin-services-server/src/main/java/org/odpi/openmetadata/adminservices/OMAGConformanceSuiteConfigServices.java index ecee936d7c3..5e6c1c99600 100644 --- a/open-metadata-implementation/admin-services/admin-services-server/src/main/java/org/odpi/openmetadata/adminservices/OMAGConformanceSuiteConfigServices.java +++ b/open-metadata-implementation/admin-services/admin-services-server/src/main/java/org/odpi/openmetadata/adminservices/OMAGConformanceSuiteConfigServices.java @@ -474,7 +474,7 @@ public VoidResponse disablePlatformConformanceSuiteServices(String userId, Strin /** - * Request that all of the conformance suite tests are deactivated in this server. + * Request that all the conformance suite tests are deactivated in this server. * * @param userId user that is issuing the request. * @param serverName local server name. diff --git a/open-metadata-implementation/admin-services/admin-services-server/src/main/java/org/odpi/openmetadata/adminservices/OMAGServerAdminForAccessServices.java b/open-metadata-implementation/admin-services/admin-services-server/src/main/java/org/odpi/openmetadata/adminservices/OMAGServerAdminForAccessServices.java index 850ade6aeed..a08ee822996 100644 --- a/open-metadata-implementation/admin-services/admin-services-server/src/main/java/org/odpi/openmetadata/adminservices/OMAGServerAdminForAccessServices.java +++ b/open-metadata-implementation/admin-services/admin-services-server/src/main/java/org/odpi/openmetadata/adminservices/OMAGServerAdminForAccessServices.java @@ -1153,7 +1153,7 @@ public VoidResponse overrideAccessServiceOutTopicName(String userId, /** - * Set up the configuration for all of the open metadata access services (OMASs). This overrides + * Set up the configuration for all the open metadata access services (OMASs). This overrides * the current values. * * @param userId user that is issuing the request. diff --git a/open-metadata-implementation/admin-services/admin-services-server/src/main/java/org/odpi/openmetadata/adminservices/OMAGServerAdminForEngineServices.java b/open-metadata-implementation/admin-services/admin-services-server/src/main/java/org/odpi/openmetadata/adminservices/OMAGServerAdminForEngineServices.java index 2a44679e64f..e34d65cccf4 100644 --- a/open-metadata-implementation/admin-services/admin-services-server/src/main/java/org/odpi/openmetadata/adminservices/OMAGServerAdminForEngineServices.java +++ b/open-metadata-implementation/admin-services/admin-services-server/src/main/java/org/odpi/openmetadata/adminservices/OMAGServerAdminForEngineServices.java @@ -560,7 +560,7 @@ private List updateEngineServiceConfig(EngineServiceConfig /** - * Set up the configuration for all of the open metadata engine services (OMESs). This overrides + * Set up the configuration for all the open metadata engine services (OMESs). This overrides * the current values. * * @param userId user that is issuing the request. diff --git a/open-metadata-implementation/admin-services/admin-services-server/src/main/java/org/odpi/openmetadata/adminservices/OMAGServerAdminForIntegrationServices.java b/open-metadata-implementation/admin-services/admin-services-server/src/main/java/org/odpi/openmetadata/adminservices/OMAGServerAdminForIntegrationServices.java index a459a177bea..f3ac5b3ed70 100644 --- a/open-metadata-implementation/admin-services/admin-services-server/src/main/java/org/odpi/openmetadata/adminservices/OMAGServerAdminForIntegrationServices.java +++ b/open-metadata-implementation/admin-services/admin-services-server/src/main/java/org/odpi/openmetadata/adminservices/OMAGServerAdminForIntegrationServices.java @@ -429,7 +429,7 @@ private List updateIntegrationServiceConfig(Integrati /** - * Set up the configuration for all of the open metadata integration services (OMISs). This overrides + * Set up the configuration for all the open metadata integration services (OMISs). This overrides * the current values. * * @param userId user that is issuing the request. diff --git a/open-metadata-implementation/admin-services/admin-services-server/src/main/java/org/odpi/openmetadata/adminservices/OMAGServerAdminForViewServices.java b/open-metadata-implementation/admin-services/admin-services-server/src/main/java/org/odpi/openmetadata/adminservices/OMAGServerAdminForViewServices.java index 764a7a905f0..302459e5587 100644 --- a/open-metadata-implementation/admin-services/admin-services-server/src/main/java/org/odpi/openmetadata/adminservices/OMAGServerAdminForViewServices.java +++ b/open-metadata-implementation/admin-services/admin-services-server/src/main/java/org/odpi/openmetadata/adminservices/OMAGServerAdminForViewServices.java @@ -650,7 +650,7 @@ public VoidResponse clearAllViewServices(String userId, /** - * Set up the configuration for all of the open metadata view services (OMASs). This overrides + * Set up the configuration for all the open metadata view services (OMASs). This overrides * the current values. * * @param userId user that is issuing the request. @@ -678,7 +678,7 @@ public VoidResponse setViewServicesConfig(String userId, /** - * Set up the configuration for all of the open metadata view services (OMASs). This overrides + * Set up the configuration for all the open metadata view services (OMASs). This overrides * the current values. * * @param userId user that is issuing the request. diff --git a/open-metadata-implementation/admin-services/admin-services-server/src/main/java/org/odpi/openmetadata/adminservices/OMAGServerOperationalServices.java b/open-metadata-implementation/admin-services/admin-services-server/src/main/java/org/odpi/openmetadata/adminservices/OMAGServerOperationalServices.java index 95e271bbb7b..9ba2657d0b7 100644 --- a/open-metadata-implementation/admin-services/admin-services-server/src/main/java/org/odpi/openmetadata/adminservices/OMAGServerOperationalServices.java +++ b/open-metadata-implementation/admin-services/admin-services-server/src/main/java/org/odpi/openmetadata/adminservices/OMAGServerOperationalServices.java @@ -485,7 +485,7 @@ else if (ServerTypeClassification.VIEW_SERVER.equals(serverTypeClassification)) * Governance servers are varied in nature. Many host connectors that exchange metadata with third party technologies. * However they may also host specific types of engines, or provide an implementation of a complete governance service. * Because of this variety, Egeria does not (yet) provide any specialist frameworks for supporting the governance servers. - * All of the implementation is in the governance services subsystems initialized below. + * all the implementation is in the governance services subsystems initialized below. * * Set up the server instance - ensure it is active and the security has been set up correctly. */ diff --git a/open-metadata-implementation/admin-services/admin-services-spring/src/main/java/org/odpi/openmetadata/adminservices/spring/ConfigEngineServicesResource.java b/open-metadata-implementation/admin-services/admin-services-spring/src/main/java/org/odpi/openmetadata/adminservices/spring/ConfigEngineServicesResource.java index a64c7450227..723463178c7 100644 --- a/open-metadata-implementation/admin-services/admin-services-spring/src/main/java/org/odpi/openmetadata/adminservices/spring/ConfigEngineServicesResource.java +++ b/open-metadata-implementation/admin-services/admin-services-spring/src/main/java/org/odpi/openmetadata/adminservices/spring/ConfigEngineServicesResource.java @@ -154,7 +154,7 @@ public VoidResponse configureEngineService(@PathVariable String use /** - * Set up the configuration for all of the open metadata engine services (OMISs). This overrides + * Set up the configuration for all the open metadata engine services (OMISs). This overrides * the current values. * * @param userId user that is issuing the request. diff --git a/open-metadata-implementation/admin-services/admin-services-spring/src/main/java/org/odpi/openmetadata/adminservices/spring/ConfigIntegrationServicesResource.java b/open-metadata-implementation/admin-services/admin-services-spring/src/main/java/org/odpi/openmetadata/adminservices/spring/ConfigIntegrationServicesResource.java index aa6f71e3c22..8517b5c8fe0 100644 --- a/open-metadata-implementation/admin-services/admin-services-spring/src/main/java/org/odpi/openmetadata/adminservices/spring/ConfigIntegrationServicesResource.java +++ b/open-metadata-implementation/admin-services/admin-services-spring/src/main/java/org/odpi/openmetadata/adminservices/spring/ConfigIntegrationServicesResource.java @@ -130,7 +130,7 @@ public VoidResponse configureIntegrationService(@PathVariable String /** - * Set up the configuration for all of the open metadata integration services (OMISs). This overrides + * Set up the configuration for all the open metadata integration services (OMISs). This overrides * the current values. * * @param userId user that is issuing the request. diff --git a/open-metadata-implementation/admin-services/admin-services-spring/src/main/java/org/odpi/openmetadata/adminservices/spring/OperationalServicesResource.java b/open-metadata-implementation/admin-services/admin-services-spring/src/main/java/org/odpi/openmetadata/adminservices/spring/OperationalServicesResource.java index 9f82783dc0c..fa83edad4f9 100644 --- a/open-metadata-implementation/admin-services/admin-services-spring/src/main/java/org/odpi/openmetadata/adminservices/spring/OperationalServicesResource.java +++ b/open-metadata-implementation/admin-services/admin-services-spring/src/main/java/org/odpi/openmetadata/adminservices/spring/OperationalServicesResource.java @@ -184,7 +184,7 @@ public OMAGServerConfigResponse getActiveConfiguration(@PathVariable String @Operation(summary="Retrieve active server's status", description="Retrieve the status for a running instance of a server. The stored configuration " + "document may have changed since the server was started. This operation makes it possible to verify that " + - "all of the services. \n" + + "all the services. \n" + "\n" + "An InvalidParameterException is returned if the server is not running.", externalDocs=@ExternalDocumentation(description="OMAG Server", diff --git a/open-metadata-implementation/common-services/ffdc-services/src/main/java/org/odpi/openmetadata/commonservices/ffdc/OMAGCommonErrorCode.java b/open-metadata-implementation/common-services/ffdc-services/src/main/java/org/odpi/openmetadata/commonservices/ffdc/OMAGCommonErrorCode.java index 14d777f2ab4..f438e884c4a 100644 --- a/open-metadata-implementation/common-services/ffdc-services/src/main/java/org/odpi/openmetadata/commonservices/ffdc/OMAGCommonErrorCode.java +++ b/open-metadata-implementation/common-services/ffdc-services/src/main/java/org/odpi/openmetadata/commonservices/ffdc/OMAGCommonErrorCode.java @@ -70,7 +70,7 @@ public enum OMAGCommonErrorCode implements ExceptionMessageSet NEGATIVE_PAGE_SIZE(400, "OMAG-COMMON-400-009", "The page size {0} for the results, passed on the {1} parameter of the {2} operation, is negative", - "The system is unable to process the request with this invalid value. It should be zero to return all of the result, or greater than zero to set a maximum", + "The system is unable to process the request with this invalid value. It should be zero to return all the result, or greater than zero to set a maximum", "Correct the code in the caller to provide a non-negative value for the page size."), MAX_PAGE_SIZE(400, "OMAG-COMMON-400-010", @@ -181,6 +181,11 @@ public enum OMAGCommonErrorCode implements ExceptionMessageSet "The system is unable to process the request with this search string.", "Correct the code in the caller to provide a valid regular expression search string."), + INVALID_PROPERTIES_OBJECT(400, "OMAG-COMMON-400-029", + "The properties object passed on the {0} operation is either null or not of the correct {1} class", + "The system is unable to proceed because it can not interpret the properties needed to execute the request.", + "Correct the code in the caller to provide a valid properties object."), + INSTANCE_WRONG_TYPE_FOR_GUID(404, "OMAG-COMMON-404-001", "The {0} method has retrieved an instance for unique identifier (guid) {1} which is of type {2} rather than type {3}", "The request fails because the requested object is not of the right type.", diff --git a/open-metadata-implementation/common-services/ffdc-services/src/main/java/org/odpi/openmetadata/commonservices/ffdc/RESTExceptionHandler.java b/open-metadata-implementation/common-services/ffdc-services/src/main/java/org/odpi/openmetadata/commonservices/ffdc/RESTExceptionHandler.java index b4db06b9cec..676ed08917b 100644 --- a/open-metadata-implementation/common-services/ffdc-services/src/main/java/org/odpi/openmetadata/commonservices/ffdc/RESTExceptionHandler.java +++ b/open-metadata-implementation/common-services/ffdc-services/src/main/java/org/odpi/openmetadata/commonservices/ffdc/RESTExceptionHandler.java @@ -85,13 +85,33 @@ public void handleMissingValue(String parameterName, throw error; } + /** + * Manage an unexpected exception + * + * @param expectedClassName name of expected properties class + * @param methodName method that caught the exception + * @throws InvalidParameterException exception to report error + */ + public void handleInvalidPropertiesObject(String expectedClassName, + String methodName) throws InvalidParameterException + { + InvalidParameterException error = + new InvalidParameterException(OMAGCommonErrorCode.INVALID_PROPERTIES_OBJECT.getMessageDefinition(methodName, expectedClassName), + this.getClass().getName(), + methodName, + expectedClassName); + + log.error("Wrong properties class", error); + throw error; + } + /** * Manage a bad type name * * @param subTypeName subtype that does not match - * @param superTypeName expected uster type + * @param superTypeName expected (super) type * @param serviceName calling service * @param methodName method that caught the exception * @throws InvalidParameterException exception to report error diff --git a/open-metadata-implementation/common-services/ffdc-services/src/test/java/org/odpi/openmetadata/commonservices/ffdc/exceptions/CheckedExceptionBaseTest.java b/open-metadata-implementation/common-services/ffdc-services/src/test/java/org/odpi/openmetadata/commonservices/ffdc/exceptions/CheckedExceptionBaseTest.java index a9d5ba6efd6..2006db8f5dd 100644 --- a/open-metadata-implementation/common-services/ffdc-services/src/test/java/org/odpi/openmetadata/commonservices/ffdc/exceptions/CheckedExceptionBaseTest.java +++ b/open-metadata-implementation/common-services/ffdc-services/src/test/java/org/odpi/openmetadata/commonservices/ffdc/exceptions/CheckedExceptionBaseTest.java @@ -7,7 +7,7 @@ /** - * Validate that all of the checked exceptions are properly populated and support toString hashCode and equals. + * Validate that all the checked exceptions are properly populated and support toString hashCode and equals. */ public class CheckedExceptionBaseTest extends OCFCheckedExceptionBasedTest { diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ActorProfileHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ActorProfileHandler.java index 83c2d6a1da9..d8760283767 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ActorProfileHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ActorProfileHandler.java @@ -729,36 +729,159 @@ public List getActorProfilesByName(String userId, effectiveTime, methodName); - if (entities != null) - { - List beans = new ArrayList<>(); + return getFullBeans(userId, entities, typeName, forLineage, forDuplicateProcessing, effectiveTime, methodName); + } - for (EntityDetail entity : entities) - { - if (entity != null) - { - B bean = this.getFullProfileBean(userId, - entity, - typeName, - forLineage, - forDuplicateProcessing, - effectiveTime, - methodName); - if (bean != null) - { - beans.add(bean); - } - } - } + /** + * Return the actors attached to a supplied project via the project team relationship. + * + * @param userId calling user + * @param projectGUID identifier for the entity that the actor profiles are attached to + * @param projectGUIDParameterName name of parameter supplying the GUID + * @param startingFrom where to start from in the list + * @param pageSize maximum number of results that can be returned + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * @return list of objects or null if none found + * @throws InvalidParameterException the input properties are invalid + * @throws UserNotAuthorizedException user not authorized to issue this request + * @throws PropertyServerException problem accessing the property server + */ + public List getActorsForProject(String userId, + String projectGUID, + String projectGUIDParameterName, + int startingFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return this.getAttachedElements(userId, + null, + null, + projectGUID, + projectGUIDParameterName, + OpenMetadataAPIMapper.PROJECT_TYPE_NAME, + OpenMetadataAPIMapper.PROJECT_TEAM_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.PROJECT_TEAM_RELATIONSHIP_TYPE_NAME, + OpenMetadataAPIMapper.ACTOR_PROFILE_TYPE_NAME, + null, + null, + 2, + forLineage, + forDuplicateProcessing, + supportedZones, + startingFrom, + pageSize, + effectiveTime, + methodName); + } - if (! beans.isEmpty()) - { - return beans; - } - } - return null; + + /** + * Return the locations attached to an actor profile. + * + * @param userId calling user + * @param elementGUID identifier for the entity that the feedback is attached to + * @param elementGUIDParameterName name of parameter supplying the GUID + * @param elementTypeName name of the type of object being attached to + * @param startingFrom where to start from in the list + * @param pageSize maximum number of results that can be returned + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @return list of retrieved objects or null if none found + * + * @throws InvalidParameterException the input properties are invalid + * @throws UserNotAuthorizedException user not authorized to issue this request + * @throws PropertyServerException problem accessing the property server + */ + public List getActorProfilesByLocation(String userId, + String elementGUID, + String elementGUIDParameterName, + String elementTypeName, + int startingFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + List entities = this.getAttachedEntities(userId, + elementGUID, + elementGUIDParameterName, + elementTypeName, + OpenMetadataAPIMapper.PROFILE_LOCATION_TYPE_GUID, + OpenMetadataAPIMapper.PROFILE_LOCATION_TYPE_NAME, + OpenMetadataAPIMapper.ACTOR_PROFILE_TYPE_NAME, + null, + null, + 1, + forLineage, + forDuplicateProcessing, + startingFrom, + pageSize, + effectiveTime, + methodName); + + return getFullBeans(userId, entities, elementTypeName, forLineage, forDuplicateProcessing, effectiveTime, methodName); + } + + + /** + * Return all the actor profiles. + * + * @param userId calling user + * @param elementTypeGUID identifier of the type of object to retrieve + * @param elementTypeName name of the type of object to retrieve + * @param startingFrom where to start from in the list + * @param pageSize maximum number of results that can be returned + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @return list of retrieved objects or null if none found + * + * @throws InvalidParameterException the input properties are invalid + * @throws UserNotAuthorizedException user not authorized to issue this request + * @throws PropertyServerException problem accessing the property server + */ + public List getActorProfiles(String userId, + String elementTypeGUID, + String elementTypeName, + int startingFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + List entities = this.getEntitiesByType(userId, + elementTypeGUID, + elementTypeName, + null, + forLineage, + forDuplicateProcessing, + startingFrom, + pageSize, + effectiveTime, + methodName); + + return getFullBeans(userId, entities, elementTypeName, forLineage, forDuplicateProcessing, effectiveTime, methodName); } @@ -947,6 +1070,68 @@ public B getActorProfileByUniqueName(String userId, } + /** + * Retrieve the full profile metadata element for each entity in the list. + * This includes contact details, user identity, contribution record and pointers to related elements such as + * roles and peers. + * + * @param userId calling user + * @param entities root entities for the profiles + * @param typeName type name of the primary entity + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @return matching metadata element + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + private List getFullBeans(String userId, + List entities, + String typeName, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + if (entities != null) + { + List beans = new ArrayList<>(); + + for (EntityDetail entity : entities) + { + if (entity != null) + { + B bean = this.getFullProfileBean(userId, + entity, + typeName, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + + if (bean != null) + { + beans.add(bean); + } + } + } + + if (! beans.isEmpty()) + { + return beans; + } + } + + return null; + } + + /** * Retrieve the profile metadata element with the supplied unique identifier. * This includes contact details, user identity, contribution record and pointers to related elements such as diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/CollectionBuilder.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/CollectionBuilder.java index e75d0d101fa..65d4bf4474b 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/CollectionBuilder.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/CollectionBuilder.java @@ -124,7 +124,7 @@ public InstanceProperties getInstanceProperties(String methodName) throws Inval properties = repositoryHelper.addStringPropertyToInstance(serviceName, properties, - OpenMetadataAPIMapper.DISPLAY_NAME_PROPERTY_NAME, + OpenMetadataAPIMapper.NAME_PROPERTY_NAME, displayName, methodName); diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/CollectionHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/CollectionHandler.java index 93ff0205eee..32a2bfbda0f 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/CollectionHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/CollectionHandler.java @@ -10,6 +10,7 @@ import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; import org.odpi.openmetadata.metadatasecurity.server.OpenMetadataServerSecurityVerifier; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper; diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/CommunityBuilder.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/CommunityBuilder.java new file mode 100644 index 00000000000..8adcbfa0273 --- /dev/null +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/CommunityBuilder.java @@ -0,0 +1,144 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.commonservices.generichandlers; + +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper; + +import java.util.Map; + +/** + * CommunityBuilder creates the parts for an entity that represents a community. + */ +public class CommunityBuilder extends ReferenceableBuilder +{ + private String displayName = null; + private String description = null; + private String mission = null; + + + /** + * Create constructor + * + * @param qualifiedName unique name for the community + * @param displayName short display name for the community + * @param description description of the community + * @param mission purpose of the community + * @param additionalProperties additional properties for a community + * @param typeGUID unique identifier of this element's type + * @param typeName unique name of this element's type + * @param extendedProperties properties for a community subtype + * @param repositoryHelper helper methods + * @param serviceName name of this OMAS + * @param serverName name of local server + */ + CommunityBuilder(String qualifiedName, + String displayName, + String description, + String mission, + Map additionalProperties, + String typeGUID, + String typeName, + Map extendedProperties, + OMRSRepositoryHelper repositoryHelper, + String serviceName, + String serverName) + { + super(qualifiedName, + additionalProperties, + typeGUID, + typeName, + extendedProperties, + repositoryHelper, + serviceName, + serverName); + + this.displayName = displayName; + this.description = description; + this.mission = mission; + } + + + /** + * Create constructor + * + * @param qualifiedName unique name for the community + * @param displayName short display name for the community + * @param description description of the community + * @param repositoryHelper helper methods + * @param serviceName name of this OMAS + * @param serverName name of local server + */ + CommunityBuilder(String qualifiedName, + String displayName, + String description, + OMRSRepositoryHelper repositoryHelper, + String serviceName, + String serverName) + { + super(qualifiedName, + null, + OpenMetadataAPIMapper.COMMUNITY_TYPE_GUID, + OpenMetadataAPIMapper.COMMUNITY_TYPE_NAME, + null, + repositoryHelper, + serviceName, + serverName); + + this.displayName = displayName; + this.description = description; + } + + + /** + * Classification constructor + * + * @param repositoryHelper helper methods + * @param serviceName name of this OMAS + * @param serverName name of local server + */ + CommunityBuilder(OMRSRepositoryHelper repositoryHelper, + String serviceName, + String serverName) + { + super(OpenMetadataAPIMapper.COMMUNITY_TYPE_GUID, + OpenMetadataAPIMapper.COMMUNITY_TYPE_NAME, + repositoryHelper, + serviceName, + serverName); + } + + + /** + * Return the supplied bean properties in an InstanceProperties object. + * + * @param methodName name of the calling method + * @return InstanceProperties object + * @throws InvalidParameterException there is a problem with the properties + */ + @Override + public InstanceProperties getInstanceProperties(String methodName) throws InvalidParameterException + { + InstanceProperties properties = super.getInstanceProperties(methodName); + + properties = repositoryHelper.addStringPropertyToInstance(serviceName, + properties, + OpenMetadataAPIMapper.NAME_PROPERTY_NAME, + displayName, + methodName); + + properties = repositoryHelper.addStringPropertyToInstance(serviceName, + properties, + OpenMetadataAPIMapper.DESCRIPTION_PROPERTY_NAME, + description, + methodName); + + properties = repositoryHelper.addStringPropertyToInstance(serviceName, + properties, + OpenMetadataAPIMapper.MISSION_PROPERTY_NAME, + mission, + methodName); + return properties; + } +} diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/CommunityHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/CommunityHandler.java new file mode 100644 index 00000000000..cd72d062326 --- /dev/null +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/CommunityHandler.java @@ -0,0 +1,681 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.commonservices.generichandlers; + + +import org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler; +import org.odpi.openmetadata.commonservices.repositoryhandler.RepositoryHandler; +import org.odpi.openmetadata.frameworks.auditlog.AuditLog; +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; +import org.odpi.openmetadata.metadatasecurity.server.OpenMetadataServerSecurityVerifier; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper; +import org.odpi.openmetadata.repositoryservices.ffdc.exception.TypeErrorException; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * CommunityHandler provides the exchange of metadata about communities between the repository and the OMAS. + * + * @param class that represents the community + */ +public class CommunityHandler extends ReferenceableHandler +{ + private static final String qualifiedNameParameterName = "qualifiedName"; + + /** + * Construct the handler with information needed to work with B objects. + * + * @param converter specific converter for this bean class + * @param beanClass name of bean class that is represented by the generic class B + * @param serviceName name of this service + * @param serverName name of the local server + * @param invalidParameterHandler handler for managing parameter errors + * @param repositoryHandler manages calls to the repository services + * @param repositoryHelper provides utilities for manipulating the repository services objects + * @param localServerUserId userId for this server + * @param securityVerifier open metadata security services verifier + * @param supportedZones list of zones that the access service is allowed to serve B instances from + * @param defaultZones list of zones that the access service should set in all new B instances + * @param publishZones list of zones that the access service sets up in published B instances + * @param auditLog destination for audit log events + */ + public CommunityHandler(OpenMetadataAPIGenericConverter converter, + Class beanClass, + String serviceName, + String serverName, + InvalidParameterHandler invalidParameterHandler, + RepositoryHandler repositoryHandler, + OMRSRepositoryHelper repositoryHelper, + String localServerUserId, + OpenMetadataServerSecurityVerifier securityVerifier, + List supportedZones, + List defaultZones, + List publishZones, + AuditLog auditLog) + { + super(converter, + beanClass, + serviceName, + serverName, + invalidParameterHandler, + repositoryHandler, + repositoryHelper, + localServerUserId, + securityVerifier, + supportedZones, + defaultZones, + publishZones, + auditLog); + } + + + /** + * Create the community object. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of the software capability that owns this community + * @param externalSourceName unique name of the software capability that owns this community + * @param qualifiedName unique name for the community - used in other configuration + * @param displayName short display name for the community + * @param description description of the governance community + * @param mission purpose of the community + * @param additionalProperties additional properties for a community + * @param suppliedTypeName type name from the caller (enables creation of subtypes) + * @param extendedProperties properties for a governance community subtype + * @param effectiveFrom the time that the relationship element must be effective from (null for any time, new Date() for now) + * @param effectiveTo the time that the relationship must be effective to (null for any time, new Date() for now) + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @return unique identifier of the new community object + * @throws InvalidParameterException qualifiedName or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + public String createCommunity(String userId, + String externalSourceGUID, + String externalSourceName, + String qualifiedName, + String displayName, + String description, + String mission, + Map additionalProperties, + String suppliedTypeName, + Map extendedProperties, + Date effectiveFrom, + Date effectiveTo, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateName(qualifiedName, qualifiedNameParameterName, methodName); + + String typeName = OpenMetadataAPIMapper.COMMUNITY_TYPE_NAME; + + if (suppliedTypeName != null) + { + typeName = suppliedTypeName; + } + + String typeGUID = invalidParameterHandler.validateTypeName(typeName, + OpenMetadataAPIMapper.COMMUNITY_TYPE_NAME, + serviceName, + methodName, + repositoryHelper); + + CommunityBuilder builder = new CommunityBuilder(qualifiedName, + displayName, + description, + mission, + additionalProperties, + typeGUID, + typeName, + extendedProperties, + repositoryHelper, + serviceName, + serverName); + + builder.setEffectivityDates(effectiveFrom, effectiveTo); + + return this.createBeanInRepository(userId, + externalSourceGUID, + externalSourceName, + typeGUID, + typeName, + qualifiedName, + OpenMetadataAPIMapper.QUALIFIED_NAME_PROPERTY_NAME, + builder, + effectiveTime, + methodName); + } + + + /** + * Create a new metadata element to represent a community using an existing metadata element as a template. + * The template defines additional classifications and relationships that should be added to the new community. + * + * All categories and terms are linked to a single community. They are owned by this community and if the + * community is deleted, any linked terms and categories are deleted as well. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of the software capability that owns this community + * @param externalSourceName unique name of the software capability that owns this community + * @param templateGUID unique identifier of the metadata element to copy + * @param qualifiedName unique name for the community - used in other configuration + * @param displayName short display name for the community + * @param description description of the governance community + * @param methodName calling method + * + * @return unique identifier of the new metadata element + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public String createCommunityFromTemplate(String userId, + String externalSourceGUID, + String externalSourceName, + String templateGUID, + String qualifiedName, + String displayName, + String description, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String templateGUIDParameterName = "templateGUID"; + final String qualifiedNameParameterName = "qualifiedName"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(templateGUID, templateGUIDParameterName, methodName); + invalidParameterHandler.validateName(qualifiedName, qualifiedNameParameterName, methodName); + + CommunityBuilder builder = new CommunityBuilder(qualifiedName, + displayName, + description, + repositoryHelper, + serviceName, + serverName); + + return this.createBeanFromTemplate(userId, + externalSourceGUID, + externalSourceName, + templateGUID, + templateGUIDParameterName, + OpenMetadataAPIMapper.COMMUNITY_TYPE_GUID, + OpenMetadataAPIMapper.COMMUNITY_TYPE_NAME, + qualifiedName, + OpenMetadataAPIMapper.QUALIFIED_NAME_PROPERTY_NAME, + builder, + methodName); + } + + + /** + * Update the anchor object that all elements in a community (terms and categories) are linked to. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of the software capability that owns this community + * @param externalSourceName unique name of the software capability that owns this community + * @param communityGUID unique identifier of the community to update + * @param communityGUIDParameterName parameter passing the communityGUID + * @param qualifiedName unique name for the community - used in other configuration + * @param displayName short display name for the community + * @param description description of the governance community + * @param mission purpose of the community + * @param additionalProperties additional properties for a governance community + * @param suppliedTypeName type of community + * @param extendedProperties properties for a governance community subtype + * @param effectiveFrom the time that the relationship element must be effective from (null for any time, new Date() for now) + * @param effectiveTo the time that the relationship must be effective to (null for any time, new Date() for now) + * @param isMergeUpdate should the properties be merged with the existing properties or completely over-write them + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @throws InvalidParameterException qualifiedName or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + public void updateCommunity(String userId, + String externalSourceGUID, + String externalSourceName, + String communityGUID, + String communityGUIDParameterName, + String qualifiedName, + String displayName, + String description, + String mission, + Map additionalProperties, + String suppliedTypeName, + Map extendedProperties, + Date effectiveFrom, + Date effectiveTo, + boolean isMergeUpdate, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(communityGUID, communityGUIDParameterName, methodName); + invalidParameterHandler.validateName(qualifiedName, qualifiedNameParameterName, methodName); + + String typeName = OpenMetadataAPIMapper.COMMUNITY_TYPE_NAME; + + if (suppliedTypeName != null) + { + typeName = suppliedTypeName; + } + + String typeGUID = invalidParameterHandler.validateTypeName(typeName, + OpenMetadataAPIMapper.COMMUNITY_TYPE_NAME, + serviceName, + methodName, + repositoryHelper); + + CommunityBuilder builder = new CommunityBuilder(qualifiedName, + displayName, + description, + mission, + additionalProperties, + typeGUID, + typeName, + extendedProperties, + repositoryHelper, + serviceName, + serverName); + + builder.setEffectivityDates(effectiveFrom, effectiveTo); + + this.updateBeanInRepository(userId, + externalSourceGUID, + externalSourceName, + communityGUID, + communityGUIDParameterName, + typeGUID, + typeName, + forLineage, + forDuplicateProcessing, + supportedZones, + builder.getInstanceProperties(methodName), + isMergeUpdate, + effectiveTime, + methodName); + } + + + /** + * Add a member (PersonRole) to community. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of the software capability that owns this community + * @param externalSourceName unique name of the software capability that owns this community + * @param communityGUID unique identifier of the community + * @param communityGUIDParameterName parameter supplying the communityGUID + * @param memberGUID unique identifier of the element that is being added to the community + * @param memberGUIDParameterName parameter supplying the memberGUID + * @param membershipType why is the element a member? (optional) + * @param effectiveFrom the time that the relationship element must be effective from (null for any time, new Date() for now) + * @param effectiveTo the time that the relationship must be effective to (null for any time, new Date() for now) + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void addRoleToCommunity(String userId, + String externalSourceGUID, + String externalSourceName, + String communityGUID, + String communityGUIDParameterName, + String memberGUID, + String memberGUIDParameterName, + int membershipType, + Date effectiveFrom, + Date effectiveTo, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + InstanceProperties properties; + + try + { + properties = repositoryHelper.addEnumPropertyToInstance(serviceName, + null, + OpenMetadataAPIMapper.MEMBERSHIP_TYPE_PROPERTY_NAME, + OpenMetadataAPIMapper.COMMUNITY_MEMBERSHIP_TYPE_ENUM_TYPE_GUID, + OpenMetadataAPIMapper.COMMUNITY_MEMBERSHIP_TYPE_ENUM_TYPE_NAME, + membershipType, + methodName); + } + catch (TypeErrorException classificationNotSupported) + { + throw new InvalidParameterException(classificationNotSupported, OpenMetadataAPIMapper.MEMBERSHIP_TYPE_PROPERTY_NAME); + } + + this.linkElementToElement(userId, + externalSourceGUID, + externalSourceName, + communityGUID, + communityGUIDParameterName, + OpenMetadataAPIMapper.COMMUNITY_TYPE_NAME, + memberGUID, + memberGUIDParameterName, + OpenMetadataAPIMapper.PERSON_ROLE_TYPE_NAME, + forLineage, + forDuplicateProcessing, + supportedZones, + OpenMetadataAPIMapper.COMMUNITY_MEMBERSHIP_TYPE_GUID, + OpenMetadataAPIMapper.COMMUNITY_MEMBERSHIP_TYPE_NAME, + properties, + effectiveFrom, + effectiveTo, + effectiveTime, + methodName); + } + + + /** + * Remove a member (PersonRole) from community. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of the software capability that owns this community + * @param externalSourceName unique name of the software capability that owns this community + * @param communityGUID unique identifier of the community + * @param communityGUIDParameterName parameter supplying the communityGUID + * @param memberGUID unique identifier of the element that is being added to the community + * @param memberGUIDParameterName parameter supplying the memberGUID + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void removeRoleFromCommunity(String userId, + String externalSourceGUID, + String externalSourceName, + String communityGUID, + String communityGUIDParameterName, + String memberGUID, + String memberGUIDParameterName, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + this.unlinkElementFromElement(userId, + false, + externalSourceGUID, + externalSourceName, + communityGUID, + communityGUIDParameterName, + OpenMetadataAPIMapper.COMMUNITY_TYPE_NAME, + memberGUID, + memberGUIDParameterName, + OpenMetadataAPIMapper.PERSON_ROLE_TYPE_GUID, + OpenMetadataAPIMapper.PERSON_ROLE_TYPE_NAME, + forLineage, + forDuplicateProcessing, + OpenMetadataAPIMapper.COMMUNITY_MEMBERSHIP_TYPE_GUID, + OpenMetadataAPIMapper.COMMUNITY_MEMBERSHIP_TYPE_NAME, + effectiveTime, + methodName); + } + + + /** + * Remove the metadata element representing a community. This will delete the community and all categories and terms because + * the Anchors classifications are set up in these elements. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of the software capability that owns this community + * @param externalSourceName unique name of the software capability that owns this community + * @param communityGUID unique identifier of the metadata element to remove + * @param communityGUIDParameterName parameter supplying the communityGUID + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void removeCommunity(String userId, + String externalSourceGUID, + String externalSourceName, + String communityGUID, + String communityGUIDParameterName, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + this.deleteBeanInRepository(userId, + externalSourceGUID, + externalSourceName, + communityGUID, + communityGUIDParameterName, + OpenMetadataAPIMapper.COMMUNITY_TYPE_GUID, + OpenMetadataAPIMapper.COMMUNITY_TYPE_NAME, + null, + null, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + } + + + /** + * Retrieve the list of community metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param userId calling user + * @param searchString string to find in the properties + * @param searchStringParameterName name of parameter supplying the search string + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public List findCommunities(String userId, + String searchString, + String searchStringParameterName, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return this.findBeans(userId, + searchString, + searchStringParameterName, + OpenMetadataAPIMapper.COMMUNITY_TYPE_GUID, + OpenMetadataAPIMapper.COMMUNITY_TYPE_NAME, + null, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + } + + + /** + * Retrieve the list of community metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param userId calling user + * @param name name to search for + * @param nameParameterName parameter supplying name + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + + * @param methodName calling method + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public List getCommunitiesByName(String userId, + String name, + String nameParameterName, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + List specificMatchPropertyNames = new ArrayList<>(); + specificMatchPropertyNames.add(OpenMetadataAPIMapper.QUALIFIED_NAME_PROPERTY_NAME); + specificMatchPropertyNames.add(OpenMetadataAPIMapper.NAME_PROPERTY_NAME); + + return this.getBeansByValue(userId, + name, + nameParameterName, + OpenMetadataAPIMapper.COMMUNITY_TYPE_GUID, + OpenMetadataAPIMapper.COMMUNITY_TYPE_NAME, + specificMatchPropertyNames, + true, + null, + null, + forLineage, + forDuplicateProcessing, + supportedZones, + null, + startFrom, + pageSize, + effectiveTime, + methodName); + } + + + /** + * Retrieve the list of community metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + + * @param methodName calling method + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public List getCommunities(String userId, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return this.getBeansByType(userId, + OpenMetadataAPIMapper.COMMUNITY_TYPE_GUID, + OpenMetadataAPIMapper.COMMUNITY_TYPE_NAME, + null, + forLineage, + forDuplicateProcessing, + supportedZones, + startFrom, + pageSize, + effectiveTime, + methodName); + } + + + /** + * Retrieve the community metadata element with the supplied unique identifier. + * + * @param userId calling user + * @param guid unique identifier of the requested metadata element + * @param guidParameterName parameter name of guid + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @return matching metadata element + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public B getCommunityByGUID(String userId, + String guid, + String guidParameterName, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return this.getBeanFromRepository(userId, + guid, + guidParameterName, + OpenMetadataAPIMapper.COMMUNITY_TYPE_NAME, + forLineage, + forDuplicateProcessing, + supportedZones, + effectiveTime, + methodName); + + } +} diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ContactDetailsBuilder.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ContactDetailsBuilder.java index 372b164113f..0b8e05d4d70 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ContactDetailsBuilder.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ContactDetailsBuilder.java @@ -13,6 +13,8 @@ */ public class ContactDetailsBuilder extends OpenMetadataAPIGenericBuilder { + private final String name; + private final String contactType; private final int contactMethodType; private final String contactMethodService; private final String contactMethodValue; @@ -21,6 +23,8 @@ public class ContactDetailsBuilder extends OpenMetadataAPIGenericBuilder /** * Constructor. * + * @param name name of this contact method - eg my office phone number + * @param contactType type of contact eg "Office phone number" - typically controlled from a valid value set * @param contactMethodType type of contact method * @param contactMethodService service to call * @param contactMethodValue identity of recipient for this service @@ -28,7 +32,9 @@ public class ContactDetailsBuilder extends OpenMetadataAPIGenericBuilder * @param serviceName name of this OMAS * @param serverName name of local server */ - public ContactDetailsBuilder(int contactMethodType, + public ContactDetailsBuilder(String name, + String contactType, + int contactMethodType, String contactMethodService, String contactMethodValue, OMRSRepositoryHelper repositoryHelper, @@ -41,6 +47,8 @@ public ContactDetailsBuilder(int contactMethodType, serviceName, serverName); + this.name = name; + this.contactType = contactType; this.contactMethodType = contactMethodType; this.contactMethodService = contactMethodService; this.contactMethodValue = contactMethodValue; @@ -75,10 +83,22 @@ public InstanceProperties getInstanceProperties(String methodName) throws Inval } properties = repositoryHelper.addStringPropertyToInstance(serviceName, - properties, - OpenMetadataAPIMapper.CONTACT_METHOD_SERVICE_PROPERTY_NAME, - contactMethodService, - methodName); + properties, + OpenMetadataAPIMapper.NAME_PROPERTY_NAME, + name, + methodName); + + properties = repositoryHelper.addStringPropertyToInstance(serviceName, + properties, + OpenMetadataAPIMapper.CONTACT_TYPE_PROPERTY_NAME, + contactType, + methodName); + + properties = repositoryHelper.addStringPropertyToInstance(serviceName, + properties, + OpenMetadataAPIMapper.CONTACT_METHOD_SERVICE_PROPERTY_NAME, + contactMethodService, + methodName); properties = repositoryHelper.addStringPropertyToInstance(serviceName, properties, diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ContactDetailsHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ContactDetailsHandler.java index b7def06e87e..4c615e6fe6f 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ContactDetailsHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ContactDetailsHandler.java @@ -107,7 +107,7 @@ public List getContactDetails(String userId, OpenMetadataAPIMapper.CONTACT_DETAILS_TYPE_NAME, null, null, - 0, + 2, forLineage, forDuplicateProcessing, supportedZones, @@ -126,6 +126,8 @@ public List getContactDetails(String userId, * @param externalSourceName name of the software capability entity that represented the external source * @param profileGUID unique identifier for the connected entity (Referenceable). * @param profileGUIDParameterName parameter supplying the profileGUID + * @param contactName name of this contact method - eg my office phone number + * @param contactType type of contact eg "Office phone number" - typically controlled from a valid value set * @param contactMethodType ordinal for contact type * @param contactMethodService name of the service to call * @param contactMethodValue identity value to use for this profile through this contact method @@ -146,6 +148,8 @@ public String createContactMethod(String userId, String externalSourceName, String profileGUID, String profileGUIDParameterName, + String contactName, + String contactType, int contactMethodType, String contactMethodService, String contactMethodValue, @@ -158,7 +162,9 @@ public String createContactMethod(String userId, PropertyServerException, UserNotAuthorizedException { - ContactDetailsBuilder builder = new ContactDetailsBuilder(contactMethodType, + ContactDetailsBuilder builder = new ContactDetailsBuilder(contactName, + contactType, + contactMethodType, contactMethodService, contactMethodValue, repositoryHelper, diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/GovernanceDomainHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/GovernanceDomainHandler.java index 8af6643de4a..bd7f972e017 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/GovernanceDomainHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/GovernanceDomainHandler.java @@ -356,6 +356,60 @@ public List getGovernanceDomainsByName(String userId, } + + /** + * Return the keywords attached to a supplied entity. + * + * @param userId calling user + * @param startingGUID identifier for the entity that the keyword is attached to + * @param startingGUIDParameterName name of parameter supplying the GUID + * @param startingFrom start position for results + * @param pageSize maximum number of results + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @return list of retrieved objects or null if none found + * + * @throws InvalidParameterException the input properties are invalid + * @throws UserNotAuthorizedException user not authorized to issue this request + * @throws PropertyServerException problem accessing the property server + */ + public List getDomainsInSet(String userId, + String startingGUID, + String startingGUIDParameterName, + int startingFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return this.getAttachedElements(userId, + null, + null, + startingGUID, + startingGUIDParameterName, + OpenMetadataAPIMapper.COLLECTION_TYPE_NAME, + OpenMetadataAPIMapper.COLLECTION_MEMBERSHIP_TYPE_GUID, + OpenMetadataAPIMapper.COLLECTION_MEMBERSHIP_TYPE_NAME, + OpenMetadataAPIMapper.GOVERNANCE_DOMAIN_TYPE_NAME, + null, + null, + 2, + forLineage, + forDuplicateProcessing, + supportedZones, + startingFrom, + pageSize, + effectiveTime, + methodName); + } + + /** * Retrieve the governance domain metadata element with the supplied unique identifier. * @@ -383,8 +437,42 @@ public B getGovernanceDomainByGUID(String userId, OpenMetadataAPIMapper.GOVERNANCE_DOMAIN_TYPE_NAME, false, false, - null, + new Date(), methodName); } + + + + /** + * Retrieve the governance domain metadata element with the supplied unique domainIdentifier. + * + * @param userId calling user + * @param domainIdentifier identifier used to identify the domain + * @param methodName calling method + * + * @return matching metadata element + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public B getGovernanceDomainByDomainIdentifier(String userId, + int domainIdentifier, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return this.getBeanByUniqueName(userId, + "GovernanceDomain:" + domainIdentifier, + OpenMetadataAPIMapper.DOMAIN_IDENTIFIER_PROPERTY_NAME, + OpenMetadataAPIMapper.DOMAIN_IDENTIFIER_PROPERTY_NAME, + OpenMetadataAPIMapper.GOVERNANCE_DOMAIN_TYPE_GUID, + OpenMetadataAPIMapper.GOVERNANCE_DOMAIN_TYPE_NAME, + false, + false, + supportedZones, + new Date(), + methodName); + } } diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/GovernanceZoneBuilder.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/GovernanceZoneBuilder.java index 1cb7de0b432..1cf3c7ab1a2 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/GovernanceZoneBuilder.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/GovernanceZoneBuilder.java @@ -13,6 +13,7 @@ */ public class GovernanceZoneBuilder extends ReferenceableBuilder { + private final String zoneName; private final String displayName; private final String description; private final String criteria; @@ -23,7 +24,8 @@ public class GovernanceZoneBuilder extends ReferenceableBuilder /** * Create constructor * - * @param qualifiedName unique name for the zone - used in other configuration + * @param qualifiedName unique name for the zone entity + * @param zoneName unique name for the zone - used in other configuration * @param displayName short display name for the zone * @param description description of the governance zone * @param criteria the criteria for inclusion in a governance zone @@ -38,6 +40,7 @@ public class GovernanceZoneBuilder extends ReferenceableBuilder * @param serverName name of local server */ GovernanceZoneBuilder(String qualifiedName, + String zoneName, String displayName, String description, String criteria, @@ -60,6 +63,7 @@ public class GovernanceZoneBuilder extends ReferenceableBuilder serviceName, serverName); + this.zoneName = zoneName; this.displayName = displayName; this.description = description; this.criteria = criteria; @@ -86,6 +90,12 @@ public InstanceProperties getInstanceProperties(String methodName) throws Inval displayName, methodName); + properties = repositoryHelper.addStringPropertyToInstance(serviceName, + properties, + OpenMetadataAPIMapper.ZONE_NAME_PROPERTY_NAME, + zoneName, + methodName); + properties = repositoryHelper.addStringPropertyToInstance(serviceName, properties, OpenMetadataAPIMapper.DESCRIPTION_PROPERTY_NAME, diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/GovernanceZoneHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/GovernanceZoneHandler.java index 1c7e6722d3e..10eee9f09ed 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/GovernanceZoneHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/GovernanceZoneHandler.java @@ -82,7 +82,8 @@ public GovernanceZoneHandler(OpenMetadataAPIGenericConverter converter, * @param userId calling user * @param externalSourceGUID guid of the software capability entity that represented the external source - null for local * @param externalSourceName name of the software capability entity that represented the external source - * @param qualifiedName unique name for the zone - used in other configuration + * @param qualifiedName unique name for the zone entity + * @param zoneName unique name for the zone - used in other configuration * @param displayName short display name for the zone * @param description description of the governance zone * @param criteria the criteria for inclusion in a governance zone @@ -104,6 +105,7 @@ public String createGovernanceZone(String userId, String externalSourceGUID, String externalSourceName, String qualifiedName, + String zoneName, String displayName, String description, String criteria, @@ -131,6 +133,7 @@ public String createGovernanceZone(String userId, repositoryHelper); GovernanceZoneBuilder builder = new GovernanceZoneBuilder(qualifiedName, + zoneName, displayName, description, criteria, @@ -168,7 +171,8 @@ public String createGovernanceZone(String userId, * @param externalSourceName name of the software capability entity that represented the external source * @param zoneGUID unique identifier for the zone to change * @param zoneGUIDParameterName parameter supplying the zoneGUID - * @param qualifiedName unique name for the zone - used in other configuration + * @param qualifiedName unique name for the zone entity + * @param zoneName unique name for the zone - used in other configuration * @param displayName short display name for the zone * @param description description of the governance zone * @param criteria the criteria for inclusion in a governance zone @@ -190,6 +194,7 @@ public void updateGovernanceZone(String userId, String zoneGUID, String zoneGUIDParameterName, String qualifiedName, + String zoneName, String displayName, String description, String criteria, @@ -217,6 +222,7 @@ public void updateGovernanceZone(String userId, repositoryHelper); GovernanceZoneBuilder builder = new GovernanceZoneBuilder(qualifiedName, + zoneName, displayName, description, criteria, @@ -251,34 +257,37 @@ public void updateGovernanceZone(String userId, * Return information about a specific governance zone. * * @param userId calling user - * @param qualifiedName unique name for the zone - * @param qualifiedNameParameter name of parameter supplying the qualifiedName + * @param name unique name for the zone + * @param nameParameter name of parameter supplying the name * @param methodName calling method * * @return properties of the governance zone * - * @throws InvalidParameterException qualifiedName or userId is null + * @throws InvalidParameterException name or userId is null * @throws PropertyServerException problem accessing property server * @throws UserNotAuthorizedException security access problem */ public B getGovernanceZone(String userId, - String qualifiedName, - String qualifiedNameParameter, + String name, + String nameParameter, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException { - return this.getBeanByUniqueName(userId, - qualifiedName, - qualifiedNameParameter, - OpenMetadataAPIMapper.QUALIFIED_NAME_PROPERTY_NAME, - OpenMetadataAPIMapper.ZONE_TYPE_GUID, - OpenMetadataAPIMapper.ZONE_TYPE_NAME, - false, - false, - supportedZones, - new Date(), - methodName); + List specificMatchPropertyNames = new ArrayList<>(); + specificMatchPropertyNames.add(OpenMetadataAPIMapper.QUALIFIED_NAME_PROPERTY_NAME); + specificMatchPropertyNames.add(OpenMetadataAPIMapper.ZONE_NAME_PROPERTY_NAME); + + return this.getBeanByValue(userId, + name, + nameParameter, + OpenMetadataAPIMapper.ZONE_TYPE_GUID, + OpenMetadataAPIMapper.ZONE_TYPE_NAME, + specificMatchPropertyNames, + false, + false, + new Date(), + methodName); } diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/LocationBuilder.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/LocationBuilder.java index ee7cd0c36ce..73121283662 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/LocationBuilder.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/LocationBuilder.java @@ -13,6 +13,7 @@ */ public class LocationBuilder extends ReferenceableBuilder { + private String identifier = null; private String displayName = null; private String description = null; @@ -21,6 +22,7 @@ public class LocationBuilder extends ReferenceableBuilder * Create constructor * * @param qualifiedName unique name for the location + * @param identifier code value or symbol used to identify the location - typically unique. * @param displayName short display name for the location * @param description description of the location * @param additionalProperties additional properties for a location @@ -32,6 +34,7 @@ public class LocationBuilder extends ReferenceableBuilder * @param serverName name of local server */ LocationBuilder(String qualifiedName, + String identifier, String displayName, String description, Map additionalProperties, @@ -51,6 +54,7 @@ public class LocationBuilder extends ReferenceableBuilder serviceName, serverName); + this.identifier = identifier; this.displayName = displayName; this.description = description; } @@ -60,6 +64,7 @@ public class LocationBuilder extends ReferenceableBuilder * Create constructor * * @param qualifiedName unique name for the location + * @param identifier code value or symbol used to identify the location - typically unique. * @param displayName short display name for the location * @param description description of the location * @param repositoryHelper helper methods @@ -67,6 +72,7 @@ public class LocationBuilder extends ReferenceableBuilder * @param serverName name of local server */ LocationBuilder(String qualifiedName, + String identifier, String displayName, String description, OMRSRepositoryHelper repositoryHelper, @@ -82,6 +88,7 @@ public class LocationBuilder extends ReferenceableBuilder serviceName, serverName); + this.identifier = identifier; this.displayName = displayName; this.description = description; } @@ -118,6 +125,12 @@ public InstanceProperties getInstanceProperties(String methodName) throws Inval { InstanceProperties properties = super.getInstanceProperties(methodName); + properties = repositoryHelper.addStringPropertyToInstance(serviceName, + properties, + OpenMetadataAPIMapper.IDENTIFIER_PROPERTY_NAME, + identifier, + methodName); + properties = repositoryHelper.addStringPropertyToInstance(serviceName, properties, OpenMetadataAPIMapper.DISPLAY_NAME_PROPERTY_NAME, diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/LocationHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/LocationHandler.java index ae7d10420dd..9714e8ce428 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/LocationHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/LocationHandler.java @@ -9,8 +9,10 @@ import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; import org.odpi.openmetadata.metadatasecurity.server.OpenMetadataServerSecurityVerifier; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper; +import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; @@ -77,6 +79,7 @@ public LocationHandler(OpenMetadataAPIGenericConverter converter, * @param externalSourceGUID guid of the software capability entity that represented the external source - null for local * @param externalSourceName name of the software capability entity that represented the external source * @param qualifiedName unique name for the location - used in other configuration + * @param identifier code value or symbol used to identify the location - typically unique. * @param displayName short display name for the location * @param description description of the governance location * @param additionalProperties additional properties for a location @@ -96,6 +99,7 @@ public String createLocation(String userId, String externalSourceGUID, String externalSourceName, String qualifiedName, + String identifier, String displayName, String description, Map additionalProperties, @@ -127,6 +131,7 @@ public String createLocation(String userId, repositoryHelper); LocationBuilder locationBuilder = new LocationBuilder(qualifiedName, + identifier, displayName, description, additionalProperties, @@ -163,6 +168,7 @@ public String createLocation(String userId, * @param externalSourceGUID guid of the software capability entity that represented the external source - null for local * @param externalSourceName name of the software capability entity that represented the external source * @param templateGUID unique identifier of the metadata element to copy + * @param identifier code value or symbol used to identify the location - typically unique. * @param qualifiedName unique name for the location - used in other configuration * @param displayName short display name for the location * @param description description of the governance location @@ -179,6 +185,7 @@ public String createLocationFromTemplate(String userId, String externalSourceName, String templateGUID, String qualifiedName, + String identifier, String displayName, String description, String methodName) throws InvalidParameterException, @@ -193,6 +200,7 @@ public String createLocationFromTemplate(String userId, invalidParameterHandler.validateName(qualifiedName, qualifiedNameParameterName, methodName); LocationBuilder locationBuilder = new LocationBuilder(qualifiedName, + identifier, displayName, description, repositoryHelper, @@ -222,6 +230,7 @@ public String createLocationFromTemplate(String userId, * @param locationGUID unique identifier of the location to update * @param locationGUIDParameterName parameter passing the locationGUID * @param qualifiedName unique name for the location - used in other configuration + * @param identifier code value or symbol used to identify the location - typically unique. * @param displayName short display name for the location * @param description description of the governance location * @param additionalProperties additional properties for a governance location @@ -245,6 +254,7 @@ public void updateLocation(String userId, String locationGUID, String locationGUIDParameterName, String qualifiedName, + String identifier, String displayName, String description, Map additionalProperties, @@ -280,6 +290,7 @@ public void updateLocation(String userId, repositoryHelper); LocationBuilder locationBuilder = new LocationBuilder(qualifiedName, + identifier, displayName, description, additionalProperties, @@ -854,6 +865,123 @@ public void clearPeerLocations(String userId, } + + /** + * Create a relationship between an actor profile and an associated location. + * + * @param userId calling user + * @param externalSourceGUID guid of the software capability entity that represented the external source - null for local + * @param externalSourceName name of the software capability entity that represented the external source + * @param actorProfileGUID unique identifier of the first location + * @param actorProfileGUIDParameterName parameter supplying the first location + * @param locationGUID unique identifier of the second location + * @param locationGUIDParameterName parameter supplying the second location + * @param associationType type of association with the location + * @param effectiveFrom starting time for this relationship (null for all time) + * @param effectiveTo ending time for this relationship (null for all time) + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void setupProfileLocation(String userId, + String externalSourceGUID, + String externalSourceName, + String actorProfileGUID, + String actorProfileGUIDParameterName, + String locationGUID, + String locationGUIDParameterName, + String associationType, + Date effectiveFrom, + Date effectiveTo, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + InstanceProperties properties = repositoryHelper.addStringPropertyToInstance(serviceName, null, OpenMetadataAPIMapper.ASSOCIATION_TYPE_PROPERTY_NAME, associationType, methodName); + + this.linkElementToElement(userId, + externalSourceGUID, + externalSourceName, + actorProfileGUID, + actorProfileGUIDParameterName, + OpenMetadataAPIMapper.ACTOR_PROFILE_TYPE_NAME, + locationGUID, + locationGUIDParameterName, + OpenMetadataAPIMapper.LOCATION_TYPE_NAME, + forLineage, + forDuplicateProcessing, + supportedZones, + OpenMetadataAPIMapper.PROFILE_LOCATION_TYPE_GUID, + OpenMetadataAPIMapper.PROFILE_LOCATION_TYPE_NAME, + setUpEffectiveDates(properties, effectiveFrom, effectiveTo), + effectiveFrom, + effectiveTo, + effectiveTime, + methodName); + } + + + /** + * Remove a relationship between an actor profile and an associated location. + * + * @param userId calling user + * @param externalSourceGUID guid of the software capability entity that represented the external source - null for local + * @param externalSourceName name of the software capability entity that represented the external source + * @param actorProfileGUID unique identifier of the first location + * @param actorProfileGUIDParameterName parameter supplying the first location + * @param locationGUID unique identifier of the second location + * @param locationGUIDParameterName parameter supplying the second location + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void clearProfileLocation(String userId, + String externalSourceGUID, + String externalSourceName, + String actorProfileGUID, + String actorProfileGUIDParameterName, + String locationGUID, + String locationGUIDParameterName, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + this.unlinkElementFromElement(userId, + false, + externalSourceGUID, + externalSourceName, + actorProfileGUID, + actorProfileGUIDParameterName, + OpenMetadataAPIMapper.ACTOR_PROFILE_TYPE_NAME, + locationGUID, + locationGUIDParameterName, + OpenMetadataAPIMapper.LOCATION_TYPE_GUID, + OpenMetadataAPIMapper.LOCATION_TYPE_NAME, + forLineage, + forDuplicateProcessing, + OpenMetadataAPIMapper.PROFILE_LOCATION_TYPE_GUID, + OpenMetadataAPIMapper.PROFILE_LOCATION_TYPE_NAME, + effectiveTime, + methodName); + } + + /** * Create a relationship between a location and an asset. * @@ -1011,6 +1139,172 @@ public void removeLocation(String userId, } + /** + * Retrieve the list of adjacent location metadata elements linked to locationGUID. + * + * @param userId calling user + * @param elementGUID identifier for the entity that the location is attached to + * @param elementGUIDParameterName name of parameter supplying the GUID + * @param elementTypeName name of the type of object being attached to + * @param startingFrom where to start from in the list + * @param pageSize maximum number of results that can be returned + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @return list of retrieved objects or null if none found + * + * @throws InvalidParameterException the input properties are invalid + * @throws UserNotAuthorizedException user not authorized to issue this request + * @throws PropertyServerException problem accessing the property server + */ + public List getAdjacentLocations(String userId, + String elementGUID, + String elementGUIDParameterName, + String elementTypeName, + int startingFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return this.getAttachedElements(userId, + null, + null, + elementGUID, + elementGUIDParameterName, + elementTypeName, + OpenMetadataAPIMapper.ADJACENT_LOCATION_TYPE_GUID, + OpenMetadataAPIMapper.ADJACENT_LOCATION_TYPE_NAME, + OpenMetadataAPIMapper.LOCATION_TYPE_NAME, + null, + null, + 0, + forLineage, + forDuplicateProcessing, + supportedZones, + startingFrom, + pageSize, + effectiveTime, + methodName); + } + + + /** + * Retrieve the list of nested location metadata elements linked to locationGUID. + * + * @param userId calling user + * @param elementGUID identifier for the entity that the location is attached to + * @param elementGUIDParameterName name of parameter supplying the GUID + * @param elementTypeName name of the type of object being attached to + * @param startingFrom where to start from in the list + * @param pageSize maximum number of results that can be returned + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @return list of retrieved objects or null if none found + * + * @throws InvalidParameterException the input properties are invalid + * @throws UserNotAuthorizedException user not authorized to issue this request + * @throws PropertyServerException problem accessing the property server + */ + public List getNestedLocations(String userId, + String elementGUID, + String elementGUIDParameterName, + String elementTypeName, + int startingFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return this.getAttachedElements(userId, + null, + null, + elementGUID, + elementGUIDParameterName, + elementTypeName, + OpenMetadataAPIMapper.NESTED_LOCATION_TYPE_GUID, + OpenMetadataAPIMapper.NESTED_LOCATION_TYPE_NAME, + OpenMetadataAPIMapper.LOCATION_TYPE_NAME, + null, + null, + 2, + forLineage, + forDuplicateProcessing, + supportedZones, + startingFrom, + pageSize, + effectiveTime, + methodName); + } + + + /** + * Retrieve the list of location metadata elements that has the location identifier with locationGUID nested inside it. + * + * @param userId calling user + * @param elementGUID identifier for the entity that the location is attached to + * @param elementGUIDParameterName name of parameter supplying the GUID + * @param elementTypeName name of the type of object being attached to + * @param startingFrom where to start from in the list + * @param pageSize maximum number of results that can be returned + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @return list of retrieved objects or null if none found + * + * @throws InvalidParameterException the input properties are invalid + * @throws UserNotAuthorizedException user not authorized to issue this request + * @throws PropertyServerException problem accessing the property server + */ + public List getGroupingLocations(String userId, + String elementGUID, + String elementGUIDParameterName, + String elementTypeName, + int startingFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return this.getAttachedElements(userId, + null, + null, + elementGUID, + elementGUIDParameterName, + elementTypeName, + OpenMetadataAPIMapper.NESTED_LOCATION_TYPE_GUID, + OpenMetadataAPIMapper.NESTED_LOCATION_TYPE_NAME, + OpenMetadataAPIMapper.LOCATION_TYPE_NAME, + null, + null, + 1, + forLineage, + forDuplicateProcessing, + supportedZones, + startingFrom, + pageSize, + effectiveTime, + methodName); + } + + + /** * Count the number of locations attached to an entity. * @@ -1036,10 +1330,10 @@ public int countKnownLocations(String userId, { return super.countAttachments(userId, elementGUID, - OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + OpenMetadataAPIMapper.ASSET_TYPE_NAME, OpenMetadataAPIMapper.ASSET_LOCATION_TYPE_GUID, OpenMetadataAPIMapper.ASSET_LOCATION_TYPE_NAME, - 2, + 1, forLineage, forDuplicateProcessing, effectiveTime, @@ -1048,10 +1342,10 @@ public int countKnownLocations(String userId, /** - * Return the locations attached to an entity. + * Return the locations attached to an asset. * * @param userId calling user - * @param elementGUID identifier for the entity that the feedback is attached to + * @param elementGUID identifier for the entity that the location is attached to * @param elementGUIDParameterName name of parameter supplying the GUID * @param elementTypeName name of the type of object being attached to * @param startingFrom where to start from in the list @@ -1067,28 +1361,28 @@ public int countKnownLocations(String userId, * @throws UserNotAuthorizedException user not authorized to issue this request * @throws PropertyServerException problem accessing the property server */ - public List getLocations(String userId, - String elementGUID, - String elementGUIDParameterName, - String elementTypeName, - int startingFrom, - int pageSize, - boolean forLineage, - boolean forDuplicateProcessing, - Date effectiveTime, - String methodName) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException + public List getAssetLocations(String userId, + String elementGUID, + String elementGUIDParameterName, + String elementTypeName, + int startingFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException { - return this.getLocations(userId, elementGUID, elementGUIDParameterName, elementTypeName, supportedZones, startingFrom, pageSize, forLineage, forDuplicateProcessing, effectiveTime, methodName); + return this.getAssetLocations(userId, elementGUID, elementGUIDParameterName, elementTypeName, supportedZones, startingFrom, pageSize, forLineage, forDuplicateProcessing, effectiveTime, methodName); } /** - * Return the locations attached to an entity. + * Return the locations attached to an asset. * * @param userId calling user - * @param elementGUID identifier for the entity that the feedback is attached to + * @param elementGUID identifier for the entity that the location is attached to * @param elementGUIDParameterName name of parameter supplying the GUID * @param elementTypeName name of the type of object being attached to * @param serviceSupportedZones supported zones for calling service @@ -1105,17 +1399,17 @@ public List getLocations(String userId, * @throws UserNotAuthorizedException user not authorized to issue this request * @throws PropertyServerException problem accessing the property server */ - public List getLocations(String userId, - String elementGUID, - String elementGUIDParameterName, - String elementTypeName, - List serviceSupportedZones, - int startingFrom, - int pageSize, - boolean forLineage, - boolean forDuplicateProcessing, - Date effectiveTime, - String methodName) throws InvalidParameterException, + public List getAssetLocations(String userId, + String elementGUID, + String elementGUIDParameterName, + String elementTypeName, + List serviceSupportedZones, + int startingFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException { @@ -1130,7 +1424,7 @@ public List getLocations(String userId, OpenMetadataAPIMapper.LOCATION_TYPE_NAME, null, null, - 0, + 1, forLineage, forDuplicateProcessing, serviceSupportedZones, @@ -1139,4 +1433,245 @@ public List getLocations(String userId, effectiveTime, methodName); } + + + /** + * Return the locations attached to an actor profile. + * + * @param userId calling user + * @param elementGUID identifier for the entity that the location is attached to + * @param elementGUIDParameterName name of parameter supplying the GUID + * @param elementTypeName name of the type of object being attached to + * @param startingFrom where to start from in the list + * @param pageSize maximum number of results that can be returned + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @return list of retrieved objects or null if none found + * + * @throws InvalidParameterException the input properties are invalid + * @throws UserNotAuthorizedException user not authorized to issue this request + * @throws PropertyServerException problem accessing the property server + */ + public List getProfileLocations(String userId, + String elementGUID, + String elementGUIDParameterName, + String elementTypeName, + int startingFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return this.getProfileLocations(userId, elementGUID, elementGUIDParameterName, elementTypeName, supportedZones, startingFrom, pageSize, forLineage, forDuplicateProcessing, effectiveTime, methodName); + } + + + /** + * Return the locations attached to an actor profile. + * + * @param userId calling user + * @param elementGUID identifier for the entity that the location is attached to + * @param elementGUIDParameterName name of parameter supplying the GUID + * @param elementTypeName name of the type of object being attached to + * @param serviceSupportedZones supported zones for calling service + * @param startingFrom where to start from in the list + * @param pageSize maximum number of results that can be returned + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @return list of retrieved objects or null if none found + * + * @throws InvalidParameterException the input properties are invalid + * @throws UserNotAuthorizedException user not authorized to issue this request + * @throws PropertyServerException problem accessing the property server + */ + public List getProfileLocations(String userId, + String elementGUID, + String elementGUIDParameterName, + String elementTypeName, + List serviceSupportedZones, + int startingFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return this.getAttachedElements(userId, + null, + null, + elementGUID, + elementGUIDParameterName, + elementTypeName, + OpenMetadataAPIMapper.PROFILE_LOCATION_TYPE_GUID, + OpenMetadataAPIMapper.PROFILE_LOCATION_TYPE_NAME, + OpenMetadataAPIMapper.LOCATION_TYPE_NAME, + null, + null, + 2, + forLineage, + forDuplicateProcessing, + serviceSupportedZones, + startingFrom, + pageSize, + effectiveTime, + methodName); + } + + + /** + * Retrieve the list of community metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param userId calling user + * @param searchString string to find in the properties + * @param searchStringParameterName name of parameter supplying the search string + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public List findLocations(String userId, + String searchString, + String searchStringParameterName, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return this.findBeans(userId, + searchString, + searchStringParameterName, + OpenMetadataAPIMapper.LOCATION_TYPE_GUID, + OpenMetadataAPIMapper.LOCATION_TYPE_NAME, + null, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + } + + + /** + * Retrieve the list of location metadata elements with a matching qualified name, identifier or display name. + * There are no wildcards supported on this request. + * + * @param userId calling user + * @param name name to search for + * @param nameParameterName parameter supplying name + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + + * @param methodName calling method + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public List getLocationsByName(String userId, + String name, + String nameParameterName, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + List specificMatchPropertyNames = new ArrayList<>(); + specificMatchPropertyNames.add(OpenMetadataAPIMapper.QUALIFIED_NAME_PROPERTY_NAME); + specificMatchPropertyNames.add(OpenMetadataAPIMapper.IDENTIFIER_PROPERTY_NAME); + specificMatchPropertyNames.add(OpenMetadataAPIMapper.NAME_PROPERTY_NAME); + + return this.getBeansByValue(userId, + name, + nameParameterName, + OpenMetadataAPIMapper.LOCATION_TYPE_GUID, + OpenMetadataAPIMapper.LOCATION_TYPE_NAME, + specificMatchPropertyNames, + true, + null, + null, + forLineage, + forDuplicateProcessing, + supportedZones, + null, + startFrom, + pageSize, + effectiveTime, + methodName); + } + + + /** + * Retrieve the list of location metadata elements. + * + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + + * @param methodName calling method + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public List getLocations(String userId, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return this.getBeansByType(userId, + OpenMetadataAPIMapper.LOCATION_TYPE_GUID, + OpenMetadataAPIMapper.LOCATION_TYPE_NAME, + null, + forLineage, + forDuplicateProcessing, + supportedZones, + startFrom, + pageSize, + effectiveTime, + methodName); + } } diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIGenericConverter.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIGenericConverter.java index bc64e7a62ff..db4ac27e84e 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIGenericConverter.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIGenericConverter.java @@ -1122,6 +1122,28 @@ protected String removeEmployeeType(InstanceProperties instanceProperties) } + /** + * Extract and delete the contactType property from the supplied instance properties. + * + * @param instanceProperties properties from entity + * @return string name or null + */ + protected String removeContactType(InstanceProperties instanceProperties) + { + final String methodName = "removeContactType"; + + if (instanceProperties != null) + { + return repositoryHelper.removeStringProperty(serviceName, + OpenMetadataAPIMapper.CONTACT_TYPE_PROPERTY_NAME, + instanceProperties, + methodName); + } + + return null; + } + + /** * Extract and delete the contactMethodService property from the supplied instance properties. * @@ -1189,6 +1211,30 @@ protected String removeMission(InstanceProperties instanceProperties) } + + + /** + * Extract and delete the associationType property from the supplied instance properties. + * + * @param instanceProperties properties from entity + * @return string text or null + */ + protected String removeAssociationType(InstanceProperties instanceProperties) + { + final String methodName = "removeAssociationType"; + + if (instanceProperties != null) + { + return repositoryHelper.removeStringProperty(serviceName, + OpenMetadataAPIMapper.ASSOCIATION_TYPE_PROPERTY_NAME, + instanceProperties, + methodName); + } + + return null; + } + + /** * Extract and delete the identifier property from the supplied instance properties. * @@ -2079,6 +2125,49 @@ protected List removeZoneMembership(InstanceProperties instancePropertie } + /** + * Retrieve the zoneName from the properties. + * + * @param instanceProperties properties from the entity + * @return zone name + */ + protected String removeZoneName(InstanceProperties instanceProperties) + { + final String methodName = "removeZoneName"; + + if (instanceProperties != null) + { + return repositoryHelper.removeStringProperty(serviceName, + OpenMetadataAPIMapper.ZONE_NAME_PROPERTY_NAME, + instanceProperties, + methodName); + } + + return null; + } + + + /** + * Retrieve the subjectAreaName from the properties. + * + * @param instanceProperties properties from the entity + * @return subject area name + */ + protected String removeSubjectAreaName(InstanceProperties instanceProperties) + { + final String methodName = "removeSubjectAreaName"; + + if (instanceProperties != null) + { + return repositoryHelper.removeStringProperty(serviceName, + OpenMetadataAPIMapper.SUBJECT_AREA_NAME_PROPERTY_NAME, + instanceProperties, + methodName); + } + + return null; + } + /** * Retrieve the zone membership from the properties of the zone membership classification. * @@ -3009,6 +3098,28 @@ protected boolean removeIsDeprecated(InstanceProperties instanceProperties) } + /** + * Retrieve the isDefaultValue flag from the properties from the supplied instance properties. + * + * @param instanceProperties properties from the classification + * @return boolean - default is false + */ + protected boolean removeIsDefaultValue(InstanceProperties instanceProperties) + { + final String methodName = "removeIsDefaultValue"; + + if (instanceProperties != null) + { + return repositoryHelper.removeBooleanProperty(serviceName, + OpenMetadataAPIMapper.IS_DEFAULT_VALUE_PROPERTY_NAME, + instanceProperties, + methodName); + } + + return false; + } + + /** * Extract and delete the anchorGUID property from the supplied instance properties. * @@ -3995,6 +4106,29 @@ protected String removeTitle(InstanceProperties instanceProperties) } + + /** + * Extract the pronouns property from the supplied instance properties. + * + * @param instanceProperties properties from governance entities + * @return string property or null + */ + protected String removePronouns(InstanceProperties instanceProperties) + { + final String methodName = "removePronouns"; + + if (instanceProperties != null) + { + return repositoryHelper.removeStringProperty(serviceName, + OpenMetadataAPIMapper.PRONOUNS_PROPERTY_NAME, + instanceProperties, + methodName); + } + + return null; + } + + /** * Extract the text property from the supplied instance properties. * @@ -5212,7 +5346,7 @@ protected int getConfidence(InstanceProperties instanceProperties) if (instanceProperties != null) { return repositoryHelper.getIntProperty(serviceName, - OpenMetadataAPIMapper.VALID_VALUES_CONFIDENCE_PROPERTY_NAME, + OpenMetadataAPIMapper.CONFIDENCE_PROPERTY_NAME, instanceProperties, methodName); } @@ -5234,7 +5368,52 @@ protected String getSteward(InstanceProperties instanceProperties) if (instanceProperties != null) { return repositoryHelper.getStringProperty(serviceName, - OpenMetadataAPIMapper.VALID_VALUES_STEWARD_PROPERTY_NAME, + OpenMetadataAPIMapper.STEWARD_PROPERTY_NAME, + instanceProperties, + methodName); + } + + return null; + } + + + + /** + * Extract the stewardTypeName property from the supplied instance properties. + * + * @param instanceProperties properties from ReferenceValueAssignment or ValidValuesMapping relationship + * @return string text or null + */ + protected String getStewardTypeName(InstanceProperties instanceProperties) + { + final String methodName = "getStewardTypeName"; + + if (instanceProperties != null) + { + return repositoryHelper.getStringProperty(serviceName, + OpenMetadataAPIMapper.STEWARD_TYPE_NAME_PROPERTY_NAME, + instanceProperties, + methodName); + } + + return null; + } + + + /** + * Extract the stewardTypeName property from the supplied instance properties. + * + * @param instanceProperties properties from ReferenceValueAssignment or ValidValuesMapping relationship + * @return string text or null + */ + protected String getStewardPropertyName(InstanceProperties instanceProperties) + { + final String methodName = "getStewardPropertyName"; + + if (instanceProperties != null) + { + return repositoryHelper.getStringProperty(serviceName, + OpenMetadataAPIMapper.STEWARD_PROPERTY_NAME_PROPERTY_NAME, instanceProperties, methodName); } @@ -5301,7 +5480,7 @@ protected String getAssociationDescription(InstanceProperties instancePropertie if (instanceProperties != null) { return repositoryHelper.getStringProperty(serviceName, - OpenMetadataAPIMapper.VALID_VALUES_ASSOCIATION_DESCRIPTION_PROPERTY_NAME, + OpenMetadataAPIMapper.ASSOCIATION_DESCRIPTION_PROPERTY_NAME, instanceProperties, methodName); } diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIGenericHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIGenericHandler.java index 2be5d6c793d..d696bd00be7 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIGenericHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIGenericHandler.java @@ -4516,6 +4516,8 @@ public void maintainSupplementaryProperties(String userId, * @param effectiveTime the time that the retrieved elements must be effective for * @param methodName calling method * + * @return entity containing the supplementary properties + * * @throws InvalidParameterException the parameters are invalid * @throws UserNotAuthorizedException user not authorized to issue this request * @throws PropertyServerException problem detected in the repository services diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIMapper.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIMapper.java index 43a22ca2c4e..80b0f971696 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIMapper.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIMapper.java @@ -154,7 +154,7 @@ public class OpenMetadataAPIMapper public static final String REFERENCE_VERSION_PROPERTY_NAME = "referenceVersion"; /* from ExternalReference entity */ public static final String REFERENCE_ID_PROPERTY_NAME = "referenceId"; /* from ExternalReferenceLink relationship */ - /* also description property */ + /* plus description property */ public static final String RELATED_MEDIA_TYPE_GUID = "747f8b86-fe7c-4c9b-ba75-979e093cc307"; public static final String RELATED_MEDIA_TYPE_NAME = "RelatedMedia"; /* from Area 0 */ @@ -247,6 +247,12 @@ public class OpenMetadataAPIMapper public static final String ASSET_LOCATION_TYPE_NAME = "AssetLocation"; /* End1 = Location; End 2 = Asset */ + public static final String PROFILE_LOCATION_TYPE_GUID = "4d652ef7-99c7-4ec3-a2fd-b10c0a1ab4b4"; /* from Area 1 */ + public static final String PROFILE_LOCATION_TYPE_NAME = "ProfileLocation"; + /* End1 = ActorProfile; End 2 = Location */ + + public static final String ASSOCIATION_TYPE_PROPERTY_NAME = "associationType"; + public static final String NESTED_LOCATION_TYPE_GUID = "f82a96c2-95a3-4223-88c0-9cbf2882b772"; /* from Area 0 */ public static final String NESTED_LOCATION_TYPE_NAME = "NestedLocation"; /* End1 = ParentLocation; End 2 = ChildLocation */ @@ -552,14 +558,6 @@ public class OpenMetadataAPIMapper public static final String USER_IDENTITY_TYPE_NAME = "UserIdentity"; /* Referenceable */ - public static final String PROJECT_TYPE_GUID = "0799569f-0c16-4a1f-86d9-e2e89568f7fd"; - public static final String PROJECT_TYPE_NAME = "Project"; /* from Area 1 */ - /* Project */ - - public static final String PROJECT_SCOPE_RELATIONSHIP_TYPE_GUID = "bc63ac45-b4d0-4fba-b583-92859de77dd8"; - public static final String PROJECT_SCOPE_RELATIONSHIP_TYPE_NAME = "ProjectScope"; /* from Area 1 */ - /* Project Scope*/ - public static final String PROFILE_IDENTITY_RELATIONSHIP_TYPE_GUID = "01664609-e777-4079-b543-6baffe910ff1"; /* from Area 1 */ public static final String PROFILE_IDENTITY_RELATIONSHIP_TYPE_NAME = "ProfileIdentity"; /* End1 = ActorProfile; End 2 = UserIdentity */ @@ -570,6 +568,7 @@ public class OpenMetadataAPIMapper public static final String CONTACT_DETAILS_TYPE_GUID = "79296df8-645a-4ef7-a011-912d1cdcf75a"; public static final String CONTACT_DETAILS_TYPE_NAME = "ContactDetails"; + public static final String CONTACT_TYPE_PROPERTY_NAME = "contactType"; /* from ContactDetail entity */ public static final String CONTACT_METHOD_TYPE_PROPERTY_NAME = "contactMethodType"; /* from ContactDetail entity */ public static final String CONTACT_METHOD_SERVICE_PROPERTY_NAME = "contactMethodService"; /* from ContactDetail entity */ public static final String CONTACT_METHOD_VALUE_PROPERTY_NAME = "contactMethodValue"; /* from ContactDetail entity */ @@ -590,7 +589,8 @@ public class OpenMetadataAPIMapper public static final String GIVEN_NAMES_PROPERTY_NAME = "givenNames"; /* from Person entity */ public static final String SURNAME_PROPERTY_NAME = "surname"; /* from Person entity */ public static final String FULL_NAME_PROPERTY_NAME = "fullName"; /* from Person entity */ - public static final String PREFERRED_LANGUAGE_PROPERTY_NAME = "preferredLanguage"; /* from Person entity */ + public static final String PRONOUNS_PROPERTY_NAME = "pronouns"; /* from Person entity */ + public static final String PREFERRED_LANGUAGE_PROPERTY_NAME = "preferredLanguage"; /* from Person entity */ public static final String JOB_TITLE_PROPERTY_NAME = "jobTitle"; /* from Person entity */ public static final String EMPLOYEE_NUMBER_PROPERTY_NAME = "employeeNumber"; /* from Person entity */ public static final String EMPLOYEE_TYPE_PROPERTY_NAME = "employeeType"; /* from Person entity */ @@ -653,6 +653,93 @@ public class OpenMetadataAPIMapper public static final String IT_INFRASTRUCTURE_PROFILE_RELATIONSHIP_TYPE_NAME = "ITInfrastructureProfile"; /* End1 = ITInfrastructure; End 2 = ITProfile */ + public static final String ASSIGNMENT_SCOPE_RELATIONSHIP_TYPE_GUID = "e3fdafe3-692a-46c6-a595-c538cc189dd9"; /* from Area 1 */ + public static final String ASSIGNMENT_SCOPE_RELATIONSHIP_TYPE_NAME = "AssignmentScope"; + /* End1 = assignedActors - Referenceable; End 2 = assignedScope - Referenceable */ + + public static final String ASSIGNMENT_TYPE_PROPERTY_NAME = "assignmentType"; /* from Area 1 */ + + public static final String PROJECT_TYPE_GUID = "0799569f-0c16-4a1f-86d9-e2e89568f7fd"; + public static final String PROJECT_TYPE_NAME = "Project"; /* from Area 1 */ + /* Referenceable */ + + public static final String CAMPAIGN_CLASSIFICATION_TYPE_NAME = "Campaign"; /* from Area 1 */ + public static final String TASK_CLASSIFICATION_TYPE_NAME = "Task"; /* from Area 1 */ + + public static final String PROJECT_STATUS_PROPERTY_NAME = "projectStatus"; /* from Area 1 */ + public static final String TEAM_ROLE_PROPERTY_NAME = "teamRole"; /* from Area 1 */ + public static final String DEPENDENCY_SUMMARY_PROPERTY_NAME = "dependencySummary"; /* from Area 1 */ + + public static final String PROJECT_TEAM_RELATIONSHIP_TYPE_GUID = "746875af-2e41-4d1f-864b-35265df1d5dc"; + public static final String PROJECT_TEAM_RELATIONSHIP_TYPE_NAME = "ProjectTeam"; /* from Area 1 */ + /* End1 = Project; End 2 = ActorProfile */ + + public static final String PROJECT_MANAGEMENT_RELATIONSHIP_TYPE_GUID = "ac63ac45-a4d0-4fba-b583-92859de77dd8"; + public static final String PROJECT_MANAGEMENT_RELATIONSHIP_TYPE_NAME = "ProjectManagement"; /* from Area 1 */ + /* End1 = Project; End 2 = PersonRole */ + + public static final String PROJECT_HIERARCHY_RELATIONSHIP_TYPE_GUID = "8f1134f6-b9fe-4971-bc57-6e1b8b302b55"; + public static final String PROJECT_HIERARCHY_RELATIONSHIP_TYPE_NAME = "ProjectHierarchy"; /* from Area 1 */ + /* End1 = managingProject; End 2 = managedProject */ + + public static final String PROJECT_DEPENDENCY_RELATIONSHIP_TYPE_GUID = "5b6a56f1-68e2-4e10-85f0-fda47a4263fd"; + public static final String PROJECT_DEPENDENCY_RELATIONSHIP_TYPE_NAME = "ProjectDependency"; /* from Area 1 */ + /* End1 = dependentProject; End 2 = dependsOnProject */ + + public static final String STAKEHOLDER_RELATIONSHIP_TYPE_GUID = "efd8a136-0aea-4668-b91a-30f947e38b82"; + public static final String STAKEHOLDER_RELATIONSHIP_TYPE_NAME = "Stakeholder"; /* from Area 1 */ + /* End1 = commissioned - Referenceable; End 2 = commissionedBy - Referenceable */ + + public static final String STAKEHOLDER_ROLE_PROPERTY_NAME = "stakeholderRole"; /* from Area 1 */ + + public static final String MEETING_TYPE_GUID = "6bf90c79-32f4-47ad-959c-8fff723fe744"; + public static final String MEETING_TYPE_NAME = "Meeting"; /* from Area 1 */ + /* Referenceable */ + + public static final String START_TIME_PROPERTY_NAME = "startTime"; /* from Area 1 */ + public static final String END_TIME_PROPERTY_NAME = "endTime"; /* from Area 1 */ + public static final String OBJECTIVE_PROPERTY_NAME = "objective"; /* from Area 1 */ + public static final String MINUTES_PROPERTY_NAME = "minutes"; /* from Area 1 */ + public static final String MEETING_TYPE_PROPERTY_NAME = "meetingType"; /* from Area 1 */ + + public static final String MEETINGS_RELATIONSHIP_TYPE_GUID = "a05f918e-e7e2-419d-8016-5b37406df63a"; + public static final String MEETINGS_RELATIONSHIP_TYPE_NAME = "Meetings"; /* from Area 1 */ + /* End1 = Meeting; End 2 = Referenceable */ + + public static final String TO_DO_TYPE_GUID = "93dbc58d-c826-4bc2-b36f-195148d46f86"; + public static final String TO_DO_TYPE_NAME = "ToDo"; /* from Area 1 */ + /* Referenceable */ + + public static final String CREATION_TIME_PROPERTY_NAME = "creationTime"; /* from Area 1 */ + public static final String PRIORITY_PROPERTY_NAME = "priority"; /* from Area 1 */ + public static final String DUE_TIME_PROPERTY_NAME = "dueTime"; /* from Area 1 */ + public static final String COMPLETION_TIME_PROPERTY_NAME = "completionTime"; /* from Area 1 */ + public static final String STATUS_PROPERTY_NAME = "status"; /* from Area 1 */ + + public static final String TO_DO_STATUS_ENUM_TYPE_GUID = "7197ea39-334d-403f-a70b-d40231092df7"; /* from Area 0 */ + public static final String TO_DO_STATUS_ENUM_TYPE_NAME = "ToDoStatus"; + public static final int TO_DO_STATUS_ENUM_OPEN_ORDINAL = 0; + public static final int TO_DO_STATUS_ENUM_IN_PROGRESS_ORDINAL = 1; + public static final int TO_DO_STATUS_ENUM_WAITING_ORDINAL = 2; + public static final int TO_DO_STATUS_ENUM_COMPLETE_ORDINAL = 3; + public static final int TO_DO_STATUS_ENUM_ABANDONED_ORDINAL = 4; + + public static final String TO_DO_SOURCE_RELATIONSHIP_TYPE_GUID = "a0b7ba50-4c97-4b76-9a7d-c6a00e1be646"; + public static final String TO_DO_SOURCE_RELATIONSHIP_TYPE_NAME = "ToDoSource"; /* from Area 1 */ + /* End1 = source -Referenceable; End 2 = To Do */ + + public static final String ACTIONS_RELATIONSHIP_TYPE_GUID = "aca1277b-bf1c-42f5-9b3b-fbc2c9047325"; + public static final String ACTIONS_RELATIONSHIP_TYPE_NAME = "Actions"; /* from Area 1 */ + /* End1 = originator - Referenceable; End 2 = To Do */ + + public static final String ACTION_TARGET_RELATIONSHIP_TYPE_GUID = "207e2594-e3e4-4be8-a12c-4c401656e241"; + public static final String ACTION_TARGET_RELATIONSHIP_TYPE_NAME = "ActionTarget"; /* from Area 1 */ + /* End1 = To Do; End 2 = Referenceable */ + + public static final String ACTION_ASSIGNMENT_RELATIONSHIP_TYPE_GUID = "af2b5fab-8f83-4a2b-b749-1e6219f61f79"; + public static final String ACTION_ASSIGNMENT_RELATIONSHIP_TYPE_NAME = "ActionAssignment"; /* from Area 1 */ + /* End1 = PersonRole; End 2 = To Do */ + public static final String COMMUNITY_TYPE_GUID = "ba846a7b-2955-40bf-952b-2793ceca090a"; public static final String COMMUNITY_TYPE_NAME = "Community"; /* from Area 1 */ /* Referenceable */ @@ -669,6 +756,7 @@ public class OpenMetadataAPIMapper /* End1 = Community; End 2 = CommunityMember */ public static final String MISSION_PROPERTY_NAME = "mission"; + public static final String MEMBERSHIP_TYPE_PROPERTY_NAME = "membershipType"; public static final String INFORMAL_TAG_TYPE_GUID = "ba846a7b-2955-40bf-952b-2793ceca090a"; public static final String INFORMAL_TAG_TYPE_NAME = "InformalTag"; /* from Area 1 */ @@ -1167,7 +1255,6 @@ public class OpenMetadataAPIMapper public static final String TERM_ASSIGNMENT_STATUS_ENUM_TYPE_NAME = "TermAssignmentStatus"; public static final String EXPRESSION_PROPERTY_NAME = "expression"; - public static final String STATUS_PROPERTY_NAME = "status"; public static final String CONFIDENCE_PROPERTY_NAME = "confidence"; public static final String STEWARD_PROPERTY_NAME = "steward"; public static final String STEWARD_TYPE_NAME_PROPERTY_NAME = "stewardTypeName"; @@ -1192,6 +1279,8 @@ public class OpenMetadataAPIMapper public static final String GOVERNANCE_DOMAIN_TYPE_NAME = "GovernanceDomainDescription"; /* Referenceable */ + public static final String GOVERNANCE_DOMAIN_SET_CLASSIFICATION_NAME = "GovernanceDomainSet"; + public static final String GOVERNANCE_ROLE_TYPE_GUID = "de2d7f2e-1759-44e3-b8a6-8af53e8fb0ee"; public static final String GOVERNANCE_ROLE_TYPE_NAME = "GovernanceRole"; /* PersonRole */ @@ -1200,10 +1289,26 @@ public class OpenMetadataAPIMapper public static final String GOVERNANCE_OFFICER_TYPE_NAME = "GovernanceOfficer"; /* GovernanceRole */ + public static final String GOVERNANCE_REPRESENTATIVE_TYPE_GUID = "6046bdf8-a37e-4bc4-b51d-325d8c31a96c"; + public static final String GOVERNANCE_REPRESENTATIVE_TYPE_NAME = "GovernanceRepresentative"; + /* GovernanceRole */ + + public static final String LOCATION_OWNER_TYPE_GUID = "3437fd1d-5098-426c-9b55-c94d1fc5dc0e"; + public static final String LOCATION_OWNER_TYPE_NAME = "LocationOwner"; + /* GovernanceRole */ + public static final String ASSET_OWNER_TYPE_GUID = "ac406bf8-e53e-49f1-9088-2af28eeee285"; public static final String ASSET_OWNER_TYPE_NAME = "AssetOwner"; /* GovernanceRole */ + public static final String BUSINESS_OWNER_TYPE_GUID = "0e83bb5f-f2f5-4a85-92eb-f71e92a181f5"; + public static final String BUSINESS_OWNER_TYPE_NAME = "BusinessOwner"; + /* GovernanceRole */ + + public static final String SOLUTION_OWNER_TYPE_GUID = "e44d5019-37e5-4965-8b89-2bef412833bf"; + public static final String SOLUTION_OWNER_TYPE_NAME = "SolutionOwner"; + /* GovernanceRole */ + public static final String COMPONENT_OWNER_TYPE_GUID = "21756af1-06c9-4b06-87d2-3ef911f0a58a"; public static final String COMPONENT_OWNER_TYPE_NAME = "ComponentOwner"; /* GovernanceRole */ @@ -1321,7 +1426,6 @@ public class OpenMetadataAPIMapper public static final String DOMAIN_IDENTIFIER_PROPERTY_NAME = "domainIdentifier"; /* from many governance entities */ public static final String CRITERIA_PROPERTY_NAME = "criteria"; /* from many governance entities */ - public static final String PRIORITY_PROPERTY_NAME = "priority"; /* from GovernanceDefinition and To Do entity */ public static final String IMPLICATIONS_PROPERTY_NAME = "implications"; /* from GovernanceDefinition entity */ public static final String OUTCOMES_PROPERTY_NAME = "outcomes"; /* from GovernanceDefinition entity */ public static final String RESULTS_PROPERTY_NAME = "results"; /* from GovernanceDefinition entity */ @@ -1427,6 +1531,8 @@ public class OpenMetadataAPIMapper public static final String ZONE_TYPE_NAME = "GovernanceZone"; /* Referenceable */ + public static final String ZONE_NAME_PROPERTY_NAME = "zoneName"; + public static final String ZONE_HIERARCHY_TYPE_GUID = "ee6cf469-cb4d-4c3b-a4c7-e2da1236d139"; public static final String ZONE_HIERARCHY_TYPE_NAME = "ZoneHierarchy"; /* from Area 4 */ /* End1 = Parent Zone; End 2 = Child Zone */ @@ -1435,6 +1541,8 @@ public class OpenMetadataAPIMapper public static final String SUBJECT_AREA_TYPE_NAME = "SubjectAreaDefinition"; /* Referenceable */ + public static final String SUBJECT_AREA_NAME_PROPERTY_NAME = "subjectAreaName"; + public static final String SUBJECT_AREA_HIERARCHY_TYPE_GUID = "fd3b7eaf-969c-4c26-9e1e-f31c4c2d1e4b"; public static final String SUBJECT_AREA_HIERARCHY_TYPE_NAME = "SubjectAreaHierarchy"; /* from Area 4 */ /* End1 = Parent Subject Area; End 2 = Child Subject Area */ @@ -1655,9 +1763,6 @@ public class OpenMetadataAPIMapper public static final String RECEIVED_GUARDS_PROPERTY_NAME = "receivedGuards"; /* from GovernanceAction entity */ public static final String START_DATE_PROPERTY_NAME = "startDate"; /* from GovernanceAction and Project entity */ public static final String PLANNED_END_DATE_PROPERTY_NAME = "plannedEndDate"; /* from Project entity */ - public static final String CREATION_TIME_PROPERTY_NAME = "creationTime"; /* from To Do entity */ - public static final String DUE_TIME_PROPERTY_NAME = "dueTime"; /* from To Do entity */ - public static final String COMPLETION_TIME_PROPERTY_NAME = "completionTime"; /* from To Do entity */ public static final String ACTION_STATUS_PROPERTY_NAME = "actionStatus"; /* from GovernanceAction entity */ public static final String PROCESSING_ENGINE_USER_ID_PROPERTY_NAME = "processingEngineUserId"; /* from GovernanceAction entity */ public static final String COMPLETION_DATE_PROPERTY_NAME = "completionDate"; /* from GovernanceAction entity */ @@ -2175,6 +2280,7 @@ public class OpenMetadataAPIMapper /* End1 = Referenceable; End 2 = ValidValuesDefinition */ public static final String IS_STRICT_REQUIREMENT_PROPERTY_NAME = "strictRequirement"; /* from ValidValuesAssignment relationship */ + public static final String IS_DEFAULT_VALUE_PROPERTY_NAME = "isDefaultValue"; /* from ValidValuesMember relationship */ public static final String VALID_VALUES_MEMBER_RELATIONSHIP_TYPE_GUID = "6337c9cd-8e5a-461b-97f9-5151bcb97a9e"; /* from Area 5 */ public static final String VALID_VALUES_MEMBER_RELATIONSHIP_TYPE_NAME = "ValidValueMember"; @@ -2192,10 +2298,7 @@ public class OpenMetadataAPIMapper public static final String VALID_VALUES_MAP_RELATIONSHIP_TYPE_NAME = "ValidValuesMapping"; /* End1 = ValidValuesDefinition; End 2 = ValidValuesDefinition */ - public static final String VALID_VALUES_ASSOCIATION_DESCRIPTION_PROPERTY_NAME = "associationDescription"; /* from ValidValuesMapping relationship */ - public static final String VALID_VALUES_CONFIDENCE_PROPERTY_NAME = "confidence"; /* from ValidValuesMapping and ReferenceValueAssignment relationship */ - public static final String VALID_VALUES_STEWARD_PROPERTY_NAME = "steward"; /* from ValidValuesMapping and ReferenceValueAssignment relationship */ - public static final String VALID_VALUES_NOTES_PROPERTY_NAME = "notes"; /* from ValidValuesMapping and ReferenceValueAssignment relationship */ + public static final String ASSOCIATION_DESCRIPTION_PROPERTY_NAME = "associationDescription"; /* from ValidValuesMapping relationship */ public static final String REFERENCE_VALUE_ASSIGNMENT_RELATIONSHIP_TYPE_GUID = "111e6d2e-94e9-43ed-b4ed-f0d220668cbf"; /* from Area 5 */ public static final String REFERENCE_VALUE_ASSIGNMENT_RELATIONSHIP_TYPE_NAME = "ReferenceValueAssignment"; @@ -2492,6 +2595,13 @@ public class OpenMetadataAPIMapper /* Area 7 - Lineage */ /* ============================================================================================================================*/ + public static final String IMPLEMENTED_BY_RELATIONSHIP_TYPE_GUID = "28f63c94-aaef-4c84-98f7-d77aa605272e"; + public static final String IMPLEMENTED_BY_RELATIONSHIP_TYPE_NAME = "ImplementedBy"; + /* End1 = SolutionPort; End 2 = SchemaType */ + + public static final String DESIGN_STEP_PROPERTY_NAME = "designStep"; + public static final String ROLE_PROPERTY_NAME = "role"; + public static final String SOLUTION_PORT_SCHEMA_RELATIONSHIP_TYPE_GUID = "bf02c703-57a2-4ab7-b6db-f49b57b05985"; public static final String SOLUTION_PORT_SCHEMA_RELATIONSHIP_TYPE_NAME = "SolutionPortSchema"; /* End1 = SolutionPort; End 2 = SchemaType */ diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/PersonRoleBuilder.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/PersonRoleBuilder.java index 352e453bfc0..5edf254435d 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/PersonRoleBuilder.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/PersonRoleBuilder.java @@ -15,21 +15,28 @@ */ public class PersonRoleBuilder extends ReferenceableBuilder { - private String name = null; - private String description = null; - private String scope = null; - private int headCount = 1; - private boolean headCountLimitSet = false; + private String identifier = null; + private String name = null; + private String description = null; + private String scope = null; + private int headCount = 1; + private boolean headCountLimitSet = false; + private int domainIdentifier = 0; /* only supported on roles that inherit from GovernanceRole. */ + private boolean domainIdentifierSet = false; /** * Create constructor * * @param qualifiedName unique name for the role + * @param identifier unique identifier for the role - typically from external system * @param name short display name for the role * @param description description of the role * @param scope the scope of the role * @param headCount number of individuals that can be appointed to this role + * @param headCountLimitSet should the headcount attribute be set in the role? + * @param domainIdentifier governance domain identifier + * @param domainIdentifierSet should the domainIdentifier attribute be set in the role? * @param additionalProperties additional properties for a role * @param typeGUID unique identifier of this element's type * @param typeName unique name of this element's type @@ -39,11 +46,14 @@ public class PersonRoleBuilder extends ReferenceableBuilder * @param serverName name of local server */ PersonRoleBuilder(String qualifiedName, + String identifier, String name, String description, String scope, int headCount, boolean headCountLimitSet, + int domainIdentifier, + boolean domainIdentifierSet, Map additionalProperties, String typeGUID, String typeName, @@ -61,27 +71,32 @@ public class PersonRoleBuilder extends ReferenceableBuilder serviceName, serverName); + this.identifier = identifier; this.name = name; this.description = description; this.scope = scope; this.headCount = headCount; this.headCountLimitSet = headCountLimitSet; + this.domainIdentifier = domainIdentifier; + this.domainIdentifierSet = domainIdentifierSet; } /** - * Create constructor + * Create constructor for templated roles. * * @param qualifiedName unique name for the role + * @param identifier unique identifier for the role - typically from external system * @param name short display name for the role * @param description description of the role * @param headCount number of individuals that can be appointed to this role - * @param headCountLimitSet should the head count property be set? + * @param headCountLimitSet should the headcount attribute be set in the role? * @param repositoryHelper helper methods * @param serviceName name of this OMAS * @param serverName name of local server */ PersonRoleBuilder(String qualifiedName, + String identifier, String name, String description, int headCount, @@ -95,6 +110,7 @@ public class PersonRoleBuilder extends ReferenceableBuilder serviceName, serverName); + this.identifier = identifier; this.name = name; this.description = description; this.headCount = headCount; @@ -133,6 +149,12 @@ public InstanceProperties getInstanceProperties(String methodName) throws Inval { InstanceProperties properties = super.getInstanceProperties(methodName); + properties = repositoryHelper.addStringPropertyToInstance(serviceName, + properties, + OpenMetadataAPIMapper.IDENTIFIER_PROPERTY_NAME, + identifier, + methodName); + properties = repositoryHelper.addStringPropertyToInstance(serviceName, properties, OpenMetadataAPIMapper.NAME_PROPERTY_NAME, @@ -160,6 +182,22 @@ public InstanceProperties getInstanceProperties(String methodName) throws Inval methodName); } + if (domainIdentifierSet) + { + /* + * The domain identifier may have been set in the extended properties which are populated by the super class. + * This ensures the value fromm extended properties is not overridden. + */ + if ((properties == null) || (properties.getPropertyValue(OpenMetadataAPIMapper.DOMAIN_IDENTIFIER_PROPERTY_NAME) == null)) + { + properties = repositoryHelper.addIntPropertyToInstance(serviceName, + properties, + OpenMetadataAPIMapper.DOMAIN_IDENTIFIER_PROPERTY_NAME, + domainIdentifier, + methodName); + } + } + return properties; } diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/PersonRoleHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/PersonRoleHandler.java index 406aac32e79..9f54fcbc5a5 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/PersonRoleHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/PersonRoleHandler.java @@ -83,11 +83,13 @@ public PersonRoleHandler(OpenMetadataAPIGenericConverter converter, * @param externalSourceGUID unique identifier of software capability representing the caller * @param externalSourceName unique name of software capability representing the caller * @param qualifiedName unique name for the role - used in other configuration + * @param identifier unique identifier for the role - typically from external system * @param name short display name for the role * @param description description of the role * @param scope the scope of the role * @param headCount number of individuals that can be appointed to this role * @param headCountLimitSet should the headcount be added to the entity? + * @param domainIdentifier governance domain identifier * @param additionalProperties additional properties for a role * @param suppliedTypeName type name from the caller (enables creation of subtypes) * @param extendedProperties properties for a governance role subtype @@ -105,11 +107,13 @@ public String createPersonRole(String userId, String externalSourceGUID, String externalSourceName, String qualifiedName, + String identifier, String name, String description, String scope, int headCount, boolean headCountLimitSet, + int domainIdentifier, Map additionalProperties, String suppliedTypeName, Map extendedProperties, @@ -138,12 +142,22 @@ public String createPersonRole(String userId, methodName, repositoryHelper); + /* + * GovernanceRole inherits from PersonRole and introduces the domainIdentifier property. If the requested role + * is a type of governance role then domain identifier is set. If the role comes from an API that does not explicitly support + * the domain identifier then it will be set to zero (all domains) unless overridden in the extended properties. + */ + boolean domainIdentifierSet = repositoryHelper.isTypeOf(serviceName, typeName, OpenMetadataAPIMapper.GOVERNANCE_ROLE_TYPE_NAME); + PersonRoleBuilder roleBuilder = new PersonRoleBuilder(qualifiedName, + identifier, name, description, scope, headCount, headCountLimitSet, + domainIdentifier, + domainIdentifierSet, additionalProperties, typeGUID, typeName, @@ -176,6 +190,7 @@ public String createPersonRole(String userId, * @param externalSourceName unique name of software capability representing the caller * @param templateGUID unique identifier of the metadata element to copy * @param qualifiedName unique name for the role - used in other configuration + * @param identifier unique identifier for the role - typically from external system * @param name short display name for the role * @param description description of the governance role * @param headCount number of individuals that can be appointed to this role @@ -193,6 +208,7 @@ public String createPersonRoleFromTemplate(String userId, String externalSourceName, String templateGUID, String qualifiedName, + String identifier, String name, String description, int headCount, @@ -209,6 +225,7 @@ public String createPersonRoleFromTemplate(String userId, invalidParameterHandler.validateName(qualifiedName, qualifiedNameParameterName, methodName); PersonRoleBuilder roleBuilder = new PersonRoleBuilder(qualifiedName, + identifier, name, description, headCount, @@ -599,7 +616,6 @@ public void removeTeamLeader(String userId, } - /** * Link a team member role to a team profile. * @@ -719,7 +735,6 @@ public void removeTeamMember(String userId, } - /** * Update the person role object. * @@ -730,12 +745,14 @@ public void removeTeamMember(String userId, * @param roleGUIDParameterName parameter passing the roleGUID * @param qualifiedName unique name for the role - used in other configuration * @param qualifiedNameParameterName parameter providing qualified name + * @param identifier unique identifier for the role - typically from external system * @param name short display name for the role * @param nameParameterName parameter providing name * @param description description of the role * @param scope the scope of the role * @param headCountLimitSet should the head count be set in the entity? * @param headCount number of individuals that can be appointed to this role + * @param domainIdentifier governance domain identifier * @param additionalProperties additional properties for a governance role * @param typeName type of role * @param extendedProperties properties for a governance role subtype @@ -759,12 +776,14 @@ public void updatePersonRole(String userId, String roleGUIDParameterName, String qualifiedName, String qualifiedNameParameterName, + String identifier, String name, String nameParameterName, String description, String scope, int headCount, boolean headCountLimitSet, + int domainIdentifier, Map additionalProperties, String typeName, Map extendedProperties, @@ -787,18 +806,31 @@ public void updatePersonRole(String userId, invalidParameterHandler.validateName(name, nameParameterName, methodName); } + String typeGUID = invalidParameterHandler.validateTypeName(typeName, OpenMetadataAPIMapper.PERSON_ROLE_TYPE_NAME, serviceName, methodName, repositoryHelper); + /* + * GovernanceRole inherits from PersonRole and introduces the domainIdentifier property. If the requested role + * is a type of governance role then domain identifier is set. If the role comes from an API that does not explicitly support + * the domain identifier then it will be set to zero (all domains) unless overridden in the extended properties. + */ + boolean domainIdentifierSet = (typeName != null) && + (!(isMergeUpdate) && (domainIdentifier == 0)) && + (repositoryHelper.isTypeOf(serviceName, typeName, OpenMetadataAPIMapper.GOVERNANCE_ROLE_TYPE_NAME)); + PersonRoleBuilder roleBuilder = new PersonRoleBuilder(qualifiedName, + identifier, name, description, scope, headCount, headCountLimitSet, + domainIdentifier, + domainIdentifierSet, additionalProperties, typeGUID, typeName, @@ -949,6 +981,7 @@ public List getPersonRolesByName(String userId, { List specificMatchPropertyNames = new ArrayList<>(); specificMatchPropertyNames.add(OpenMetadataAPIMapper.QUALIFIED_NAME_PROPERTY_NAME); + specificMatchPropertyNames.add(OpenMetadataAPIMapper.IDENTIFIER_PROPERTY_NAME); specificMatchPropertyNames.add(OpenMetadataAPIMapper.NAME_PROPERTY_NAME); return this.getBeansByValue(userId, @@ -971,6 +1004,212 @@ public List getPersonRolesByName(String userId, } + /** + * Return the person roles attached to a supplied project via the project management relationship. + * + * @param userId calling user + * @param projectGUID identifier for the entity that the contact details are attached to + * @param projectGUIDParameterName name of parameter supplying the GUID + * @param startingFrom where to start from in the list + * @param pageSize maximum number of results that can be returned + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * @return list of objects or null if none found + * @throws InvalidParameterException the input properties are invalid + * @throws UserNotAuthorizedException user not authorized to issue this request + * @throws PropertyServerException problem accessing the property server + */ + public List getProjectManagerRoles(String userId, + String projectGUID, + String projectGUIDParameterName, + int startingFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return this.getAttachedElements(userId, + null, + null, + projectGUID, + projectGUIDParameterName, + OpenMetadataAPIMapper.PROJECT_TYPE_NAME, + OpenMetadataAPIMapper.PROJECT_MANAGEMENT_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.PROJECT_MANAGEMENT_RELATIONSHIP_TYPE_NAME, + OpenMetadataAPIMapper.PERSON_ROLE_TYPE_NAME, + null, + null, + 2, + forLineage, + forDuplicateProcessing, + supportedZones, + startingFrom, + pageSize, + effectiveTime, + methodName); + } + + + /** + * Return the person roles attached to a supplied team via the team leadership relationship. + * + * @param userId calling user + * @param teamGUID identifier for the entity that the contact details are attached to + * @param teamGUIDParameterName name of parameter supplying the GUID + * @param startingFrom where to start from in the list + * @param pageSize maximum number of results that can be returned + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * @return list of objects or null if none found + * @throws InvalidParameterException the input properties are invalid + * @throws UserNotAuthorizedException user not authorized to issue this request + * @throws PropertyServerException problem accessing the property server + */ + public List getTeamLeaderRoles(String userId, + String teamGUID, + String teamGUIDParameterName, + int startingFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return this.getAttachedElements(userId, + null, + null, + teamGUID, + teamGUIDParameterName, + OpenMetadataAPIMapper.TEAM_TYPE_NAME, + OpenMetadataAPIMapper.TEAM_LEADERSHIP_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.TEAM_LEADERSHIP_RELATIONSHIP_TYPE_NAME, + OpenMetadataAPIMapper.PERSON_ROLE_TYPE_NAME, + null, + null, + 1, + forLineage, + forDuplicateProcessing, + supportedZones, + startingFrom, + pageSize, + effectiveTime, + methodName); + } + + + /** + * Return the person roles attached to a supplied team via the team membership relationship. + * + * @param userId calling user + * @param teamGUID identifier for the entity that the contact details are attached to + * @param teamGUIDParameterName name of parameter supplying the GUID + * @param startingFrom where to start from in the list + * @param pageSize maximum number of results that can be returned + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * @return list of objects or null if none found + * @throws InvalidParameterException the input properties are invalid + * @throws UserNotAuthorizedException user not authorized to issue this request + * @throws PropertyServerException problem accessing the property server + */ + public List getTeamMemberRoles(String userId, + String teamGUID, + String teamGUIDParameterName, + int startingFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return this.getAttachedElements(userId, + null, + null, + teamGUID, + teamGUIDParameterName, + OpenMetadataAPIMapper.TEAM_TYPE_NAME, + OpenMetadataAPIMapper.TEAM_MEMBERSHIP_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.TEAM_MEMBERSHIP_RELATIONSHIP_TYPE_NAME, + OpenMetadataAPIMapper.PERSON_ROLE_TYPE_NAME, + null, + null, + 1, + forLineage, + forDuplicateProcessing, + supportedZones, + startingFrom, + pageSize, + effectiveTime, + methodName); + } + + + + /** + * Return the person roles attached to a supplied community via the community membership relationship. + * + * @param userId calling user + * @param communityGUID identifier for the entity that the contact details are attached to + * @param communityGUIDParameterName name of parameter supplying the GUID + * @param startingFrom where to start from in the list + * @param pageSize maximum number of results that can be returned + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * @return list of objects or null if none found + * @throws InvalidParameterException the input properties are invalid + * @throws UserNotAuthorizedException user not authorized to issue this request + * @throws PropertyServerException problem accessing the property server + */ + public List getCommunityRoles(String userId, + String communityGUID, + String communityGUIDParameterName, + int startingFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return this.getAttachedElements(userId, + null, + null, + communityGUID, + communityGUIDParameterName, + OpenMetadataAPIMapper.COMMUNITY_TYPE_NAME, + OpenMetadataAPIMapper.COMMUNITY_MEMBERSHIP_TYPE_NAME, + OpenMetadataAPIMapper.COMMUNITY_MEMBERSHIP_TYPE_NAME, + OpenMetadataAPIMapper.PERSON_ROLE_TYPE_NAME, + null, + null, + 2, + forLineage, + forDuplicateProcessing, + supportedZones, + startingFrom, + pageSize, + effectiveTime, + methodName); + } + + + /** * Return the bean that represents a person role. * @@ -1120,8 +1359,7 @@ public List getPersonRolesForTitle(String userId, /** - * Retrieve the list of role metadata elements with a matching qualified or display name. - * There are no wildcards supported on this request. + * Retrieve the list of role metadata elements with a matching domain identifier. If the domain identifier is 0 then all roles are returned. * * @param userId calling user * @param domainIdentifier domain of interest - 0 means all domains diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ProjectBuilder.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ProjectBuilder.java index cb1e57e72dc..6169bab4044 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ProjectBuilder.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ProjectBuilder.java @@ -3,8 +3,12 @@ package org.odpi.openmetadata.commonservices.generichandlers; import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Classification; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.ClassificationOrigin; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProvenanceType; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper; +import org.odpi.openmetadata.repositoryservices.ffdc.exception.TypeErrorException; import java.util.Date; import java.util.Map; @@ -14,22 +18,24 @@ */ public class ProjectBuilder extends ReferenceableBuilder { + private String identifier = null; private String name = null; private String description = null; private Date startDate = null; private Date plannedEndDate = null; - private String status = null; + private String projectStatus = null; /** * Create constructor * * @param qualifiedName unique name for the Project + * @param identifier unique identifier for the Project - typically allocated by an external system * @param name name for the project * @param description description of the glossary * @param startDate start date of the project * @param plannedEndDate planned end Date for the project - * @param status status of the project + * @param projectStatus status of the project * @param additionalProperties additional properties for a Project * @param typeGUID unique identifier of this element's type * @param typeName unique name of this element's type @@ -39,11 +45,12 @@ public class ProjectBuilder extends ReferenceableBuilder * @param serverName name of local server */ public ProjectBuilder(String qualifiedName, + String identifier, String name, String description, Date startDate, Date plannedEndDate, - String status, + String projectStatus, Map additionalProperties, String typeGUID, String typeName, @@ -61,11 +68,42 @@ public ProjectBuilder(String qualifiedName, serviceName, serverName); + this.identifier = identifier; this.name = name; this.description = description; this.startDate = startDate; this.plannedEndDate = plannedEndDate; - this.status = status; + this.projectStatus = projectStatus; + } + + + /** + * Create constructor + * + * @param qualifiedName unique name for the Project + * @param identifier unique identifier for the Project - typically allocated by an external system + * @param name name for the project + * @param description description of the glossary + * @param repositoryHelper helper methods + * @param serviceName name of this OMAS + * @param serverName name of local server + */ + public ProjectBuilder(String qualifiedName, + String identifier, + String name, + String description, + OMRSRepositoryHelper repositoryHelper, + String serviceName, + String serverName) + { + super(qualifiedName, + repositoryHelper, + serviceName, + serverName); + + this.identifier = identifier; + this.name = name; + this.description = description; } @@ -88,6 +126,70 @@ public ProjectBuilder(String qualifiedName, } + /** + * Set up the Campaign classification for this project. + * + * @param userId calling user + * @param methodName calling method + * @throws InvalidParameterException classification is not supported in the local repository, or any repository + * connected by an open metadata repository cohort + */ + public void setCampaignClassification(String userId, + String methodName) throws InvalidParameterException + { + this.setProjectTypeClassification(userId, OpenMetadataAPIMapper.CAMPAIGN_CLASSIFICATION_TYPE_NAME, methodName); + } + + + /** + * Set up the Task classification for this project. + * + * @param userId calling user + * @param methodName calling method + * @throws InvalidParameterException classification is not supported in the local repository, or any repository + * connected by an open metadata repository cohort + */ + public void setTaskClassification(String userId, + String methodName) throws InvalidParameterException + { + this.setProjectTypeClassification(userId, OpenMetadataAPIMapper.TASK_CLASSIFICATION_TYPE_NAME, methodName); + } + + + /** + * Set up the Task classification for this project. + * + * @param userId calling user + * @param classificationName name of the classificaton to add + * @param methodName calling method + * @throws InvalidParameterException classification is not supported in the local repository, or any repository + * connected by an open metadata repository cohort + */ + public void setProjectTypeClassification(String userId, + String classificationName, + String methodName) throws InvalidParameterException + { + try + { + Classification classification = repositoryHelper.getNewClassification(serviceName, + null, + null, + InstanceProvenanceType.LOCAL_COHORT, + userId, + classificationName, + typeName, + ClassificationOrigin.ASSIGNED, + null, + null); + newClassifications.put(classification.getName(), classification); + } + catch (TypeErrorException error) + { + errorHandler.handleUnsupportedType(error, methodName, OpenMetadataAPIMapper.SECURITY_TAG_CLASSIFICATION_TYPE_NAME); + } + } + + /** * Return the supplied bean properties in an InstanceProperties object. * @@ -100,6 +202,12 @@ public InstanceProperties getInstanceProperties(String methodName) throws Inval { InstanceProperties properties = super.getInstanceProperties(methodName); + properties = repositoryHelper.addStringPropertyToInstance(serviceName, + properties, + OpenMetadataAPIMapper.IDENTIFIER_PROPERTY_NAME, + identifier, + methodName); + properties = repositoryHelper.addStringPropertyToInstance(serviceName, properties, OpenMetadataAPIMapper.NAME_PROPERTY_NAME, @@ -126,8 +234,8 @@ public InstanceProperties getInstanceProperties(String methodName) throws Inval properties = repositoryHelper.addStringPropertyToInstance(serviceName, properties, - OpenMetadataAPIMapper.STATUS_PROPERTY_NAME, - status, + OpenMetadataAPIMapper.PROJECT_STATUS_PROPERTY_NAME, + projectStatus, methodName); return properties; diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ProjectHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ProjectHandler.java new file mode 100644 index 00000000000..0ee1001b8a6 --- /dev/null +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ProjectHandler.java @@ -0,0 +1,1361 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.commonservices.generichandlers; + + +import org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler; +import org.odpi.openmetadata.commonservices.repositoryhandler.RepositoryHandler; +import org.odpi.openmetadata.frameworks.auditlog.AuditLog; +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; +import org.odpi.openmetadata.metadatasecurity.server.OpenMetadataServerSecurityVerifier; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * ProjectHandler provides the exchange of metadata about projects between the repository and the OMAS. + * + * @param class that represents the project + */ +public class ProjectHandler extends ReferenceableHandler +{ + private static final String qualifiedNameParameterName = "qualifiedName"; + + /** + * Construct the handler with information needed to work with B objects. + * + * @param converter specific converter for this bean class + * @param beanClass name of bean class that is represented by the generic class B + * @param serviceName name of this service + * @param serverName name of the local server + * @param invalidParameterHandler handler for managing parameter errors + * @param repositoryHandler manages calls to the repository services + * @param repositoryHelper provides utilities for manipulating the repository services objects + * @param localServerUserId userId for this server + * @param securityVerifier open metadata security services verifier + * @param supportedZones list of zones that the access service is allowed to serve B instances from + * @param defaultZones list of zones that the access service should set in all new B instances + * @param publishZones list of zones that the access service sets up in published B instances + * @param auditLog destination for audit log events + */ + public ProjectHandler(OpenMetadataAPIGenericConverter converter, + Class beanClass, + String serviceName, + String serverName, + InvalidParameterHandler invalidParameterHandler, + RepositoryHandler repositoryHandler, + OMRSRepositoryHelper repositoryHelper, + String localServerUserId, + OpenMetadataServerSecurityVerifier securityVerifier, + List supportedZones, + List defaultZones, + List publishZones, + AuditLog auditLog) + { + super(converter, + beanClass, + serviceName, + serverName, + invalidParameterHandler, + repositoryHandler, + repositoryHelper, + localServerUserId, + securityVerifier, + supportedZones, + defaultZones, + publishZones, + auditLog); + } + + + /** + * Create the project object. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of the software capability that owns this project + * @param externalSourceName unique name of the software capability that owns this project + * @param qualifiedName qualified name of project + * @param identifier unique identifier of project - typically allocated externally + * @param name display name + * @param description description + * @param startDate date the project started + * @param plannedEndDate date the project is expected to end + * @param projectStatus status of the project + * @param additionalProperties additional properties for a project + * @param suppliedTypeName type name from the caller (enables creation of subtypes) + * @param extendedProperties properties for a governance project subtype + * @param setCampaignClassification should the Campaign classification be set? + * @param setTaskClassification should the Task classification be set? + * @param projectTypeClassification add special classification that defines the type of project - eg GlossaryProject or GovernanceProject + * @param effectiveFrom the time that the relationship element must be effective from (null for any time, new Date() for now) + * @param effectiveTo the time that the relationship must be effective to (null for any time, new Date() for now) + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @return unique identifier of the new project object + * @throws InvalidParameterException qualifiedName or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + public String createProject(String userId, + String externalSourceGUID, + String externalSourceName, + String qualifiedName, + String identifier, + String name, + String description, + Date startDate, + Date plannedEndDate, + String projectStatus, + Map additionalProperties, + String suppliedTypeName, + Map extendedProperties, + boolean setCampaignClassification, + boolean setTaskClassification, + String projectTypeClassification, + Date effectiveFrom, + Date effectiveTo, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateName(qualifiedName, qualifiedNameParameterName, methodName); + + String typeName = OpenMetadataAPIMapper.PROJECT_TYPE_NAME; + + if (suppliedTypeName != null) + { + typeName = suppliedTypeName; + } + + String typeGUID = invalidParameterHandler.validateTypeName(typeName, + OpenMetadataAPIMapper.PROJECT_TYPE_NAME, + serviceName, + methodName, + repositoryHelper); + + ProjectBuilder builder = new ProjectBuilder(qualifiedName, + identifier, + name, + description, + startDate, + plannedEndDate, + projectStatus, + additionalProperties, + typeGUID, + typeName, + extendedProperties, + repositoryHelper, + serviceName, + serverName); + + builder.setEffectivityDates(effectiveFrom, effectiveTo); + + if (setCampaignClassification) + { + builder.setCampaignClassification(userId, methodName); + } + else if (setTaskClassification) + { + builder.setTaskClassification(userId, methodName); + } + + if (projectTypeClassification != null) + { + builder.setProjectTypeClassification(userId, projectTypeClassification, methodName); + } + + return this.createBeanInRepository(userId, + externalSourceGUID, + externalSourceName, + typeGUID, + typeName, + qualifiedName, + OpenMetadataAPIMapper.QUALIFIED_NAME_PROPERTY_NAME, + builder, + effectiveTime, + methodName); + } + + + /** + * Create a new metadata element to represent a project using an existing metadata element as a template. + * The template defines additional classifications and relationships that should be added to the new project. + * + * All categories and terms are linked to a single project. They are owned by this project and if the + * project is deleted, any linked terms and categories are deleted as well. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of the software capability that owns this project + * @param externalSourceName unique name of the software capability that owns this project + * @param templateGUID unique identifier of the metadata element to copy + * @param qualifiedName unique name for the project - used in other configuration + * @param identifier unique identifier of project - typically allocated externally + * @param displayName short display name for the project + * @param description description of the governance project + * @param methodName calling method + * + * @return unique identifier of the new metadata element + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public String createProjectFromTemplate(String userId, + String externalSourceGUID, + String externalSourceName, + String templateGUID, + String qualifiedName, + String identifier, + String displayName, + String description, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String templateGUIDParameterName = "templateGUID"; + final String qualifiedNameParameterName = "qualifiedName"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(templateGUID, templateGUIDParameterName, methodName); + invalidParameterHandler.validateName(qualifiedName, qualifiedNameParameterName, methodName); + + ProjectBuilder builder = new ProjectBuilder(qualifiedName, + identifier, + displayName, + description, + repositoryHelper, + serviceName, + serverName); + + return this.createBeanFromTemplate(userId, + externalSourceGUID, + externalSourceName, + templateGUID, + templateGUIDParameterName, + OpenMetadataAPIMapper.PROJECT_TYPE_GUID, + OpenMetadataAPIMapper.PROJECT_TYPE_NAME, + qualifiedName, + OpenMetadataAPIMapper.QUALIFIED_NAME_PROPERTY_NAME, + builder, + methodName); + } + + + /** + * Update the anchor object that all elements in a project (terms and categories) are linked to. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of the software capability that owns this project + * @param externalSourceName unique name of the software capability that owns this project + * @param projectGUID unique identifier of the project to update + * @param projectGUIDParameterName parameter passing the projectGUID + * @param qualifiedName qualified name of project + * @param identifier unique identifier of project - typically allocated externally + * @param name display name + * @param description description + * @param startDate date the project started + * @param plannedEndDate date the project is expected to end + * @param projectStatus status of the project + * @param additionalProperties additional properties for a governance project + * @param suppliedTypeName type of project + * @param extendedProperties properties for a governance project subtype + * @param effectiveFrom the time that the relationship element must be effective from (null for any time, new Date() for now) + * @param effectiveTo the time that the relationship must be effective to (null for any time, new Date() for now) + * @param isMergeUpdate should the properties be merged with the existing properties or completely over-write them + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @throws InvalidParameterException qualifiedName or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + public void updateProject(String userId, + String externalSourceGUID, + String externalSourceName, + String projectGUID, + String projectGUIDParameterName, + String qualifiedName, + String identifier, + String name, + String description, + Date startDate, + Date plannedEndDate, + String projectStatus, + Map additionalProperties, + String suppliedTypeName, + Map extendedProperties, + Date effectiveFrom, + Date effectiveTo, + boolean isMergeUpdate, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(projectGUID, projectGUIDParameterName, methodName); + invalidParameterHandler.validateName(qualifiedName, qualifiedNameParameterName, methodName); + + String typeName = OpenMetadataAPIMapper.PROJECT_TYPE_NAME; + + if (suppliedTypeName != null) + { + typeName = suppliedTypeName; + } + + String typeGUID = invalidParameterHandler.validateTypeName(typeName, + OpenMetadataAPIMapper.PROJECT_TYPE_NAME, + serviceName, + methodName, + repositoryHelper); + + ProjectBuilder builder = new ProjectBuilder(qualifiedName, + identifier, + name, + description, + startDate, + plannedEndDate, + projectStatus, + additionalProperties, + typeGUID, + typeName, + extendedProperties, + repositoryHelper, + serviceName, + serverName); + + builder.setEffectivityDates(effectiveFrom, effectiveTo); + + this.updateBeanInRepository(userId, + externalSourceGUID, + externalSourceName, + projectGUID, + projectGUIDParameterName, + typeGUID, + typeName, + forLineage, + forDuplicateProcessing, + supportedZones, + builder.getInstanceProperties(methodName), + isMergeUpdate, + effectiveTime, + methodName); + } + + + /** + * Add a project team (ActorProfile) to a project. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of the software capability that owns this project + * @param externalSourceName unique name of the software capability that owns this project + * @param projectGUID unique identifier of the project + * @param projectGUIDParameterName parameter supplying the projectGUID + * @param actorProfileGUID unique identifier of the element that is being added to the project + * @param actorProfileGUIDParameterName parameter supplying the actorProfileGUID + * @param teamRole why is the team attached to the project? (optional) + * @param effectiveFrom the time that the relationship element must be effective from (null for any time, new Date() for now) + * @param effectiveTo the time that the relationship must be effective to (null for any time, new Date() for now) + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void addActorToProject(String userId, + String externalSourceGUID, + String externalSourceName, + String projectGUID, + String projectGUIDParameterName, + String actorProfileGUID, + String actorProfileGUIDParameterName, + String teamRole, + Date effectiveFrom, + Date effectiveTo, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + InstanceProperties properties = repositoryHelper.addStringPropertyToInstance(serviceName, + null, + OpenMetadataAPIMapper.TEAM_ROLE_PROPERTY_NAME, + teamRole, + methodName); + + this.linkElementToElement(userId, + externalSourceGUID, + externalSourceName, + projectGUID, + projectGUIDParameterName, + OpenMetadataAPIMapper.PROJECT_TYPE_NAME, + actorProfileGUID, + actorProfileGUIDParameterName, + OpenMetadataAPIMapper.ACTOR_PROFILE_TYPE_NAME, + forLineage, + forDuplicateProcessing, + supportedZones, + OpenMetadataAPIMapper.PROJECT_TEAM_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.PROJECT_TEAM_RELATIONSHIP_TYPE_NAME, + properties, + effectiveFrom, + effectiveTo, + effectiveTime, + methodName); + } + + + /** + * Remove a project team (ActorProfile) from a project. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of the software capability that owns this project + * @param externalSourceName unique name of the software capability that owns this project + * @param projectGUID unique identifier of the project + * @param projectGUIDParameterName parameter supplying the projectGUID + * @param actorProfileGUID unique identifier of the element that is being added to the project + * @param actorProfileGUIDParameterName parameter supplying the actorProfileGUID + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void removeActorFromProject(String userId, + String externalSourceGUID, + String externalSourceName, + String projectGUID, + String projectGUIDParameterName, + String actorProfileGUID, + String actorProfileGUIDParameterName, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + this.unlinkElementFromElement(userId, + false, + externalSourceGUID, + externalSourceName, + projectGUID, + projectGUIDParameterName, + OpenMetadataAPIMapper.PROJECT_TYPE_NAME, + actorProfileGUID, + actorProfileGUIDParameterName, + OpenMetadataAPIMapper.ACTOR_PROFILE_TYPE_GUID, + OpenMetadataAPIMapper.ACTOR_PROFILE_TYPE_NAME, + forLineage, + forDuplicateProcessing, + OpenMetadataAPIMapper.PROJECT_TEAM_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.PROJECT_TEAM_RELATIONSHIP_TYPE_NAME, + effectiveTime, + methodName); + } + + + + /** + * Add a subproject. This creates a hierarchical relationship between the projects. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of the software capability that owns this project + * @param externalSourceName unique name of the software capability that owns this project + * @param projectGUID unique identifier of the project + * @param projectGUIDParameterName parameter supplying the projectGUID + * @param subprojectGUID unique identifier of the subproject that is being added to the project + * @param subprojectGUIDParameterName parameter supplying the subprojectGUID + * @param effectiveFrom the time that the relationship element must be effective from (null for any time, new Date() for now) + * @param effectiveTo the time that the relationship must be effective to (null for any time, new Date() for now) + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void addSubProject(String userId, + String externalSourceGUID, + String externalSourceName, + String projectGUID, + String projectGUIDParameterName, + String subprojectGUID, + String subprojectGUIDParameterName, + Date effectiveFrom, + Date effectiveTo, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + this.linkElementToElement(userId, + externalSourceGUID, + externalSourceName, + projectGUID, + projectGUIDParameterName, + OpenMetadataAPIMapper.PROJECT_TYPE_NAME, + subprojectGUID, + subprojectGUIDParameterName, + OpenMetadataAPIMapper.PROJECT_TYPE_NAME, + forLineage, + forDuplicateProcessing, + supportedZones, + OpenMetadataAPIMapper.PROJECT_HIERARCHY_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.PROJECT_HIERARCHY_RELATIONSHIP_TYPE_NAME, + null, + effectiveFrom, + effectiveTo, + effectiveTime, + methodName); + } + + + /** + * Remove a subproject. This deletes a hierarchical relationship between the projects. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of the software capability that owns this project + * @param externalSourceName unique name of the software capability that owns this project + * @param projectGUID unique identifier of the project + * @param projectGUIDParameterName parameter supplying the projectGUID + * @param subprojectProfileGUID unique identifier of the subproject that is being added to the project + * @param subprojectGUIDParameterName parameter supplying the subprojectProfileGUID + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void removeSubProject(String userId, + String externalSourceGUID, + String externalSourceName, + String projectGUID, + String projectGUIDParameterName, + String subprojectProfileGUID, + String subprojectGUIDParameterName, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + this.unlinkElementFromElement(userId, + false, + externalSourceGUID, + externalSourceName, + projectGUID, + projectGUIDParameterName, + OpenMetadataAPIMapper.PROJECT_TYPE_NAME, + subprojectProfileGUID, + subprojectGUIDParameterName, + OpenMetadataAPIMapper.PROJECT_TYPE_GUID, + OpenMetadataAPIMapper.PROJECT_TYPE_NAME, + forLineage, + forDuplicateProcessing, + OpenMetadataAPIMapper.PROJECT_HIERARCHY_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.PROJECT_HIERARCHY_RELATIONSHIP_TYPE_NAME, + effectiveTime, + methodName); + } + + + /** + * Add a project dependency. This adds a ProjectDependency relationship between the projects. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of the software capability that owns this project + * @param externalSourceName unique name of the software capability that owns this project + * @param projectGUID unique identifier of the project + * @param projectGUIDParameterName parameter supplying the projectGUID + * @param dependsOnProjectGUID unique identifier of the project that is being added to the project as a dependency + * @param dependsOnProjectGUIDParameterName parameter supplying the dependsOnProjectGUID + * @param dependencySummary why is the team attached to the project? (optional) + * @param effectiveFrom the time that the relationship element must be effective from (null for any time, new Date() for now) + * @param effectiveTo the time that the relationship must be effective to (null for any time, new Date() for now) + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void addProjectDependency(String userId, + String externalSourceGUID, + String externalSourceName, + String projectGUID, + String projectGUIDParameterName, + String dependsOnProjectGUID, + String dependsOnProjectGUIDParameterName, + String dependencySummary, + Date effectiveFrom, + Date effectiveTo, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + InstanceProperties properties = repositoryHelper.addStringPropertyToInstance(serviceName, + null, + OpenMetadataAPIMapper.DEPENDENCY_SUMMARY_PROPERTY_NAME, + dependencySummary, + methodName); + + this.linkElementToElement(userId, + externalSourceGUID, + externalSourceName, + projectGUID, + projectGUIDParameterName, + OpenMetadataAPIMapper.PROJECT_TYPE_NAME, + dependsOnProjectGUID, + dependsOnProjectGUIDParameterName, + OpenMetadataAPIMapper.PROJECT_TYPE_NAME, + forLineage, + forDuplicateProcessing, + supportedZones, + OpenMetadataAPIMapper.PROJECT_DEPENDENCY_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.PROJECT_DEPENDENCY_RELATIONSHIP_TYPE_NAME, + properties, + effectiveFrom, + effectiveTo, + effectiveTime, + methodName); + } + + + /** + * Remove a project dependency. This removes a ProjectDependency relationship between the projects. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of the software capability that owns this project + * @param externalSourceName unique name of the software capability that owns this project + * @param projectGUID unique identifier of the project + * @param projectGUIDParameterName parameter supplying the projectGUID + * @param dependsOnProjectGUID unique identifier of the project that is being added to the project as a dependency + * @param dependsOnProjectGUIDParameterName parameter supplying the dependsOnProjectGUID + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void removeProjectDependency(String userId, + String externalSourceGUID, + String externalSourceName, + String projectGUID, + String projectGUIDParameterName, + String dependsOnProjectGUID, + String dependsOnProjectGUIDParameterName, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + this.unlinkElementFromElement(userId, + false, + externalSourceGUID, + externalSourceName, + projectGUID, + projectGUIDParameterName, + OpenMetadataAPIMapper.PROJECT_TYPE_NAME, + dependsOnProjectGUID, + dependsOnProjectGUIDParameterName, + OpenMetadataAPIMapper.PROJECT_TYPE_GUID, + OpenMetadataAPIMapper.PROJECT_TYPE_NAME, + forLineage, + forDuplicateProcessing, + OpenMetadataAPIMapper.PROJECT_DEPENDENCY_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.PROJECT_DEPENDENCY_RELATIONSHIP_TYPE_NAME, + effectiveTime, + methodName); + } + + + /** + * Add a project manager (PersonRole) to a project. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of the software capability that owns this project + * @param externalSourceName unique name of the software capability that owns this project + * @param projectGUID unique identifier of the project + * @param projectGUIDParameterName parameter supplying the projectGUID + * @param personRoleGUID unique identifier of the element that is being added to the project + * @param personRoleGUIDParameterName parameter supplying the personRoleGUID + * @param effectiveFrom the time that the relationship element must be effective from (null for any time, new Date() for now) + * @param effectiveTo the time that the relationship must be effective to (null for any time, new Date() for now) + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void addProjectManager(String userId, + String externalSourceGUID, + String externalSourceName, + String projectGUID, + String projectGUIDParameterName, + String personRoleGUID, + String personRoleGUIDParameterName, + Date effectiveFrom, + Date effectiveTo, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + this.linkElementToElement(userId, + externalSourceGUID, + externalSourceName, + projectGUID, + projectGUIDParameterName, + OpenMetadataAPIMapper.PROJECT_TYPE_NAME, + personRoleGUID, + personRoleGUIDParameterName, + OpenMetadataAPIMapper.PERSON_ROLE_TYPE_NAME, + forLineage, + forDuplicateProcessing, + supportedZones, + OpenMetadataAPIMapper.PROJECT_MANAGEMENT_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.PROJECT_MANAGEMENT_RELATIONSHIP_TYPE_NAME, + null, + effectiveFrom, + effectiveTo, + effectiveTime, + methodName); + } + + + /** + * Remove a project manager (PersonRole) from a project. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of the software capability that owns this project + * @param externalSourceName unique name of the software capability that owns this project + * @param projectGUID unique identifier of the project + * @param projectGUIDParameterName parameter supplying the projectGUID + * @param personRoleGUID unique identifier of the element that is being added to the project + * @param personRoleGUIDParameterName parameter supplying the personRoleGUID + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void removeProjectManager(String userId, + String externalSourceGUID, + String externalSourceName, + String projectGUID, + String projectGUIDParameterName, + String personRoleGUID, + String personRoleGUIDParameterName, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + this.unlinkElementFromElement(userId, + false, + externalSourceGUID, + externalSourceName, + projectGUID, + projectGUIDParameterName, + OpenMetadataAPIMapper.PROJECT_TYPE_NAME, + personRoleGUID, + personRoleGUIDParameterName, + OpenMetadataAPIMapper.PERSON_ROLE_TYPE_GUID, + OpenMetadataAPIMapper.PERSON_ROLE_TYPE_NAME, + forLineage, + forDuplicateProcessing, + OpenMetadataAPIMapper.PROJECT_MANAGEMENT_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.PROJECT_MANAGEMENT_RELATIONSHIP_TYPE_NAME, + effectiveTime, + methodName); + } + + + /** + * Remove the metadata element representing a project. This will delete the project and all categories and terms because + * the Anchors classifications are set up in these elements. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of the software capability that owns this project + * @param externalSourceName unique name of the software capability that owns this project + * @param projectGUID unique identifier of the metadata element to remove + * @param projectGUIDParameterName parameter supplying the projectGUID + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void removeProject(String userId, + String externalSourceGUID, + String externalSourceName, + String projectGUID, + String projectGUIDParameterName, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + this.deleteBeanInRepository(userId, + externalSourceGUID, + externalSourceName, + projectGUID, + projectGUIDParameterName, + OpenMetadataAPIMapper.PROJECT_TYPE_GUID, + OpenMetadataAPIMapper.PROJECT_TYPE_NAME, + null, + null, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + } + + + /** + * Retrieve the list of project metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param userId calling user + * @param searchString string to find in the properties + * @param searchStringParameterName name of parameter supplying the search string + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public List findProjects(String userId, + String searchString, + String searchStringParameterName, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return this.findBeans(userId, + searchString, + searchStringParameterName, + OpenMetadataAPIMapper.PROJECT_TYPE_GUID, + OpenMetadataAPIMapper.PROJECT_TYPE_NAME, + null, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + } + + + /** + * Retrieve the list of project metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param userId calling user + * @param name name to search for + * @param nameParameterName parameter supplying name + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + + * @param methodName calling method + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public List getProjectsByName(String userId, + String name, + String nameParameterName, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + List specificMatchPropertyNames = new ArrayList<>(); + specificMatchPropertyNames.add(OpenMetadataAPIMapper.QUALIFIED_NAME_PROPERTY_NAME); + specificMatchPropertyNames.add(OpenMetadataAPIMapper.IDENTIFIER_PROPERTY_NAME); + specificMatchPropertyNames.add(OpenMetadataAPIMapper.NAME_PROPERTY_NAME); + + return this.getBeansByValue(userId, + name, + nameParameterName, + OpenMetadataAPIMapper.PROJECT_TYPE_GUID, + OpenMetadataAPIMapper.PROJECT_TYPE_NAME, + specificMatchPropertyNames, + true, + null, + null, + forLineage, + forDuplicateProcessing, + supportedZones, + null, + startFrom, + pageSize, + effectiveTime, + methodName); + } + + + /** + * Retrieve the list of project metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + + * @param methodName calling method + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public List getProjects(String userId, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return this.getBeansByType(userId, + OpenMetadataAPIMapper.PROJECT_TYPE_GUID, + OpenMetadataAPIMapper.PROJECT_TYPE_NAME, + null, + forLineage, + forDuplicateProcessing, + supportedZones, + startFrom, + pageSize, + effectiveTime, + methodName); + } + + + /** + * Return the projects attached to a supplied actor profile via the project team relationship. + * + * @param userId calling user + * @param profileGUID identifier for the entity that the projects are attached to + * @param profileGUIDParameterName name of parameter supplying the GUID + * @param startingFrom where to start from in the list + * @param pageSize maximum number of results that can be returned + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * @return list of objects or null if none found + * @throws InvalidParameterException the input properties are invalid + * @throws UserNotAuthorizedException user not authorized to issue this request + * @throws PropertyServerException problem accessing the property server + */ + public List getActorProjects(String userId, + String profileGUID, + String profileGUIDParameterName, + int startingFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return this.getAttachedElements(userId, + null, + null, + profileGUID, + profileGUIDParameterName, + OpenMetadataAPIMapper.ACTOR_PROFILE_TYPE_NAME, + OpenMetadataAPIMapper.PROJECT_TEAM_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.PROJECT_TEAM_RELATIONSHIP_TYPE_NAME, + OpenMetadataAPIMapper.PROJECT_TYPE_NAME, + null, + null, + 1, + forLineage, + forDuplicateProcessing, + supportedZones, + startingFrom, + pageSize, + effectiveTime, + methodName); + } + + + /** + * Return the projects attached to a supplied person role via the project management relationship. + * + * @param userId calling user + * @param personRoleGUID identifier for the entity that the projects are attached to + * @param personRoleGUIDParameterName name of parameter supplying the GUID + * @param startingFrom where to start from in the list + * @param pageSize maximum number of results that can be returned + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * @return list of objects or null if none found + * @throws InvalidParameterException the input properties are invalid + * @throws UserNotAuthorizedException user not authorized to issue this request + * @throws PropertyServerException problem accessing the property server + */ + public List getRoleProjects(String userId, + String personRoleGUID, + String personRoleGUIDParameterName, + int startingFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return this.getAttachedElements(userId, + null, + null, + personRoleGUID, + personRoleGUIDParameterName, + OpenMetadataAPIMapper.PERSON_ROLE_TYPE_NAME, + OpenMetadataAPIMapper.PROJECT_MANAGEMENT_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.PROJECT_MANAGEMENT_RELATIONSHIP_TYPE_NAME, + OpenMetadataAPIMapper.PROJECT_TYPE_NAME, + null, + null, + 1, + forLineage, + forDuplicateProcessing, + supportedZones, + startingFrom, + pageSize, + effectiveTime, + methodName); + } + + + /** + * Return the projects that are dependent on this project. + * + * @param userId calling user + * @param projectGUID identifier for the entity that the contact details are attached to + * @param projectGUIDParameterName name of parameter supplying the GUID + * @param startingFrom where to start from in the list + * @param pageSize maximum number of results that can be returned + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * @return list of objects or null if none found + * @throws InvalidParameterException the input properties are invalid + * @throws UserNotAuthorizedException user not authorized to issue this request + * @throws PropertyServerException problem accessing the property server + */ + public List getDependentProjects(String userId, + String projectGUID, + String projectGUIDParameterName, + int startingFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return this.getAttachedElements(userId, + null, + null, + projectGUID, + projectGUIDParameterName, + OpenMetadataAPIMapper.PERSON_ROLE_TYPE_NAME, + OpenMetadataAPIMapper.PROJECT_MANAGEMENT_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.PROJECT_MANAGEMENT_RELATIONSHIP_TYPE_NAME, + OpenMetadataAPIMapper.PROJECT_TYPE_NAME, + null, + null, + 1, + forLineage, + forDuplicateProcessing, + supportedZones, + startingFrom, + pageSize, + effectiveTime, + methodName); + } + + + /** + * Return the projects that this project depends on. + * + * @param userId calling user + * @param projectGUID identifier for the entity that the contact details are attached to + * @param projectGUIDParameterName name of parameter supplying the GUID + * @param startingFrom where to start from in the list + * @param pageSize maximum number of results that can be returned + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * @return list of objects or null if none found + * @throws InvalidParameterException the input properties are invalid + * @throws UserNotAuthorizedException user not authorized to issue this request + * @throws PropertyServerException problem accessing the property server + */ + public List getDependsOnProjects(String userId, + String projectGUID, + String projectGUIDParameterName, + int startingFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return this.getAttachedElements(userId, + null, + null, + projectGUID, + projectGUIDParameterName, + OpenMetadataAPIMapper.PERSON_ROLE_TYPE_NAME, + OpenMetadataAPIMapper.PROJECT_MANAGEMENT_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.PROJECT_MANAGEMENT_RELATIONSHIP_TYPE_NAME, + OpenMetadataAPIMapper.PROJECT_TYPE_NAME, + null, + null, + 2, + forLineage, + forDuplicateProcessing, + supportedZones, + startingFrom, + pageSize, + effectiveTime, + methodName); + } + + + /** + * Return the projects that manage this project via the ProjectHierarchy relationship. + * + * @param userId calling user + * @param projectGUID identifier for the entity that the contact details are attached to + * @param projectGUIDParameterName name of parameter supplying the GUID + * @param startingFrom where to start from in the list + * @param pageSize maximum number of results that can be returned + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * @return list of objects or null if none found + * @throws InvalidParameterException the input properties are invalid + * @throws UserNotAuthorizedException user not authorized to issue this request + * @throws PropertyServerException problem accessing the property server + */ + public List getSuperProjects(String userId, + String projectGUID, + String projectGUIDParameterName, + int startingFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return this.getAttachedElements(userId, + null, + null, + projectGUID, + projectGUIDParameterName, + OpenMetadataAPIMapper.PROJECT_TYPE_NAME, + OpenMetadataAPIMapper.PROJECT_HIERARCHY_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.PROJECT_HIERARCHY_RELATIONSHIP_TYPE_NAME, + OpenMetadataAPIMapper.PROJECT_TYPE_NAME, + null, + null, + 1, + forLineage, + forDuplicateProcessing, + supportedZones, + startingFrom, + pageSize, + effectiveTime, + methodName); + } + + + /** + * Return the projects that this project is managing via the ProjectHierarchy relationship. + * + * @param userId calling user + * @param projectGUID identifier for the entity that the contact details are attached to + * @param projectGUIDParameterName name of parameter supplying the GUID + * @param startingFrom where to start from in the list + * @param pageSize maximum number of results that can be returned + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * @return list of objects or null if none found + * @throws InvalidParameterException the input properties are invalid + * @throws UserNotAuthorizedException user not authorized to issue this request + * @throws PropertyServerException problem accessing the property server + */ + public List getSubProjects(String userId, + String projectGUID, + String projectGUIDParameterName, + int startingFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return this.getAttachedElements(userId, + null, + null, + projectGUID, + projectGUIDParameterName, + OpenMetadataAPIMapper.PROJECT_TYPE_NAME, + OpenMetadataAPIMapper.PROJECT_HIERARCHY_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.PROJECT_HIERARCHY_RELATIONSHIP_TYPE_NAME, + OpenMetadataAPIMapper.PROJECT_TYPE_NAME, + null, + null, + 2, + forLineage, + forDuplicateProcessing, + supportedZones, + startingFrom, + pageSize, + effectiveTime, + methodName); + } + + + /** + * Retrieve the project metadata element with the supplied unique identifier. + * + * @param userId calling user + * @param guid unique identifier of the requested metadata element + * @param guidParameterName parameter name of guid + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @return matching metadata element + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public B getProjectByGUID(String userId, + String guid, + String guidParameterName, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return this.getBeanFromRepository(userId, + guid, + guidParameterName, + OpenMetadataAPIMapper.PROJECT_TYPE_NAME, + forLineage, + forDuplicateProcessing, + supportedZones, + effectiveTime, + methodName); + } +} diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ReferenceableHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ReferenceableHandler.java index 4ef932d2c7f..9e86f50f5e7 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ReferenceableHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ReferenceableHandler.java @@ -1204,6 +1204,118 @@ public void removeTemplateClassification(String userId, } + /** + * Add a more information to element. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of the software capability that owns this project + * @param externalSourceName unique name of the software capability that owns this project + * @param elementGUID unique identifier of the element + * @param elementGUIDParameterName parameter supplying the elementGUID + * @param moreInformationGUID unique identifier of the element that is supplying more information + * @param moreInformationGUIDParameterName parameter supplying the moreInformationGUID + * @param effectiveFrom the time that the relationship element must be effective from (null for any time, new Date() for now) + * @param effectiveTo the time that the relationship must be effective to (null for any time, new Date() for now) + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void addMoreInformation(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String elementGUIDParameterName, + String moreInformationGUID, + String moreInformationGUIDParameterName, + Date effectiveFrom, + Date effectiveTo, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + this.linkElementToElement(userId, + externalSourceGUID, + externalSourceName, + elementGUID, + elementGUIDParameterName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + moreInformationGUID, + moreInformationGUIDParameterName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + forLineage, + forDuplicateProcessing, + supportedZones, + OpenMetadataAPIMapper.IMPLEMENTED_BY_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.IMPLEMENTED_BY_RELATIONSHIP_TYPE_NAME, + null, + effectiveFrom, + effectiveTo, + effectiveTime, + methodName); + } + + + /** + * Remove more information from an element. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of the software capability that owns this project + * @param externalSourceName unique name of the software capability that owns this project + * @param elementGUID unique identifier of the project + * @param elementGUIDParameterName parameter supplying the elementGUID + * @param moreInformationGUID unique identifier of the element that is being added to the project + * @param moreInformationGUIDParameterName parameter supplying the moreInformationGUID + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void removeMoreInformation(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String elementGUIDParameterName, + String moreInformationGUID, + String moreInformationGUIDParameterName, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + this.unlinkElementFromElement(userId, + false, + externalSourceGUID, + externalSourceName, + elementGUID, + elementGUIDParameterName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + moreInformationGUID, + moreInformationGUIDParameterName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_GUID, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + forLineage, + forDuplicateProcessing, + OpenMetadataAPIMapper.REFERENCEABLE_TO_MORE_INFO_TYPE_GUID, + OpenMetadataAPIMapper.REFERENCEABLE_TO_MORE_INFO_TYPE_NAME, + effectiveTime, + methodName); + } + + /** * Returns the list of elements that are linked to provide more information. It uses the supportedZones supplied with the service. * @@ -1312,7 +1424,7 @@ public List getMoreInformation(String userId, resultingTypeName, null, null, - 0, + 2, forLineage, forDuplicateProcessing, serviceSupportedZones, @@ -1323,6 +1435,74 @@ public List getMoreInformation(String userId, } + /** + * Retrieve the descriptive elements linked via a "MoreInformation" relationship between two referenceables. + * + * @param userId String userId of user making request. + * @param startingGUID String unique id for element. + * @param startingGUIDParameterName name of parameter supplying the GUID + * @param suppliedStartingTypeName name of the type of object that the search begins with - null means referenceable + * @param suppliedResultingTypeName name of the type of object that the search returns - null mean referenceable + * @param startFrom int starting position for fist returned element. + * @param pageSize int maximum number of elements to return on the call. + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for + * @param methodName String calling method + * + * @return a list of assets or + * @throws InvalidParameterException - the GUID is not recognized or the paging values are invalid or + * @throws PropertyServerException - there is a problem retrieving the asset properties from the property server or + * @throws UserNotAuthorizedException - the requesting user is not authorized to issue this request. + */ + public List getDescriptiveElements(String userId, + String startingGUID, + String startingGUIDParameterName, + String suppliedStartingTypeName, + String suppliedResultingTypeName, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + String startingTypeName = OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME; + String resultingTypeName = OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME; + + if (suppliedStartingTypeName != null) + { + startingTypeName = suppliedStartingTypeName; + } + if (suppliedResultingTypeName != null) + { + resultingTypeName = suppliedResultingTypeName; + } + + return this.getAttachedElements(userId, + null, + null, + startingGUID, + startingGUIDParameterName, + startingTypeName, + OpenMetadataAPIMapper.REFERENCEABLE_TO_MORE_INFO_TYPE_GUID, + OpenMetadataAPIMapper.REFERENCEABLE_TO_MORE_INFO_TYPE_NAME, + resultingTypeName, + null, + null, + 1, + forLineage, + forDuplicateProcessing, + supportedZones, + startFrom, + pageSize, + effectiveTime, + methodName); + } + + /** * Create relationships between the identified glossary terms and an Asset. * @@ -1444,7 +1624,6 @@ public void saveSemanticAssignment(String userId, } - /** * Create a simple relationship between a glossary term and a referenceable. * @@ -1622,6 +1801,130 @@ public void removeSemanticAssignment(String userId, } + /** + * Returns the list of glossary terms that are linked to provide a semantic definition of a data item. + * + * @param userId String userId of user making request. + * @param startingGUID String unique id for element. + * @param startingGUIDParameterName name of parameter supplying the GUID + * @param suppliedStartingTypeName name of the type of object that the search begins with - null means referenceable + * @param startFrom int starting position for fist returned element. + * @param pageSize int maximum number of elements to return on the call. + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for + * @param methodName String calling method + * + * @return a list of assets or + * @throws InvalidParameterException - the GUID is not recognized or the paging values are invalid or + * @throws PropertyServerException - there is a problem retrieving the asset properties from the property server or + * @throws UserNotAuthorizedException - the requesting user is not authorized to issue this request. + */ + public List getMeanings(String userId, + String startingGUID, + String startingGUIDParameterName, + String suppliedStartingTypeName, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + String startingTypeName = OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME; + String resultingTypeName = OpenMetadataAPIMapper.GLOSSARY_TERM_TYPE_NAME; + + if (suppliedStartingTypeName != null) + { + startingTypeName = suppliedStartingTypeName; + } + + return this.getAttachedElements(userId, + null, + null, + startingGUID, + startingGUIDParameterName, + startingTypeName, + OpenMetadataAPIMapper.REFERENCEABLE_TO_MEANING_TYPE_GUID, + OpenMetadataAPIMapper.REFERENCEABLE_TO_MEANING_TYPE_NAME, + resultingTypeName, + null, + null, + 2, + forLineage, + forDuplicateProcessing, + supportedZones, + startFrom, + pageSize, + effectiveTime, + methodName); + } + + + /** + * Returns the list of elements that are linked to a glossary term that is providing a semantic definition. + * + * @param userId String userId of user making request. + * @param startingGUID String unique id for element. + * @param startingGUIDParameterName name of parameter supplying the GUID + * @param suppliedResultingTypeName name of the type of object that the search returns - null mean referenceable + * @param startFrom int starting position for fist returned element. + * @param pageSize int maximum number of elements to return on the call. + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for + * @param methodName String calling method + * + * @return a list of assets or + * @throws InvalidParameterException - the GUID is not recognized or the paging values are invalid or + * @throws PropertyServerException - there is a problem retrieving the asset properties from the property server or + * @throws UserNotAuthorizedException - the requesting user is not authorized to issue this request. + */ + public List getSemanticAssignments(String userId, + String startingGUID, + String startingGUIDParameterName, + String suppliedResultingTypeName, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + String startingTypeName = OpenMetadataAPIMapper.GLOSSARY_TERM_TYPE_NAME; + String resultingTypeName = OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME; + + if (suppliedResultingTypeName != null) + { + resultingTypeName = suppliedResultingTypeName; + } + + return this.getAttachedElements(userId, + null, + null, + startingGUID, + startingGUIDParameterName, + startingTypeName, + OpenMetadataAPIMapper.REFERENCEABLE_TO_MEANING_TYPE_GUID, + OpenMetadataAPIMapper.REFERENCEABLE_TO_MEANING_TYPE_NAME, + resultingTypeName, + null, + null, + 1, + forLineage, + forDuplicateProcessing, + supportedZones, + startFrom, + pageSize, + effectiveTime, + methodName); + } + + /** * Create a relationship between a referenceable and a resource it uses. * @@ -1755,6 +2058,792 @@ public void removeResourceListMember(String userId, + /** + * Returns the list of elements that are linked to provide resources to the starting element (for example, a community provides + * people to a governance domain). + * + * @param userId String userId of user making request. + * @param startingGUID String unique id for element. + * @param startingGUIDParameterName name of parameter supplying the GUID + * @param suppliedStartingTypeName name of the type of object that the search begins with - null means referenceable + * @param startFrom int starting position for fist returned element. + * @param pageSize int maximum number of elements to return on the call. + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for + * @param methodName String calling method + * + * @return a list of assets or + * @throws InvalidParameterException - the GUID is not recognized or the paging values are invalid or + * @throws PropertyServerException - there is a problem retrieving the asset properties from the property server or + * @throws UserNotAuthorizedException - the requesting user is not authorized to issue this request. + */ + public List getResourceList(String userId, + String startingGUID, + String startingGUIDParameterName, + String suppliedStartingTypeName, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + String startingTypeName = OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME; + String resultingTypeName = OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME; + + if (suppliedStartingTypeName != null) + { + startingTypeName = suppliedStartingTypeName; + } + + return this.getAttachedElements(userId, + null, + null, + startingGUID, + startingGUIDParameterName, + startingTypeName, + OpenMetadataAPIMapper.RESOURCE_LIST_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.RESOURCE_LIST_RELATIONSHIP_TYPE_NAME, + resultingTypeName, + null, + null, + 2, + forLineage, + forDuplicateProcessing, + supportedZones, + startFrom, + pageSize, + effectiveTime, + methodName); + } + + + + /** + * Retrieve the list of elements assigned to a resource via the "ResourceList" relationship between two referenceables. + * + * @param userId String userId of user making request. + * @param startingGUID String unique id for element. + * @param startingGUIDParameterName name of parameter supplying the GUID + * @param suppliedStartingTypeName name of the type of object that the search begins with - null means referenceable + * @param startFrom int starting position for fist returned element. + * @param pageSize int maximum number of elements to return on the call. + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for + * @param methodName String calling method + * + * @return a list of assets or + * @throws InvalidParameterException - the GUID is not recognized or the paging values are invalid or + * @throws PropertyServerException - there is a problem retrieving the asset properties from the property server or + * @throws UserNotAuthorizedException - the requesting user is not authorized to issue this request. + */ + public List getSupportedByResource(String userId, + String startingGUID, + String startingGUIDParameterName, + String suppliedStartingTypeName, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + String startingTypeName = OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME; + String resultingTypeName = OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME; + + if (suppliedStartingTypeName != null) + { + startingTypeName = suppliedStartingTypeName; + } + + return this.getAttachedElements(userId, + null, + null, + startingGUID, + startingGUIDParameterName, + startingTypeName, + OpenMetadataAPIMapper.RESOURCE_LIST_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.RESOURCE_LIST_RELATIONSHIP_TYPE_NAME, + resultingTypeName, + null, + null, + 1, + forLineage, + forDuplicateProcessing, + supportedZones, + startFrom, + pageSize, + effectiveTime, + methodName); + } + + + /** + * Add a scope to an actor - both referenceables. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of the software capability that owns this project + * @param externalSourceName unique name of the software capability that owns this project + * @param assignedActorGUID unique identifier of the actor + * @param assignedActorGUIDParameterName parameter supplying the assignedActorGUID + * @param assignedScopeGUID unique identifier of the scope + * @param assignedScopeGUIDParameterName parameter supplying the assignedScopeGUID + * @param assignmentType Type of assignment - such as accountable, responsible, observing ... + * @param description mode details about the assignment + * @param effectiveFrom the time that the relationship element must be effective from (null for any time, new Date() for now) + * @param effectiveTo the time that the relationship must be effective to (null for any time, new Date() for now) + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void addAssignmentScope(String userId, + String externalSourceGUID, + String externalSourceName, + String assignedActorGUID, + String assignedActorGUIDParameterName, + String assignedScopeGUID, + String assignedScopeGUIDParameterName, + String assignmentType, + String description, + Date effectiveFrom, + Date effectiveTo, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + InstanceProperties properties = repositoryHelper.addStringPropertyToInstance(serviceName, + null, + OpenMetadataAPIMapper.ASSIGNMENT_TYPE_PROPERTY_NAME, + assignmentType, + methodName); + + properties = repositoryHelper.addStringPropertyToInstance(serviceName, + properties, + OpenMetadataAPIMapper.DESCRIPTION_PROPERTY_NAME, + description, + methodName); + + this.linkElementToElement(userId, + externalSourceGUID, + externalSourceName, + assignedActorGUID, + assignedActorGUIDParameterName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + assignedScopeGUID, + assignedScopeGUIDParameterName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + forLineage, + forDuplicateProcessing, + supportedZones, + OpenMetadataAPIMapper.ASSIGNMENT_SCOPE_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.ASSIGNMENT_SCOPE_RELATIONSHIP_TYPE_NAME, + properties, + effectiveFrom, + effectiveTo, + effectiveTime, + methodName); + } + + + /** + * Remove a scope from an actor - both referenceables. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of the software capability that owns this project + * @param externalSourceName unique name of the software capability that owns this project + * @param assignedActorGUID unique identifier of the actor + * @param assignedActorGUIDParameterName parameter supplying the assignedActorGUID + * @param assignedScopeGUID unique identifier of the scope + * @param assignedScopeGUIDParameterName parameter supplying the assignedScopeGUID + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void removeAssignmentScope(String userId, + String externalSourceGUID, + String externalSourceName, + String assignedActorGUID, + String assignedActorGUIDParameterName, + String assignedScopeGUID, + String assignedScopeGUIDParameterName, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + this.unlinkElementFromElement(userId, + false, + externalSourceGUID, + externalSourceName, + assignedActorGUID, + assignedActorGUIDParameterName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + assignedScopeGUID, + assignedScopeGUIDParameterName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_GUID, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + forLineage, + forDuplicateProcessing, + OpenMetadataAPIMapper.ASSIGNMENT_SCOPE_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.ASSIGNMENT_SCOPE_RELATIONSHIP_TYPE_NAME, + effectiveTime, + methodName); + } + + + /** + * Returns the list of elements that are scoping the work of one or more actors/roles. + * + * @param userId String userId of user making request. + * @param startingGUID String unique id for element. + * @param startingGUIDParameterName name of parameter supplying the GUID + * @param suppliedStartingTypeName name of the type of object that the search begins with - null means referenceable + * @param suppliedResultingTypeName name of the type of object that the search returns - null mean referenceable + * @param startFrom int starting position for fist returned element. + * @param pageSize int maximum number of elements to return on the call. + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for + * @param methodName String calling method + * + * @return a list of assets or + * @throws InvalidParameterException - the GUID is not recognized or the paging values are invalid or + * @throws PropertyServerException - there is a problem retrieving the asset properties from the property server or + * @throws UserNotAuthorizedException - the requesting user is not authorized to issue this request. + */ + public List getAssignmentScope(String userId, + String startingGUID, + String startingGUIDParameterName, + String suppliedStartingTypeName, + String suppliedResultingTypeName, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + String startingTypeName = OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME; + String resultingTypeName = OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME; + + if (suppliedStartingTypeName != null) + { + startingTypeName = suppliedStartingTypeName; + } + if (suppliedResultingTypeName != null) + { + resultingTypeName = suppliedResultingTypeName; + } + + return this.getAttachedElements(userId, + null, + null, + startingGUID, + startingGUIDParameterName, + startingTypeName, + OpenMetadataAPIMapper.ASSIGNMENT_SCOPE_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.ASSIGNMENT_SCOPE_RELATIONSHIP_TYPE_NAME, + resultingTypeName, + null, + null, + 2, + forLineage, + forDuplicateProcessing, + supportedZones, + startFrom, + pageSize, + effectiveTime, + methodName); + } + + + /** + * Returns the list of actors/roles that assigned to a specific scope. + * + * @param userId String userId of user making request. + * @param startingGUID String unique id for element. + * @param startingGUIDParameterName name of parameter supplying the GUID + * @param suppliedStartingTypeName name of the type of object that the search begins with - null means referenceable + * @param suppliedResultingTypeName name of the type of object that the search returns - null mean referenceable + * @param startFrom int starting position for fist returned element. + * @param pageSize int maximum number of elements to return on the call. + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for + * @param methodName String calling method + * + * @return a list of assets or + * @throws InvalidParameterException - the GUID is not recognized or the paging values are invalid or + * @throws PropertyServerException - there is a problem retrieving the asset properties from the property server or + * @throws UserNotAuthorizedException - the requesting user is not authorized to issue this request. + */ + public List getAssignedActors(String userId, + String startingGUID, + String startingGUIDParameterName, + String suppliedStartingTypeName, + String suppliedResultingTypeName, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + String startingTypeName = OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME; + String resultingTypeName = OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME; + + if (suppliedStartingTypeName != null) + { + startingTypeName = suppliedStartingTypeName; + } + if (suppliedResultingTypeName != null) + { + resultingTypeName = suppliedResultingTypeName; + } + + return this.getAttachedElements(userId, + null, + null, + startingGUID, + startingGUIDParameterName, + startingTypeName, + OpenMetadataAPIMapper.ASSIGNMENT_SCOPE_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.ASSIGNMENT_SCOPE_RELATIONSHIP_TYPE_NAME, + resultingTypeName, + null, + null, + 1, + forLineage, + forDuplicateProcessing, + supportedZones, + startFrom, + pageSize, + effectiveTime, + methodName); + } + + + /** + * Add a commissioning stakeholder to a project/team/community etc. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of the software capability that owns this project + * @param externalSourceName unique name of the software capability that owns this project + * @param commissionedGUID unique identifier of the project etc + * @param commissionedGUIDParameterName parameter supplying the commissionedGUID + * @param stakeholderGUID unique identifier of the stakeholder - may be a person, team, role, ... + * @param stakeholderGUIDParameterName parameter supplying the stakeholderGUID + * @param stakeholderRole what are the responsibilities of a stakeholder? + * @param effectiveFrom the time that the relationship element must be effective from (null for any time, new Date() for now) + * @param effectiveTo the time that the relationship must be effective to (null for any time, new Date() for now) + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void addStakeholder(String userId, + String externalSourceGUID, + String externalSourceName, + String commissionedGUID, + String commissionedGUIDParameterName, + String stakeholderGUID, + String stakeholderGUIDParameterName, + String stakeholderRole, + Date effectiveFrom, + Date effectiveTo, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + InstanceProperties properties = repositoryHelper.addStringPropertyToInstance(serviceName, + null, + OpenMetadataAPIMapper.STAKEHOLDER_ROLE_PROPERTY_NAME, + stakeholderRole, + methodName); + + this.linkElementToElement(userId, + externalSourceGUID, + externalSourceName, + commissionedGUID, + commissionedGUIDParameterName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + stakeholderGUID, + stakeholderGUIDParameterName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + forLineage, + forDuplicateProcessing, + supportedZones, + OpenMetadataAPIMapper.STAKEHOLDER_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.STAKEHOLDER_RELATIONSHIP_TYPE_NAME, + properties, + effectiveFrom, + effectiveTo, + effectiveTime, + methodName); + } + + + /** + * Remove a commissioning stakeholder from a project/team/community etc. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of the software capability that owns this project + * @param externalSourceName unique name of the software capability that owns this project + * @param commissionedGUID unique identifier of the project etc + * @param commissionedGUIDParameterName parameter supplying the commissionedGUID + * @param stakeholderGUID unique identifier of the stakeholder + * @param stakeholderGUIDParameterName parameter supplying the stakeholderGUID + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void removeStakeholder(String userId, + String externalSourceGUID, + String externalSourceName, + String commissionedGUID, + String commissionedGUIDParameterName, + String stakeholderGUID, + String stakeholderGUIDParameterName, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + this.unlinkElementFromElement(userId, + false, + externalSourceGUID, + externalSourceName, + commissionedGUID, + commissionedGUIDParameterName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + stakeholderGUID, + stakeholderGUIDParameterName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_GUID, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + forLineage, + forDuplicateProcessing, + OpenMetadataAPIMapper.STAKEHOLDER_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.STAKEHOLDER_RELATIONSHIP_TYPE_NAME, + effectiveTime, + methodName); + } + + + + + /** + * Returns the list one or more actors/roles are stakeholders for the starting element. + * + * @param userId String userId of user making request. + * @param startingGUID String unique id for element. + * @param startingGUIDParameterName name of parameter supplying the GUID + * @param suppliedStartingTypeName name of the type of object that the search begins with - null means referenceable + * @param suppliedResultingTypeName name of the type of object that the search returns - null mean referenceable + * @param startFrom int starting position for fist returned element. + * @param pageSize int maximum number of elements to return on the call. + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for + * @param methodName String calling method + * + * @return a list of assets or + * @throws InvalidParameterException - the GUID is not recognized or the paging values are invalid or + * @throws PropertyServerException - there is a problem retrieving the asset properties from the property server or + * @throws UserNotAuthorizedException - the requesting user is not authorized to issue this request. + */ + public List getStakeholders(String userId, + String startingGUID, + String startingGUIDParameterName, + String suppliedStartingTypeName, + String suppliedResultingTypeName, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + String startingTypeName = OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME; + String resultingTypeName = OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME; + + if (suppliedStartingTypeName != null) + { + startingTypeName = suppliedStartingTypeName; + } + if (suppliedResultingTypeName != null) + { + resultingTypeName = suppliedResultingTypeName; + } + + return this.getAttachedElements(userId, + null, + null, + startingGUID, + startingGUIDParameterName, + startingTypeName, + OpenMetadataAPIMapper.STAKEHOLDER_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.STAKEHOLDER_RELATIONSHIP_TYPE_NAME, + resultingTypeName, + null, + null, + 2, + forLineage, + forDuplicateProcessing, + supportedZones, + startFrom, + pageSize, + effectiveTime, + methodName); + } + + + /** + * Returns the list of elements that one or more actors/roles are stakeholders for. + * + * @param userId String userId of user making request. + * @param startingGUID String unique id for element. + * @param startingGUIDParameterName name of parameter supplying the GUID + * @param suppliedStartingTypeName name of the type of object that the search begins with - null means referenceable + * @param suppliedResultingTypeName name of the type of object that the search returns - null mean referenceable + * @param startFrom int starting position for fist returned element. + * @param pageSize int maximum number of elements to return on the call. + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for + * @param methodName String calling method + * + * @return a list of assets or + * @throws InvalidParameterException - the GUID is not recognized or the paging values are invalid or + * @throws PropertyServerException - there is a problem retrieving the asset properties from the property server or + * @throws UserNotAuthorizedException - the requesting user is not authorized to issue this request. + */ + public List getCommissionedByStakeholder(String userId, + String startingGUID, + String startingGUIDParameterName, + String suppliedStartingTypeName, + String suppliedResultingTypeName, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + String startingTypeName = OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME; + String resultingTypeName = OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME; + + if (suppliedStartingTypeName != null) + { + startingTypeName = suppliedStartingTypeName; + } + if (suppliedResultingTypeName != null) + { + resultingTypeName = suppliedResultingTypeName; + } + + return this.getAttachedElements(userId, + null, + null, + startingGUID, + startingGUIDParameterName, + startingTypeName, + OpenMetadataAPIMapper.STAKEHOLDER_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.STAKEHOLDER_RELATIONSHIP_TYPE_NAME, + resultingTypeName, + null, + null, + 1, + forLineage, + forDuplicateProcessing, + supportedZones, + startFrom, + pageSize, + effectiveTime, + methodName); + } + + + + /** + * Add a link between a design artifact and its implementation. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of the software capability that owns this project + * @param externalSourceName unique name of the software capability that owns this project + * @param designArtifactGUID unique identifier of the project + * @param designArtifactGUIDParameterName parameter supplying the designArtifactGUID + * @param implementationGUID unique identifier of the element that is being added to the project + * @param implementationGUIDParameterName parameter supplying the implementationGUID + * @param designStep match to design process + * @param role describe role performing from design + * @param description additional description + * @param effectiveFrom the time that the relationship element must be effective from (null for any time, new Date() for now) + * @param effectiveTo the time that the relationship must be effective to (null for any time, new Date() for now) + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void addImplementedBy(String userId, + String externalSourceGUID, + String externalSourceName, + String designArtifactGUID, + String designArtifactGUIDParameterName, + String implementationGUID, + String implementationGUIDParameterName, + String designStep, + String role, + String description, + Date effectiveFrom, + Date effectiveTo, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + InstanceProperties properties = repositoryHelper.addStringPropertyToInstance(serviceName, + null, + OpenMetadataAPIMapper.DESIGN_STEP_PROPERTY_NAME, + designStep, + methodName); + + properties = repositoryHelper.addStringPropertyToInstance(serviceName, + properties, + OpenMetadataAPIMapper.ROLE_PROPERTY_NAME, + role, + methodName); + + properties = repositoryHelper.addStringPropertyToInstance(serviceName, + properties, + OpenMetadataAPIMapper.DESCRIPTION_PROPERTY_NAME, + description, + methodName); + + + + this.linkElementToElement(userId, + externalSourceGUID, + externalSourceName, + designArtifactGUID, + designArtifactGUIDParameterName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + implementationGUID, + implementationGUIDParameterName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + forLineage, + forDuplicateProcessing, + supportedZones, + OpenMetadataAPIMapper.IMPLEMENTED_BY_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.IMPLEMENTED_BY_RELATIONSHIP_TYPE_NAME, + properties, + effectiveFrom, + effectiveTo, + effectiveTime, + methodName); + } + + + /** + * Remove a link between a design artifact and its implementation. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of the software capability that owns this project + * @param externalSourceName unique name of the software capability that owns this project + * @param designArtifactGUID unique identifier of the project + * @param designArtifactGUIDParameterName parameter supplying the designArtifactGUID + * @param implementationGUID unique identifier of the element that is being added to the project + * @param implementationGUIDParameterName parameter supplying the implementationGUID + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void removeImplementedBy(String userId, + String externalSourceGUID, + String externalSourceName, + String designArtifactGUID, + String designArtifactGUIDParameterName, + String implementationGUID, + String implementationGUIDParameterName, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + this.unlinkElementFromElement(userId, + false, + externalSourceGUID, + externalSourceName, + designArtifactGUID, + designArtifactGUIDParameterName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + implementationGUID, + implementationGUIDParameterName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_GUID, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + forLineage, + forDuplicateProcessing, + OpenMetadataAPIMapper.IMPLEMENTED_BY_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.IMPLEMENTED_BY_RELATIONSHIP_TYPE_NAME, + effectiveTime, + methodName); + } + /** * Return the list of elements associated with a collection. diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/SearchKeywordHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/SearchKeywordHandler.java index 35b3d1a270b..dc818c9272b 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/SearchKeywordHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/SearchKeywordHandler.java @@ -344,7 +344,7 @@ public List getAttachedKeywords(String userId, OpenMetadataAPIMapper.SEARCH_KEYWORD_TYPE_NAME, null, null, - 0, + 2, forLineage, forDuplicateProcessing, serviceSupportedZones, diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/SubjectAreaBuilder.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/SubjectAreaBuilder.java index e87047d9d54..2da8162ebc8 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/SubjectAreaBuilder.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/SubjectAreaBuilder.java @@ -13,6 +13,7 @@ */ public class SubjectAreaBuilder extends ReferenceableBuilder { + private final String subjectAreaName; private final String displayName; private final String description; private final String usage; @@ -23,7 +24,8 @@ public class SubjectAreaBuilder extends ReferenceableBuilder /** * Create constructor * - * @param qualifiedName unique name for the subject area - used in other configuration + * @param qualifiedName unique name for the subject area entity + * @param subjectAreaName unique name for the subject area - used in other configuration * @param displayName short display name for the subject area * @param description description of the subject area * @param usage the usage for inclusion in a subject area @@ -38,6 +40,7 @@ public class SubjectAreaBuilder extends ReferenceableBuilder * @param serverName name of local server */ SubjectAreaBuilder(String qualifiedName, + String subjectAreaName, String displayName, String description, String usage, @@ -60,6 +63,7 @@ public class SubjectAreaBuilder extends ReferenceableBuilder serviceName, serverName); + this.subjectAreaName = subjectAreaName; this.displayName = displayName; this.description = description; this.usage = usage; @@ -80,6 +84,12 @@ public InstanceProperties getInstanceProperties(String methodName) throws Inval { InstanceProperties properties = super.getInstanceProperties(methodName); + properties = repositoryHelper.addStringPropertyToInstance(serviceName, + properties, + OpenMetadataAPIMapper.SUBJECT_AREA_NAME_PROPERTY_NAME, + subjectAreaName, + methodName); + properties = repositoryHelper.addStringPropertyToInstance(serviceName, properties, OpenMetadataAPIMapper.DISPLAY_NAME_PROPERTY_NAME, diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/SubjectAreaHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/SubjectAreaHandler.java index ff6ce3d1c18..c448586da6d 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/SubjectAreaHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/SubjectAreaHandler.java @@ -80,7 +80,8 @@ public SubjectAreaHandler(OpenMetadataAPIGenericConverter converter, * @param userId calling user * @param externalSourceGUID guid of the software capability entity that represented the external source - null for local * @param externalSourceName name of the software capability entity that represented the external source - * @param qualifiedName unique name for the subjectArea - used in other configuration + * @param qualifiedName unique name for the subject area entity + * @param subjectAreaName unique name for the subject area - used in other configuration * @param displayName short display name for the subjectArea * @param description description of the subject area * @param usage the usage for inclusion in a subject area @@ -102,6 +103,7 @@ public String createSubjectArea(String userId, String externalSourceGUID, String externalSourceName, String qualifiedName, + String subjectAreaName, String displayName, String description, String usage, @@ -129,6 +131,7 @@ public String createSubjectArea(String userId, repositoryHelper); SubjectAreaBuilder builder = new SubjectAreaBuilder(qualifiedName, + subjectAreaName, displayName, description, usage, @@ -166,7 +169,8 @@ public String createSubjectArea(String userId, * @param externalSourceName name of the software capability entity that represented the external source * @param subjectAreaGUID unique identifier of subject area * @param subjectAreaGUIDParameterName parameter name for subjectAreaGUID - * @param qualifiedName unique name for the subjectArea - used in other configuration + * @param qualifiedName unique name for the subject area entity + * @param subjectAreaName unique name for the subject area - used in other configuration * @param displayName short display name for the subjectArea * @param description description of the subject area * @param criteria the criteria for inclusion in a subject area @@ -188,6 +192,7 @@ public void updateSubjectArea(String userId, String subjectAreaGUID, String subjectAreaGUIDParameterName, String qualifiedName, + String subjectAreaName, String displayName, String description, String criteria, @@ -215,6 +220,7 @@ public void updateSubjectArea(String userId, repositoryHelper); SubjectAreaBuilder builder = new SubjectAreaBuilder(qualifiedName, + subjectAreaName, displayName, description, criteria, @@ -249,8 +255,8 @@ public void updateSubjectArea(String userId, * Return information about a specific subject area. * * @param userId calling user - * @param qualifiedName unique name for the subjectArea - * @param qualifiedNameParameter name of parameter supplying the qualifiedName + * @param name unique name for the subjectArea + * @param nameParameter name of parameter supplying the name * @param forLineage return elements marked with the Memento classification? * @param forDuplicateProcessing do not merge elements marked as duplicates? * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) @@ -258,13 +264,13 @@ public void updateSubjectArea(String userId, * * @return properties of the subject area * - * @throws InvalidParameterException qualifiedName or userId is null + * @throws InvalidParameterException name or userId is null * @throws PropertyServerException problem accessing property server * @throws UserNotAuthorizedException security access problem */ public B getSubjectArea(String userId, - String qualifiedName, - String qualifiedNameParameter, + String name, + String nameParameter, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, @@ -272,16 +278,20 @@ public B getSubjectArea(String userId, UserNotAuthorizedException, PropertyServerException { - return this.getBeanByUniqueName(userId, - qualifiedName, - qualifiedNameParameter, - OpenMetadataAPIMapper.QUALIFIED_NAME_PROPERTY_NAME, - OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_GUID, - OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME, - forLineage, - forDuplicateProcessing, - effectiveTime, - methodName); + List specificMatchPropertyNames = new ArrayList<>(); + specificMatchPropertyNames.add(OpenMetadataAPIMapper.QUALIFIED_NAME_PROPERTY_NAME); + specificMatchPropertyNames.add(OpenMetadataAPIMapper.SUBJECT_AREA_NAME_PROPERTY_NAME); + + return this.getBeanByValue(userId, + name, + nameParameter, + OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_GUID, + OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME, + specificMatchPropertyNames, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); } @@ -318,7 +328,7 @@ public String getSubjectAreaParentGUID(String userId, OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME, OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID, OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME, - OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME, + OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME, 1, forLineage, forDuplicateProcessing, @@ -370,7 +380,7 @@ public List getSubjectAreaChildrenGUIDs(String userId, OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME, OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID, OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME, - OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME, + OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME, null, null, 0, diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/UserIdentityBuilder.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/UserIdentityBuilder.java index cf46444b294..6579b37c3b1 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/UserIdentityBuilder.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/UserIdentityBuilder.java @@ -13,12 +13,14 @@ */ public class UserIdentityBuilder extends ReferenceableBuilder { + private final String userId; private String distinguishedName = null; /** * Create constructor * * @param qualifiedName unique name for the user identity + * @param userId user account identifier * @param distinguishedName LDAP distinguished name * @param additionalProperties additional properties for a user identity * @param typeGUID unique identifier of this element's type @@ -29,6 +31,7 @@ public class UserIdentityBuilder extends ReferenceableBuilder * @param serverName name of local server */ UserIdentityBuilder(String qualifiedName, + String userId, String distinguishedName, Map additionalProperties, String typeGUID, @@ -47,6 +50,7 @@ public class UserIdentityBuilder extends ReferenceableBuilder serviceName, serverName); + this.userId = userId; this.distinguishedName = distinguishedName; } @@ -55,6 +59,7 @@ public class UserIdentityBuilder extends ReferenceableBuilder * Create constructor * * @param qualifiedName unique name for the user identity + * @param userId user account identifier * @param additionalProperties additional properties for a user identity * @param extendedProperties properties for a user identity subtype * @param repositoryHelper helper methods @@ -62,6 +67,7 @@ public class UserIdentityBuilder extends ReferenceableBuilder * @param serverName name of local server */ UserIdentityBuilder(String qualifiedName, + String userId, Map additionalProperties, Map extendedProperties, OMRSRepositoryHelper repositoryHelper, @@ -76,6 +82,8 @@ public class UserIdentityBuilder extends ReferenceableBuilder repositoryHelper, serviceName, serverName); + + this.userId = userId; } @@ -91,6 +99,12 @@ public InstanceProperties getInstanceProperties(String methodName) throws Inval { InstanceProperties properties = super.getInstanceProperties(methodName); + properties = repositoryHelper.addStringPropertyToInstance(serviceName, + properties, + OpenMetadataAPIMapper.USER_ID_PROPERTY_NAME, + userId, + methodName); + properties = repositoryHelper.addStringPropertyToInstance(serviceName, properties, OpenMetadataAPIMapper.DISTINGUISHED_NAME_PROPERTY_NAME, diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/UserIdentityHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/UserIdentityHandler.java index 098a355b0e4..f4a409b2bf8 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/UserIdentityHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/UserIdentityHandler.java @@ -13,6 +13,7 @@ import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper; +import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; @@ -81,6 +82,7 @@ public UserIdentityHandler(OpenMetadataAPIGenericConverter converter, * @param profileGUID the unique identifier of the profile GUID that is the anchor of * @param profileGUIDParameterName parameter name supplying profileGUID * @param qualifiedName unique name for the user identity - used in other configuration + * @param elementUserId user account identifier * @param distinguishedName LDAP distinguished name * @param additionalProperties additional properties for a user identity * @param suppliedTypeName type name from the caller (enables creation of subtypes) @@ -101,6 +103,7 @@ public String createUserIdentity(String userId, String profileGUID, String profileGUIDParameterName, String qualifiedName, + String elementUserId, String distinguishedName, Map additionalProperties, String suppliedTypeName, @@ -131,6 +134,7 @@ public String createUserIdentity(String userId, repositoryHelper); UserIdentityBuilder builder = new UserIdentityBuilder(qualifiedName, + elementUserId, distinguishedName, additionalProperties, typeGUID, @@ -192,6 +196,7 @@ public String createUserIdentity(String userId, * @param userIdentityGUID unique identifier of the user identity to update * @param userIdentityGUIDParameterName parameter passing the userIdentityGUID * @param qualifiedName unique name for the user identity - used in other configuration + * @param elementUserId user account identifier * @param distinguishedName LDAP distinguished name * @param additionalProperties additional properties for a governance user identity * @param typeName type of user identity @@ -215,6 +220,7 @@ public void updateUserIdentity(String userId, String userIdentityGUID, String userIdentityGUIDParameterName, String qualifiedName, + String elementUserId, String distinguishedName, Map additionalProperties, String typeName, @@ -242,6 +248,7 @@ public void updateUserIdentity(String userId, repositoryHelper); UserIdentityBuilder builder = new UserIdentityBuilder(qualifiedName, + elementUserId, distinguishedName, additionalProperties, typeGUID, @@ -470,18 +477,27 @@ public List getUserIdentitiesByName(String userId, UserNotAuthorizedException, PropertyServerException { - return this.getBeansByQualifiedName(userId, - OpenMetadataAPIMapper.USER_IDENTITY_TYPE_GUID, - OpenMetadataAPIMapper.USER_IDENTITY_TYPE_NAME, - name, - nameParameterName, - supportedZones, - startFrom, - pageSize, - forLineage, - forDuplicateProcessing, - effectiveTime, - methodName); + List specificMatchPropertyNames = new ArrayList<>(); + specificMatchPropertyNames.add(OpenMetadataAPIMapper.QUALIFIED_NAME_PROPERTY_NAME); + specificMatchPropertyNames.add(OpenMetadataAPIMapper.USER_ID_PROPERTY_NAME); + + return this.getBeansByValue(userId, + name, + nameParameterName, + OpenMetadataAPIMapper.USER_IDENTITY_TYPE_GUID, + OpenMetadataAPIMapper.USER_IDENTITY_TYPE_NAME, + specificMatchPropertyNames, + true, + null, + null, + forLineage, + forDuplicateProcessing, + supportedZones, + null, + startFrom, + pageSize, + effectiveTime, + methodName); } diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ValidValuesHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ValidValuesHandler.java index 76f1c6103a4..51a4bbcd82d 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ValidValuesHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ValidValuesHandler.java @@ -226,6 +226,7 @@ public String createValidValueSet(String userId, * @param externalSourceGUID guid of the software capability entity that represented the external source - null for local * @param externalSourceName name of the software capability entity that represented the external source * @param setGUID unique identifier of the set to attach this to. + * @param isDefaultValue is this the default value for the set? * @param qualifiedName unique name. * @param displayName displayable descriptive name. * @param description further information. @@ -250,6 +251,7 @@ public String createValidValueDefinition(String userId, String externalSourceGUID, String externalSourceName, String setGUID, + boolean isDefaultValue, String qualifiedName, String displayName, String description, @@ -303,6 +305,8 @@ public String createValidValueDefinition(String userId, if ((definitionGUID != null) && (setGUID != null)) { + InstanceProperties relationshipProperties = repositoryHelper.addBooleanPropertyToInstance(serviceName, null, OpenMetadataAPIMapper.IS_DEFAULT_VALUE_PROPERTY_NAME, isDefaultValue, methodName); + this.uncheckedLinkElementToElement(userId, externalSourceGUID, externalSourceName, @@ -317,7 +321,7 @@ public String createValidValueDefinition(String userId, supportedZones, OpenMetadataAPIMapper.VALID_VALUES_MEMBER_RELATIONSHIP_TYPE_GUID, OpenMetadataAPIMapper.VALID_VALUES_MEMBER_RELATIONSHIP_TYPE_NAME, - null, + relationshipProperties, effectiveTime, methodName); } @@ -476,6 +480,7 @@ public void deleteValidValue(String userId, * @param externalSourceName name of the software capability entity that represented the external source * @param setGUID unique identifier of the set. * @param validValueGUID unique identifier of the valid value to add to the set. + * @param isDefaultValue is this the default value for the set? * @param effectiveFrom starting time for this relationship (null for all time) * @param effectiveTo ending time for this relationship (null for all time) * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned @@ -491,6 +496,7 @@ public void attachValidValueToSet(String userId, String externalSourceName, String setGUID, String validValueGUID, + boolean isDefaultValue, Date effectiveFrom, Date effectiveTo, boolean forLineage, @@ -503,6 +509,8 @@ public void attachValidValueToSet(String userId, final String setGUIDParameter = "setGUID"; final String validValueGUIDParameter = "validValueGUID"; + InstanceProperties properties = repositoryHelper.addBooleanPropertyToInstance(serviceName, null, OpenMetadataAPIMapper.IS_DEFAULT_VALUE_PROPERTY_NAME, isDefaultValue, methodName); + this.linkElementToElement(userId, externalSourceGUID, externalSourceName, @@ -517,7 +525,7 @@ public void attachValidValueToSet(String userId, supportedZones, OpenMetadataAPIMapper.VALID_VALUES_MEMBER_RELATIONSHIP_TYPE_GUID, OpenMetadataAPIMapper.VALID_VALUES_MEMBER_RELATIONSHIP_TYPE_NAME, - this.setUpEffectiveDates(null, effectiveFrom, effectiveTo), + this.setUpEffectiveDates(properties, effectiveFrom, effectiveTo), effectiveFrom, effectiveTo, effectiveTime, @@ -848,7 +856,9 @@ public void unassignValidValueFromConsumer(String userId, * @param validValueGUID unique identifier of the valid value. * @param referenceableGUID unique identifier of the element to link to. * @param confidence how confident is the steward that this mapping is correct (0-100). - * @param steward identifier of steward + * @param steward identifier of steward + * @param stewardTypeName type of element that represents steward + * @param stewardPropertyName property name of steward identifier * @param notes additional notes from the steward * @param effectiveFrom starting time for this relationship (null for all time) * @param effectiveTo ending time for this relationship (null for all time) @@ -867,6 +877,8 @@ public void assignReferenceValueToItem(String userId, String referenceableGUID, int confidence, String steward, + String stewardTypeName, + String stewardPropertyName, String notes, Date effectiveFrom, Date effectiveTo, @@ -886,27 +898,33 @@ public void assignReferenceValueToItem(String userId, InstanceProperties relationshipProperties = repositoryHelper.addIntPropertyToInstance(serviceName, null, - OpenMetadataAPIMapper.VALID_VALUES_CONFIDENCE_PROPERTY_NAME, + OpenMetadataAPIMapper.CONFIDENCE_PROPERTY_NAME, confidence, methodName); - if (steward != null) - { - relationshipProperties = repositoryHelper.addStringPropertyToInstance(serviceName, - null, - OpenMetadataAPIMapper.VALID_VALUES_STEWARD_PROPERTY_NAME, - steward, - methodName); - } - - if (notes != null) - { - relationshipProperties = repositoryHelper.addStringPropertyToInstance(serviceName, - null, - OpenMetadataAPIMapper.VALID_VALUES_NOTES_PROPERTY_NAME, - notes, - methodName); - } + relationshipProperties = repositoryHelper.addStringPropertyToInstance(serviceName, + relationshipProperties, + OpenMetadataAPIMapper.STEWARD_PROPERTY_NAME, + steward, + methodName); + + relationshipProperties = repositoryHelper.addStringPropertyToInstance(serviceName, + relationshipProperties, + OpenMetadataAPIMapper.STEWARD_TYPE_NAME_PROPERTY_NAME, + stewardTypeName, + methodName); + + relationshipProperties = repositoryHelper.addStringPropertyToInstance(serviceName, + relationshipProperties, + OpenMetadataAPIMapper.STEWARD_PROPERTY_NAME_PROPERTY_NAME, + stewardPropertyName, + methodName); + + relationshipProperties = repositoryHelper.addStringPropertyToInstance(serviceName, + relationshipProperties, + OpenMetadataAPIMapper.NOTES_PROPERTY_NAME, + notes, + methodName); this.linkElementToElement(userId, externalSourceGUID, @@ -992,6 +1010,8 @@ public void unassignReferenceValueFromItem(String userId, * @param associationDescription how are the valid values related? * @param confidence how confident is the steward that this mapping is correct (0-100). * @param steward identifier of steward + * @param stewardTypeName type of element that represents steward + * @param stewardPropertyName property name of steward identifier * @param notes additional notes from the steward * @param effectiveFrom starting time for this relationship (null for all time) * @param effectiveTo ending time for this relationship (null for all time) @@ -1011,6 +1031,8 @@ public void mapValidValues(String userId, String associationDescription, int confidence, String steward, + String stewardTypeName, + String stewardPropertyName, String notes, Date effectiveFrom, Date effectiveTo, @@ -1026,36 +1048,38 @@ public void mapValidValues(String userId, InstanceProperties relationshipProperties = repositoryHelper.addIntPropertyToInstance(serviceName, null, - OpenMetadataAPIMapper.VALID_VALUES_CONFIDENCE_PROPERTY_NAME, + OpenMetadataAPIMapper.CONFIDENCE_PROPERTY_NAME, confidence, methodName); - if (associationDescription != null) - { - relationshipProperties = repositoryHelper.addStringPropertyToInstance(serviceName, - null, - OpenMetadataAPIMapper.VALID_VALUES_ASSOCIATION_DESCRIPTION_PROPERTY_NAME, - associationDescription, - methodName); - } - - if (steward != null) - { - relationshipProperties = repositoryHelper.addStringPropertyToInstance(serviceName, - null, - OpenMetadataAPIMapper.VALID_VALUES_STEWARD_PROPERTY_NAME, - steward, - methodName); - } - - if (notes != null) - { - relationshipProperties = repositoryHelper.addStringPropertyToInstance(serviceName, - null, - OpenMetadataAPIMapper.VALID_VALUES_NOTES_PROPERTY_NAME, - notes, - methodName); - } + relationshipProperties = repositoryHelper.addStringPropertyToInstance(serviceName, + relationshipProperties, + OpenMetadataAPIMapper.ASSOCIATION_DESCRIPTION_PROPERTY_NAME, + associationDescription, + methodName); + + relationshipProperties = repositoryHelper.addStringPropertyToInstance(serviceName, + relationshipProperties, + OpenMetadataAPIMapper.STEWARD_PROPERTY_NAME, + steward, + methodName); + relationshipProperties = repositoryHelper.addStringPropertyToInstance(serviceName, + relationshipProperties, + OpenMetadataAPIMapper.STEWARD_TYPE_NAME_PROPERTY_NAME, + stewardTypeName, + methodName); + + relationshipProperties = repositoryHelper.addStringPropertyToInstance(serviceName, + relationshipProperties, + OpenMetadataAPIMapper.STEWARD_PROPERTY_NAME_PROPERTY_NAME, + stewardPropertyName, + methodName); + + relationshipProperties = repositoryHelper.addStringPropertyToInstance(serviceName, + relationshipProperties, + OpenMetadataAPIMapper.NOTES_PROPERTY_NAME, + notes, + methodName); this.linkElementToElement(userId, externalSourceGUID, @@ -1204,6 +1228,7 @@ public List getValidValueByName(String userId, List specificMatchPropertyNames = new ArrayList<>(); specificMatchPropertyNames.add(OpenMetadataAPIMapper.QUALIFIED_NAME_PROPERTY_NAME); specificMatchPropertyNames.add(OpenMetadataAPIMapper.VALID_VALUE_DISPLAY_NAME_PROPERTY_NAME); + specificMatchPropertyNames.add(OpenMetadataAPIMapper.PREFERRED_VALUE_PROPERTY_NAME); return this.getBeansByValue(userId, name, diff --git a/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-api/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/properties/package-info.java b/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-api/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/properties/package-info.java index 90b7ed33d90..5a7ed660e9c 100644 --- a/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-api/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/properties/package-info.java +++ b/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-api/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/properties/package-info.java @@ -3,7 +3,7 @@ /** - * This package contains all of the beans for metadata objects in addition to the beans defined in the + * This package contains all the beans for metadata objects in addition to the beans defined in the * Open Connector Framework (OCF). */ package org.odpi.openmetadata.commonservices.ocf.metadatamanagement.properties; \ No newline at end of file diff --git a/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/client/ConnectedAssetProperties.java b/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/client/ConnectedAssetProperties.java index 607bd78f783..f133957ad73 100644 --- a/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/client/ConnectedAssetProperties.java +++ b/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/client/ConnectedAssetProperties.java @@ -22,7 +22,7 @@ * The ConnectedAssetProperties returns metadata about the asset at three levels of detail: *
    *
  • assetSummary - used for displaying details of the asset in summary lists or hover text
  • - *
  • assetDetail - used to display all of the information known about the asset with summaries + *
  • assetDetail - used to display all the information known about the asset with summaries * of the relationships to other metadata entities
  • *
  • assetUniverse - used to define the broader context for the asset
  • *
diff --git a/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/client/ConnectedAssetRelatedAssetProperties.java b/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/client/ConnectedAssetRelatedAssetProperties.java index 4cfd857e26a..084edf4db8e 100644 --- a/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/client/ConnectedAssetRelatedAssetProperties.java +++ b/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/client/ConnectedAssetRelatedAssetProperties.java @@ -21,7 +21,7 @@ * The ConnectedAssetProperties returns metadata about the asset at three levels of detail: *
    *
  • assetSummary - used for displaying details of the asset in summary lists or hover text
  • - *
  • assetDetail - used to display all of the information known about the asset with summaries + *
  • assetDetail - used to display all the information known about the asset with summaries * of the relationships to other metadata entities
  • *
  • assetUniverse - used to define the broader context for the asset
  • *
diff --git a/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/OCFMetadataRESTServices.java b/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/OCFMetadataRESTServices.java index d9a67ea6fde..62e451ee542 100644 --- a/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/OCFMetadataRESTServices.java +++ b/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/OCFMetadataRESTServices.java @@ -1073,17 +1073,17 @@ public LocationsResponse getKnownLocations(String serverName, LocationHandler handler = instanceHandler.getLocationHandler(userId, serverName, methodName); auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - response.setList(handler.getLocations(userId, - assetGUID, - guidParameterName, - OpenMetadataAPIMapper.ASSET_TYPE_NAME, - instanceHandler.getSupportedZones(userId, serverName, serviceURLName, methodName), - elementStart, - maxElements, - false, - false, - new Date(), - methodName)); + response.setList(handler.getAssetLocations(userId, + assetGUID, + guidParameterName, + OpenMetadataAPIMapper.ASSET_TYPE_NAME, + instanceHandler.getSupportedZones(userId, serverName, serviceURLName, methodName), + elementStart, + maxElements, + false, + false, + new Date(), + methodName)); } catch (Exception error) { diff --git a/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/converters/CertificationConverter.java b/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/converters/CertificationConverter.java index 4b4c711fc40..587f964aa68 100644 --- a/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/converters/CertificationConverter.java +++ b/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/converters/CertificationConverter.java @@ -36,7 +36,7 @@ public CertificationConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/converters/CommentConverter.java b/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/converters/CommentConverter.java index 8cf77373b62..61e1a0714f1 100644 --- a/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/converters/CommentConverter.java +++ b/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/converters/CommentConverter.java @@ -36,7 +36,7 @@ public CommentConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/converters/InformalTagConverter.java b/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/converters/InformalTagConverter.java index 352a57a4bf8..e2f5eeff684 100644 --- a/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/converters/InformalTagConverter.java +++ b/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/converters/InformalTagConverter.java @@ -35,7 +35,7 @@ public InformalTagConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/converters/LicenseConverter.java b/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/converters/LicenseConverter.java index aa9f75aa874..587b0d09de5 100644 --- a/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/converters/LicenseConverter.java +++ b/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/converters/LicenseConverter.java @@ -37,7 +37,7 @@ public LicenseConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/converters/LikeConverter.java b/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/converters/LikeConverter.java index 436be8717da..b4b1fc25055 100644 --- a/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/converters/LikeConverter.java +++ b/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/converters/LikeConverter.java @@ -35,7 +35,7 @@ public LikeConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/converters/RatingConverter.java b/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/converters/RatingConverter.java index 3f1c323c2ec..24066b88a92 100644 --- a/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/converters/RatingConverter.java +++ b/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/converters/RatingConverter.java @@ -36,7 +36,7 @@ public RatingConverter(OMRSRepositoryHelper repositoryHelper, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/converters/RelatedAssetConverter.java b/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/converters/RelatedAssetConverter.java index feab7f65226..b09637ad0f2 100644 --- a/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/converters/RelatedAssetConverter.java +++ b/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/converters/RelatedAssetConverter.java @@ -57,7 +57,7 @@ public B getNewBean(Class beanClass, /** - * Using the supplied instances, return a new instance of the bean. This is used for beans that have + * Using the supplied instances, return a new instance of the bean. This is used for beans that * contain a combination of the properties from an entity and that of a connected relationship. * * @param beanClass name of the class to create diff --git a/open-metadata-implementation/common-services/repository-handler/src/main/java/org/odpi/openmetadata/commonservices/repositoryhandler/RepositoryHandlerErrorCode.java b/open-metadata-implementation/common-services/repository-handler/src/main/java/org/odpi/openmetadata/commonservices/repositoryhandler/RepositoryHandlerErrorCode.java index 03e11ff01e8..c57866dd5ed 100644 --- a/open-metadata-implementation/common-services/repository-handler/src/main/java/org/odpi/openmetadata/commonservices/repositoryhandler/RepositoryHandlerErrorCode.java +++ b/open-metadata-implementation/common-services/repository-handler/src/main/java/org/odpi/openmetadata/commonservices/repositoryhandler/RepositoryHandlerErrorCode.java @@ -123,7 +123,7 @@ public enum RepositoryHandlerErrorCode implements ExceptionMessageSet "The unique identifier of the entity is supplied by the caller. Verify that the caller's logic is correct, and that there are no errors being reported by the open metadata repository. Once all errors have been resolved, retry the request."), NO_RELATIONSHIPS_FOUND(404, "OMAG-REPOSITORY-HANDLER-404-008", "No {0} relationships are connected to the {1} entity with unique identifier {2}: the calling method is {3} and the server is {4}", - "The system is unable to process a request because no relationships have been discovered and it is unable to retrieve all of the information it needs.", + "The system is unable to process a request because no relationships have been discovered and it is unable to retrieve all the information it needs.", "Check that the unique identifier of the entity is correct and the metadata server supporting the request is running. If these are " + "both correct, investigate why the relationships are missing. It is likely that the process responsible for " + "the creation of the relationships has not yet run, or failed part way through its operation."), diff --git a/open-metadata-implementation/engine-services/asset-analysis/asset-analysis-api/src/main/java/org/odpi/openmetadata/engineservices/assetanalysis/ffdc/AssetAnalysisAuditCode.java b/open-metadata-implementation/engine-services/asset-analysis/asset-analysis-api/src/main/java/org/odpi/openmetadata/engineservices/assetanalysis/ffdc/AssetAnalysisAuditCode.java index 8f19cccdd9e..af466ad6f0c 100644 --- a/open-metadata-implementation/engine-services/asset-analysis/asset-analysis-api/src/main/java/org/odpi/openmetadata/engineservices/assetanalysis/ffdc/AssetAnalysisAuditCode.java +++ b/open-metadata-implementation/engine-services/asset-analysis/asset-analysis-api/src/main/java/org/odpi/openmetadata/engineservices/assetanalysis/ffdc/AssetAnalysisAuditCode.java @@ -92,7 +92,7 @@ public enum AssetAnalysisAuditCode implements AuditLogMessageSet OMRSAuditLogRecordSeverity.STARTUP, "The Asset Analysis OMES in server {0} has initialized", "The engine service has completed initialization.", - "Verify that all of the configured discovery engines have successfully started and retrieved their configuration."), + "Verify that all the configured discovery engines have successfully started and retrieved their configuration."), SERVER_SHUTTING_DOWN("OMES-ASSET-ANALYSIS-0014", OMRSAuditLogRecordSeverity.SHUTDOWN, @@ -186,10 +186,10 @@ public enum AssetAnalysisAuditCode implements AuditLogMessageSet OMRSAuditLogRecordSeverity.INFO, "All discovery service configuration is being refreshed for discovery engine {0}", "The Asset Analysis OMES will call the Discovery Engine OMAS in the metadata server to " + - "retrieve details of all of the discovery services configured for this engine." + + "retrieve details of all the discovery services configured for this engine." + "During this process, some discovery request may fail if the associated discovery" + "service is only partially configured.", - "Monitor the Asset Analysis OMES to ensure all of the discovery services are retrieved." + + "Monitor the Asset Analysis OMES to ensure all the discovery services are retrieved." + "Then it is ready to process new discovery requests."), FINISHED_ALL_DISCOVERY_SERVICE_CONFIG("OMES-ASSET-ANALYSIS-0026", @@ -197,7 +197,7 @@ public enum AssetAnalysisAuditCode implements AuditLogMessageSet "Refreshing all discovery service configuration has being completed for discovery engine {0}", "The discovery engine is ready to receive discovery requests for all successfully loaded " + "discovery services.", - "No action is required as long as all of the expected discovery services are loaded." + + "No action is required as long as all the expected discovery services are loaded." + "If there are any discovery services missing then validate the configuration of" + "the discovery engine in the metadata server."), diff --git a/open-metadata-implementation/engine-services/governance-action/governance-action-api/src/main/java/org/odpi/openmetadata/engineservices/governanceaction/ffdc/GovernanceActionAuditCode.java b/open-metadata-implementation/engine-services/governance-action/governance-action-api/src/main/java/org/odpi/openmetadata/engineservices/governanceaction/ffdc/GovernanceActionAuditCode.java index 6e93f30c72c..54e26ed3f0f 100644 --- a/open-metadata-implementation/engine-services/governance-action/governance-action-api/src/main/java/org/odpi/openmetadata/engineservices/governanceaction/ffdc/GovernanceActionAuditCode.java +++ b/open-metadata-implementation/engine-services/governance-action/governance-action-api/src/main/java/org/odpi/openmetadata/engineservices/governanceaction/ffdc/GovernanceActionAuditCode.java @@ -91,7 +91,7 @@ public enum GovernanceActionAuditCode implements AuditLogMessageSet OMRSAuditLogRecordSeverity.STARTUP, "The Governance Action OMES in server {0} has initialized", "The engine service has completed initialization.", - "Verify that all of the configured governance action engines have successfully started and retrieved their configuration."), + "Verify that all the configured governance action engines have successfully started and retrieved their configuration."), SERVER_SHUTTING_DOWN("OMES-GOVERNANCE-ACTION-0014", OMRSAuditLogRecordSeverity.SHUTDOWN, diff --git a/open-metadata-implementation/engine-services/governance-action/governance-action-server/src/main/java/org/odpi/openmetadata/engineservices/governanceaction/context/OpenMetadataStoreClient.java b/open-metadata-implementation/engine-services/governance-action/governance-action-server/src/main/java/org/odpi/openmetadata/engineservices/governanceaction/context/OpenMetadataStoreClient.java index afbd0d00a62..b898f7454eb 100644 --- a/open-metadata-implementation/engine-services/governance-action/governance-action-server/src/main/java/org/odpi/openmetadata/engineservices/governanceaction/context/OpenMetadataStoreClient.java +++ b/open-metadata-implementation/engine-services/governance-action/governance-action-server/src/main/java/org/odpi/openmetadata/engineservices/governanceaction/context/OpenMetadataStoreClient.java @@ -390,7 +390,7 @@ public String createMetadataElementInStore(String metadataElementType /** * Update the properties of a specific metadata element. The properties must match the type definition associated with the - * metadata element when it was created. However, it is possible to update a few properties, or replace all of them by + * metadata element when it was created. However, it is possible to update a few properties, or replace all them by * the value used in the replaceProperties flag. * * @param metadataElementGUID unique identifier of the metadata element to update diff --git a/open-metadata-implementation/engine-services/repository-governance/repository-governance-api/src/main/java/org/odpi/openmetadata/engineservices/repositorygovernance/connector/RepositoryGovernanceContext.java b/open-metadata-implementation/engine-services/repository-governance/repository-governance-api/src/main/java/org/odpi/openmetadata/engineservices/repositorygovernance/connector/RepositoryGovernanceContext.java index e01282d0fc5..9acb0fac2d5 100644 --- a/open-metadata-implementation/engine-services/repository-governance/repository-governance-api/src/main/java/org/odpi/openmetadata/engineservices/repositorygovernance/connector/RepositoryGovernanceContext.java +++ b/open-metadata-implementation/engine-services/repository-governance/repository-governance-api/src/main/java/org/odpi/openmetadata/engineservices/repositorygovernance/connector/RepositoryGovernanceContext.java @@ -196,7 +196,7 @@ public abstract TypeDefGallery findTypesByName(String name) throws InvalidParame /** - * Returns all of the TypeDefs for a specific category. + * Returns all the TypeDefs for a specific category. * * @param category enum value for the category of TypeDef to return. * @return TypeDefs list. @@ -212,7 +212,7 @@ public abstract List findTypeDefsByCategory(TypeDefCategory category) t /** - * Returns all of the AttributeTypeDefs for a specific category. + * Returns all the AttributeTypeDefs for a specific category. * * @param category enum value for the category of an AttributeTypeDef to return. * @return TypeDefs list. @@ -955,7 +955,7 @@ public abstract List findRelationshipsByPropertyValue(String /** - * Declare that all of the processing for the governance action service is finished and the status of the work. + * Declare that all the processing for the governance action service is finished and the status of the work. * * @param status completion status enum value * @param outputGuards optional guard strings for triggering subsequent action(s) diff --git a/open-metadata-implementation/engine-services/repository-governance/repository-governance-api/src/main/java/org/odpi/openmetadata/engineservices/repositorygovernance/ffdc/RepositoryGovernanceAuditCode.java b/open-metadata-implementation/engine-services/repository-governance/repository-governance-api/src/main/java/org/odpi/openmetadata/engineservices/repositorygovernance/ffdc/RepositoryGovernanceAuditCode.java index c5da32e093b..9d4eccea07d 100644 --- a/open-metadata-implementation/engine-services/repository-governance/repository-governance-api/src/main/java/org/odpi/openmetadata/engineservices/repositorygovernance/ffdc/RepositoryGovernanceAuditCode.java +++ b/open-metadata-implementation/engine-services/repository-governance/repository-governance-api/src/main/java/org/odpi/openmetadata/engineservices/repositorygovernance/ffdc/RepositoryGovernanceAuditCode.java @@ -92,7 +92,7 @@ public enum RepositoryGovernanceAuditCode implements AuditLogMessageSet OMRSAuditLogRecordSeverity.STARTUP, "The Repository Governance OMES in server {0} has initialized", "The engine service has completed initialization.", - "Verify that all of the configured repository governance engines have successfully started and retrieved their configuration."), + "Verify that all the configured repository governance engines have successfully started and retrieved their configuration."), SERVER_SHUTTING_DOWN("OMES-REPOSITORY-GOVERNANCE-0014", OMRSAuditLogRecordSeverity.SHUTDOWN, @@ -191,10 +191,10 @@ public enum RepositoryGovernanceAuditCode implements AuditLogMessageSet OMRSAuditLogRecordSeverity.INFO, "All repository governance service configuration is being refreshed for repository governance engine {0}", "The Repository Governance OMES will call the OMRS in the metadata server to " + - "retrieve details of all of the repository governance services configured for this engine." + + "retrieve details of all the repository governance services configured for this engine." + "During this process, some repository governance request may fail if the associated repository governance" + "service is only partially configured.", - "Monitor the Repository Governance OMES to ensure all of the repository governance services are retrieved." + + "Monitor the Repository Governance OMES to ensure all the repository governance services are retrieved." + "Then it is ready to process new repository governance requests."), FINISHED_ALL_REPOSITORY_GOVERNANCE_SERVICE_CONFIG("OMES-REPOSITORY-GOVERNANCE-0026", @@ -202,7 +202,7 @@ public enum RepositoryGovernanceAuditCode implements AuditLogMessageSet "Refreshing all repository governance service configuration has being completed for repository governance engine {0}", "The repository governance engine is ready to receive repository governance requests for all successfully loaded " + "repository governance services.", - "No action is required as long as all of the expected repository governance services are loaded." + + "No action is required as long as all the expected repository governance services are loaded." + "If there are any repository governance services missing then validate the configuration of" + "the repository governance engine in the metadata server."), diff --git a/open-metadata-implementation/engine-services/repository-governance/repository-governance-server/src/main/java/org/odpi/openmetadata/engineservices/repositorygovernance/handlers/RepositoryGovernanceServiceContext.java b/open-metadata-implementation/engine-services/repository-governance/repository-governance-server/src/main/java/org/odpi/openmetadata/engineservices/repositorygovernance/handlers/RepositoryGovernanceServiceContext.java index 2722e682c3d..f8f3273b630 100644 --- a/open-metadata-implementation/engine-services/repository-governance/repository-governance-server/src/main/java/org/odpi/openmetadata/engineservices/repositorygovernance/handlers/RepositoryGovernanceServiceContext.java +++ b/open-metadata-implementation/engine-services/repository-governance/repository-governance-server/src/main/java/org/odpi/openmetadata/engineservices/repositorygovernance/handlers/RepositoryGovernanceServiceContext.java @@ -191,7 +191,7 @@ public TypeDefGallery findTypesByName(String name) throws InvalidParameterExcept /** - * Returns all of the TypeDefs for a specific category. + * Returns all the TypeDefs for a specific category. * * @param category enum value for the category of TypeDef to return. * @return TypeDefs list. @@ -208,7 +208,7 @@ public List findTypeDefsByCategory(TypeDefCategory category) throws Inv /** - * Returns all of the AttributeTypeDefs for a specific category. + * Returns all the AttributeTypeDefs for a specific category. * * @param category enum value for the category of an AttributeTypeDef to return. * @return TypeDefs list. @@ -1030,7 +1030,7 @@ public List findRelationshipsByPropertyValue(String /** - * Declare that all of the processing for the archive service is finished and the status of the work. + * Declare that all the processing for the archive service is finished and the status of the work. * * @param status completion status enum value * @param outputGuards optional guard strings for triggering subsequent action(s) @@ -1052,7 +1052,7 @@ public synchronized void recordCompletionStatus(CompletionStatus status, /** - * Declare that all of the processing for the archive service is finished and the status of the work. + * Declare that all the processing for the archive service is finished and the status of the work. * * @param status completion status enum value * @param outputGuards optional guard strings for triggering subsequent action(s) diff --git a/open-metadata-implementation/frameworks/audit-log-framework/src/main/java/org/odpi/openmetadata/frameworks/auditlog/messagesets/AuditLogMessageDefinition.java b/open-metadata-implementation/frameworks/audit-log-framework/src/main/java/org/odpi/openmetadata/frameworks/auditlog/messagesets/AuditLogMessageDefinition.java index 9f4016ff71f..c78bfb5344f 100644 --- a/open-metadata-implementation/frameworks/audit-log-framework/src/main/java/org/odpi/openmetadata/frameworks/auditlog/messagesets/AuditLogMessageDefinition.java +++ b/open-metadata-implementation/frameworks/audit-log-framework/src/main/java/org/odpi/openmetadata/frameworks/auditlog/messagesets/AuditLogMessageDefinition.java @@ -24,7 +24,7 @@ public class AuditLogMessageDefinition extends MessageDefinition private AuditLogRecordSeverity severity; /** - * Constructor to save all of the fixed values of a message. This is typically populated + * Constructor to save all the fixed values of a message. This is typically populated * from an Enum message set. The constructor passes most values to the super class and just retains * the additional value for the audit log. * diff --git a/open-metadata-implementation/frameworks/audit-log-framework/src/main/java/org/odpi/openmetadata/frameworks/auditlog/messagesets/ExceptionMessageDefinition.java b/open-metadata-implementation/frameworks/audit-log-framework/src/main/java/org/odpi/openmetadata/frameworks/auditlog/messagesets/ExceptionMessageDefinition.java index ae4f1b282e3..2bb54abcb5c 100644 --- a/open-metadata-implementation/frameworks/audit-log-framework/src/main/java/org/odpi/openmetadata/frameworks/auditlog/messagesets/ExceptionMessageDefinition.java +++ b/open-metadata-implementation/frameworks/audit-log-framework/src/main/java/org/odpi/openmetadata/frameworks/auditlog/messagesets/ExceptionMessageDefinition.java @@ -25,7 +25,7 @@ public class ExceptionMessageDefinition extends MessageDefinition /** - * Constructor to save all of the fixed values of a message. This is typically populated + * Constructor to save all the fixed values of a message. This is typically populated * from an Enum message set. The constructor passes most values to the super class and just retains * the additional value for the exception. * diff --git a/open-metadata-implementation/frameworks/audit-log-framework/src/main/java/org/odpi/openmetadata/frameworks/auditlog/messagesets/MessageDefinition.java b/open-metadata-implementation/frameworks/audit-log-framework/src/main/java/org/odpi/openmetadata/frameworks/auditlog/messagesets/MessageDefinition.java index e4ebff63f22..bd9c58b09e5 100644 --- a/open-metadata-implementation/frameworks/audit-log-framework/src/main/java/org/odpi/openmetadata/frameworks/auditlog/messagesets/MessageDefinition.java +++ b/open-metadata-implementation/frameworks/audit-log-framework/src/main/java/org/odpi/openmetadata/frameworks/auditlog/messagesets/MessageDefinition.java @@ -31,7 +31,7 @@ public abstract class MessageDefinition private String[] params; /** - * Constructor to save all of the fixed values of a message. This is typically populated + * Constructor to save all the fixed values of a message. This is typically populated * from an Enum message set. * * @param messageId unique id of the message type. diff --git a/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/GovernanceActionContext.java b/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/GovernanceActionContext.java index 9e63747beb6..2845295bd12 100644 --- a/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/GovernanceActionContext.java +++ b/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/GovernanceActionContext.java @@ -713,7 +713,7 @@ public String createMetadataElement(String metadataElementTypeName, /** * Update the properties of a specific metadata element. The properties must match the type definition associated with the - * metadata element when it was created. However, it is possible to update a few properties, or replace all of them by + * metadata element when it was created. However, it is possible to update a few properties, or replace all them by * the value used in the replaceProperties flag. * * @param metadataElementGUID unique identifier of the metadata element to update diff --git a/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/GovernanceActionServiceConnector.java b/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/GovernanceActionServiceConnector.java index bf5e67e654c..1c22ce3ecb0 100644 --- a/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/GovernanceActionServiceConnector.java +++ b/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/GovernanceActionServiceConnector.java @@ -30,7 +30,7 @@ * When you build a governance action service, you extend the governance action service class that matches the purpose of your governance action * to ensure your code receives a context with the appropriate interface. * - * In addition there is a generic governance action service called GovernanceActionService that combines all of the functions of the + * In addition there is a generic governance action service called GovernanceActionService that combines all the functions of the * five specialist types of governance action service. It is used when if is more efficient to combine the functions into one execution. */ public abstract class GovernanceActionServiceConnector extends ConnectorBase implements AuditLoggingComponent, VirtualConnectorExtension diff --git a/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/GovernanceContext.java b/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/GovernanceContext.java index 7d1331f89f0..d42e28032d1 100644 --- a/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/GovernanceContext.java +++ b/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/GovernanceContext.java @@ -116,7 +116,7 @@ void updateActionTargetStatus(String actionTargetGUID, /** - * Declare that all of the processing for the governance action service is finished and the status of the work. + * Declare that all the processing for the governance action service is finished and the status of the work. * * @param status completion status enum value * @param outputGuards optional guard strings for triggering subsequent action(s) @@ -133,7 +133,7 @@ void recordCompletionStatus(CompletionStatus status, /** - * Declare that all of the processing for the governance action service is finished and the status of the work. + * Declare that all the processing for the governance action service is finished and the status of the work. * * @param status completion status enum value * @param outputGuards optional guard strings for triggering subsequent action(s) @@ -153,7 +153,7 @@ void recordCompletionStatus(CompletionStatus status, /** - * Declare that all of the processing for the governance action service is finished and the status of the work. + * Declare that all the processing for the governance action service is finished and the status of the work. * * @param status completion status enum value * @param outputGuards optional guard strings for triggering subsequent action(s) diff --git a/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/OpenMetadataClient.java b/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/OpenMetadataClient.java index 8025c3c1df2..51f5cbea69d 100644 --- a/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/OpenMetadataClient.java +++ b/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/OpenMetadataClient.java @@ -250,7 +250,7 @@ public abstract List findRelationshipsBetweenMetadataE * @param effectiveFrom the date when this element is active - null for active on creation * @param effectiveTo the date when this element becomes inactive - null for active until deleted * @param properties properties of the new metadata element - * @param templateGUID the unique identifier of the existing asset to copy (this will copy all of the attachments such as nested content, schema + * @param templateGUID the unique identifier of the existing asset to copy (this will copy all the attachments such as nested content, schema * connection etc) * * @return unique identifier of the new metadata element @@ -271,7 +271,7 @@ public abstract String createMetadataElementInStore(String metadataEl /** * Update the properties of a specific metadata element. The properties must match the type definition associated with the - * metadata element when it was created. However, it is possible to update a few properties, or replace all of them by + * metadata element when it was created. However, it is possible to update a few properties, or replace all them by * the value used in the replaceProperties flag. * * @param metadataElementGUID unique identifier of the metadata element to update @@ -599,7 +599,7 @@ public abstract void updateActionTargetStatus(String actionTarge /** - * Declare that all of the processing for the governance action service is finished and the status of the work. + * Declare that all the processing for the governance action service is finished and the status of the work. * * @param status completion status enum value * @param outputGuards optional guard strings for triggering subsequent action(s) diff --git a/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/OpenMetadataStore.java b/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/OpenMetadataStore.java index 2055fec3235..9d2577ece72 100644 --- a/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/OpenMetadataStore.java +++ b/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/OpenMetadataStore.java @@ -18,7 +18,7 @@ /** * OpenMetadataStore provides access to metadata elements stored in the metadata repositories. It is implemented by the - * abstract class OpenMetadataClient and used by all of the governance action services to retrieve metadata. + * abstract class OpenMetadataClient and used by all the governance action services to retrieve metadata. * * The concrete class for OpenMetadataClient is implemented by a metadata repository provider. In Egeria, this class is * implemented in the Governance Engine OMAS client. diff --git a/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/ProvisioningGovernanceContext.java b/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/ProvisioningGovernanceContext.java index 77c8eb31b39..554d14ef1f3 100644 --- a/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/ProvisioningGovernanceContext.java +++ b/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/ProvisioningGovernanceContext.java @@ -51,7 +51,7 @@ String createAsset(String assetTypeName, * governance action service has created a new asset as part of the provisioning process. * This interface includes an optional templateGUID to copy the structure of an existing asset of the same type. * - * @param templateGUID the unique identifier of the existing asset to copy (this will copy all of the attachments + * @param templateGUID the unique identifier of the existing asset to copy (this will copy all the attachments * such as nested content, schema, connection etc) * @param qualifiedName the unique name of the new asset * @param name the technical display name of the asset @@ -98,7 +98,7 @@ String createProcess(String processTypeName, /** * Create a new process to represent the processing of this governance action process. * - * @param templateGUID the unique identifier of the existing process to copy (this will copy all of the attachments such as ports, nested content, + * @param templateGUID the unique identifier of the existing process to copy (this will copy all the attachments such as ports, nested content, * schema, connection etc) * @param initialStatus status value of the process * @param qualifiedName the unique name of the new process @@ -127,7 +127,7 @@ String createProcessFromTemplate(String templateGUID, * @param qualifiedName the unique name of the new process * @param name the technical display name of the process * @param description the description of the process - * @param parentGUID the unique identifier of the existing process to copy (this will copy all of the attachments such as ports, nested content, + * @param parentGUID the unique identifier of the existing process to copy (this will copy all the attachments such as ports, nested content, * schema, connection etc) * * @return unique identifier of the new process diff --git a/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/RemediationGovernanceContext.java b/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/RemediationGovernanceContext.java index 53dd0e07988..01f5006699a 100644 --- a/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/RemediationGovernanceContext.java +++ b/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/RemediationGovernanceContext.java @@ -80,7 +80,7 @@ String createMetadataElement(String metadataElementTypeName, /** * Update the properties of a specific metadata element. The properties must match the type definition associated with the - * metadata element when it was created. However, it is possible to update a few properties, or replace all of them by + * metadata element when it was created. However, it is possible to update a few properties, or replace all them by * the value used in the replaceProperties flag. * * @param metadataElementGUID unique identifier of the metadata element to update diff --git a/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/properties/ElementControlHeader.java b/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/properties/ElementControlHeader.java index 31c1301fb38..d095af0e215 100644 --- a/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/properties/ElementControlHeader.java +++ b/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/properties/ElementControlHeader.java @@ -33,7 +33,7 @@ public class ElementControlHeader implements Serializable private static final long serialVersionUID = 1L; /* - * Version number for this header. This is used to ensure that all of the critical header information + * Version number for this header. This is used to ensure that all the critical header information * is read in a back-level version of the GAF. The default is 0 to indicate that the instance came from * a version of the GAF that does not have a version number encoded. */ @@ -94,7 +94,7 @@ public ElementControlHeader(ElementControlHeader template) /** * Return the version of this header. This is used by the OMRS to determine if it is back level and * should not process events from a source that is more advanced because it does not have the ability - * to receive all of the header properties. + * to receive all the header properties. * * @return long version number - the value is incremented each time a new non-informational field is added * to the audit header. @@ -108,7 +108,7 @@ public long getHeaderVersion() /** * Return the version of this header. This is used by the OMRS to determine if it is back level and * should not process events from a source that is more advanced because it does not have the ability - * to receive all of the header properties. + * to receive all the header properties. * * @param headerVersion long version number - the value is incremented each time a new non-informational field is added * to the audit header. diff --git a/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/search/SequencingOrder.java b/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/search/SequencingOrder.java index e4ad9949574..ac29c9d1c9d 100644 --- a/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/search/SequencingOrder.java +++ b/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/search/SequencingOrder.java @@ -14,7 +14,7 @@ /** * SequencingOrder is used for search requests against a metadata collection. It defines how the results should * to be ordered before they are returned. This is particularly important when the results are to returned - * over multiple pages since the caller does not have all of the results at once to perform the sort themselves. + * over multiple pages since the caller does not have all the results at once to perform the sort themselves. * * The sequencing order values are: *
    diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/Connector.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/Connector.java index 234f2cc8f4b..dee627e8d2f 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/Connector.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/Connector.java @@ -54,7 +54,7 @@ *

    *

    * Both the connector and the connector provider have base classes (ConnectorBase and - * ConnectorProviderBase respectively) that implement all of the standard methods. The connector developer extends + * ConnectorProviderBase respectively) that implement all the standard methods. The connector developer extends * these classes to add the specific methods to manage the asset and configure the base classes. *

    */ @@ -135,7 +135,7 @@ public abstract ConnectedAssetProperties getConnectedAssetProperties(String user /** - * Retrieve all of the statistics gathered by the connector. + * Retrieve all the statistics gathered by the connector. * * @return name-value pairs for the statistics */ diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/ConnectorBase.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/ConnectorBase.java index 75ad207e429..7200688e510 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/ConnectorBase.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/ConnectorBase.java @@ -29,7 +29,7 @@ * identifier, a connection object and a metadata properties object for its connected asset. * These are supplied to the connector during its initialization. * - * The ConnectorBase base class implements all of the methods required by the Connector interface. + * The ConnectorBase base class implements all the methods required by the Connector interface. * Each specific implementation of a connector then extends this interface to add the methods to work with the * particular type of asset it supports. For example, a JDBC connector would add the standard JDBC SQL interface, the * OMRS Connectors add the metadata repository management APIs... diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/ConnectorBroker.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/ConnectorBroker.java index 9445db31403..28feb334add 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/ConnectorBroker.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/ConnectorBroker.java @@ -18,7 +18,7 @@ /** * The ConnectorBroker is a generic factory for Open Connector Framework (OCF) Connectors. - * The OCF provides a default implementation because all of the implementation that is specific to a + * The OCF provides a default implementation because all the implementation that is specific to a * particular type of connector is delegated to the connector provider specified in the connection. */ public class ConnectorBroker diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/ConnectorProvider.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/ConnectorProvider.java index 818aa295b8f..aee0c587903 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/ConnectorProvider.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/ConnectorProvider.java @@ -46,7 +46,7 @@ public abstract class ConnectorProvider * Creates a new instance of a connector using the information from the connection and the properties * from the subclass(es). * - * @param connection connection that should have all of the properties needed by the Connector Provider + * @param connection connection that should have all the properties needed by the Connector Provider * to create a connector instance. * @return new connector instance. * @throws ConnectionCheckedException an error with the connection. @@ -59,7 +59,7 @@ public abstract class ConnectorProvider * Creates a new instance of a connector using the information from the connection and the properties * from the subclass(es). * - * @param connection connection that should have all of the properties needed by the Connector Provider + * @param connection connection that should have all the properties needed by the Connector Provider * to create a connector instance. * @return Connector instance of the connector. * @throws ConnectionCheckedException if there are missing or invalid properties in the connection diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/ConnectorProviderBase.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/ConnectorProviderBase.java index bf948792acd..dfc886fee3c 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/ConnectorProviderBase.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/ConnectorProviderBase.java @@ -20,7 +20,7 @@ import java.util.UUID; /** - * ConnectorProviderBase is a base class for a connector provider. It manages all of the class loading + * ConnectorProviderBase is a base class for a connector provider. It manages all the class loading * for subclass implementations of the connector provider along with the generation of new connector guids. * * ConnectorProviderBase creates a connector instance with the class name from the private variable called @@ -199,7 +199,7 @@ public Connector getConnector(Connection connection) throws ConnectionCheckedExc /** * Creates a new instance of a connector based on the information in the supplied connection. * - * @param connection connection that should have all of the properties needed by the Connector Provider + * @param connection connection that should have all the properties needed by the Connector Provider * to create a connector instance. * @return Connector instance of the connector. * @throws ConnectionCheckedException if there are missing or invalid properties in the connection diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/ffdc/OCFErrorCode.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/ffdc/OCFErrorCode.java index 40d743e62cf..a108137dd37 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/ffdc/OCFErrorCode.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/ffdc/OCFErrorCode.java @@ -132,7 +132,7 @@ public enum OCFErrorCode implements ExceptionMessageSet "Verify that the endpoint information is correct and the server that supports it is operational, then retry the request."), PROPERTIES_NOT_AVAILABLE(404, "OCF-PROPERTIES-404-002", "Exception with error message \"{0}\" was returned to object {1} resulted from a request for connected asset properties", - "The requested action is not able to complete which may mean that the server is not able to return all of the properties associated with the asset.", + "The requested action is not able to complete which may mean that the server is not able to return all the properties associated with the asset.", "Verify that the endpoint information is correct and the server that supports it is operational, then retry the request."), UNKNOWN_SCHEMA_TYPE(404, "OCF-PROPERTIES-404-003", "{0} retrieved a schema attribute of type {1} which does not have an associated schema type. The schema attribute is from metadata " + diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetCertification.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetCertification.java index f5f1c6831f0..c618dce6936 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetCertification.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetCertification.java @@ -32,7 +32,7 @@ public class AssetCertification extends AssetReferenceable /** * Bean constructor * - * @param certificationBean bean containing all of the parameters + * @param certificationBean bean containing all the parameters */ public AssetCertification(Certification certificationBean) { @@ -53,7 +53,7 @@ public AssetCertification(Certification certificationBean) * Bean constructor with parent asset * * @param parentAsset descriptor for parent asset - * @param certificationBean bean with all of the properties in it + * @param certificationBean bean with all the properties in it */ public AssetCertification(AssetDescriptor parentAsset, Certification certificationBean) @@ -93,7 +93,7 @@ public AssetCertification(AssetDescriptor parentAsset, AssetCertification templa /** - * Return the bean with all of the properties in it. + * Return the bean with all the properties in it. * * @return certification bean */ diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetComment.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetComment.java index 226ea6be127..7d9b13a09f2 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetComment.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetComment.java @@ -29,7 +29,7 @@ public class AssetComment extends AssetElementHeader /** * Bean constructor * - * @param commentBean bean that contains all of the properties + * @param commentBean bean that contains all the properties * @param commentReplies any replies to this comment */ public AssetComment(Comment commentBean, @@ -64,7 +64,7 @@ public AssetComment(Comment commentBean, * Bean constructor with parent asset and replies * * @param parentAsset descriptor for parent asset - * @param commentBean bean that contains all of the properties + * @param commentBean bean that contains all the properties * @param commentReplies any replies to this comment */ public AssetComment(AssetDescriptor parentAsset, @@ -127,7 +127,7 @@ public AssetComment(AssetDescriptor parentAsset, AssetComment templateComment) /** - * Return the bean with all of the properties. + * Return the bean with all the properties. * * @return Comment bean */ diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetComplexSchemaType.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetComplexSchemaType.java index 62768771629..d9c079e84b0 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetComplexSchemaType.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetComplexSchemaType.java @@ -91,7 +91,7 @@ protected void setBean(ComplexSchemaType bean) /** - * Return the bean with all of the properties. + * Return the bean with all the properties. * * @return complex element bean */ diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetDescriptor.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetDescriptor.java index 85f43a4485d..8fcc7a0fd08 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetDescriptor.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetDescriptor.java @@ -10,7 +10,7 @@ import java.util.Objects; /** - * This is the base class for a connected asset. It is passed to all of the embedded property objects so the name + * This is the base class for a connected asset. It is passed to all the embedded property objects so the name * and type can be used for error messages and other diagnostics. It also carries the URL of the asset in the * metadata repository where this is known to enable properties to be retrieved on request. */ @@ -44,7 +44,7 @@ protected AssetDescriptor() * Bean constructor - the asset descriptor is effectively empty - and the protected * set methods need to be called to add useful content to it. * - * @param assetBean bean containing all of the properties + * @param assetBean bean containing all the properties */ public AssetDescriptor(Asset assetBean) { @@ -80,7 +80,7 @@ public AssetDescriptor(AssetDescriptor templateAssetDescriptor) /** * Set up private attributes based on the supplied asset bean. * - * @param assetBean bean containing all of the properties + * @param assetBean bean containing all the properties */ protected void setAssetBean(Asset assetBean) { diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetDetail.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetDetail.java index 4d5d67c0c63..c52cc6dd69a 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetDetail.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetDetail.java @@ -7,7 +7,7 @@ import java.util.Objects; /** - * AssetDetail extends AssetSummary to provide all of the properties related to this asset. It includes: + * AssetDetail extends AssetSummary to provide all the properties related to this asset. It includes: *
      *
    • AssetProperties - properties unique to the particular type of asset including any vendor-specific facets.
    • *
    • ExternalIdentifiers - list of identifiers for this asset that are used in other systems.
    • diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetElementHeader.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetElementHeader.java index 425a9d4fda5..5d428751ceb 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetElementHeader.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetElementHeader.java @@ -100,7 +100,7 @@ protected AssetElementHeader(AssetDescriptor parentAsset, AssetElementHeader ass /** * Set up the bean that contains the properties of the element header. * - * @param elementBaseBean bean containing all of the properties + * @param elementBaseBean bean containing all the properties */ protected void setBean(ElementBase elementBaseBean) { diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetEnumSchemaType.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetEnumSchemaType.java index df280806220..458c761b43e 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetEnumSchemaType.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetEnumSchemaType.java @@ -95,7 +95,7 @@ public AssetEnumSchemaType(AssetDescriptor parentAsset, /** - * Return the bean with all of the properties. + * Return the bean with all the properties. * * @return enum element bean */ diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetExternalIdentifier.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetExternalIdentifier.java index e2d8fb24a31..3e3077ecbbc 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetExternalIdentifier.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetExternalIdentifier.java @@ -23,7 +23,7 @@ public class AssetExternalIdentifier extends AssetReferenceable /** * Bean constructor * - * @param externalIdentifierBean bean containing all of the properties + * @param externalIdentifierBean bean containing all the properties */ public AssetExternalIdentifier(ExternalIdentifier externalIdentifierBean) { @@ -44,7 +44,7 @@ public AssetExternalIdentifier(ExternalIdentifier externalIdentifierBean) * Bean constructor with parent asset * * @param parentAsset descriptor for parent asset - * @param externalIdentifierBean bean containing all of the properties + * @param externalIdentifierBean bean containing all the properties */ public AssetExternalIdentifier(AssetDescriptor parentAsset, ExternalIdentifier externalIdentifierBean) @@ -84,7 +84,7 @@ public AssetExternalIdentifier(AssetDescriptor parentAsset, AssetExternalIdentif /** - * Return the bean with all of the properties - used in the cloning process. + * Return the bean with all the properties - used in the cloning process. * * @return ExternalIdentifier bean */ diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetExternalReference.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetExternalReference.java index 2371841b0c7..d635119f7aa 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetExternalReference.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetExternalReference.java @@ -18,7 +18,7 @@ public class AssetExternalReference extends AssetReferenceable /** * Bean constructor * - * @param externalReferenceBean bean with all of the properties in it + * @param externalReferenceBean bean with all the properties in it */ public AssetExternalReference(ExternalReference externalReferenceBean) { @@ -39,7 +39,7 @@ public AssetExternalReference(ExternalReference externalReferenceBean) * Bean constructor with parent asset * * @param parentAsset descriptor for parent asset - * @param externalReferenceBean bean with all of the properties in it + * @param externalReferenceBean bean with all the properties in it */ public AssetExternalReference(AssetDescriptor parentAsset, ExternalReference externalReferenceBean) @@ -81,7 +81,7 @@ public AssetExternalReference(AssetDescriptor parentAsset, AssetExternalReferenc /** * Return the bean - used in the cloning process. * - * @return bean with all of the properties in + * @return bean with all the properties in */ protected ExternalReference getExternalReferenceBean() { diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetExternalSchemaType.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetExternalSchemaType.java index ef191133b63..a550cdd2835 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetExternalSchemaType.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetExternalSchemaType.java @@ -95,7 +95,7 @@ public AssetExternalSchemaType(AssetDescriptor parentAsset, /** - * Return the bean with all of the properties. + * Return the bean with all the properties. * * @return schema choice bean */ diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetInformalTag.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetInformalTag.java index a0005f0cb8b..c9c5d7c623e 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetInformalTag.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetInformalTag.java @@ -93,7 +93,7 @@ public AssetInformalTag(AssetDescriptor parentAsset, AssetInformalTag templateIn /** - * Return the bean with all of the properties in it + * Return the bean with all the properties in it * * @return informal tag bean */ diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetLicense.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetLicense.java index 7ebaef18bb7..2b46c5197f0 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetLicense.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetLicense.java @@ -28,7 +28,7 @@ public class AssetLicense extends AssetReferenceable /** * Bean constructor * - * @param licenseBean bean with all of the properties in it + * @param licenseBean bean with all the properties in it */ public AssetLicense(License licenseBean) { @@ -49,7 +49,7 @@ public AssetLicense(License licenseBean) * Bean constructor with parent asset * * @param parentAsset descriptor for parent asset - * @param licenseBean bean with all of the properties in it + * @param licenseBean bean with all the properties in it */ public AssetLicense(AssetDescriptor parentAsset, License licenseBean) @@ -89,7 +89,7 @@ public AssetLicense(AssetDescriptor parentAsset, AssetLicense templateLicense) /** - * Return the bean with all of the properties. + * Return the bean with all the properties. * * @return license bean */ diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetLiteralSchemaType.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetLiteralSchemaType.java index d15d858b3f1..c424850ee45 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetLiteralSchemaType.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetLiteralSchemaType.java @@ -95,7 +95,7 @@ public AssetLiteralSchemaType(AssetDescriptor parentAsset, /** - * Return the bean with all of the properties. + * Return the bean with all the properties. * * @return primitive element bean */ diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetLocation.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetLocation.java index eebd8e816bd..149da4b511e 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetLocation.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetLocation.java @@ -21,7 +21,7 @@ public class AssetLocation extends AssetReferenceable /** * Bean constructor * - * @param locationBean bean containing all of the properties + * @param locationBean bean containing all the properties */ public AssetLocation(Location locationBean) { @@ -42,7 +42,7 @@ public AssetLocation(Location locationBean) * Bean constructor and parent asset * * @param parentAsset descriptor for parent asset - * @param locationBean bean containing all of the properties + * @param locationBean bean containing all the properties */ public AssetLocation(AssetDescriptor parentAsset, Location locationBean) @@ -82,7 +82,7 @@ public AssetLocation(AssetDescriptor parentAsset, AssetLocation templateLocatio /** - * Return the bean with all of the properties in it. + * Return the bean with all the properties in it. * * @return location bean */ diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetMapSchemaType.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetMapSchemaType.java index 951074f9b28..dbee85c544c 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetMapSchemaType.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetMapSchemaType.java @@ -76,7 +76,7 @@ public AssetMapSchemaType(AssetDescriptor parentAsset, AssetMapSchemaType templa /** - * Return the bean with all of the properties. + * Return the bean with all the properties. * * @return map element bean */ diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetMeaning.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetMeaning.java index c7d3a995f21..ad546f72bd0 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetMeaning.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetMeaning.java @@ -21,7 +21,7 @@ public class AssetMeaning extends AssetElementHeader /** * Bean constructor * - * @param meaningBean - bean containing all of the properties + * @param meaningBean - bean containing all the properties */ public AssetMeaning(Meaning meaningBean) { @@ -42,7 +42,7 @@ public AssetMeaning(Meaning meaningBean) * Bean constructor * * @param parentAsset descriptor for parent asset - * @param meaningBean - bean containing all of the properties + * @param meaningBean - bean containing all the properties */ public AssetMeaning(AssetDescriptor parentAsset, Meaning meaningBean) @@ -82,7 +82,7 @@ public AssetMeaning(AssetDescriptor parentAsset, AssetMeaning templateMeaning) /** - * Return the bean containing all of the properties + * Return the bean containing all the properties * * @return meaning bean */ diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetNote.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetNote.java index 9187aa54a79..80a2575869c 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetNote.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetNote.java @@ -85,7 +85,7 @@ public AssetNote(AssetDescriptor parentAsset, AssetNote templateNote) /** - * Return the bean with all of the properties. + * Return the bean with all the properties. * * @return note bean */ diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetPrimitiveSchemaType.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetPrimitiveSchemaType.java index 64f939d4fcc..7e8604f6ba0 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetPrimitiveSchemaType.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetPrimitiveSchemaType.java @@ -95,7 +95,7 @@ public AssetPrimitiveSchemaType(AssetDescriptor parentAsset, /** - * Return the bean with all of the properties. + * Return the bean with all the properties. * * @return primitive element bean */ diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetRating.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetRating.java index 4a1fb8d9cc5..acd791d2e02 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetRating.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetRating.java @@ -28,7 +28,7 @@ public class AssetRating extends AssetElementHeader /** * Bean constructor * - * @param ratingBean bean containing all of the properties + * @param ratingBean bean containing all the properties */ public AssetRating(Rating ratingBean) { @@ -49,7 +49,7 @@ public AssetRating(Rating ratingBean) * Bean constructor with parent asset * * @param parentAsset descriptor for parent asset - * @param ratingBean bean containing all of the properties + * @param ratingBean bean containing all the properties */ public AssetRating(AssetDescriptor parentAsset, Rating ratingBean) @@ -92,7 +92,7 @@ public AssetRating(AssetDescriptor parentAsset, AssetRating templateRating) /** - * Return the bean with all of the properties. + * Return the bean with all the properties. * * @return rating bean */ diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetReferenceable.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetReferenceable.java index 5d49a10b8a0..8ae0f0a4a93 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetReferenceable.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetReferenceable.java @@ -42,7 +42,7 @@ protected AssetReferenceable(AssetDescriptor parentAsset) /** * Bean constructor * - * @param referenceableBean bean containing all of the properties + * @param referenceableBean bean containing all the properties */ protected AssetReferenceable(Referenceable referenceableBean) { @@ -108,7 +108,7 @@ public AssetReferenceable(AssetDescriptor parentAsset, AssetReferenceable templa /** * Set up the bean that contains the properties of the referenceable. * - * @param referenceableBean bean containing all of the properties + * @param referenceableBean bean containing all the properties */ protected void setBean(Referenceable referenceableBean) { @@ -120,7 +120,7 @@ protected void setBean(Referenceable referenceableBean) /** * Return the bean for this referenceable. * - * @return Referenceable object with all of the properties + * @return Referenceable object with all the properties */ protected Referenceable getReferenceableBean() { diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetSchemaAttribute.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetSchemaAttribute.java index 61fc7e8af58..75c46fe7602 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetSchemaAttribute.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetSchemaAttribute.java @@ -25,7 +25,7 @@ public class AssetSchemaAttribute extends AssetReferenceable /** * Bean constructor used by subclasses * - * @param schemaAttributeBean bean containing all of the properties + * @param schemaAttributeBean bean containing all the properties */ protected AssetSchemaAttribute(SchemaAttribute schemaAttributeBean) { @@ -46,7 +46,7 @@ protected AssetSchemaAttribute(SchemaAttribute schemaAttributeBean) * Bean constructor with parent asset * * @param parentAsset description of the asset that this schema attribute is attached to. - * @param schemaAttributeBean bean containing all of the properties + * @param schemaAttributeBean bean containing all the properties */ public AssetSchemaAttribute(AssetDescriptor parentAsset, SchemaAttribute schemaAttributeBean) @@ -86,7 +86,7 @@ public AssetSchemaAttribute(AssetDescriptor parentAsset, AssetSchemaAttribute te /** - * Return the bean with all of the properties. + * Return the bean with all the properties. * * @return schema attribute bean */ @@ -196,7 +196,7 @@ public DataItemSortOrder getSortOrder() /** * Return the SchemaType that relates to the type of this attribute. It is possible to query its type and cast it to - * specific types of schema type to retrieve all of the values. + * specific types of schema type to retrieve all the values. * * @return SchemaType object */ @@ -209,7 +209,7 @@ public AssetSchemaType getLocalSchemaType() /** * Return the SchemaType that relates to the type of this attribute. It is possible to query its type and cast it to - * specific types of schema type to retrieve all of the values. + * specific types of schema type to retrieve all the values. * * @return SchemaType object */ diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetSchemaAttributeRelationship.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetSchemaAttributeRelationship.java index cdfe91c00ae..6c29aa61f6e 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetSchemaAttributeRelationship.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetSchemaAttributeRelationship.java @@ -21,7 +21,7 @@ public class AssetSchemaAttributeRelationship extends AssetPropertyBase /** * Bean constructor * - * @param schemaAttributeRelationshipBean bean containing all of the properties + * @param schemaAttributeRelationshipBean bean containing all the properties */ public AssetSchemaAttributeRelationship(SchemaAttributeRelationship schemaAttributeRelationshipBean) { @@ -42,7 +42,7 @@ public AssetSchemaAttributeRelationship(SchemaAttributeRelationship schemaAttrib * Bean constructor with parent asset * * @param parentAsset descriptor of parent asset - * @param schemaAttributeRelationship bean containing all of the properties + * @param schemaAttributeRelationship bean containing all the properties */ public AssetSchemaAttributeRelationship(AssetDescriptor parentAsset, SchemaAttributeRelationship schemaAttributeRelationship) @@ -82,7 +82,7 @@ public AssetSchemaAttributeRelationship(AssetDescriptor parentAsset, AssetSchema /** - * Return the bean with all of the properties + * Return the bean with all the properties * * @return schema link bean */ diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetSchemaElement.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetSchemaElement.java index 722b50ab812..25887b3dcc9 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetSchemaElement.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetSchemaElement.java @@ -66,7 +66,7 @@ public AssetSchemaElement(AssetDescriptor parentAsset, AssetSchemaElement templa /** * Set up the bean that contains the properties of the schema element. * - * @param schemaElementBean bean containing all of the properties + * @param schemaElementBean bean containing all the properties */ protected void setBean(SchemaElement schemaElementBean) { diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetSchemaTypeChoice.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetSchemaTypeChoice.java index 3121d8f5fb7..1dc33de0cdc 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetSchemaTypeChoice.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetSchemaTypeChoice.java @@ -97,7 +97,7 @@ public AssetSchemaTypeChoice(AssetDescriptor parentAsset, /** - * Return the bean with all of the properties. + * Return the bean with all the properties. * * @return schema choice bean */ diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetSecurityTags.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetSecurityTags.java index 49a6852e57b..e5f30c0a310 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetSecurityTags.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetSecurityTags.java @@ -22,7 +22,7 @@ public class AssetSecurityTags extends AssetPropertyBase /** * Bean constructor * - * @param securityTags - bean containing all of the properties + * @param securityTags - bean containing all the properties */ public AssetSecurityTags(SecurityTags securityTags) { @@ -43,7 +43,7 @@ public AssetSecurityTags(SecurityTags securityTags) * Bean constructor * * @param parentAsset descriptor for parent asset - * @param securityTags - bean containing all of the properties + * @param securityTags - bean containing all the properties */ public AssetSecurityTags(AssetDescriptor parentAsset, SecurityTags securityTags) @@ -83,7 +83,7 @@ public AssetSecurityTags(AssetDescriptor parentAsset, AssetSecurityTags template /** - * Return the bean containing all of the properties + * Return the bean containing all the properties * * @return bean */ diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetSimpleSchemaType.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetSimpleSchemaType.java index c61d429c391..78e276d1158 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetSimpleSchemaType.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetSimpleSchemaType.java @@ -77,7 +77,7 @@ public AssetSimpleSchemaType(AssetDescriptor parentAsset, /** - * Return the bean with all of the properties. + * Return the bean with all the properties. * * @return primitive element bean */ diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/ConnectedAssetProperties.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/ConnectedAssetProperties.java index a325e28756e..53731fb9a0a 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/ConnectedAssetProperties.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/ConnectedAssetProperties.java @@ -17,7 +17,7 @@ * The ConnectedAssetProperties returns metadata about the asset at three levels of detail: *
        *
      • assetSummary used for displaying details of the asset in summary lists or hover text
      • - *
      • assetDetail used to display all of the information known about the asset with summaries + *
      • assetDetail used to display all the information known about the asset with summaries * of the relationships to other metadata entities
      • *
      • assetUniverse used to define the broader context for the asset
      • *
      @@ -90,7 +90,7 @@ public ConnectedAssetProperties(ConnectedAssetProperties templateProperties) /** - * Returns all of the detail of the asset and information connected to it in organized in the assetUniverse + * Returns all the detail of the asset and information connected to it in organized in the assetUniverse * structure. * * @return AssetUniverse universe object diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/ConnectionProperties.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/ConnectionProperties.java index c718ca88086..46bfffdf6d5 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/ConnectionProperties.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/ConnectionProperties.java @@ -146,7 +146,7 @@ public ConnectionProperties(AssetDescriptor parentAsset, ConnectionProperties t /** - * Return the bean with all of the properties. + * Return the bean with all the properties. * * @return connection bean */ diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/EmbeddedConnectionProperties.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/EmbeddedConnectionProperties.java index a4fbf2c1424..4b551037883 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/EmbeddedConnectionProperties.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/EmbeddedConnectionProperties.java @@ -22,7 +22,7 @@ public class EmbeddedConnectionProperties extends AssetPropertyBase /** * Bean constructor * - * @param embeddedConnectionBean bean containing all of the properties + * @param embeddedConnectionBean bean containing all the properties */ public EmbeddedConnectionProperties(EmbeddedConnection embeddedConnectionBean) { @@ -43,7 +43,7 @@ public EmbeddedConnectionProperties(EmbeddedConnection embeddedConnectionBean) * Bean constructor with parent asset * * @param parentAsset descriptor of parent asset - * @param embeddedConnectionBean bean containing all of the properties + * @param embeddedConnectionBean bean containing all the properties */ public EmbeddedConnectionProperties(AssetDescriptor parentAsset, EmbeddedConnection embeddedConnectionBean) @@ -83,7 +83,7 @@ public EmbeddedConnectionProperties(AssetDescriptor parentAsset, EmbeddedConnect /** - * Return the bean with all of the properties + * Return the bean with all the properties * * @return schema link bean */ diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/EndpointProperties.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/EndpointProperties.java index 681a1fe49d3..7d96ffa68e7 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/EndpointProperties.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/EndpointProperties.java @@ -44,7 +44,7 @@ * *
    • * encryptionMethod - Describes the encryption method to use (if any). This is an open value allowing - * information needed by the connector user to retrieve all of the information they need to work with + * information needed by the connector user to retrieve all the information they need to work with * the endpoint. *
    • *
    • @@ -140,7 +140,7 @@ public EndpointProperties(AssetDescriptor parentAsset, /** - * Return the Endpoint bean that contains all of the properties. + * Return the Endpoint bean that contains all the properties. * * @return Endpoint bean */ diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/RelatedAssetProperties.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/RelatedAssetProperties.java index 9191b61fb18..c84452254d2 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/RelatedAssetProperties.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/RelatedAssetProperties.java @@ -16,7 +16,7 @@ * The RelatedAssetProperties returns metadata about the asset at three levels of detail: *
        *
      • assetSummary - used for displaying details of the asset in summary lists or hover text
      • - *
      • assetDetail - used to display all of the information known about the asset with summaries + *
      • assetDetail - used to display all the information known about the asset with summaries * of the relationships to other metadata entities
      • *
      • assetUniverse - used to define the broader context for the asset
      • *
      @@ -105,7 +105,7 @@ public RelatedAssetProperties(RelatedAssetProperties templateProperties) /** - * Returns all of the detail of the asset and information connected to it in organized in the assetUniverse + * Returns all the detail of the asset and information connected to it in organized in the assetUniverse * structure. * * @return AssetUniverse universe object diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/VirtualConnectionProperties.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/VirtualConnectionProperties.java index 8ed5d3475aa..ed685415008 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/VirtualConnectionProperties.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/VirtualConnectionProperties.java @@ -102,7 +102,7 @@ public VirtualConnectionProperties(AssetDescriptor parentAsset, VirtualConnectio /** - * Return the bean with all of the properties. + * Return the bean with all the properties. * * @return connection bean */ diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/beans/Endpoint.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/beans/Endpoint.java index 3b7c3ec0b3d..e0cb102daeb 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/beans/Endpoint.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/beans/Endpoint.java @@ -48,7 +48,7 @@ *
    • *
    • * encryptionMethod - Describes the encryption method to use (if any). This is an open value allowing - * information needed by the connector user to retrieve all of the information they need to work with + * information needed by the connector user to retrieve all the information they need to work with * the endpoint. *
    • *
    • diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/MockConnectionCheckedExceptionConnectorProvider.java b/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/MockConnectionCheckedExceptionConnectorProvider.java index 1f311de77d9..d05b75bb4f1 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/MockConnectionCheckedExceptionConnectorProvider.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/MockConnectionCheckedExceptionConnectorProvider.java @@ -26,7 +26,7 @@ public MockConnectionCheckedExceptionConnectorProvider() /** * Creates a new instance of a connector based on the information in the supplied connection. * - * @param connection connection that should have all of the properties needed by the Connector Provider + * @param connection connection that should have all the properties needed by the Connector Provider * to create a connector instance. * @return Connector instance of the connector. * @throws ConnectionCheckedException if there are missing or invalid properties in the connection diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/MockConnectorCheckedExceptionConnectorProvider.java b/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/MockConnectorCheckedExceptionConnectorProvider.java index c6dae7acbc3..d3ac6b55a2b 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/MockConnectorCheckedExceptionConnectorProvider.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/MockConnectorCheckedExceptionConnectorProvider.java @@ -27,7 +27,7 @@ public MockConnectorCheckedExceptionConnectorProvider() /** * Creates a new instance of a connector based on the information in the supplied connection. * - * @param connection connection that should have all of the properties needed by the Connector Provider + * @param connection connection that should have all the properties needed by the Connector Provider * to create a connector instance. * @return Connector instance of the connector. * @throws ConnectionCheckedException if there are missing or invalid properties in the connection diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/MockEmptyConnectorProvider.java b/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/MockEmptyConnectorProvider.java index 241bd0c5e2c..55a8a92b049 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/MockEmptyConnectorProvider.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/MockEmptyConnectorProvider.java @@ -72,7 +72,7 @@ public void setTestRuntimeException(RuntimeException exception) /** * Creates a new instance of a connector based on the information in the supplied connection. * - * @param connection connection that should have all of the properties needed by the Connector Provider + * @param connection connection that should have all the properties needed by the Connector Provider * to create a connector instance. * @return Connector instance of the connector. * @throws ConnectionCheckedException if there are missing or invalid properties in the connection diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/MockRuntimeExceptionConnector.java b/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/MockRuntimeExceptionConnector.java index 32bcc2c71b8..0f47cb736b8 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/MockRuntimeExceptionConnector.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/MockRuntimeExceptionConnector.java @@ -29,7 +29,7 @@ * identifier, a connection object and a metadata properties object for its connected asset. * These are supplied to the connector during its initialization. * - * The ConnectorBase base class implements all of the methods required by the Connector interface. + * The ConnectorBase base class implements all the methods required by the Connector interface. * Each specific implementation of a connector then extends this interface to add the methods to work with the * particular type of asset it supports. For example, a JDBC connector would add the standard JDBC SQL interface, the * OMRS Connectors add the metadata repository management APIs... diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/MockRuntimeExceptionConnectorProvider.java b/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/MockRuntimeExceptionConnectorProvider.java index 19af7482c01..427c63241a4 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/MockRuntimeExceptionConnectorProvider.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/MockRuntimeExceptionConnectorProvider.java @@ -27,7 +27,7 @@ public MockRuntimeExceptionConnectorProvider() /** * Creates a new instance of a connector based on the information in the supplied connection. * - * @param connection connection that should have all of the properties needed by the Connector Provider + * @param connection connection that should have all the properties needed by the Connector Provider * to create a connector instance. * @return Connector instance of the connector. * @throws ConnectionCheckedException if there are missing or invalid properties in the connection diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/properties/TestAssetFeedback.java b/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/properties/TestAssetFeedback.java index a080b974623..5a8d8e86a0b 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/properties/TestAssetFeedback.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/properties/TestAssetFeedback.java @@ -107,7 +107,7 @@ private AssetFeedback getAnotherDifferentObject() } /** - * Validate the subclass constructor works all of the way up the inheritance hierarchy. + * Validate the subclass constructor works all the way up the inheritance hierarchy. */ @Test public void testSubclassInitialization() { diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/properties/TestAssetUniverse.java b/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/properties/TestAssetUniverse.java index 211f27e029e..672b0b73d42 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/properties/TestAssetUniverse.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/properties/TestAssetUniverse.java @@ -244,7 +244,7 @@ private AssetDetail getAnotherDifferentObject() /** - * Validate the subclass constructor works all of the way up the inheritance hierarchy. + * Validate the subclass constructor works all the way up the inheritance hierarchy. */ @Test public void testSubclassInitialization() { diff --git a/open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/ElementControlHeader.java b/open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/ElementControlHeader.java index ae81e19db2e..114a602ee6f 100644 --- a/open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/ElementControlHeader.java +++ b/open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/ElementControlHeader.java @@ -31,7 +31,7 @@ public class ElementControlHeader implements Serializable private static final long serialVersionUID = 1L; /* - * Version number for this header. This is used to ensure that all of the critical header information + * Version number for this header. This is used to ensure that all the critical header information * in read in a back-level version of the OCF. The default is 0 to indicate that the instance came from * a version of the OCF that does not have a version number encoded. */ @@ -92,7 +92,7 @@ public ElementControlHeader(ElementControlHeader template) /** * Return the version of this header. This is used by the OMRS to determine if it is back level and * should not process events from a source that is more advanced because it does not have the ability - * to receive all of the header properties. + * to receive all the header properties. * * @return long version number - the value is incremented each time a new non-informational field is added * to the audit header. @@ -106,7 +106,7 @@ public long getHeaderVersion() /** * Return the version of this header. This is used by the OMRS to determine if it is back level and * should not process events from a source that is more advanced because it does not have the ability - * to receive all of the header properties. + * to receive all the header properties. * * @param headerVersion long version number - the value is incremented each time a new non-informational field is added * to the audit header. diff --git a/open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/PropertyBase.java b/open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/PropertyBase.java index c1150ad41dc..c332f85dd1f 100644 --- a/open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/PropertyBase.java +++ b/open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/PropertyBase.java @@ -48,7 +48,7 @@ public abstract class PropertyBase implements Serializable /* - * Version number for this header. This is used to ensure that all of the critical header information + * Version number for this header. This is used to ensure that all the critical header information * in read in a back-level version of the ODF. The default is 0 to indicate that the instance came from * a version of the OCF that does not have a version number encoded. */ @@ -83,7 +83,7 @@ public PropertyBase(PropertyBase template) /** * Return the version of this header. This is used by the OMAS to determine if it is back level and * should not process events from a source that is more advanced because it does not have the ability - * to receive all of the header properties. + * to receive all the header properties. * * @return long version number - the value is incremented each time a new non-informational field is added * to the audit header. @@ -97,7 +97,7 @@ public long getHeaderVersion() /** * Return the version of this header. This is used by the OMAS to determine if it is back level and * should not process events from a source that is more advanced because it does not have the ability - * to receive all of the header properties. + * to receive all the header properties. * * @param headerVersion long version number - the value is incremented each time a new non-informational field is added * to the audit header. diff --git a/open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/SuspectDuplicateAnnotation.java b/open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/SuspectDuplicateAnnotation.java index 502041a203a..a23c0e70865 100644 --- a/open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/SuspectDuplicateAnnotation.java +++ b/open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/SuspectDuplicateAnnotation.java @@ -92,7 +92,7 @@ public void setDuplicateAnchorGUIDs(List duplicateAnchorGUIDs) /** - * Return the list of property names whose values match in all of the duplicate suspects. + * Return the list of property names whose values match in all the duplicate suspects. * * @return list of property names */ @@ -112,7 +112,7 @@ else if (matchingPropertyNames.isEmpty()) /** - * Set up the list of property names whose values match in all of the duplicate suspects. + * Set up the list of property names whose values match in all the duplicate suspects. * * @param matchingPropertyNames list of property names */ @@ -123,7 +123,7 @@ public void setMatchingPropertyNames(List matchingPropertyNames) /** - * Return the list of classifications that match in all of the duplicate suspects. + * Return the list of classifications that match in all the duplicate suspects. * * @return list of classification names */ @@ -143,7 +143,7 @@ else if (matchingClassificationNames.isEmpty()) /** - * Set up the list of classifications that match in all of the duplicate suspects. + * Set up the list of classifications that match in all the duplicate suspects. * * @param matchingClassificationNames list of classification names */ @@ -154,7 +154,7 @@ public void setMatchingClassificationNames(List matchingClassificationNa /** - * Return the list of unique identifiers for attachments that match in all of the duplicate suspects. + * Return the list of unique identifiers for attachments that match in all the duplicate suspects. * * @return list of string guids */ @@ -174,7 +174,7 @@ else if (matchingAttachmentGUIDs.isEmpty()) /** - * Set up the list of unique identifiers for attachments that match in all of the duplicate suspects. + * Set up the list of unique identifiers for attachments that match in all the duplicate suspects. * * @param matchingAttachmentGUIDs list of string guids */ @@ -185,7 +185,7 @@ public void setMatchingAttachmentGUIDs(List matchingAttachmentGUIDs) /** - * Return the list of relationships that are common across all of the duplicate suspects. + * Return the list of relationships that are common across all the duplicate suspects. * * @return list of string guids */ @@ -205,7 +205,7 @@ else if (matchingRelationshipGUIDs.isEmpty()) /** - * Set up the list of relationships that are common across all of the duplicate suspects. + * Set up the list of relationships that are common across all the duplicate suspects. * * @param matchingRelationshipGUIDs list of string guids */ diff --git a/open-metadata-implementation/governance-servers/data-engine-proxy-services/data-engine-proxy-connector/src/main/java/org/odpi/openmetadata/governanceservers/dataengineproxy/connectors/DataEngineConnectorBase.java b/open-metadata-implementation/governance-servers/data-engine-proxy-services/data-engine-proxy-connector/src/main/java/org/odpi/openmetadata/governanceservers/dataengineproxy/connectors/DataEngineConnectorBase.java index b2dd0b2a4da..9ce00de1afc 100644 --- a/open-metadata-implementation/governance-servers/data-engine-proxy-services/data-engine-proxy-connector/src/main/java/org/odpi/openmetadata/governanceservers/dataengineproxy/connectors/DataEngineConnectorBase.java +++ b/open-metadata-implementation/governance-servers/data-engine-proxy-services/data-engine-proxy-connector/src/main/java/org/odpi/openmetadata/governanceservers/dataengineproxy/connectors/DataEngineConnectorBase.java @@ -15,7 +15,7 @@ import java.util.List; /** - * Base implementation of a Data Engine Connector, implementing all of the required methods any Data Engine Connector + * Base implementation of a Data Engine Connector, implementing all the required methods any Data Engine Connector * is expected to provide (via the DataEngineInterface). It is an abstract class as on its own it does absolutely * nothing, and therefore a Data Engine Connector needs to extend it and override at least one of the methods to * actually do something. diff --git a/open-metadata-implementation/governance-servers/engine-host-services/engine-host-services-api/src/main/java/org/odpi/openmetadata/governanceservers/enginehostservices/ffdc/EngineHostServicesAuditCode.java b/open-metadata-implementation/governance-servers/engine-host-services/engine-host-services-api/src/main/java/org/odpi/openmetadata/governanceservers/enginehostservices/ffdc/EngineHostServicesAuditCode.java index 756092cc1b6..5a4f3899c1e 100644 --- a/open-metadata-implementation/governance-servers/engine-host-services/engine-host-services-api/src/main/java/org/odpi/openmetadata/governanceservers/enginehostservices/ffdc/EngineHostServicesAuditCode.java +++ b/open-metadata-implementation/governance-servers/engine-host-services/engine-host-services-api/src/main/java/org/odpi/openmetadata/governanceservers/enginehostservices/ffdc/EngineHostServicesAuditCode.java @@ -34,7 +34,7 @@ public enum EngineHostServicesAuditCode implements AuditLogMessageSet OMRSAuditLogRecordSeverity.STARTUP, "The engine host {0} has initialized", "The engine host services has completed initialization.", - "Verify that all of the configured engine services have successfully started, the configuration for their " + + "Verify that all the configured engine services have successfully started, the configuration for their " + "assigned governance engines has been retrieved from the Governance Engine OMAS by the engine host services " + "and the engine services are able to connect to their partner OMAS."), @@ -164,7 +164,7 @@ public enum EngineHostServicesAuditCode implements AuditLogMessageSet OMRSAuditLogRecordSeverity.SECURITY, "Engine host server {0} is not authorized to call the Governance Engine " + "OMAS running in server {1} on OMAG Server Platform {2} with userId {3}. The error message was: {4}", - "Some, or all of the metadata definitions needed for the governance engines are not accessible from the open" + + "Some, or all the metadata definitions needed for the governance engines are not accessible from the open" + "metadata ecosystem.", "The userId comes from the engine host's configuration document. It is stored as the localServerUserId. " + "The authorization failure may be limited to a single operation, or extend to all requests to the Governance " + @@ -256,10 +256,10 @@ public enum EngineHostServicesAuditCode implements AuditLogMessageSet OMRSAuditLogRecordSeverity.INFO, "All governance service configuration is being refreshed for governance engine {0}", "The engine host services will call the Governance Engine OMAS in the metadata server to " + - "retrieve details of all of the governance services configured for this engine." + + "retrieve details of all the governance services configured for this engine." + "During this process, some governance request may fail if the associated governance" + "service is only partially configured.", - "Monitor the engine host services to ensure all of the governance services are retrieved. " + + "Monitor the engine host services to ensure all the governance services are retrieved. " + "Then it is ready to process new governance requests."), FINISHED_ALL_GOVERNANCE_SERVICE_CONFIG("ENGINE-HOST-SERVICES-0029", @@ -267,7 +267,7 @@ public enum EngineHostServicesAuditCode implements AuditLogMessageSet "Refreshing all governance service configuration has being completed for governance engine {0}", "The governance engine is ready to receive governance requests for all successfully loaded " + "governance services.", - "No action is required as long as all of the expected governance services are loaded." + + "No action is required as long as all the expected governance services are loaded." + "If there are any governance services missing then validate the configuration of" + "the governance engine in the metadata server."), diff --git a/open-metadata-implementation/governance-servers/engine-host-services/engine-host-services-registration/src/main/java/org/odpi/openmetadata/governanceservers/enginehostservices/admin/GovernanceServiceHandler.java b/open-metadata-implementation/governance-servers/engine-host-services/engine-host-services-registration/src/main/java/org/odpi/openmetadata/governanceservers/enginehostservices/admin/GovernanceServiceHandler.java index cf339cf77f5..9c24d743670 100644 --- a/open-metadata-implementation/governance-servers/engine-host-services/engine-host-services-registration/src/main/java/org/odpi/openmetadata/governanceservers/enginehostservices/admin/GovernanceServiceHandler.java +++ b/open-metadata-implementation/governance-servers/engine-host-services/engine-host-services-registration/src/main/java/org/odpi/openmetadata/governanceservers/enginehostservices/admin/GovernanceServiceHandler.java @@ -172,7 +172,7 @@ public void updateActionTargetStatus(String actionTargetGUID, /** - * Declare that all of the processing for the governance action service is finished and the status of the work. + * Declare that all the processing for the governance action service is finished and the status of the work. * * @param status completion status enum value * @param outputGuards optional guard strings for triggering subsequent action(s) diff --git a/open-metadata-implementation/governance-servers/engine-host-services/engine-host-services-server/src/main/java/org/odpi/openmetadata/governanceservers/enginehostservices/listener/GovernanceEngineOutTopicListener.java b/open-metadata-implementation/governance-servers/engine-host-services/engine-host-services-server/src/main/java/org/odpi/openmetadata/governanceservers/enginehostservices/listener/GovernanceEngineOutTopicListener.java index 3bea2df3195..52df6cebccf 100644 --- a/open-metadata-implementation/governance-servers/engine-host-services/engine-host-services-server/src/main/java/org/odpi/openmetadata/governanceservers/enginehostservices/listener/GovernanceEngineOutTopicListener.java +++ b/open-metadata-implementation/governance-servers/engine-host-services/engine-host-services-server/src/main/java/org/odpi/openmetadata/governanceservers/enginehostservices/listener/GovernanceEngineOutTopicListener.java @@ -25,7 +25,7 @@ public class GovernanceEngineOutTopicListener extends GovernanceEngineEventListe * Constructor for the listener. Its job is to receive events and pass the information received on to the * appropriate governance engine handler. * - * @param governanceEngineHandlers these are the handlers for all of the governance engines that are hosted by this + * @param governanceEngineHandlers these are the handlers for all the governance engines that are hosted by this * engine host server. * @param auditLog logging destination */ diff --git a/open-metadata-implementation/governance-servers/engine-host-services/engine-host-services-server/src/main/java/org/odpi/openmetadata/governanceservers/enginehostservices/server/EngineHostInstance.java b/open-metadata-implementation/governance-servers/engine-host-services/engine-host-services-server/src/main/java/org/odpi/openmetadata/governanceservers/enginehostservices/server/EngineHostInstance.java index 4f95881aebb..e243577e2b5 100644 --- a/open-metadata-implementation/governance-servers/engine-host-services/engine-host-services-server/src/main/java/org/odpi/openmetadata/governanceservers/enginehostservices/server/EngineHostInstance.java +++ b/open-metadata-implementation/governance-servers/engine-host-services/engine-host-services-server/src/main/java/org/odpi/openmetadata/governanceservers/enginehostservices/server/EngineHostInstance.java @@ -60,7 +60,7 @@ public class EngineHostInstance extends GovernanceServerServiceInstance /** - * Retrieve all of the definitions for the requested governance engine from the Governance Engine OMAS + * Retrieve all the definitions for the requested governance engine from the Governance Engine OMAS * running in a metadata server. * * @param governanceEngineName qualifiedName of the requested governance engine @@ -139,7 +139,7 @@ GovernanceEngineSummary getGovernanceEngineSummary(String governanceEngineName, /** - * Return a summary of all of the engine statuses for the engine service. + * Return a summary of all the engine statuses for the engine service. * * @param serviceURLMarker URL identifier of the Engine Service * @param serviceOperationName name of the REST API call (typically the top-level methodName) @@ -192,7 +192,7 @@ List getGovernanceEngineSummaries(String serviceURLMark /** - * Return a summary of all of the engine statuses for the engine host. + * Return a summary of all the engine statuses for the engine host. * * @param serviceOperationName name of the REST API call (typically the top-level methodName) * diff --git a/open-metadata-implementation/governance-servers/engine-host-services/engine-host-services-server/src/main/java/org/odpi/openmetadata/governanceservers/enginehostservices/server/EngineHostInstanceHandler.java b/open-metadata-implementation/governance-servers/engine-host-services/engine-host-services-server/src/main/java/org/odpi/openmetadata/governanceservers/enginehostservices/server/EngineHostInstanceHandler.java index 5e7f29693ab..4d1b6723ae9 100644 --- a/open-metadata-implementation/governance-servers/engine-host-services/engine-host-services-server/src/main/java/org/odpi/openmetadata/governanceservers/enginehostservices/server/EngineHostInstanceHandler.java +++ b/open-metadata-implementation/governance-servers/engine-host-services/engine-host-services-server/src/main/java/org/odpi/openmetadata/governanceservers/enginehostservices/server/EngineHostInstanceHandler.java @@ -29,7 +29,7 @@ class EngineHostInstanceHandler extends GovernanceServerServiceInstanceHandler /** - * Retrieve all of the definitions for the requested governance engine from the Governance Engine OMAS. + * Retrieve all the definitions for the requested governance engine from the Governance Engine OMAS. * * @param userId calling user * @param serverName name of the server tied to the request @@ -87,7 +87,7 @@ GovernanceEngineSummary getGovernanceEngineSummary(String userId, /** - * Return a summary of all of the engine statuses for the engine service. + * Return a summary of all the engine statuses for the engine service. * * @param userId calling user * @param serverName name of the server tied to the request @@ -117,7 +117,7 @@ List getGovernanceEngineSummaries(String userId, /** - * Return a summary of all of the engine statuses for the engine host. + * Return a summary of all the engine statuses for the engine host. * * @param userId calling user * @param serverName name of the server tied to the request diff --git a/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-api/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/ffdc/IntegrationDaemonServicesAuditCode.java b/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-api/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/ffdc/IntegrationDaemonServicesAuditCode.java index e9b6c0097e8..50c63a85748 100644 --- a/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-api/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/ffdc/IntegrationDaemonServicesAuditCode.java +++ b/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-api/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/ffdc/IntegrationDaemonServicesAuditCode.java @@ -124,7 +124,7 @@ public enum IntegrationDaemonServicesAuditCode implements AuditLogMessageSet OMRSAuditLogRecordSeverity.STARTUP, "The integration daemon {0} has initialized", "The integration daemon services has completed initialization.", - "Verify that all of the configured integration services, and their connectors within have successfully started and" + + "Verify that all the configured integration services, and their connectors within have successfully started and" + "are able to connect both to their third party technology and their partner OMAS."), NO_PERMITTED_SYNCHRONIZATION("INTEGRATION-DAEMON-SERVICES-0014", @@ -142,7 +142,7 @@ public enum IntegrationDaemonServicesAuditCode implements AuditLogMessageSet DAEMON_CONNECTOR_CONFIG_PROPS_CLEARED("INTEGRATION-DAEMON-SERVICES-0016", OMRSAuditLogRecordSeverity.INFO, - "User {0} has cleared all of the configuration properties for the integration connector {1} in integration daemon {2}", + "User {0} has cleared all the configuration properties for the integration connector {1} in integration daemon {2}", "The connector will be restarted once the properties are cleared.", "Ensure that the connector does not report any errors during the restart processing as it operated on its default properties."), @@ -311,7 +311,7 @@ public enum IntegrationDaemonServicesAuditCode implements AuditLogMessageSet OMRSAuditLogRecordSeverity.SECURITY, "Integration service {0} is not authorized to call its partner " + "OMAS running in integration daemon {1} on OMAG Server Platform {2} with userId {3}. The error message was: {4}", - "Some, or all of the metadata from the connected third party technologies can not be exchanged with the open" + + "Some, or all the metadata from the connected third party technologies can not be exchanged with the open" + "metadata ecosystem.", "The userId comes from the integration daemon's configuration document. It is stored as the localServerUserId. " + "The authorization failure may be limited to a single operation, or extend to all requests to a specific partner " + diff --git a/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-server/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/handlers/IntegrationServiceHandler.java b/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-server/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/handlers/IntegrationServiceHandler.java index 423e6e757e2..45e67d881e8 100644 --- a/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-server/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/handlers/IntegrationServiceHandler.java +++ b/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-server/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/handlers/IntegrationServiceHandler.java @@ -166,7 +166,7 @@ public IntegrationServiceSummary getSummary() /** - * Refresh all of the connectors, or a specific connector if a connector name is supplied. + * Refresh all the connectors, or a specific connector if a connector name is supplied. * * @param connectorName name of a specific connector or null for all connectors * @throws InvalidParameterException the connector name is not recognized @@ -306,7 +306,7 @@ public void updateConfigurationProperties(String userId, /** - * Restart all of the connectors, or a specific connector if a connector name is supplied. + * Restart all the connectors, or a specific connector if a connector name is supplied. * * @param connectorName name of a specific connector or null for all connectors * @throws InvalidParameterException the connector name is not recognized @@ -352,7 +352,7 @@ public void restartService(String connectorName) throws InvalidParameterExceptio /** - * Step through all of the connector handlers and disconnect the integration connectors + * Step through all the connector handlers and disconnect the integration connectors */ public void shutdown() { diff --git a/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-server/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/server/IntegrationDaemonInstance.java b/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-server/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/server/IntegrationDaemonInstance.java index 92fc2b4ff5c..aeacfa41410 100644 --- a/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-server/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/server/IntegrationDaemonInstance.java +++ b/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-server/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/server/IntegrationDaemonInstance.java @@ -34,7 +34,7 @@ public class IntegrationDaemonInstance extends GovernanceServerServiceInstance * @param localServerUserId userId to use for local server initiated actions * @param maxPageSize max number of results to return on single request. * @param integrationDaemonThread handler managing the threading for the active integration connectors in this server. - * @param integrationServiceHandlers handler for all of the active integration services in this server. + * @param integrationServiceHandlers handler for all the active integration services in this server. */ IntegrationDaemonInstance(String serverName, String serviceName, @@ -52,7 +52,7 @@ public class IntegrationDaemonInstance extends GovernanceServerServiceInstance /** - * Return the list of all of the integration service handlers for this integration daemon. + * Return the list of all the integration service handlers for this integration daemon. * * @param serviceOperationName name of calling request * @return list of integration service handlers. diff --git a/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-server/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/server/IntegrationDaemonInstanceHandler.java b/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-server/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/server/IntegrationDaemonInstanceHandler.java index 387bceddbd0..9aec916f2d8 100644 --- a/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-server/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/server/IntegrationDaemonInstanceHandler.java +++ b/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-server/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/server/IntegrationDaemonInstanceHandler.java @@ -27,7 +27,7 @@ public IntegrationDaemonInstanceHandler() /** - * Retrieve the all of the integration service handlers for the requested integration daemon. + * Retrieve the all the integration service handlers for the requested integration daemon. * * @param userId calling user * @param serverName name of the server tied to the request diff --git a/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-server/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/server/IntegrationDaemonOperationalServices.java b/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-server/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/server/IntegrationDaemonOperationalServices.java index e48658f004c..039b9231f81 100644 --- a/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-server/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/server/IntegrationDaemonOperationalServices.java +++ b/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-server/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/server/IntegrationDaemonOperationalServices.java @@ -163,7 +163,7 @@ else if (configuration.isEmpty()) } /* - * Create the thread that calls refresh on all of the connectors. + * Create the thread that calls refresh on all the connectors. */ IntegrationDaemonThread integrationDaemonThread = new IntegrationDaemonThread(localServerName, daemonConnectorHandlers, diff --git a/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-server/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/server/IntegrationDaemonRESTServices.java b/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-server/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/server/IntegrationDaemonRESTServices.java index af04ec8a51b..43a1078e238 100644 --- a/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-server/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/server/IntegrationDaemonRESTServices.java +++ b/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-server/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/server/IntegrationDaemonRESTServices.java @@ -136,7 +136,7 @@ public VoidResponse updateConfigurationProperties(String /** - * Request that the integration daemon refresh all of the connectors in all of the integration services + * Request that the integration daemon refresh all the connectors in all the integration services * * @param serverName name of the integration daemon * @param userId identifier of calling user diff --git a/open-metadata-implementation/integration-services/organization-integrator/organization-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/organization/connector/OrganizationIntegratorContext.java b/open-metadata-implementation/integration-services/organization-integrator/organization-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/organization/connector/OrganizationIntegratorContext.java index a41f16ce59c..b8b23f901d7 100644 --- a/open-metadata-implementation/integration-services/organization-integrator/organization-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/organization/connector/OrganizationIntegratorContext.java +++ b/open-metadata-implementation/integration-services/organization-integrator/organization-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/organization/connector/OrganizationIntegratorContext.java @@ -324,25 +324,69 @@ public ActorProfileElement getActorProfileByUserId(String actorProfileUserId) th /** - * Return information about a named actor profile. + * Return information about matching named actor profiles. * * @param name unique name for the actor profile * @param startFrom index of the list to start from (0 for start) * @param pageSize maximum number of elements to return. * + * @return list of matching actor profiles + * + * @throws InvalidParameterException name or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + public List getActorProfilesByName(String name, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return organizationClient.getActorProfilesByName(userId, name, startFrom, pageSize); + } + + + /** + * Return information about actor profiles associated with a location. + * + * @param locationGUID unique identifier or the location + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching actor profiles + * + * @throws InvalidParameterException locationGUID or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + public List getActorProfilesByLocation(String locationGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return organizationClient.getActorProfilesByLocation(userId, locationGUID, startFrom, pageSize); + } + + + /** + * Return information about all actor profiles. + * + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * * @return list of matching actor profiles (hopefully only one) * * @throws InvalidParameterException name or userId is null * @throws PropertyServerException problem accessing property server * @throws UserNotAuthorizedException security access problem */ - public List getActorProfileByName(String name, - int startFrom, - int pageSize) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + public List getActorProfiles(int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { - return organizationClient.getActorProfileByName(userId, name, startFrom, pageSize); + return organizationClient.getActorProfiles(userId, startFrom, pageSize); } @@ -359,13 +403,13 @@ public List getActorProfileByName(String name, * @throws PropertyServerException the server is not available. * @throws UserNotAuthorizedException the calling user is not authorized to issue the call. */ - public List findActorProfile(String searchString, - int startFrom, - int pageSize) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException + public List findActorProfiles(String searchString, + int startFrom, + int pageSize) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException { - return organizationClient.findActorProfile(userId, searchString, startFrom, pageSize); + return organizationClient.findActorProfiles(userId, searchString, startFrom, pageSize); } @@ -586,13 +630,59 @@ public PersonRoleElement getPersonRoleByGUID(String personRoleGUID) throws Inval * @throws PropertyServerException problem accessing property server * @throws UserNotAuthorizedException security access problem */ - public List getPersonRoleByName(String name, - int startFrom, - int pageSize) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + public List getPersonRolesByName(String name, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { - return organizationClient.getPersonRoleByName(userId, name, startFrom, pageSize); + return organizationClient.getPersonRolesByName(userId, name, startFrom, pageSize); + } + + + /** + * Return information about the leadership person roles linked to a team. + * + * @param teamGUID unique identifier for the Team actor profile + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching actor profiles (hopefully only one) + * + * @throws InvalidParameterException name or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + public List getLeadershipRolesForTeam(String teamGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return organizationClient.getLeadershipRolesForTeam(userId, teamGUID, startFrom, pageSize); + } + + + /** + * Return information about the membership person roles linked to a team. + * + * @param teamGUID unique identifier for the Team actor profile + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching actor profiles (hopefully only one) + * + * @throws InvalidParameterException name or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + public List getMembershipRolesForTeam(String teamGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return organizationClient.getMembershipRolesForTeam(userId, teamGUID, startFrom, pageSize); } @@ -609,13 +699,13 @@ public List getPersonRoleByName(String name, * @throws PropertyServerException the server is not available. * @throws UserNotAuthorizedException the calling user is not authorized to issue the call. */ - public List findPersonRole(String searchString, - int startFrom, - int pageSize) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException + public List findPersonRoles(String searchString, + int startFrom, + int pageSize) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException { - return organizationClient.findPersonRole(userId, searchString, startFrom, pageSize); + return organizationClient.findPersonRoles(userId, searchString, startFrom, pageSize); } diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/auditlog/OMRSAuditLog.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/auditlog/OMRSAuditLog.java index 4b215bcfc13..f5b426a7080 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/auditlog/OMRSAuditLog.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/auditlog/OMRSAuditLog.java @@ -21,7 +21,7 @@ * will have their own instance of an OMRSAuditLog. OMRSAuditLog will ensure audit log records are written to * disk in the common OMRSAuditLog for this local server. * - * There are different severities of log record to cover all of the activity of the OMRS. + * There are different severities of log record to cover all the activity of the OMRS. * * This audit log is critical to validate the behavior of the OMAG Service, particularly in the initial interaction of * a new member in the OMRS Cohort. diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/OMRSDynamicTypeMetadataCollectionBase.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/OMRSDynamicTypeMetadataCollectionBase.java index e81f876b664..bb9e0a25f26 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/OMRSDynamicTypeMetadataCollectionBase.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/OMRSDynamicTypeMetadataCollectionBase.java @@ -531,7 +531,7 @@ public AttributeTypeDef reIdentifyAttributeTypeDef(String userId, * * @param userId unique identifier for requesting user. * @param entityGUID unique identifier of the entity with classifications to retrieve - * @return list of all of the classifications for this entity that are homed in this repository + * @return list of all the classifications for this entity that are homed in this repository * @throws InvalidParameterException the entity is null. * @throws RepositoryErrorException there is a problem communicating with the metadata repository where * the metadata collection is stored. @@ -577,7 +577,7 @@ public List getHomeClassifications(String userId, * @param userId unique identifier for requesting user. * @param entityGUID unique identifier of the entity with classifications to retrieve * @param asOfTime the time used to determine which version of the entity that is desired. - * @return list of all of the classifications for this entity that are homed in this repository + * @return list of all the classifications for this entity that are homed in this repository * @throws InvalidParameterException the entity is null. * @throws RepositoryErrorException there is a problem communicating with the metadata repository where * the metadata collection is stored. diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/OMRSFixedTypeMetadataCollectionBase.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/OMRSFixedTypeMetadataCollectionBase.java index a7dc7790fdf..009c9bdb6de 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/OMRSFixedTypeMetadataCollectionBase.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/OMRSFixedTypeMetadataCollectionBase.java @@ -18,7 +18,7 @@ * OMRSFixedTypeMetadataCollectionBase provides a base class for an open metadata repository that * has a fixed type system. Its constructor requires the fixed list of types and attribute types * that its implementing repository supports. Once this is in place, - * OMRSFixedTypeMetadataCollectionBase can support all of the type management methods. + * OMRSFixedTypeMetadataCollectionBase can support all the type management methods. */ public abstract class OMRSFixedTypeMetadataCollectionBase extends OMRSMetadataCollectionBase { diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/OMRSMetadataCollection.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/OMRSMetadataCollection.java index bfa0d7f7c1a..d366dff508c 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/OMRSMetadataCollection.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/OMRSMetadataCollection.java @@ -350,7 +350,7 @@ public abstract TypeDefGallery findTypesByName(String userId, /** - * Returns all of the TypeDefs for a specific category. + * Returns all the TypeDefs for a specific category. * * @param userId unique identifier for requesting user. * @param category enum value for the category of TypeDef to return. @@ -365,7 +365,7 @@ public abstract List findTypeDefsByCategory(String userId, UserNotAuthorizedException; /** - * Returns all of the AttributeTypeDefs for a specific category. + * Returns all the AttributeTypeDefs for a specific category. * * @param userId unique identifier for requesting user. * @param category enum value for the category of an AttributeTypeDef to return. @@ -1424,7 +1424,7 @@ public abstract List findRelationshipsByPropertyValue(String /** - * Return all of the relationships and intermediate entities that connect the startEntity with the endEntity. + * Return all the relationships and intermediate entities that connect the startEntity with the endEntity. * * @param userId unique identifier for requesting user. * @param startEntityGUID The entity that is used to anchor the query. @@ -2729,7 +2729,7 @@ public abstract void saveEntityReferenceCopy(String userId, * * @param userId unique identifier for requesting user. * @param entityGUID unique identifier of the entity with classifications to retrieve - * @return list of all of the classifications for this entity that are homed in this repository + * @return list of all the classifications for this entity that are homed in this repository * @throws InvalidParameterException the entity is null. * @throws RepositoryErrorException there is a problem communicating with the metadata repository where * the metadata collection is stored. @@ -2761,7 +2761,7 @@ public List getHomeClassifications(String userId, * @param userId unique identifier for requesting user. * @param entityGUID unique identifier of the entity with classifications to retrieve * @param asOfTime the time used to determine which version of the entity that is desired. - * @return list of all of the classifications for this entity that are homed in this repository + * @return list of all the classifications for this entity that are homed in this repository * @throws InvalidParameterException the entity is null. * @throws RepositoryErrorException there is a problem communicating with the metadata repository where * the metadata collection is stored. diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/OMRSMetadataCollectionBase.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/OMRSMetadataCollectionBase.java index 64cfb26a9ec..ef705d63984 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/OMRSMetadataCollectionBase.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/OMRSMetadataCollectionBase.java @@ -608,7 +608,7 @@ public TypeDefGallery findTypesByName(String userId, /** - * Returns all of the types for a specific category. + * Returns all the types for a specific category. * * @param allTypes list of types to filter. * @param category enum value for the category of types to return. @@ -647,7 +647,7 @@ protected List filterTypeDefsByCategory(List allTypes, /** - * Returns all of the TypeDefs for a specific category. + * Returns all the TypeDefs for a specific category. * * @param userId unique identifier for requesting user. * @param category enum value for the category of TypeDef to return. @@ -679,7 +679,7 @@ public List findTypeDefsByCategory(String userId, /** - * Returns all of the types for a specific category. + * Returns all the types for a specific category. * * @param allTypes list of types to filter. * @param category enum value for the category of types to return. @@ -717,7 +717,7 @@ protected List filterAttributeTypeDefsByCategory(List filterTypesByExternalID(List allTypes, for (TypeDef activeTypeDef : allTypes) { /* - * Extract all of the external standards mappings from the TypeDef. They are located in the TypeDef + * Extract all the external standards mappings from the TypeDef. They are located in the TypeDef * itself and in the TypeDefAttributes. */ List externalStandardMappings = new ArrayList<>(); @@ -3587,7 +3587,7 @@ public List findRelationshipsByPropertyValue(String /** - * Return all of the relationships and intermediate entities that connect the startEntity with the endEntity. + * Return all the relationships and intermediate entities that connect the startEntity with the endEntity. * * @param userId unique identifier for requesting user. * @param startEntityGUID The entity that is used to anchor the query. @@ -6126,7 +6126,7 @@ public void saveEntityReferenceCopy(String userId, * * @param userId unique identifier for requesting user. * @param entityGUID unique identifier of the entity with classifications to retrieve - * @return list of all of the classifications for this entity that are homed in this repository + * @return list of all the classifications for this entity that are homed in this repository * @throws InvalidParameterException the entity is null. * @throws RepositoryErrorException there is a problem communicating with the metadata repository where * the metadata collection is stored. @@ -6156,7 +6156,7 @@ public List getHomeClassifications(String userId, * @param userId unique identifier for requesting user. * @param entityGUID unique identifier of the entity with classifications to retrieve * @param asOfTime the time used to determine which version of the entity that is desired. - * @return list of all of the classifications for this entity that are homed in this repository + * @return list of all the classifications for this entity that are homed in this repository * @throws InvalidParameterException the entity is null. * @throws RepositoryErrorException there is a problem communicating with the metadata repository where * the metadata collection is stored. diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/HistorySequencingOrder.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/HistorySequencingOrder.java index c2cb8505187..91ab50923d5 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/HistorySequencingOrder.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/HistorySequencingOrder.java @@ -14,7 +14,7 @@ /** * HistorySequencingOrder is used for retrieval of history against a metadata collection. It defines how the results * should be ordered before they are returned. This is particularly important when the results are to returned - * over multiple pages since the caller does not have all of the results at once to perform the sort themselves. + * over multiple pages since the caller does not have all the results at once to perform the sort themselves. * * The sequencing order values are: *
        diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/RepositoryElementHeader.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/RepositoryElementHeader.java index 8d8a1abd892..28c52c95460 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/RepositoryElementHeader.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/RepositoryElementHeader.java @@ -32,7 +32,7 @@ public abstract class RepositoryElementHeader implements Serializable private static final long serialVersionUID = 1L; /* - * Version number for this header. This is used to ensure that all of the critical header information + * Version number for this header. This is used to ensure that all the critical header information * in read in a back-level version of the OMRS. The default is 0 to indicate that the element came from * a version of the OMRS that does not have a version number encoded. */ @@ -69,7 +69,7 @@ public RepositoryElementHeader(RepositoryElementHeader template) /** * Return the version of this header. This is used by the OMRS to determine if it is back level and * should not process events from a source that is more advanced because it does not have the ability - * to receive all of the header properties. + * to receive all the header properties. * * @return long version number - the value is incremented each time a new non-informational field is added * to the type definition. @@ -83,7 +83,7 @@ public long getHeaderVersion() /** * Return the version of this header. This is used by the OMRS to determine if it is back level and * should not process events from a source that is more advanced because it does not have the ability - * to receive all of the header properties. + * to receive all the header properties. * * @param headerVersion long version number - the value is incremented each time a new non-informational field is added * to the type definition. diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/SequencingOrder.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/SequencingOrder.java index 68adab3f3a0..d3d15175381 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/SequencingOrder.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/SequencingOrder.java @@ -14,7 +14,7 @@ /** * SequencingOrder is used for search requests against a metadata collection. It defines how the results should * to be ordered before they are returned. This is particularly important when the results are to returned - * over multiple pages since the caller does not have all of the results at once to perform the sort themselves. + * over multiple pages since the caller does not have all the results at once to perform the sort themselves. * * The sequencing order values are: *
          diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/instances/InstanceGraph.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/instances/InstanceGraph.java index c1d84b7e804..b2e9f9d5a98 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/instances/InstanceGraph.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/instances/InstanceGraph.java @@ -89,7 +89,7 @@ public InstanceGraph(InstanceGraph templateGraph) /** - * Return the list of all of the entities (vertices/nodes) in the instance graph. Null means empty graph. + * Return the list of all the entities (vertices/nodes) in the instance graph. Null means empty graph. * * @return EntityDetails entity list */ diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/instances/InstanceType.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/instances/InstanceType.java index e36d7cd9e8e..1f23fbdfeb3 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/instances/InstanceType.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/instances/InstanceType.java @@ -45,7 +45,7 @@ public InstanceType() /** - * Typical constructor that set all of the properties at once. + * Typical constructor that set all the properties at once. * * @param typeDefCategory the category of the type * @param typeDefGUID unique identifier of the type diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/typedefs/TypeDefElementHeader.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/typedefs/TypeDefElementHeader.java index 99ce6a37014..f5df3ddede2 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/typedefs/TypeDefElementHeader.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/typedefs/TypeDefElementHeader.java @@ -28,7 +28,7 @@ public class TypeDefElementHeader extends RepositoryElementHeader public static final long CURRENT_TYPE_DEF_HEADER_VERSION = 1; /* - * Version number for this header. This is used to ensure that all of the critical header information + * Version number for this header. This is used to ensure that all the critical header information * in read in a back-level version of the OMRS. The default is 0 to indicate that the instance came from * a version of the OMRS that does not have a version number encoded. */ diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/repositoryconnector/OMRSRepositoryConnector.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/repositoryconnector/OMRSRepositoryConnector.java index 4286120d066..bdcc4c2a0bc 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/repositoryconnector/OMRSRepositoryConnector.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/repositoryconnector/OMRSRepositoryConnector.java @@ -13,7 +13,7 @@ /** * The OMRSRepositoryConnector defines the interface for an OMRS Repository Connector. It is an abstract - * class since not all of the methods for OMRSMetadataCollectionManager are implemented. + * class since not all the methods for OMRSMetadataCollectionManager are implemented. */ public abstract class OMRSRepositoryConnector extends ConnectorBase implements OMRSMetadataCollectionManager, AuditLoggingComponent diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/repositoryconnector/OMRSRepositoryHelper.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/repositoryconnector/OMRSRepositoryHelper.java index 79c389ed38a..d726e67a983 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/repositoryconnector/OMRSRepositoryHelper.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/repositoryconnector/OMRSRepositoryHelper.java @@ -89,7 +89,7 @@ TypeDef getTypeDefByName(String sourceName, * * @param sourceName caller * @param typeName name of instance's type - * @param allProperties all of the instance's properties + * @param allProperties all the instance's properties * @return just the unique properties */ InstanceProperties getUniqueProperties(String sourceName, @@ -246,7 +246,7 @@ boolean isTypeOf(String sourceName, /** - * Return the list of type names for all of the subtypes of an entity type. + * Return the list of type names for all the subtypes of an entity type. * * @param sourceName source of the request (used for logging) * @param superTypeName name of the super type - this value is not included in the result. @@ -257,7 +257,7 @@ List getSubTypesOf(String sourceName, /** - * Return the names of all of the properties in the supplied TypeDef and all of its super-types. + * Return the names of all the properties in the supplied TypeDef and all of its super-types. * * @param sourceName name of caller. * @param typeDef TypeDef to query. @@ -270,7 +270,7 @@ List getAllPropertiesForTypeDef(String sourceName, /** - * Return the names of all of the type definitions that define the supplied property name. + * Return the names of all the type definitions that define the supplied property name. * * @param sourceName name of the caller. * @param propertyName property name to query. diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/repositoryeventmapper/OMRSRepositoryEventProcessor.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/repositoryeventmapper/OMRSRepositoryEventProcessor.java index 443351b7c20..6e3c296002f 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/repositoryeventmapper/OMRSRepositoryEventProcessor.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/repositoryeventmapper/OMRSRepositoryEventProcessor.java @@ -49,7 +49,7 @@ protected OMRSRepositoryEventProcessor(String eventProcessorName) * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity with the new classification added. No guarantee this is all of the classifications. + * @param entity details of the entity with the new classification added. No guarantee this is all the classifications. */ @Deprecated public void processClassifiedEntityEvent(String sourceName, @@ -79,7 +79,7 @@ public void processClassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity after the classification has been removed. No guarantee this is all of the classifications. + * @param entity details of the entity after the classification has been removed. No guarantee this is all the classifications. */ @Deprecated public void processDeclassifiedEntityEvent(String sourceName, @@ -109,7 +109,7 @@ public void processDeclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity after the classification has been changed. No guarantee this is all of the classifications. + * @param entity details of the entity after the classification has been changed. No guarantee this is all the classifications. */ @Deprecated public void processReclassifiedEntityEvent(String sourceName, diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/utilities/OMRSRepositoryPropertiesHelper.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/utilities/OMRSRepositoryPropertiesHelper.java index bf13e4ba0a9..1bc450bafa6 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/utilities/OMRSRepositoryPropertiesHelper.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/utilities/OMRSRepositoryPropertiesHelper.java @@ -279,7 +279,7 @@ Map removeMapFromProperty(String sourceName, * * @param sourceName source of call * @param propertyName name of requested map property - * @param properties all of the properties of the instance + * @param properties all the properties of the instance * @param methodName method of caller * @return array property value or null */ @@ -296,7 +296,7 @@ List getStringArrayProperty(String sourceName, * * @param sourceName source of call * @param propertyName name of requested map property - * @param properties all of the properties of the instance + * @param properties all the properties of the instance * @param methodName method of caller * @return array property value or null */ diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/utilities/OMRSRepositoryPropertiesUtilities.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/utilities/OMRSRepositoryPropertiesUtilities.java index cee20592673..e2721f1b8e0 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/utilities/OMRSRepositoryPropertiesUtilities.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/utilities/OMRSRepositoryPropertiesUtilities.java @@ -248,7 +248,7 @@ public InstanceProperties getMapProperty(String sourceName, * * @param sourceName source of call * @param propertyName name of requested map property - * @param properties all of the properties of the instance + * @param properties all the properties of the instance * @param callingMethodName method of caller * @return array property value or null */ @@ -309,7 +309,7 @@ public List getStringArrayProperty(String sourceName, * * @param sourceName source of call * @param propertyName name of requested map property - * @param properties all of the properties of the instance + * @param properties all the properties of the instance * @param methodName method of caller * @return array property value or null */ @@ -338,7 +338,7 @@ public List removeStringArrayProperty(String sourceName, /** - * Convert the values in the instance properties into a String Array. It assumes all of the elements are primitives. + * Convert the values in the instance properties into a String Array. It assumes all the elements are primitives. * * @param instanceProperties instance properties containing the values. They should all be primitive Strings. * @param callingMethodName method of caller @@ -705,7 +705,7 @@ public Map removeIntegerMapFromProperty(String sour * * @param sourceName source of call * @param propertyName name of requested map property - * @param properties all of the properties of the instance + * @param properties all the properties of the instance * @param methodName method of caller * @return map property value or null */ diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/events/OMRSInstanceEventProcessor.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/events/OMRSInstanceEventProcessor.java index 5010aad1af3..383f5bfc73e 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/events/OMRSInstanceEventProcessor.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/events/OMRSInstanceEventProcessor.java @@ -125,7 +125,7 @@ public abstract void processUndoneEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity with the new classification added. No guarantee this is all of the classifications. + * @param entity details of the entity with the new classification added. No guarantee this is all the classifications. */ @Deprecated @SuppressWarnings(value = "unused") @@ -149,7 +149,7 @@ public void processClassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity with the new classification added. No guarantee this is all of the classifications. + * @param entity details of the entity with the new classification added. No guarantee this is all the classifications. * @param classification new classification */ @SuppressWarnings(value = {"unused", "deprecation"}) @@ -180,7 +180,7 @@ public void processClassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity proxy of the entity with the new classification added. No guarantee this is all of the classifications. + * @param entity proxy of the entity with the new classification added. No guarantee this is all the classifications. * @param classification new classification */ @SuppressWarnings(value = "unused") @@ -205,7 +205,7 @@ public void processClassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity after the classification has been removed. No guarantee this is all of the classifications. + * @param entity details of the entity after the classification has been removed. No guarantee this is all the classifications. */ @Deprecated @SuppressWarnings(value = "unused") @@ -229,7 +229,7 @@ public void processDeclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity after the classification has been removed. No guarantee this is all of the classifications. + * @param entity details of the entity after the classification has been removed. No guarantee this is all the classifications. * @param originalClassification classification that was removed */ @SuppressWarnings(value = {"unused", "deprecation"}) @@ -260,7 +260,7 @@ public void processDeclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity proxy of the entity after the classification has been removed. No guarantee this is all of the classifications. + * @param entity proxy of the entity after the classification has been removed. No guarantee this is all the classifications. * @param originalClassification classification that was removed */ @SuppressWarnings(value = "unused") @@ -285,7 +285,7 @@ public void processDeclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity after the classification has been changed. No guarantee this is all of the classifications. + * @param entity details of the entity after the classification has been changed. No guarantee this is all the classifications. */ @Deprecated @SuppressWarnings(value = "unused") @@ -310,7 +310,7 @@ public void processReclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity after the classification has been changed. No guarantee this is all of the classifications. + * @param entity details of the entity after the classification has been changed. No guarantee this is all the classifications. * @param originalClassification classification that was removed * @param classification new classification */ @@ -343,7 +343,7 @@ public void processReclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity proxy of the entity after the classification has been changed. No guarantee this is all of the classifications. + * @param entity proxy of the entity after the classification has been changed. No guarantee this is all the classifications. * @param originalClassification classification that was removed * @param classification new classification */ diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/events/OMRSInstanceEventProcessorClassificationExtension.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/events/OMRSInstanceEventProcessorClassificationExtension.java index bc790de4361..f0f27a96aca 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/events/OMRSInstanceEventProcessorClassificationExtension.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/events/OMRSInstanceEventProcessorClassificationExtension.java @@ -20,7 +20,7 @@ public interface OMRSInstanceEventProcessorClassificationExtension * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity proxy of the entity with the new classification added. No guarantee this is all of the classifications. + * @param entity proxy of the entity with the new classification added. No guarantee this is all the classifications. * @param classification new classification */ void processClassifiedEntityEvent(String sourceName, @@ -42,7 +42,7 @@ void processClassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity proxy of the entity after the classification has been removed. No guarantee this is all of the classifications. + * @param entity proxy of the entity after the classification has been removed. No guarantee this is all the classifications. * @param originalClassification classification that was removed */ void processDeclassifiedEntityEvent(String sourceName, @@ -64,7 +64,7 @@ void processDeclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity proxy of the entity after the classification has been changed. No guarantee this is all of the classifications. + * @param entity proxy of the entity after the classification has been changed. No guarantee this is all the classifications. * @param originalClassification classification that was removed * @param classification new classification */ diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/events/OMRSInstanceEventProcessorInterface.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/events/OMRSInstanceEventProcessorInterface.java index e84a3564c64..741218a8fc0 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/events/OMRSInstanceEventProcessorInterface.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/events/OMRSInstanceEventProcessorInterface.java @@ -100,7 +100,7 @@ void processUndoneEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity with the new classification added. No guarantee this is all of the classifications. + * @param entity details of the entity with the new classification added. No guarantee this is all the classifications. * @param classification new classification */ void processClassifiedEntityEvent(String sourceName, @@ -122,7 +122,7 @@ void processClassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity after the classification has been removed. No guarantee this is all of the classifications. + * @param entity details of the entity after the classification has been removed. No guarantee this is all the classifications. * @param originalClassification classification that was removed */ void processDeclassifiedEntityEvent(String sourceName, @@ -144,7 +144,7 @@ void processDeclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity after the classification has been changed. No guarantee this is all of the classifications. + * @param entity details of the entity after the classification has been changed. No guarantee this is all the classifications. * @param originalClassification classification that was removed * @param classification new classification */ diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/events/future/CompoundFuture.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/events/future/CompoundFuture.java index 708d5c878f2..d73ed5aa194 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/events/future/CompoundFuture.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/events/future/CompoundFuture.java @@ -29,7 +29,7 @@ public boolean hasChildren() { @Override public boolean isDone() { - //the future is done when all of the children are done + //the future is done when all the children are done for(OMRSFuture future : children) { if (! future.isDone()) { return false; diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/ffdc/OMRSAuditCode.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/ffdc/OMRSAuditCode.java index f2be6614429..38c717bb44d 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/ffdc/OMRSAuditCode.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/ffdc/OMRSAuditCode.java @@ -75,7 +75,7 @@ public enum OMRSAuditCode implements AuditLogMessageSet OMRSAuditLogRecordSeverity.STARTUP, "Connecting to open metadata repository cohort {0}", "The local server has started to initialize the communication with the named " + - "open metadata repository cohort. This will allow it to exchange metadata with all of the other " + + "open metadata repository cohort. This will allow it to exchange metadata with all the other " + "members of this cohort.", "No action is required if connecting to this cohort is the expected behavior of this server. " + "If this server is not meant to connect to this cohort then it should be shutdown with the permanent " + @@ -316,7 +316,7 @@ public enum OMRSAuditCode implements AuditLogMessageSet OMRSAuditLogRecordSeverity.STARTUP, "An enterprise OMRS connector has been created for the {0}", "This connector is responsible for supporting federated queries to both the local repository (if any)" + - "and all of the other servers registered with the same open metadata repository cohorts as this server. " + + "and all the other servers registered with the same open metadata repository cohorts as this server. " + "The enterprise OMRS connector is dynamically configured with details of the members of these cohorts " + "by the enterprise connector manager. " + "At this stage it will be configured with the known members of the cohorts. As the server operates, " + @@ -397,7 +397,7 @@ public enum OMRSAuditCode implements AuditLogMessageSet OMRSAuditLogRecordSeverity.COHORT, "Registering with open metadata repository cohort {0} using metadata collection id {1}", "The local server has sent a registration event to the other members of the cohort. " + - "This is to configure this repository into the enterprise OMRS repository connectors of all of the " + + "This is to configure this repository into the enterprise OMRS repository connectors of all the " + "other members of the cohort.", "Validate that this server is connecting to the right cohort."), @@ -428,7 +428,7 @@ public enum OMRSAuditCode implements AuditLogMessageSet OMRSAuditLogRecordSeverity.STARTUP, "The Open Metadata Repository Services (OMRS) has initialized the audit log for the {0} called {1}", "The local server has started up the logging destinations defined in the configuration document.", - "Validate that all of the logging destinations are working."), + "Validate that all the logging destinations are working."), EVENT_PARSING_ERROR("OMRS-AUDIT-0100", OMRSAuditLogRecordSeverity.EXCEPTION, diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/ffdc/OMRSErrorCode.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/ffdc/OMRSErrorCode.java index 071ea2a20a2..59ba61d40f1 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/ffdc/OMRSErrorCode.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/ffdc/OMRSErrorCode.java @@ -77,7 +77,7 @@ public enum OMRSErrorCode implements ExceptionMessageSet "The system is unable to perform the request because the match criteria is needed.", "Correct the calling code and retry the request."), NO_EXTERNAL_ID(400, "OMRS-REPOSITORY-400-012", - "Null values for all of the parameters describing an external id for a standard has been passed on a {0} request to open metadata repository {1}", + "Null values for all the parameters describing an external id for a standard has been passed on a {0} request to open metadata repository {1}", "The system is unable to perform the request because at least one of the values are needed.", "Correct the caller's code and repeat the request."), NO_SEARCH_CRITERIA(400, "OMRS-REPOSITORY-400-013", @@ -245,7 +245,7 @@ public enum OMRSErrorCode implements ExceptionMessageSet "The pageSize parameter is supplied by the caller to the API. This call needs to be corrected before the server will operate correctly."), ENTITY_PROXY_ONLY(400, "OMRS-REPOSITORY-400-051", "A request for entity {0} has been passed to repository {1} as the {2} parameter of the {3} operation but only an entity proxy has been found", - "The system is unable to return all of the details of the entity. It can only supply an entity summary.", + "The system is unable to return all the details of the entity. It can only supply an entity summary.", "The fact that the system has a proxy means that the entity exists in one of the members of the connected cohorts. " + "The repository where it is located may be unavailable, or the entity has been deleted " + "but the delete request has not propagated through to this repository."), diff --git a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/rest/properties/RelationshipCreateRequest.java b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/rest/properties/RelationshipCreateRequest.java index af0aeb95ea2..4fb6a0cc416 100644 --- a/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/rest/properties/RelationshipCreateRequest.java +++ b/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/rest/properties/RelationshipCreateRequest.java @@ -15,7 +15,7 @@ import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; /** - * RelationshipCreateRequest provides the bean to hold all of the properties needed to create a new + * RelationshipCreateRequest provides the bean to hold all the properties needed to create a new * relationship. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) diff --git a/open-metadata-implementation/repository-services/repository-services-client/src/main/java/org/odpi/openmetadata/repositoryservices/clients/MetadataHighwayServicesClient.java b/open-metadata-implementation/repository-services/repository-services-client/src/main/java/org/odpi/openmetadata/repositoryservices/clients/MetadataHighwayServicesClient.java index ccf64823bfe..ce9820e7fb9 100644 --- a/open-metadata-implementation/repository-services/repository-services-client/src/main/java/org/odpi/openmetadata/repositoryservices/clients/MetadataHighwayServicesClient.java +++ b/open-metadata-implementation/repository-services/repository-services-client/src/main/java/org/odpi/openmetadata/repositoryservices/clients/MetadataHighwayServicesClient.java @@ -677,7 +677,7 @@ private void detectAndThrowRepositoryErrorException(String methodName, else if (restResult.getExceptionClassName() != null) { /* - * All of the other expected exceptions have been processed so default exception to RepositoryErrorException + * all the other expected exceptions have been processed so default exception to RepositoryErrorException */ throw new RepositoryErrorException(restResult.getRelatedHTTPCode(), this.getClass().getName(), diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/archivemanager/OMRSArchiveManager.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/archivemanager/OMRSArchiveManager.java index 7428f5ce55d..82436603134 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/archivemanager/OMRSArchiveManager.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/archivemanager/OMRSArchiveManager.java @@ -103,7 +103,7 @@ public void setLocalRepository(String localMetadataCol this.localInstanceEventProcessor = instanceProcessor; /* - * The repository content manager is seeded with all of the open metadata types. + * The repository content manager is seeded with all the open metadata types. */ processOpenMetadataTypes(); diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/connectormanager/OMRSConnectionConsumer.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/connectormanager/OMRSConnectionConsumer.java index c65561809bb..084e101532f 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/connectormanager/OMRSConnectionConsumer.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/connectormanager/OMRSConnectionConsumer.java @@ -47,7 +47,7 @@ void removeRemoteConnection(String cohortName, /** - * Remove all of the remote connections for the requested open metadata repository cohort. + * Remove all the remote connections for the requested open metadata repository cohort. * * @param cohortName name of the cohort */ diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/connectormanager/OMRSConnectorConsumer.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/connectormanager/OMRSConnectorConsumer.java index 9aae6753327..ea94fab5d97 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/connectormanager/OMRSConnectorConsumer.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/connectormanager/OMRSConnectorConsumer.java @@ -7,7 +7,7 @@ /** * OMRSConnectorConsumer provides the interfaces for a connector consumer. This is a component that needs to - * maintain a current list of connectors to all of the remote repositories in the open metadata repository cohorts that + * maintain a current list of connectors to all the remote repositories in the open metadata repository cohorts that * the local server is a member of. */ public interface OMRSConnectorConsumer diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/EnterpriseOMRSConnectorProvider.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/EnterpriseOMRSConnectorProvider.java index e8f712431a8..bc73efdaff7 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/EnterpriseOMRSConnectorProvider.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/EnterpriseOMRSConnectorProvider.java @@ -96,7 +96,7 @@ public EnterpriseOMRSConnectorProvider(OMRSConnectorManager connectorMan /** * Creates a new instance of an EnterpriseOMRSRepositoryConnector based on the information in the supplied connection. * - * @param connection connection that should have all of the properties needed by the Connector Provider + * @param connection connection that should have all the properties needed by the Connector Provider * to create a connector instance. * @return Connector instance of the connector. * @throws ConnectionCheckedException if there are missing or invalid properties in the connection diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/EnterpriseOMRSMetadataCollection.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/EnterpriseOMRSMetadataCollection.java index e481e77d4b7..1c1be286f47 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/EnterpriseOMRSMetadataCollection.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/EnterpriseOMRSMetadataCollection.java @@ -50,7 +50,7 @@ *

          * Updates and deletes are routed to the owning (home) repository. Searches are made to each repository in turn * and the duplicates are removed. Queries are directed to the local repository and then the remote repositories - * until all of the requested metadata is assembled. + * until all the requested metadata is assembled. *

          */ class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollectionBase @@ -195,7 +195,7 @@ public TypeDefGallery findTypesByName(String userId, /** - * Returns all of the TypeDefs for a specific category. + * Returns all the TypeDefs for a specific category. * * @param userId unique identifier for requesting user. * @param category enum value for the category of TypeDef to return. @@ -233,7 +233,7 @@ public List findTypeDefsByCategory(String userId, /** - * Returns all of the AttributeTypeDefs for a specific category. + * Returns all the AttributeTypeDefs for a specific category. * * @param userId unique identifier for requesting user. * @param category enum value for the category of an AttributeTypeDef to return. @@ -2084,7 +2084,7 @@ public List findRelationshipsByPropertyValue(String /** - * Return all of the relationships and intermediate entities that connect the startEntity with the endEntity. + * Return all the relationships and intermediate entities that connect the startEntity with the endEntity. * * @param userId unique identifier for requesting user. * @param startEntityGUID The entity that is used to anchor the query. @@ -4395,7 +4395,7 @@ public void saveEntityReferenceCopy(String userId, * * @param userId unique identifier for requesting user. * @param entityGUID unique identifier of the entity with classifications to retrieve - * @return list of all of the classifications for this entity that are homed in this repository + * @return list of all the classifications for this entity that are homed in this repository * @throws FunctionNotSupportedException this method is not supported */ @Override @@ -4416,7 +4416,7 @@ public List getHomeClassifications(String userId, * @param userId unique identifier for requesting user. * @param entityGUID unique identifier of the entity with classifications to retrieve * @param asOfTime the time used to determine which version of the entity that is desired. - * @return list of all of the classifications for this entity that are homed in this repository + * @return list of all the classifications for this entity that are homed in this repository * @throws FunctionNotSupportedException this method is not supported */ @Override @@ -4931,7 +4931,7 @@ private void throwCapturedEntityNotKnownException(EntityNotKnownException except /** - * Throw a FunctionNotSupportedException if it was returned by all of the calls to the cohort connectors. + * Throw a FunctionNotSupportedException if it was returned by all the calls to the cohort connectors. * * @param exception captured exception * @throws FunctionNotSupportedException the requested function is not supported in any of the federated repositories diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/EnterpriseOMRSRepositoryConnector.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/EnterpriseOMRSRepositoryConnector.java index 0e248960719..5ef7549ee14 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/EnterpriseOMRSRepositoryConnector.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/EnterpriseOMRSRepositoryConnector.java @@ -30,7 +30,7 @@ * using the OCF ConnectorBroker. They use its metadata collection to retrieve and send the metadata they need. *

          *

          - * Each EnterpriseOMRSRepositoryConnector instance needs to maintain an up to date list of OMRS Connectors to all of the + * Each EnterpriseOMRSRepositoryConnector instance needs to maintain an up to date list of OMRS Connectors to all the * repositories in the connected open metadata repository cohort(s). It does by registering as an OMRSConnectorConsumer * with the OMRSConnectorManager to be notified when connectors to new open metadata repositories are available. *

          diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/ExceptionAccumulatorBase.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/ExceptionAccumulatorBase.java index 621c9fabcd7..3a100d2c65b 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/ExceptionAccumulatorBase.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/ExceptionAccumulatorBase.java @@ -103,7 +103,7 @@ public synchronized void throwCapturedEntityProxyOnlyException() throws EntityPr /** - * Throw a FunctionNotSupportedException if it was returned by all of the calls to the cohort connectors. + * Throw a FunctionNotSupportedException if it was returned by all the calls to the cohort connectors. * * @throws FunctionNotSupportedException the requested function is not supported in any of the federated repositories */ diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/RelationshipsAccumulator.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/RelationshipsAccumulator.java index 035dd2990a1..07cb5ba9063 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/RelationshipsAccumulator.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/RelationshipsAccumulator.java @@ -109,7 +109,7 @@ public synchronized void addRelationships(List relationships, /** * Extract the results - this will the a unique list of relationships selected from the instances - * supplied to this accumulator. It should be called once all of the executors have completed processing + * supplied to this accumulator. It should be called once all the executors have completed processing * their request(s). * * @param repositoryConnector enterprise connector diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/TypesAccumulator.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/TypesAccumulator.java index b2cfafb0c93..161a10c76f4 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/TypesAccumulator.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/enterprise/repositoryconnector/accumulators/TypesAccumulator.java @@ -134,7 +134,7 @@ public synchronized void addTypeDefGallery(TypeDefGallery types, /** * Extract the results - this will the a unique list of types selected from the responses - * supplied to this accumulator. It should be called once all of the executors have completed processing + * supplied to this accumulator. It should be called once all the executors have completed processing * their request(s). * * @return type definition gallery diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/repositoryconnector/LocalOMRSInstanceEventProcessor.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/repositoryconnector/LocalOMRSInstanceEventProcessor.java index bee27741622..b01fc08b48c 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/repositoryconnector/LocalOMRSInstanceEventProcessor.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/repositoryconnector/LocalOMRSInstanceEventProcessor.java @@ -61,7 +61,7 @@ public class LocalOMRSInstanceEventProcessor extends OMRSInstanceEventProcessor /** - * Constructor saves all of the information necessary to process incoming instance events. It is intolerant + * Constructor saves all the information necessary to process incoming instance events. It is intolerant * of nulls in any of its parameters and will throw a logic error exception is it finds any. * * @param localMetadataCollectionId local metadata collection identifier @@ -885,7 +885,7 @@ public void processUndoneEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity with the new classification added. No guarantee this is all of the classifications. + * @param entity details of the entity with the new classification added. No guarantee this is all the classifications. * @param classification new classification */ @Override @@ -925,7 +925,7 @@ public void processClassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity proxy of the entity with the new classification added. No guarantee this is all of the classifications. + * @param entity proxy of the entity with the new classification added. No guarantee this is all the classifications. * @param classification new classification */ public void processClassifiedEntityEvent(String sourceName, @@ -964,7 +964,7 @@ public void processClassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity after the classification has been removed. No guarantee this is all of the classifications. + * @param entity details of the entity after the classification has been removed. No guarantee this is all the classifications. * @param originalClassification classification that was removed */ @Override @@ -1004,7 +1004,7 @@ public void processDeclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity proxy of the entity after the classification has been removed. No guarantee this is all of the classifications. + * @param entity proxy of the entity after the classification has been removed. No guarantee this is all the classifications. * @param originalClassification classification that was removed */ public void processDeclassifiedEntityEvent(String sourceName, @@ -1043,7 +1043,7 @@ public void processDeclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity details of the entity after the classification has been changed. No guarantee this is all of the classifications. + * @param entity details of the entity after the classification has been changed. No guarantee this is all the classifications. * @param originalClassification classification that was removed * @param classification new classification */ @@ -1085,7 +1085,7 @@ public void processReclassifiedEntityEvent(String sourceName, * @param originatorServerName name of the server that the event came from. * @param originatorServerType type of server that the event came from. * @param originatorOrganizationName name of the organization that owns the server that sent the event. - * @param entity proxy of the entity after the classification has been changed. No guarantee this is all of the classifications. + * @param entity proxy of the entity after the classification has been changed. No guarantee this is all the classifications. * @param originalClassification classification that was removed * @param classification new classification */ diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/rest/server/OMRSRepositoryRESTServices.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/rest/server/OMRSRepositoryRESTServices.java index 51ee245681e..1734fe17120 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/rest/server/OMRSRepositoryRESTServices.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/rest/server/OMRSRepositoryRESTServices.java @@ -432,7 +432,7 @@ public TypeDefGalleryResponse findTypesByName(String serverName, String userId, /** - * Returns all of the TypeDefs for a specific category. + * Returns all the TypeDefs for a specific category. * * @param serverName unique identifier for requested server. * @param userId unique identifier for requesting user. @@ -481,7 +481,7 @@ public TypeDefListResponse findTypeDefsByCategory(String serverName, String user /** - * Returns all of the AttributeTypeDefs for a specific category. + * Returns all the AttributeTypeDefs for a specific category. * * @param serverName unique identifier for requested server. * @param userId unique identifier for requesting user. @@ -4191,7 +4191,7 @@ public RelationshipListResponse findRelationshipsByPropertyValueHistory(String /** - * Return all of the relationships and intermediate entities that connect the startEntity with the endEntity. + * Return all the relationships and intermediate entities that connect the startEntity with the endEntity. * * @param serverName unique identifier for requested server. * @param userId unique identifier for requesting user. @@ -4279,7 +4279,7 @@ public InstanceGraphResponse getLinkingEntities(String server /** - * Return all of the relationships and intermediate entities that connect the startEntity with the endEntity. + * Return all the relationships and intermediate entities that connect the startEntity with the endEntity. * * @param serverName unique identifier for requested server. * @param userId unique identifier for requesting user. @@ -7101,7 +7101,7 @@ public VoidResponse saveEntityReferenceCopy(String serverName, * @param serverName unique identifier for requested server. * @param userId unique identifier for requesting user. * @param entityGUID unique identifier of the entity with classifications to retrieve - * @return list of all of the classifications for this entity that are homed in this repository or + * @return list of all the classifications for this entity that are homed in this repository or * InvalidParameterException the entity is null or * RepositoryErrorException there is a problem communicating with the metadata repository where * the metadata collection is stored or @@ -7164,7 +7164,7 @@ public ClassificationListResponse getHomeClassifications(String serverName, * @param userId unique identifier for requesting user. * @param entityGUID unique identifier of the entity with classifications to retrieve * @param requestBody the time used to determine which version of the entity that is desired. - * @return list of all of the classifications for this entity that are homed in this repository or + * @return list of all the classifications for this entity that are homed in this repository or * InvalidParameterException the entity is null or * RepositoryErrorException there is a problem communicating with the metadata repository where * the metadata collection is stored or diff --git a/open-metadata-implementation/repository-services/repository-services-spring/src/main/java/org/odpi/openmetadata/repositoryservices/rest/server/spring/EnterpriseRepositoryServicesResource.java b/open-metadata-implementation/repository-services/repository-services-spring/src/main/java/org/odpi/openmetadata/repositoryservices/rest/server/spring/EnterpriseRepositoryServicesResource.java index 7ed57d9b6f1..7e7e2bd12c5 100644 --- a/open-metadata-implementation/repository-services/repository-services-spring/src/main/java/org/odpi/openmetadata/repositoryservices/rest/server/spring/EnterpriseRepositoryServicesResource.java +++ b/open-metadata-implementation/repository-services/repository-services-spring/src/main/java/org/odpi/openmetadata/repositoryservices/rest/server/spring/EnterpriseRepositoryServicesResource.java @@ -116,7 +116,7 @@ public TypeDefGalleryResponse findTypesByName(@PathVariable String serverName, /** - * Returns all of the TypeDefs for a specific category. + * Returns all the TypeDefs for a specific category. * * @param serverName unique identifier for requested server. * @param userId unique identifier for requesting user. @@ -138,7 +138,7 @@ public TypeDefListResponse findTypeDefsByCategory(@PathVariable String /** - * Returns all of the AttributeTypeDefs for a specific category. + * Returns all the AttributeTypeDefs for a specific category. * * @param serverName unique identifier for requested server. * @param userId unique identifier for requesting user. @@ -1039,7 +1039,7 @@ public RelationshipListResponse findRelationshipsByPropertyValueHistory(@PathVa /** - * Return all of the relationships and intermediate entities that connect the startEntity with the endEntity. + * Return all the relationships and intermediate entities that connect the startEntity with the endEntity. * * @param serverName unique identifier for requested server. * @param userId unique identifier for requesting user. @@ -1070,7 +1070,7 @@ public InstanceGraphResponse getLinkingEntities(@PathVariable String /** - * Return all of the relationships and intermediate entities that connect the startEntity with the endEntity. + * Return all the relationships and intermediate entities that connect the startEntity with the endEntity. * * @param serverName unique identifier for requested server. * @param userId unique identifier for requesting user. diff --git a/open-metadata-implementation/repository-services/repository-services-spring/src/main/java/org/odpi/openmetadata/repositoryservices/rest/server/spring/LocalRepositoryServicesResource.java b/open-metadata-implementation/repository-services/repository-services-spring/src/main/java/org/odpi/openmetadata/repositoryservices/rest/server/spring/LocalRepositoryServicesResource.java index 6a81546fcf4..45352ab2b2e 100644 --- a/open-metadata-implementation/repository-services/repository-services-spring/src/main/java/org/odpi/openmetadata/repositoryservices/rest/server/spring/LocalRepositoryServicesResource.java +++ b/open-metadata-implementation/repository-services/repository-services-spring/src/main/java/org/odpi/openmetadata/repositoryservices/rest/server/spring/LocalRepositoryServicesResource.java @@ -117,7 +117,7 @@ public TypeDefGalleryResponse findTypesByName(@PathVariable String serverName, /** - * Returns all of the TypeDefs for a specific category. + * Returns all the TypeDefs for a specific category. * * @param serverName unique identifier for requested server. * @param userId unique identifier for requesting user. @@ -139,7 +139,7 @@ public TypeDefListResponse findTypeDefsByCategory(@PathVariable String /** - * Returns all of the AttributeTypeDefs for a specific category. + * Returns all the AttributeTypeDefs for a specific category. * * @param serverName unique identifier for requested server. * @param userId unique identifier for requesting user. @@ -1335,7 +1335,7 @@ public RelationshipListResponse findRelationshipsByPropertyValueHistory(@PathVa /** - * Return all of the relationships and intermediate entities that connect the startEntity with the endEntity. + * Return all the relationships and intermediate entities that connect the startEntity with the endEntity. * * @param serverName unique identifier for requested server. * @param userId unique identifier for requesting user. @@ -1366,7 +1366,7 @@ public InstanceGraphResponse getLinkingEntities(@PathVariable String /** - * Return all of the relationships and intermediate entities that connect the startEntity with the endEntity. + * Return all the relationships and intermediate entities that connect the startEntity with the endEntity. * * @param serverName unique identifier for requested server. * @param userId unique identifier for requesting user. @@ -2419,7 +2419,7 @@ public VoidResponse saveEntityReferenceCopy(@PathVariable String serverNam * @param serverName unique identifier for requested server. * @param userId unique identifier for requesting user. * @param entityGUID unique identifier of the entity with classifications to retrieve - * @return list of all of the classifications for this entity that are homed in this repository or + * @return list of all the classifications for this entity that are homed in this repository or * InvalidParameterException the entity is null or * RepositoryErrorException there is a problem communicating with the metadata repository where * the metadata collection is stored or @@ -2445,7 +2445,7 @@ public ClassificationListResponse getHomeClassifications(@PathVariable String se * @param userId unique identifier for requesting user. * @param entityGUID unique identifier of the entity with classifications to retrieve * @param requestBody the time used to determine which version of the entity that is desired. - * @return list of all of the classifications for this entity that are homed in this repository or + * @return list of all the classifications for this entity that are homed in this repository or * InvalidParameterException the entity is null or * RepositoryErrorException there is a problem communicating with the metadata repository where * the metadata collection is stored or diff --git a/open-metadata-resources/open-metadata-archives/content-pack-helpers/src/main/java/org/odpi/openmetadata/samples/archiveutilities/SimpleCatalogArchiveHelper.java b/open-metadata-resources/open-metadata-archives/content-pack-helpers/src/main/java/org/odpi/openmetadata/samples/archiveutilities/SimpleCatalogArchiveHelper.java index 8e985bc4b4c..bb32645e40c 100644 --- a/open-metadata-resources/open-metadata-archives/content-pack-helpers/src/main/java/org/odpi/openmetadata/samples/archiveutilities/SimpleCatalogArchiveHelper.java +++ b/open-metadata-resources/open-metadata-archives/content-pack-helpers/src/main/java/org/odpi/openmetadata/samples/archiveutilities/SimpleCatalogArchiveHelper.java @@ -32,8 +32,22 @@ public class SimpleCatalogArchiveHelper private static final String CONNECTOR_TYPE_DIRECTORY_TYPE_NAME = "ConnectorTypeDirectory"; private static final String CONNECTOR_IMPL_CHOICE_TYPE_NAME = "ConnectorImplementationChoice"; + private static final String LOCATION_TYPE_NAME = "Location"; + private static final String FIXED_LOCATION_CLASSIFICATION_NAME = "FixedLocation"; + private static final String SECURE_LOCATION_CLASSIFICATION_NAME = "SecureLocation"; + private static final String CYBER_LOCATION_CLASSIFICATION_NAME = "CyberLocation"; + private static final String MOBILE_ASSET_CLASSIFICATION_NAME = "MobileAsset"; + private static final String NESTED_LOCATION_RELATIONSHIP_NAME = "NestedLocation"; + private static final String ADJACENT_LOCATION_RELATIONSHIP_NAME = "AdjacentLocation"; + private static final String ASSET_LOCATION_RELATIONSHIP_NAME = "AssetLocation"; + private static final String COLLECTION_TYPE_NAME = "Collection"; - private static final String COLLECTION_MEMBER_TYPE_NAME = "CollectionMembership"; + private static final String COLLECTION_MEMBER_RELATIONSHIP_NAME = "CollectionMembership"; + public static final String NAMING_STANDARD_RULE_SET_TYPE_NAME = "NamingStandardRuleSet"; + + public static final String GOVERNANCE_DOMAIN_SET_CLASSIFICATION_NAME = "GovernanceDomainSet"; + public static final String GOVERNANCE_CLASSIFICATION_SET_CLASSIFICATION_NAME = "GovernanceClassificationSet"; + public static final String GOVERNANCE_STATUS_SET_CLASSIFICATION_NAME = "GovernanceStatusSet"; private static final String SEARCH_KEYWORD_TYPE_NAME = "SearchKeyword"; private static final String SEARCH_KEYWORD_LINK_RELATIONSHIP_NAME = "SearchKeywordLink"; @@ -61,6 +75,63 @@ public class SimpleCatalogArchiveHelper private static final String LIBRARY_CATEGORY_REFERENCE_RELATIONSHIP_NAME = "LibraryCategoryReference"; private static final String LIBRARY_TERM_REFERENCE_RELATIONSHIP_NAME = "LibraryTermReference"; + private static final String GOVERNANCE_DOMAIN_DESCRIPTION_TYPE_NAME = "GovernanceDomainDescription"; + + private static final String GOVERNANCE_DEFINITION_TYPE_NAME = "GovernanceDefinition"; + public static final String GOVERNANCE_DRIVER_TYPE_NAME = "GovernanceDriver"; + public static final String GOVERNANCE_STRATEGY_TYPE_NAME = "GovernanceStrategy"; + public static final String BUSINESS_IMPERATIVE_TYPE_NAME = "BusinessImperative"; + public static final String REGULATION_TYPE_NAME = "Regulation"; + public static final String REGULATION_ARTICLE_TYPE_NAME = "RegulationArticle"; + public static final String THREAT_TYPE_NAME = "Threat"; + public static final String GOVERNANCE_POLICY_TYPE_NAME = "GovernancePolicy"; + public static final String GOVERNANCE_PRINCIPLE_TYPE_NAME = "GovernancePrinciple"; + public static final String GOVERNANCE_OBLIGATION_TYPE_NAME = "GovernanceObligation"; + public static final String GOVERNANCE_APPROACH_TYPE_NAME = "GovernanceApproach"; + public static final String GOVERNANCE_CONTROL_TYPE_NAME = "GovernanceControl"; + public static final String TECHNICAL_CONTROL_TYPE_NAME = "TechnicalControl"; + public static final String SECURITY_GROUP_TYPE_NAME = "SecurityGroup"; + public static final String GOVERNANCE_RULE_TYPE_NAME = "GovernanceRule"; + public static final String NAMING_STANDARD_RULE_TYPE_NAME = "NamingStandardRule"; + public static final String GOVERNANCE_PROCESS_TYPE_NAME = "GovernanceProcess"; + public static final String ORGANIZATIONAL_CONTROL_TYPE_NAME = "OrganizationalControl"; + public static final String GOVERNANCE_RESPONSIBILITY_TYPE_NAME = "GovernanceResponsibility"; + public static final String GOVERNANCE_PROCEDURE_TYPE_NAME = "GovernanceProcedure"; + public static final String LICENSE_TYPE_TYPE_NAME = "LicenseType"; + public static final String CERTIFICATION_TYPE_TYPE_NAME = "CertificationType"; + public static final String DATA_PROCESSING_PURPOSE_TYPE_NAME = "DataProcessingPurpose"; + + private static final String GOVERNANCE_DEFINITION_SCOPE_RELATIONSHIP_NAME = "GovernanceDefinitionScope"; + private static final String GOVERNED_BY_RELATIONSHIP_NAME = "GovernedBy"; + + public static final String GOVERNANCE_DRIVER_LINK_RELATIONSHIP_NAME = "GovernanceDriverLink"; + public static final String GOVERNANCE_RESPONSE_RELATIONSHIP_NAME = "GovernanceResponse"; + public static final String GOVERNANCE_POLICY_LINK_RELATIONSHIP_NAME = "GovernanceDriverLink"; + public static final String GOVERNANCE_IMPLEMENTATION_RELATIONSHIP_NAME = "GovernanceImplementation"; + public static final String GOVERNANCE_CONTROL_LINK_RELATIONSHIP_NAME = "GovernanceControlLink"; + + public static final String GOVERNANCE_RULE_IMPLEMENTATION_RELATIONSHIP_NAME = "GovernanceRuleImplementation"; + public static final String GOVERNANCE_PROCESS_IMPLEMENTATION_RELATIONSHIP_NAME = "GovernanceProcessImplementation"; + public static final String GOVERNANCE_RESPONSIBILITY_ASSIGNMENT_RELATIONSHIP_NAME = "GovernanceResponsibilityAssignment"; + + private static final String GOVERNANCE_ZONE_TYPE_NAME = "GovernanceZone"; + private static final String ZONE_HIERARCHY_RELATIONSHIP_NAME = "ZoneHierarchy"; + private static final String ASSET_ZONE_MEMBERSHIP_CLASSIFICATION_NAME = "AssetZoneMembership"; + + private static final String BUSINESS_CAPABILITY_TYPE_NAME = "BusinessCapability"; + private static final String BUSINESS_CAPABILITY_TYPE_ENUM_NAME = "BusinessCapabilityType"; + public static final int BUSINESS_CAPABILITY_TYPE_UNCLASSIFIED = 0; + public static final int BUSINESS_CAPABILITY_TYPE_BUSINESS_SERVICE = 1; + public static final int BUSINESS_CAPABILITY_TYPE_BUSINESS_AREA = 2; + public static final int BUSINESS_CAPABILITY_TYPE_OTHER = 99; + private static final String ORGANIZATIONAL_CAPABILITY_RELATIONSHIP_NAME = "OrganizationalCapability"; + private static final String ASSET_ORIGIN_CLASSIFICATION_NAME = "AssetOrigin"; + + private static final String PROJECT_CHARTER_TYPE_NAME = "ProjectCharter"; + private static final String PROJECT_CHARTER_LINK_RELATIONSHIP_NAME = "ProjectCharterLink"; + + private static final String OWNER_CLASSIFICATION_NAME = "Owner"; + private static final String SUBJECT_AREA_DEFINITION_TYPE_NAME = "SubjectAreaDefinition"; private static final String SUBJECT_AREA_HIERARCHY_RELATIONSHIP_NAME = "SubjectAreaHierarchy"; private static final String SUBJECT_AREA_CLASSIFICATION_NAME = "SubjectArea"; @@ -89,6 +160,73 @@ public class SimpleCatalogArchiveHelper public static final int TERM_RELATIONSHIP_STATUS_OBSOLETE = 3; public static final int TERM_RELATIONSHIP_STATUS_OTHER = 4; + private static final String PERSON_TYPE_NAME = "Person"; + private static final String TEAM_TYPE_NAME = "Team"; + public static final String ORGANIZATION_TYPE_NAME = "Organization"; + private static final String IT_PROFILE_TYPE_NAME = "ITProfile"; + private static final String USER_IDENTITY_TYPE_NAME = "UserIdentity"; + private static final String CONTACT_DETAILS_TYPE_NAME = "ContactDetails"; + + private static final String SECURITY_GROUP_MEMBERSHIP_CLASSIFICATION_NAME = "SecurityGroupMembership"; + private static final String SECURITY_TAGS_CLASSIFICATION_NAME = "SecurityTags"; + + private static final String CONTACT_METHOD_TYPE_ENUM_NAME = "ContactMethodType"; + public static final int CONTACT_METHOD_TYPE_EMAIL = 0; + public static final int CONTACT_METHOD_TYPE_PHONE = 1; + public static final int CONTACT_METHOD_TYPE_CHAT = 2; + public static final int CONTACT_METHOD_TYPE_PROFILE = 3; + public static final int CONTACT_METHOD_TYPE_ACCOUNT = 4; + public static final int CONTACT_METHOD_TYPE_OTHER = 99; + + private static final String PROFILE_LOCATION_RELATIONSHIP_NAME = "ProfileLocation"; + private static final String PROFILE_IDENTITY_RELATIONSHIP_NAME = "ProfileIdentity"; + private static final String CONTACT_THROUGH_RELATIONSHIP_NAME = "ContactThrough"; + private static final String PEER_RELATIONSHIP_NAME = "Peer"; + private static final String PERSONAL_ROLE_APPOINTMENT_RELATIONSHIP_NAME = "PersonalRoleAppointment"; + private static final String TEAM_STRUCTURE_RELATIONSHIP_NAME = "TeamStructure"; + private static final String TEAM_MEMBERSHIP_RELATIONSHIP_NAME = "TeamMembership"; + private static final String TEAM_LEADERSHIP_RELATIONSHIP_NAME = "TeamLeadership"; + private static final String IT_INFRASTRUCTURE_PROFILE_RELATIONSHIP_NAME = "ITInfrastructureProfile"; + private static final String ASSIGNMENT_SCOPE_RELATIONSHIP_NAME = "AssignmentScope"; + + private static final String PERSON_ROLE_TYPE_NAME = "PersonRole"; + public static final String TEAM_LEADER_TYPE_NAME = "TeamLeader"; + public static final String TEAM_MEMBER_TYPE_NAME = "TeamMember"; + public static final String PROJECT_MANAGER_TYPE_NAME = "ProjectManager"; + public static final String COMMUNITY_MEMBER_TYPE_NAME = "CommunityMember"; + public static final String NOTE_LOG_AUTHOR_TYPE_NAME = "NoteLogAuthor"; + public static final String GOVERNANCE_ROLE_TYPE_NAME = "GovernanceRole"; + public static final String GOVERNANCE_OFFICER_TYPE_NAME = "GovernanceOfficer"; + public static final String GOVERNANCE_REPRESENTATIVE_TYPE_NAME = "GovernanceRepresentative"; + public static final String LOCATION_OWNER_TYPE_NAME = "LocationOwner"; + public static final String BUSINESS_OWNER_TYPE_NAME = "BusinessOwner"; + public static final String SOLUTION_OWNER_TYPE_NAME = "SolutionOwner"; + public static final String ASSET_OWNER_TYPE_NAME = "AssetOwner"; + public static final String SUBJECT_AREA_OWNER_TYPE_NAME = "SubjectAreaOwner"; + public static final String COMPONENT_OWNER_TYPE_NAME = "ComponentOwner"; + public static final String DATA_ITEM_OWNER_TYPE_NAME = "DataItemOwner"; + + public static final String PROJECT_TYPE_NAME = "Project"; + public static final String CAMPAIGN_CLASSIFICATION_NAME = "Campaign"; + public static final String TASK_CLASSIFICATION_NAME = "Task"; + public static final String GLOSSARY_PROJECT_CLASSIFICATION_NAME = "GlossaryProject"; + public static final String GOVERNANCE_PROJECT_CLASSIFICATION_NAME = "GovernanceProject"; + private static final String PROJECT_HIERARCHY_RELATIONSHIP_NAME = "ProjectHierarchy"; + private static final String PROJECT_DEPENDENCY_RELATIONSHIP_NAME = "ProjectDependency"; + private static final String PROJECT_TEAM_RELATIONSHIP_NAME = "ProjectTeam"; + private static final String PROJECT_MANAGEMENT_RELATIONSHIP_NAME = "ProjectManagement"; + + private static final String STAKEHOLDER_RELATIONSHIP_NAME = "Stakeholder"; + + public static final String COMMUNITY_TYPE_NAME = "Community"; + private static final String COMMUNITY_MEMBERSHIP_RELATIONSHIP_NAME = "CommunityMembership"; + private static final String COMMUNITY_MEMBERSHIP_TYPE_ENUM_NAME = "CommunityMembershipType"; + public static final int COMMUNITY_MEMBERSHIP_TYPE_CONTRIBUTOR = 0; + public static final int COMMUNITY_MEMBERSHIP_TYPE_ADMINISTRATOR = 1; + public static final int COMMUNITY_MEMBERSHIP_TYPE_LEADER = 2; + public static final int COMMUNITY_MEMBERSHIP_TYPE_OBSERVER = 3; + public static final int COMMUNITY_MEMBERSHIP_TYPE_OTHER = 99; + private static final String CONTEXT_DEFINITION_CLASSIFICATION_NAME = "ContextDefinition"; private static final String USED_IN_CONTEXT_RELATIONSHIP_NAME = "UsedInContext"; @@ -170,12 +308,72 @@ public class SimpleCatalogArchiveHelper /* * Properties */ - protected static final String QUALIFIED_NAME_PROPERTY = "qualifiedName"; - protected static final String ADDITIONAL_PROPERTIES_PROPERTY = "additionalProperties"; + protected static final String QUALIFIED_NAME_PROPERTY = "qualifiedName"; + protected static final String ADDITIONAL_PROPERTIES_PROPERTY = "additionalProperties"; + + protected static final String NAME_PROPERTY = "name"; + protected static final String DISPLAY_NAME_PROPERTY = "displayName"; + protected static final String DESCRIPTION_PROPERTY = "description"; + + private static final String COORDINATES_PROPERTY = "coordinates"; + private static final String MAP_PROJECTION_PROPERTY = "mapProjection"; + private static final String POSTAL_ADDRESS_PROPERTY = "postalAddress"; + private static final String TIME_ZONE_PROPERTY = "timeZone"; + private static final String LEVEL_PROPERTY = "level"; + + private static final String ASSOCIATION_TYPE_PROPERTY = "associationType"; + private static final String CONTACT_TYPE_PROPERTY = "contactType"; + private static final String CONTACT_METHOD_TYPE_PROPERTY = "contactMethodType"; + private static final String CONTACT_METHOD_SERVICE_PROPERTY = "contactMethodService"; + private static final String CONTACT_METHOD_VALUE_PROPERTY = "contactMethodValue"; + private static final String DISTINGUISHED_NAME_PROPERTY = "distinguishedName"; + private static final String ROLE_TYPE_NAME_PROPERTY = "roleTypeName"; + private static final String ROLE_GUID_PROPERTY = "roleGUID"; + private static final String IS_PUBLIC_PROPERTY = "isPublic"; + private static final String HEAD_COUNT_PROPERTY = "headCount"; + private static final String PRONOUNS_PROPERTY = "pronouns"; + private static final String TITLE_PROPERTY = "title"; + private static final String INITIALS_PROPERTY = "initials"; + private static final String GIVEN_NAMES_PROPERTY = "givenNames"; + private static final String SURNAME_PROPERTY = "surname"; + private static final String FULL_NAME_PROPERTY = "fullName"; + private static final String JOB_TITLE_PROPERTY = "jobTitle"; + private static final String EMPLOYEE_NUMBER_PROPERTY = "employeeNumber"; + private static final String EMPLOYEE_TYPE_PROPERTY = "employeeType"; + private static final String PREFERRED_LANGUAGE_PROPERTY = "preferredLanguage"; + private static final String DELEGATION_ESCALATION_AUTHORITY_PROPERTY = "delegationEscalationAuthority"; + private static final String TEAM_TYPE_PROPERTY = "teamType"; + private static final String ASSIGNMENT_TYPE_PROPERTY = "assignmentType"; + + private static final String DEPENDENCY_SUMMARY_PROPERTY = "dependencySummary"; + private static final String TEAM_ROLE_PROPERTY = "teamRole"; + private static final String START_DATE_PROPERTY = "startDate"; + private static final String PLANNED_END_DATE_PROPERTY = "plannedEndDate"; + private static final String PROJECT_STATUS_PROPERTY = "projectStatus"; + + private static final String MISSION_PROPERTY = "mission"; + private static final String MEMBERSHIP_TYPE_PROPERTY = "membershipType"; + private static final String MEMBERSHIP_RATIONALE_PROPERTY = "membershipRationale"; + private static final String PROJECT_TYPE_PROPERTY = "projectType"; + private static final String PURPOSES_PROPERTY = "purposes"; + private static final String DETAILS_PROPERTY = "details"; + + private static final String GROUPS_PROPERTY = "groups"; + private static final String SECURITY_LABELS_PROPERTY = "securityLabels"; + private static final String SECURITY_PROPERTIES_PROPERTY = "securityProperties"; + + private static final String IDENTIFIER_PROPERTY = "identifier"; + + private static final String ORGANIZATION_PROPERTY = "organization"; + private static final String ORGANIZATION_PROPERTY_NAME_PROPERTY = "organizationPropertyName"; + private static final String BUSINESS_CAPABILITY_PROPERTY = "businessCapability"; + private static final String BUSINESS_CAPABILITY_TYPE_PROPERTY = "businessCapabilityType"; + private static final String BUSINESS_CAPABILITY_PROPERTY_NAME_PROPERTY = "businessCapabilityPropertyName"; + private static final String OTHER_ORIGIN_VALUES_PROPERTY = "otherOriginValues"; - protected static final String NAME_PROPERTY = "name"; - protected static final String DISPLAY_NAME_PROPERTY = "displayName"; - protected static final String DESCRIPTION_PROPERTY = "description"; + private static final String OWNER_PROPERTY = "owner"; + private static final String OWNER_TYPE_NAME_PROPERTY = "ownerTypeName"; + private static final String OWNER_PROPERTY_NAME_PROPERTY = "ownerPropertyName"; private static final String ATTRIBUTE_NAME_PROPERTY = "attributeName"; private static final String TECHNICAL_NAME_PROPERTY = "technicalName"; @@ -191,6 +389,15 @@ public class SimpleCatalogArchiveHelper private static final String ASSET_SUMMARY_PROPERTY = "assetSummary"; private static final String ZONE_MEMBERSHIP_PROPERTY = "zoneMembership"; + private static final String ZONE_NAME_PROPERTY = "zoneName"; + private static final String SUBJECT_AREA_NAME_PROPERTY = "subjectAreaName"; + public static final String DOMAIN_IDENTIFIER_PROPERTY = "domainIdentifier"; + private static final String PRIORITY_PROPERTY = "priority"; + private static final String IMPLICATIONS_PROPERTY = "implications"; + private static final String OUTCOMES_PROPERTY = "outcomes"; + private static final String RESULTS_PROPERTY = "results"; + private static final String JURISDICTION_PROPERTY = "jurisdiction"; + private static final String RATIONALE_PROPERTY = "rationale"; private static final String CAPABILITY_TYPE_PROPERTY = "capabilityType"; private static final String CAPABILITY_VERSION_PROPERTY = "capabilityVersion"; @@ -219,10 +426,10 @@ public class SimpleCatalogArchiveHelper private static final String PROTOCOL_PROPERTY = "protocol"; private static final String REQUIRED_PROPERTY = "required"; private static final String PARAMETER_TYPE_PROPERTY = "parameterType"; - private static final String PATH_TYPE_PROPERTY = "path"; - private static final String COMMAND_TYPE_PROPERTY = "command"; - private static final String CONFIDENCE_TYPE_PROPERTY = "confidence"; + private static final String PATH_PROPERTY = "path"; + private static final String COMMAND_PROPERTY = "command"; private static final String SCOPE_PROPERTY = "scope"; + private static final String CRITERIA_PROPERTY = "criteria"; private static final String STATUS_PROPERTY = "status"; private static final String STEWARD_PROPERTY = "steward"; private static final String STEWARD_TYPE_NAME_PROPERTY = "stewardTypeName"; @@ -252,12 +459,10 @@ public class SimpleCatalogArchiveHelper private static final String DEFAULT_VALUE_PROPERTY = "defaultValue"; private static final String FIXED_VALUE_PROPERTY = "fixedValue"; - protected static final String DOMAIN_IDENTIFIER_PROPERTY = "domainIdentifier"; private static final String SUMMARY_PROPERTY = "summary"; private static final String EXAMPLES_PROPERTY = "examples"; private static final String ABBREVIATION_PROPERTY = "abbreviation"; private static final String LANGUAGE_PROPERTY = "language"; - private static final String IDENTIFIER_PROPERTY = "identifier"; private static final String LAST_VERIFIED_PROPERTY = "lastVerified"; private static final String REFERENCE_ID_PROPERTY = "referenceId"; @@ -273,7 +478,6 @@ public class SimpleCatalogArchiveHelper private static final String AUTHORS_PROPERTY = "authors"; private static final String NUMBER_OF_PAGES_PROPERTY = "numberOfPages"; private static final String PAGE_RANGE_PROPERTY = "pageRange"; - private static final String ORGANIZATION_PROPERTY = "organization"; private static final String PUBLICATION_SERIES_PROPERTY = "publicationSeries"; private static final String PUBLICATION_SERIES_VOLUME_PROPERTY = "publicationSeriesVolume"; private static final String EDITION_PROPERTY = "edition"; @@ -304,6 +508,7 @@ public class SimpleCatalogArchiveHelper private static final String IMPLEMENTATION_VALUE_PROPERTY = "implementationValue"; private static final String ADDITIONAL_VALUES_PROPERTY = "additionalValues"; private static final String ASSOCIATION_DESCRIPTION_PROPERTY = "associationDescription"; + private static final String IS_DEFAULT_VALUE_PROPERTY = "isDefaultValue"; protected OpenMetadataArchiveBuilder archiveBuilder; @@ -355,7 +560,7 @@ public SimpleCatalogArchiveHelper(OpenMetadataArchiveBuilder archiveBuilder, /** - * Return the guid of an element based on its qualified name. This is a look up in the GUID map not the archive. + * Return the guid of an element based on its qualified name. This is a lookup in the GUID map not the archive. * This means if the qualified name is not known, a new GUID is generated. * * @param qualifiedName qualified name ot look up @@ -455,123 +660,1769 @@ public String addExternalReference(String typeName, { final String methodName = "addExternalReference"; - String elementTypeName = EXTERNAL_REFERENCE_TYPE_NAME; + String elementTypeName = EXTERNAL_REFERENCE_TYPE_NAME; + + if (typeName != null) + { + elementTypeName = typeName; + } + + InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, QUALIFIED_NAME_PROPERTY, qualifiedName, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, DISPLAY_NAME_PROPERTY, displayName, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, REFERENCE_TITLE_PROPERTY, referenceTitle, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, REFERENCE_ABSTRACT_PROPERTY, referenceAbstract, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, DESCRIPTION_PROPERTY, description, methodName); + properties = archiveHelper.addStringArrayPropertyToInstance(archiveRootName, properties, AUTHORS_PROPERTY, authors, methodName); + properties = archiveHelper.addIntPropertyToInstance(archiveRootName, properties, NUMBER_OF_PAGES_PROPERTY, numberOfPages, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, PAGE_RANGE_PROPERTY, pageRange, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, ORGANIZATION_PROPERTY, authorOrganization, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, REFERENCE_VERSION_PROPERTY, versionNumber, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, PUBLICATION_SERIES_PROPERTY, publicationSeries, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, PUBLICATION_SERIES_VOLUME_PROPERTY, publicationSeriesVolume, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, EDITION_PROPERTY, edition, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, URL_PROPERTY, referenceURL, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, PUBLISHER_PROPERTY, publisher, methodName); + properties = archiveHelper.addDatePropertyToInstance(archiveRootName, properties, FIRST_PUBLICATION_DATE_PROPERTY, firstPublicationDate, methodName); + properties = archiveHelper.addDatePropertyToInstance(archiveRootName, properties, PUBLICATION_DATE_PROPERTY, publicationDate, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, PUBLICATION_CITY_PROPERTY, publicationCity, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, PUBLICATION_YEAR_PROPERTY, publicationYear, methodName); + properties = archiveHelper.addStringArrayPropertyToInstance(archiveRootName, properties, PUBLICATION_NUMBERS_PROPERTY, publicationNumbers, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, LICENSE_PROPERTY, license, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, COPYRIGHT_PROPERTY, copyright, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, ATTRIBUTION_PROPERTY, attribution, methodName); + properties = archiveHelper.addStringMapPropertyToInstance(archiveRootName, properties, ADDITIONAL_PROPERTIES_PROPERTY, additionalProperties, methodName); + properties = archiveHelper.addPropertyMapToInstance(archiveRootName, properties, extendedProperties, methodName); + + EntityDetail externalReferenceEntity = archiveHelper.getEntityDetail(elementTypeName, + idToGUIDMap.getGUID(qualifiedName), + properties, + InstanceStatus.ACTIVE, + null); + + archiveBuilder.addEntity(externalReferenceEntity); + + if (searchKeywords != null) + { + for (String keyword : searchKeywords) + { + if (keyword != null) + { + String keywordGUID = idToGUIDMap.queryGUID(SEARCH_KEYWORD_TYPE_NAME + ":" + keyword); + EntityDetail keywordEntity = null; + + InstanceProperties keywordProperties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, KEYWORD_PROPERTY, keyword, methodName); + + if (keywordGUID != null) + { + keywordEntity = archiveBuilder.queryEntity(keywordGUID); + } + + if (keywordEntity == null) + { + keywordEntity = archiveHelper.getEntityDetail(SEARCH_KEYWORD_TYPE_NAME, + idToGUIDMap.getGUID(SEARCH_KEYWORD_TYPE_NAME + ":" + keyword), + keywordProperties, + InstanceStatus.ACTIVE, + null); + archiveBuilder.addEntity(keywordEntity); + } + + if (keywordEntity != null) + { + EntityProxy end1 = archiveHelper.getEntityProxy(externalReferenceEntity); + EntityProxy end2 = archiveHelper.getEntityProxy(keywordEntity); + + archiveBuilder.addRelationship(archiveHelper.getRelationship(SEARCH_KEYWORD_LINK_RELATIONSHIP_NAME, + idToGUIDMap.getGUID(externalReferenceEntity.getGUID() + "_to_" + keywordEntity.getGUID() + "_search_keyword_link_relationship"), + null, + InstanceStatus.ACTIVE, + end1, + end2)); + } + } + } + } + + return externalReferenceEntity.getGUID(); + } + + + /** + * Create the relationship between a referenceable and an external reference. + * + * @param referenceableGUID unique identifier of the element making the reference + * @param externalReferenceGUID unique identifier of the external reference + * @param referenceId unique reference id for this referenceable + * @param description description of the relevance of the external reference + * @param pages relevant pages in the external reference + */ + public void addExternalReferenceLink(String referenceableGUID, + String externalReferenceGUID, + String referenceId, + String description, + String pages) + { + final String methodName = "addExternalReferenceLink"; + + EntityDetail referenceableEntity = archiveBuilder.getEntity(referenceableGUID); + EntityDetail externalReferenceEntity = archiveBuilder.getEntity(externalReferenceGUID); + + EntityProxy end1 = archiveHelper.getEntityProxy(referenceableEntity); + EntityProxy end2 = archiveHelper.getEntityProxy(externalReferenceEntity); + + InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, REFERENCE_ID_PROPERTY, referenceId, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, DESCRIPTION_PROPERTY, description, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, PAGES_PROPERTY, pages, methodName); + + archiveBuilder.addRelationship(archiveHelper.getRelationship(EXTERNAL_REFERENCE_LINK_RELATIONSHIP_NAME, + idToGUIDMap.getGUID(referenceableGUID + "_to_" + externalReferenceGUID + "_external_reference_link_relationship" + referenceId), + properties, + InstanceStatus.ACTIVE, + end1, + end2)); + } + + + /** + * Create a media reference entity. This typically describes an image, audio clip or video clip. + * + * @param typeName name of element subtype to use - default is RelatedMedia + * @param qualifiedName unique name for the element + * @param displayName display name for the element + * @param description description about the element + * @param authors authors of the element + * @param authorOrganization organization that the information is from + * @param versionNumber version number for the element + * @param referenceURL link to the external source + * @param license name of the license associated with this external source + * @param copyright copyright statement associated with this external source + * @param attribution attribution statement to use when consuming this external source + * @param mediaType type of media + * @param mediaTypeOtherId if media type is "other" add type here + * @param defaultMediaUsage usage of media if not supplied on media reference link relationship + * @param defaultMediaUsageOtherId if default media usage is "other" add usage type here + * @param searchKeywords list of keywords + * @param additionalProperties any other properties + * @param extendedProperties additional properties defined in the subtype + * @return unique identifier for new media reference (mediaReferenceGUID) + */ + public String addMediaReference(String typeName, + String qualifiedName, + String displayName, + String description, + List authors, + String authorOrganization, + String versionNumber, + String referenceURL, + String license, + String copyright, + String attribution, + int mediaType, + String mediaTypeOtherId, + int defaultMediaUsage, + String defaultMediaUsageOtherId, + List searchKeywords, + Map additionalProperties, + Map extendedProperties) + { + final String methodName = "addMediaReference"; + + String elementTypeName = RELATED_MEDIA_TYPE_NAME; + + if (typeName != null) + { + elementTypeName = typeName; + } + + EnumElementDef typeEnumElement = archiveHelper.getEnumElement(MEDIA_TYPE_ENUM_NAME, mediaType); + EnumElementDef usageEnumElement = archiveHelper.getEnumElement(MEDIA_USAGE_ENUM_NAME, defaultMediaUsage); + + InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, QUALIFIED_NAME_PROPERTY, qualifiedName, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, DISPLAY_NAME_PROPERTY, displayName, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, DESCRIPTION_PROPERTY, description, methodName); + properties = archiveHelper.addStringArrayPropertyToInstance(archiveRootName, properties, AUTHORS_PROPERTY, authors, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, ORGANIZATION_PROPERTY, authorOrganization, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, REFERENCE_VERSION_PROPERTY, versionNumber, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, URL_PROPERTY, referenceURL, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, LICENSE_PROPERTY, license, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, COPYRIGHT_PROPERTY, copyright, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, ATTRIBUTION_PROPERTY, attribution, methodName); + properties = archiveHelper.addEnumPropertyToInstance(archiveRootName, properties, MEDIA_TYPE_PROPERTY, typeEnumElement.getOrdinal(), typeEnumElement.getValue(), typeEnumElement.getDescription(), methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, MEDIA_TYPE_OTHER_ID_PROPERTY, mediaTypeOtherId, methodName); + properties = archiveHelper.addEnumPropertyToInstance(archiveRootName, properties, DEFAULT_MEDIA_USAGE_PROPERTY, usageEnumElement.getOrdinal(), usageEnumElement.getValue(), usageEnumElement.getDescription(), methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, DEFAULT_MEDIA_USAGE_OTHER_ID_PROPERTY, defaultMediaUsageOtherId, methodName); + properties = archiveHelper.addStringMapPropertyToInstance(archiveRootName, properties, ADDITIONAL_PROPERTIES_PROPERTY, additionalProperties, methodName); + properties = archiveHelper.addPropertyMapToInstance(archiveRootName, properties, extendedProperties, methodName); + + EntityDetail mediaReferenceEntity = archiveHelper.getEntityDetail(elementTypeName, + idToGUIDMap.getGUID(qualifiedName), + properties, + InstanceStatus.ACTIVE, + null); + + archiveBuilder.addEntity(mediaReferenceEntity); + + if (searchKeywords != null) + { + for (String keyword : searchKeywords) + { + if (keyword != null) + { + String keywordGUID = idToGUIDMap.queryGUID(SEARCH_KEYWORD_TYPE_NAME + ":" + keyword); + EntityDetail keywordEntity = null; + + InstanceProperties keywordProperties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, KEYWORD_PROPERTY, keyword, methodName); + + if (keywordGUID != null) + { + keywordEntity = archiveBuilder.queryEntity(keywordGUID); + } + + if (keywordEntity == null) + { + keywordEntity = archiveHelper.getEntityDetail(SEARCH_KEYWORD_TYPE_NAME, + idToGUIDMap.getGUID(SEARCH_KEYWORD_TYPE_NAME + ":" + keyword), + keywordProperties, + InstanceStatus.ACTIVE, + null); + archiveBuilder.addEntity(keywordEntity); + } + + if (keywordEntity != null) + { + EntityProxy end1 = archiveHelper.getEntityProxy(mediaReferenceEntity); + EntityProxy end2 = archiveHelper.getEntityProxy(keywordEntity); + + archiveBuilder.addRelationship(archiveHelper.getRelationship(SEARCH_KEYWORD_LINK_RELATIONSHIP_NAME, + idToGUIDMap.getGUID(mediaReferenceEntity.getGUID() + "_to_" + keywordEntity.getGUID() + "_search_keyword_link_relationship"), + null, + InstanceStatus.ACTIVE, + end1, + end2)); + } + } + } + } + + return mediaReferenceEntity.getGUID(); + } + + + /** + * Create the relationship between a referenceable and an external reference. + * + * @param referenceableGUID unique identifier of the element making the reference + * @param mediaReferenceGUID unique identifier of the media reference + * @param mediaId unique reference id for this media element + * @param description description of the relevance of the media reference + * @param mediaUsage type of usage + * @param mediaUsageOtherId other type of media usage (for example if using a valid value set). + */ + public void addMediaReferenceLink(String referenceableGUID, + String mediaReferenceGUID, + String mediaId, + String description, + int mediaUsage, + String mediaUsageOtherId) + { + final String methodName = "addMediaReferenceLink"; + + EnumElementDef enumElement = archiveHelper.getEnumElement(MEDIA_USAGE_ENUM_NAME, mediaUsage); + + EntityDetail referenceableEntity = archiveBuilder.getEntity(referenceableGUID); + EntityDetail externalReferenceEntity = archiveBuilder.getEntity(mediaReferenceGUID); + + EntityProxy end1 = archiveHelper.getEntityProxy(referenceableEntity); + EntityProxy end2 = archiveHelper.getEntityProxy(externalReferenceEntity); + + InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, MEDIA_ID_PROPERTY, mediaId, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, DESCRIPTION_PROPERTY, description, methodName); + properties = archiveHelper.addEnumPropertyToInstance(archiveRootName, properties, MEDIA_USAGE_PROPERTY, enumElement.getOrdinal(), enumElement.getValue(), enumElement.getDescription(), methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, MEDIA_TYPE_OTHER_ID_PROPERTY, mediaUsageOtherId, methodName); + + archiveBuilder.addRelationship(archiveHelper.getRelationship(MEDIA_REFERENCE_RELATIONSHIP_NAME, + idToGUIDMap.getGUID(referenceableGUID + "_to_" + mediaReferenceGUID + "_media_reference_relationship" + mediaId), + properties, + InstanceStatus.ACTIVE, + end1, + end2)); + } + + + /** + * Add a location entity to the archive. + * + * @param qualifiedName unique name of the location + * @param identifier code value or symbol used to identify the location - typically unique + * @param displayName display name of the location + * @param description description of the location + * @param additionalProperties any additional properties + * @return unique identifier of the location + */ + public String addLocation(String qualifiedName, + String identifier, + String displayName, + String description, + Map additionalProperties) + { + final String methodName = "addLocation"; + + return addClassifiedLocation(qualifiedName, identifier, displayName, description, additionalProperties, null, null, methodName); + } + + + /** + * Add a location with a FixedLocation classification. + * + * @param qualifiedName unique name of the location + * @param identifier code value or symbol used to identify the location - typically unique + * @param displayName display name of the location + * @param description description of the location + * @param coordinates location coordinates + * @param mapProjection type of location coordinates + * @param postalAddress full postal address + * @param timeZone timezone of location + * @param additionalProperties any additional properties + * @return unique identifier of the new location + */ + public String addFixedLocation(String qualifiedName, + String identifier, + String displayName, + String description, + String coordinates, + String mapProjection, + String postalAddress, + String timeZone, + Map additionalProperties) + { + final String methodName = "addFixedLocation"; + + InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, COORDINATES_PROPERTY, coordinates, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, MAP_PROJECTION_PROPERTY, mapProjection, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, POSTAL_ADDRESS_PROPERTY, postalAddress, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, TIME_ZONE_PROPERTY, timeZone, methodName); + + return addClassifiedLocation(qualifiedName, identifier, displayName, description, additionalProperties, FIXED_LOCATION_CLASSIFICATION_NAME, properties, methodName); + } + + + /** + * Add a location with a SecureLocation classification. + * + * @param qualifiedName unique name of the location + * @param identifier code value or symbol used to identify the location - typically unique + * @param displayName display name of the location + * @param description description of the location + * @param level level of security + * @param securityDescription description of security provision + * @param additionalProperties additional properties for the location + * @return unique identifier of the new location + */ + public String addSecureLocation(String qualifiedName, + String identifier, + String displayName, + String description, + String level, + String securityDescription, + Map additionalProperties) + { + final String methodName = "addSecureLocation"; + + InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, LEVEL_PROPERTY, level, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, DESCRIPTION_PROPERTY, securityDescription, methodName); + + return addClassifiedLocation(qualifiedName, identifier, displayName, description, additionalProperties, SECURE_LOCATION_CLASSIFICATION_NAME, properties, methodName); + } + + + /** + * Add a location entity with the CyberLocation classification to the archive. + * + * @param qualifiedName unique name of the location + * @param identifier code value or symbol used to identify the location - typically unique + * @param displayName display name of the location + * @param description description of the location + * @param networkAddress address of the cyber location + * @param additionalProperties any additional properties + * @return unique identifier of the location + */ + public String addCyberLocation(String qualifiedName, + String identifier, + String displayName, + String description, + String networkAddress, + Map additionalProperties) + { + final String methodName = "addCyberLocation"; + + InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, NETWORK_ADDRESS_PROPERTY, networkAddress, methodName); + + return addClassifiedLocation(qualifiedName, identifier, displayName, description, additionalProperties, CYBER_LOCATION_CLASSIFICATION_NAME, properties, methodName); + } + + + /** + * Add a location entity to the archive. + * + * @param qualifiedName unique name of the location + * @param identifier code value or symbol used to identify the location - typically unique + * @param displayName display name of the location + * @param description description of the location + * @param additionalProperties any additional properties + * @return unique identifier of the location + */ + private String addClassifiedLocation(String qualifiedName, + String identifier, + String displayName, + String description, + Map additionalProperties, + String classificationName, + InstanceProperties classificationProperties, + String methodName) + { + InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, QUALIFIED_NAME_PROPERTY, qualifiedName, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, IDENTIFIER_PROPERTY, identifier, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, DISPLAY_NAME_PROPERTY, displayName, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, DESCRIPTION_PROPERTY, description, methodName); + properties = archiveHelper.addStringMapPropertyToInstance(archiveRootName, properties, ADDITIONAL_PROPERTIES_PROPERTY, additionalProperties, methodName); + + List classifications = new ArrayList<>(); + + Classification classification = archiveHelper.getClassification(classificationName, classificationProperties, InstanceStatus.ACTIVE); + + classifications.add(classification); + + EntityDetail location = archiveHelper.getEntityDetail(LOCATION_TYPE_NAME, + idToGUIDMap.getGUID(qualifiedName), + properties, + InstanceStatus.ACTIVE, + classifications); + + archiveBuilder.addEntity(location); + + return location.getGUID(); + } + + + /** + * Add the MobileAsset classification to the requested asset. + * + * @param assetGUID unique identifier of the element to classify + */ + public void addMobileAssetClassification(String assetGUID) + { + EntityDetail assetEntity = archiveBuilder.getEntity(assetGUID); + + EntityProxy entityProxy = archiveHelper.getEntityProxy(assetEntity); + + Classification classification = archiveHelper.getClassification(MOBILE_ASSET_CLASSIFICATION_NAME, + null, + InstanceStatus.ACTIVE); + + archiveBuilder.addClassification(archiveHelper.getClassificationEntityExtension(entityProxy, classification)); + } + + + /** + * Create the relationship between a locations and one of the locations nested within it. + * + * @param broaderLocationGUID unique identifier of the broader location + * @param nestedLocationGUID unique identifier of the nested location + */ + public void addLocationHierarchy(String broaderLocationGUID, + String nestedLocationGUID) + { + EntityDetail entity1 = archiveBuilder.getEntity(broaderLocationGUID); + EntityDetail entity2 = archiveBuilder.getEntity(nestedLocationGUID); + + EntityProxy end1 = archiveHelper.getEntityProxy(entity1); + EntityProxy end2 = archiveHelper.getEntityProxy(entity2); + + archiveBuilder.addRelationship(archiveHelper.getRelationship(NESTED_LOCATION_RELATIONSHIP_NAME, + idToGUIDMap.getGUID(broaderLocationGUID + "_to_" + nestedLocationGUID + "_nested_location_relationship"), + null, + InstanceStatus.ACTIVE, + end1, + end2)); + } + + + /** + * Link two locations as peers using the AdjacentLocation relationship. + * + * @param location1GUID unique identifier of the broader location + * @param location2GUID unique identifier of the nested location + */ + public void addPeerLocations(String location1GUID, + String location2GUID) + { + EntityDetail referenceableEntity = archiveBuilder.getEntity(location1GUID); + EntityDetail externalReferenceEntity = archiveBuilder.getEntity(location2GUID); + + EntityProxy end1 = archiveHelper.getEntityProxy(referenceableEntity); + EntityProxy end2 = archiveHelper.getEntityProxy(externalReferenceEntity); + + archiveBuilder.addRelationship(archiveHelper.getRelationship(ADJACENT_LOCATION_RELATIONSHIP_NAME, + idToGUIDMap.getGUID(location1GUID + "_to_" + location2GUID + "_adjacent_location_relationship"), + null, + InstanceStatus.ACTIVE, + end1, + end2)); + } + + + /** + * Link a location to an asset. + * + * @param locationQName qualified name of the location + * @param assetQName qualified name of the asset + */ + public void addAssetLocationRelationship(String locationQName, + String assetQName) + { + String validValueId = idToGUIDMap.getGUID(locationQName); + String assetId = idToGUIDMap.getGUID(assetQName); + + EntityProxy end1 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(validValueId)); + EntityProxy end2 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(assetId)); + + archiveBuilder.addRelationship(archiveHelper.getRelationship(ASSET_LOCATION_RELATIONSHIP_NAME, + idToGUIDMap.getGUID(validValueId + "_to_" + assetId + "_asset_location_relationship"), + null, + InstanceStatus.ACTIVE, + end1, + end2)); + } + + + + /** + * Add a user identity entity to the archive. + * + * @param qualifiedName unique name of the user identity + * @param userId name of the user account + * @param distinguishedName LDAP name for the user + * @param additionalProperties any additional properties + * @return unique identifier of the user identity + */ + public String addUserIdentity(String qualifiedName, + String userId, + String distinguishedName, + Map additionalProperties) + { + final String methodName = "addUserIdentity"; + + InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, QUALIFIED_NAME_PROPERTY, qualifiedName, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, USER_ID_PROPERTY, userId, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, DISTINGUISHED_NAME_PROPERTY, distinguishedName, methodName); + properties = archiveHelper.addStringMapPropertyToInstance(archiveRootName, properties, ADDITIONAL_PROPERTIES_PROPERTY, additionalProperties, methodName); + + EntityDetail userIdentity = archiveHelper.getEntityDetail(USER_IDENTITY_TYPE_NAME, + idToGUIDMap.getGUID(qualifiedName), + properties, + InstanceStatus.ACTIVE, + null); + + archiveBuilder.addEntity(userIdentity); + + return userIdentity.getGUID(); + } + + + /** + * Link a location to a profile. + * + * @param profileQName qualified name of the profile + * @param locationQName qualified name of the location + * @param associationType identifier that describes the purpose of the association. + */ + public void addProfileLocationRelationship(String profileQName, + String locationQName, + String associationType) + { + final String methodName = "addProfileLocationRelationship"; + + String entity1GUID = idToGUIDMap.getGUID(locationQName); + String entity2GUID = idToGUIDMap.getGUID(profileQName); + + EntityProxy end1 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(entity1GUID)); + EntityProxy end2 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(entity2GUID)); + + InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, ASSOCIATION_TYPE_PROPERTY, associationType, methodName); + + archiveBuilder.addRelationship(archiveHelper.getRelationship(PROFILE_LOCATION_RELATIONSHIP_NAME, + idToGUIDMap.getGUID(entity1GUID + "_to_" + entity2GUID + "_profile_location_relationship"), + properties, + InstanceStatus.ACTIVE, + end1, + end2)); + } + + + /** + * Create the relationship between a profile and one of its userIds. + * + * @param profileGUID unique identifier of the actor profile + * @param userIdentityGUID unique identifier of the user identity + * @param roleTypeName type of role that uses this userId + * @param roleGUID unique identifier of role that uses this userId + * @param description description of why role uses this userId + */ + public void addProfileIdentity(String profileGUID, + String userIdentityGUID, + String roleTypeName, + String roleGUID, + String description) + { + final String methodName = "addProfileIdentity"; + + EntityDetail profileEntity = archiveBuilder.getEntity(profileGUID); + EntityDetail userIdentityEntity = archiveBuilder.getEntity(userIdentityGUID); + + EntityProxy end1 = archiveHelper.getEntityProxy(profileEntity); + EntityProxy end2 = archiveHelper.getEntityProxy(userIdentityEntity); + + InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, ROLE_TYPE_NAME_PROPERTY, roleTypeName, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, ROLE_GUID_PROPERTY, roleGUID, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, DESCRIPTION_PROPERTY, description, methodName); + + archiveBuilder.addRelationship(archiveHelper.getRelationship(PROFILE_IDENTITY_RELATIONSHIP_NAME, + idToGUIDMap.getGUID(profileGUID + "_to_" + userIdentityGUID + "_profile_identity_relationship"), + properties, + InstanceStatus.ACTIVE, + end1, + end2)); + } + + + /** + * Add a contact method to a profile. + * + * @param profileGUID unique identifier for a profile + * @param name name of the contact method + * @param contactType type of contact - eg home address, work mobile, emergency contact ... + * @param contactMethodType type of contact address + * @param contactMethodService service used in the contact method + * @param contactMethodValue name/account/url used to contact the individual + */ + public void addContactDetails(String profileGUID, + String name, + String contactType, + int contactMethodType, + String contactMethodService, + String contactMethodValue) + { + final String methodName = "addContactDetails"; + + EntityDetail profileEntity = archiveBuilder.getEntity(profileGUID); + + EnumElementDef enumElement = archiveHelper.getEnumElement(CONTACT_METHOD_TYPE_ENUM_NAME, contactMethodType); + + InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, NAME_PROPERTY, name, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, CONTACT_TYPE_PROPERTY, contactType, methodName); + properties = archiveHelper.addEnumPropertyToInstance(archiveRootName, properties, CONTACT_METHOD_TYPE_PROPERTY, enumElement.getOrdinal(), enumElement.getValue(), enumElement.getDescription(), methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, CONTACT_METHOD_SERVICE_PROPERTY, contactMethodService, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, CONTACT_METHOD_VALUE_PROPERTY, contactMethodValue, methodName); + + EntityDetail contactDetails = archiveHelper.getEntityDetail(CONTACT_DETAILS_TYPE_NAME, + idToGUIDMap.getGUID(contactMethodValue), + properties, + InstanceStatus.ACTIVE, + null); + + archiveBuilder.addEntity(contactDetails); + + EntityProxy end1 = archiveHelper.getEntityProxy(profileEntity); + EntityProxy end2 = archiveHelper.getEntityProxy(contactDetails); + + archiveBuilder.addRelationship(archiveHelper.getRelationship(CONTACT_THROUGH_RELATIONSHIP_NAME, + idToGUIDMap.getGUID(profileGUID + "_to_" + contactDetails.getGUID() + "_contact_through_relationship"), + properties, + InstanceStatus.ACTIVE, + end1, + end2)); + } + + + /** + * Add a new person role. + * + * @param suppliedTypeName type name to use for the person role + * @param qualifiedName qualified name of role + * @param identifier unique code + * @param name display name + * @param description description (eg job description) + * @param scope scope of role's responsibilities + * @param setHeadCount should the headcount field be set? + * @param headCount number of people that may be appointed to the role (default = 1) + * @param additionalProperties are there any additional properties to add + * @param extendedProperties any additional properties associated with a subtype + * @return unique identifier of the new profile + */ + public String addPersonRole(String suppliedTypeName, + String qualifiedName, + String identifier, + String name, + String description, + String scope, + boolean setHeadCount, + int headCount, + Map additionalProperties, + Map extendedProperties) + { + final String methodName = "addPersonRole"; + + String typeName = suppliedTypeName; + + if (typeName == null) + { + typeName = PERSON_ROLE_TYPE_NAME; + } + + InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, QUALIFIED_NAME_PROPERTY, qualifiedName, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, IDENTIFIER_PROPERTY, identifier, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, NAME_PROPERTY, name, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, DESCRIPTION_PROPERTY, description, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, SCOPE_PROPERTY, scope, methodName); + if (setHeadCount) + { + properties = archiveHelper.addIntPropertyToInstance(archiveRootName, properties, HEAD_COUNT_PROPERTY, headCount, methodName); + } + properties = archiveHelper.addStringMapPropertyToInstance(archiveRootName, properties, ADDITIONAL_PROPERTIES_PROPERTY, additionalProperties, methodName); + properties = archiveHelper.addPropertyMapToInstance(archiveRootName, properties, extendedProperties, methodName); + + EntityDetail role = archiveHelper.getEntityDetail(typeName, + idToGUIDMap.getGUID(qualifiedName), + properties, + InstanceStatus.ACTIVE, + null); + + archiveBuilder.addEntity(role); + + return role.getGUID(); + } + + + /** + * Link a person profile to a person role. + * + * @param personQName qualified name of the person profile + * @param personRoleQName qualified name of the person role + * @param isPublic is this appointment public? + */ + public void addPersonRoleAppointmentRelationship(String personQName, + String personRoleQName, + boolean isPublic) + { + final String methodName = "addPersonRoleAppointmentRelationship"; + + String guid1 = idToGUIDMap.getGUID(personQName); + String guid2 = idToGUIDMap.getGUID(personRoleQName); + + EntityProxy end1 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(guid1)); + EntityProxy end2 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(guid2)); + + InstanceProperties properties = archiveHelper.addBooleanPropertyToInstance(archiveRootName, null, IS_PUBLIC_PROPERTY, isPublic, methodName); + + archiveBuilder.addRelationship(archiveHelper.getRelationship(PERSONAL_ROLE_APPOINTMENT_RELATIONSHIP_NAME, + idToGUIDMap.getGUID(guid1 + "_to_" + guid2 + "_person_role_appointment_relationship"), + properties, + InstanceStatus.ACTIVE, + end1, + end2)); + } + + + /** + * Link a person profile to another person as a peer. + * + * @param person1QName qualified name of the first person profile + * @param person2QName qualified name of the second person profile + */ + public void addPeerRelationship(String person1QName, + String person2QName) + { + String guid1 = idToGUIDMap.getGUID(person1QName); + String guid2 = idToGUIDMap.getGUID(person2QName); + + EntityProxy end1 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(guid1)); + EntityProxy end2 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(guid2)); + + archiveBuilder.addRelationship(archiveHelper.getRelationship(PEER_RELATIONSHIP_NAME, + idToGUIDMap.getGUID(guid1 + "_to_" + guid2 + "_peer_relationship"), + null, + InstanceStatus.ACTIVE, + end1, + end2)); + } + + + /** + * Add a new person profile. + * + * @param qualifiedName qualified name of profile + * @param name display name (preferred name of individual) + * @param pronouns preferred pronouns + * @param description description (eg job description) + * @param title courtesy title + * @param initials given names initials + * @param givenNames list of given names + * @param surname family name + * @param fullName full legal name + * @param jobTitle job title + * @param employeeNumber unique employee contract number + * @param employeeType type of employee + * @param preferredLanguage preferred language to communicate with + * @param isPublic is this profile public + * @param additionalProperties are there any additional properties to add + * @return unique identifier of the new profile + */ + public String addPerson(String qualifiedName, + String name, + String pronouns, + String description, + String initials, + String title, + String givenNames, + String surname, + String fullName, + String jobTitle, + String employeeNumber, + String employeeType, + String preferredLanguage, + boolean isPublic, + Map additionalProperties) + { + final String methodName = "addPerson"; + + InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, QUALIFIED_NAME_PROPERTY, qualifiedName, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, NAME_PROPERTY, name, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, PRONOUNS_PROPERTY, pronouns, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, DESCRIPTION_PROPERTY, description, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, TITLE_PROPERTY, title, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, INITIALS_PROPERTY, initials, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, GIVEN_NAMES_PROPERTY, givenNames, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, SURNAME_PROPERTY, surname, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, FULL_NAME_PROPERTY, fullName, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, JOB_TITLE_PROPERTY, jobTitle, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, EMPLOYEE_NUMBER_PROPERTY, employeeNumber, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, EMPLOYEE_TYPE_PROPERTY, employeeType, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, PREFERRED_LANGUAGE_PROPERTY, preferredLanguage, methodName); + properties = archiveHelper.addBooleanPropertyToInstance(archiveRootName, properties, IS_PUBLIC_PROPERTY, isPublic, methodName); + properties = archiveHelper.addStringMapPropertyToInstance(archiveRootName, properties, ADDITIONAL_PROPERTIES_PROPERTY, additionalProperties, methodName); + + EntityDetail person = archiveHelper.getEntityDetail(PERSON_TYPE_NAME, + idToGUIDMap.getGUID(qualifiedName), + properties, + InstanceStatus.ACTIVE, + null); + + archiveBuilder.addEntity(person); + + return person.getGUID(); + } + + + /** + * Add a new team profile. + * + * @param suppliedTypeName type name for the team + * @param qualifiedName qualified name of profile + * @param name display name (preferred name of individual) + * @param description description (eg job description) + * @param teamType type of team + * @param identifier code value identifier for the team + * @param additionalProperties are there any additional properties to add + * @return unique identifier of the new profile + */ + public String addTeam(String suppliedTypeName, + String qualifiedName, + String name, + String description, + String teamType, + String identifier, + Map additionalProperties) + { + final String methodName = "addTeam"; + + String typeName = suppliedTypeName; + if (typeName == null) + { + typeName = TEAM_TYPE_NAME; + } + + InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, QUALIFIED_NAME_PROPERTY, qualifiedName, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, NAME_PROPERTY, name, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, DESCRIPTION_PROPERTY, description, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, TEAM_TYPE_PROPERTY, teamType, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, IDENTIFIER_PROPERTY, teamType, methodName); + properties = archiveHelper.addStringMapPropertyToInstance(archiveRootName, properties, ADDITIONAL_PROPERTIES_PROPERTY, additionalProperties, methodName); + + EntityDetail profile = archiveHelper.getEntityDetail(typeName, + idToGUIDMap.getGUID(qualifiedName), + properties, + InstanceStatus.ACTIVE, + null); + + archiveBuilder.addEntity(profile); + + return profile.getGUID(); + } + + + /** + * Link a person role as a team's leader. + * + * @param personRoleQName qualified name of the person role + * @param teamQName qualified name of the team profile + * @param position position of the role + */ + public void addTeamLeadershipRelationship(String personRoleQName, + String teamQName, + String position) + { + final String methodName = "addTeamLeadershipRelationship"; + + String guid1 = idToGUIDMap.getGUID(personRoleQName); + String guid2 = idToGUIDMap.getGUID(teamQName); + + EntityProxy end1 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(guid1)); + EntityProxy end2 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(guid2)); + + InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, POSITION_PROPERTY, position, methodName); + + archiveBuilder.addRelationship(archiveHelper.getRelationship(TEAM_LEADERSHIP_RELATIONSHIP_NAME, + idToGUIDMap.getGUID(guid1 + "_to_" + guid2 + "_team_leadership_relationship"), + properties, + InstanceStatus.ACTIVE, + end1, + end2)); + } + + + /** + * Link a person role as a team's member. + * + * @param personRoleQName qualified name of the person role + * @param teamQName qualified name of the team profile + * @param position position of the role + */ + public void addTeamMembershipRelationship(String personRoleQName, + String teamQName, + String position) + { + final String methodName = "addTeamMembershipRelationship"; + + String guid1 = idToGUIDMap.getGUID(personRoleQName); + String guid2 = idToGUIDMap.getGUID(teamQName); + + EntityProxy end1 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(guid1)); + EntityProxy end2 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(guid2)); + + InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, POSITION_PROPERTY, position, methodName); + + archiveBuilder.addRelationship(archiveHelper.getRelationship(TEAM_MEMBERSHIP_RELATIONSHIP_NAME, + idToGUIDMap.getGUID(guid1 + "_to_" + guid2 + "_team_membership_relationship"), + properties, + InstanceStatus.ACTIVE, + end1, + end2)); + } + + + /** + * Link a person role as a team's member. + * + * @param superTeamQName qualified name of the super team profile + * @param subTeamQName qualified name of the subteam profile + * @param delegationEscalationAuthority delegationEscalationAuthority of the role + */ + public void addTeamStructureRelationship(String superTeamQName, + String subTeamQName, + boolean delegationEscalationAuthority) + { + final String methodName = "addTeamStructureRelationship"; + + String guid1 = idToGUIDMap.getGUID(superTeamQName); + String guid2 = idToGUIDMap.getGUID(subTeamQName); + + EntityProxy end1 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(guid1)); + EntityProxy end2 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(guid2)); + + InstanceProperties properties = archiveHelper.addBooleanPropertyToInstance(archiveRootName, null, DELEGATION_ESCALATION_AUTHORITY_PROPERTY, delegationEscalationAuthority, methodName); + + archiveBuilder.addRelationship(archiveHelper.getRelationship(TEAM_STRUCTURE_RELATIONSHIP_NAME, + idToGUIDMap.getGUID(guid1 + "_to_" + guid2 + "_team_structure_relationship"), + properties, + InstanceStatus.ACTIVE, + end1, + end2)); + } + + + /** + * Add a new IT profile. + * + * @param assetGUID unique identifier of asset to connect the profile to. + * @param qualifiedName qualified name of profile + * @param name display name (preferred name of individual) + * @param description description (eg job description) + * @param additionalProperties are there any additional properties to add + * @return unique identifier of the new profile + */ + public String addITProfileToAsset(String assetGUID, + String qualifiedName, + String name, + String description, + Map additionalProperties) + { + final String methodName = "addITProfile"; + + InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, QUALIFIED_NAME_PROPERTY, qualifiedName, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, NAME_PROPERTY, name, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, DESCRIPTION_PROPERTY, description, methodName); + properties = archiveHelper.addStringMapPropertyToInstance(archiveRootName, properties, ADDITIONAL_PROPERTIES_PROPERTY, additionalProperties, methodName); + + EntityDetail profile = archiveHelper.getEntityDetail(IT_PROFILE_TYPE_NAME, + idToGUIDMap.getGUID(qualifiedName), + properties, + InstanceStatus.ACTIVE, + null); + + archiveBuilder.addEntity(profile); + + if (assetGUID != null) + { + EntityDetail assetEntity = archiveBuilder.getEntity(assetGUID); + + EntityProxy end1 = archiveHelper.getEntityProxy(assetEntity); + EntityProxy end2 = archiveHelper.getEntityProxy(profile); + + archiveBuilder.addRelationship(archiveHelper.getRelationship(IT_INFRASTRUCTURE_PROFILE_RELATIONSHIP_NAME, + idToGUIDMap.getGUID(assetGUID + "_to_" + profile.getGUID() + "_it_infrastructure_profile_relationship"), + properties, + InstanceStatus.ACTIVE, + end1, + end2)); + } + + return profile.getGUID(); + } + + + + /** + * Link an actor (profile/person role) to a scope. + * + * @param actorQName qualified name of the actor + * @param scopeQName qualified name of the scope + * @param assignmentType type of the assignment + * @param description description of the assignment + */ + public void addAssignmentScopeRelationship(String actorQName, + String scopeQName, + String assignmentType, + String description) + { + final String methodName = "addAssignmentScopeRelationship"; + + String guid1 = idToGUIDMap.getGUID(actorQName); + String guid2 = idToGUIDMap.getGUID(scopeQName); + + EntityProxy end1 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(guid1)); + EntityProxy end2 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(guid2)); + + InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, ASSIGNMENT_TYPE_PROPERTY, assignmentType, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, DESCRIPTION_PROPERTY, description, methodName); + + archiveBuilder.addRelationship(archiveHelper.getRelationship(ASSIGNMENT_SCOPE_RELATIONSHIP_NAME, + idToGUIDMap.getGUID(guid1 + "_to_" + guid2 + "_assignment_scope_relationship"), + properties, + InstanceStatus.ACTIVE, + end1, + end2)); + } + + + /** + * Add a new project. + * + * @param suppliedTypeName subtype information + * @param qualifiedName qualified name of project + * @param identifier unique identifier of project - typically allocated externally + * @param name display name + * @param description description + * @param startDate date the project started + * @param plannedEndDate date the project is expected to end + * @param projectStatus status of the project + * @param setCampaignClassification should the Campaign classification be set? + * @param setTaskClassification should the Task classification be set? + * @param projectTypeClassification add special classification that defines the type of project - eg GlossaryProject or GovernanceProject + * @param additionalProperties are there any additional properties to add + * @param extendedProperties any additional properties associated with a subtype + * @return unique identifier of the new profile + */ + public String addProject(String suppliedTypeName, + String qualifiedName, + String identifier, + String name, + String description, + Date startDate, + Date plannedEndDate, + String projectStatus, + boolean setCampaignClassification, + boolean setTaskClassification, + String projectTypeClassification, + Map additionalProperties, + Map extendedProperties) + { + final String methodName = "addProject"; + + String typeName = suppliedTypeName; + + if (typeName == null) + { + typeName = PROJECT_TYPE_NAME; + } + + InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, QUALIFIED_NAME_PROPERTY, qualifiedName, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, IDENTIFIER_PROPERTY, identifier, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, NAME_PROPERTY, name, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, DESCRIPTION_PROPERTY, description, methodName); + properties = archiveHelper.addDatePropertyToInstance(archiveRootName, properties, START_DATE_PROPERTY, startDate, methodName); + properties = archiveHelper.addDatePropertyToInstance(archiveRootName, properties, PLANNED_END_DATE_PROPERTY, plannedEndDate, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, PROJECT_STATUS_PROPERTY, projectStatus, methodName); + properties = archiveHelper.addStringMapPropertyToInstance(archiveRootName, properties, ADDITIONAL_PROPERTIES_PROPERTY, additionalProperties, methodName); + properties = archiveHelper.addPropertyMapToInstance(archiveRootName, properties, extendedProperties, methodName); + + List classifications = new ArrayList<>(); + + if (setCampaignClassification) + { + Classification classification = archiveHelper.getClassification(CAMPAIGN_CLASSIFICATION_NAME, null, InstanceStatus.ACTIVE); + + classifications.add(classification); + } + if (setTaskClassification) + { + Classification classification = archiveHelper.getClassification(TASK_CLASSIFICATION_NAME, null, InstanceStatus.ACTIVE); + + classifications.add(classification); + } + if (projectTypeClassification != null) + { + Classification classification = archiveHelper.getClassification(projectTypeClassification, null, InstanceStatus.ACTIVE); + + classifications.add(classification); + } + + if (classifications.isEmpty()) + { + classifications = null; + } + + EntityDetail project = archiveHelper.getEntityDetail(typeName, + idToGUIDMap.getGUID(qualifiedName), + properties, + InstanceStatus.ACTIVE, + classifications); + + archiveBuilder.addEntity(project); + + return project.getGUID(); + } + + + /** + * Link a project to a subproject. + * + * @param projectQName qualified name of the parent project + * @param subprojectQName qualified name of the subproject + */ + public void addProjectHierarchyRelationship(String projectQName, + String subprojectQName) + { + String guid1 = idToGUIDMap.getGUID(projectQName); + String guid2 = idToGUIDMap.getGUID(subprojectQName); + + EntityProxy end1 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(guid1)); + EntityProxy end2 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(guid2)); + + archiveBuilder.addRelationship(archiveHelper.getRelationship(PROJECT_HIERARCHY_RELATIONSHIP_NAME, + idToGUIDMap.getGUID(guid1 + "_to_" + guid2 + "_project_hierarchy_relationship"), + null, + InstanceStatus.ACTIVE, + end1, + end2)); + } + + + /** + * Link a referenceable to its stakeholders. + * + * @param referenceableQName qualified name of the parent project + * @param actorQName qualified name of the subproject + */ + public void addStakeHolderRelationship(String referenceableQName, + String actorQName) + { + String guid1 = idToGUIDMap.getGUID(referenceableQName); + String guid2 = idToGUIDMap.getGUID(actorQName); + + EntityProxy end1 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(guid1)); + EntityProxy end2 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(guid2)); + + archiveBuilder.addRelationship(archiveHelper.getRelationship(STAKEHOLDER_RELATIONSHIP_NAME, + idToGUIDMap.getGUID(guid1 + "_to_" + guid2 + "_stakeholder_relationship"), + null, + InstanceStatus.ACTIVE, + end1, + end2)); + } + + + /** + * Link a project to another project that it depends on. + * + * @param projectQName qualified name of the project + * @param dependsOnProjectQName qualified name of the project that it depends on + * @param dependencySummary description of what makes them dependent + */ + public void addProjectDependencyRelationship(String projectQName, + String dependsOnProjectQName, + String dependencySummary) + { + final String methodName = "addProjectDependencyRelationship"; + + String guid1 = idToGUIDMap.getGUID(projectQName); + String guid2 = idToGUIDMap.getGUID(dependsOnProjectQName); + + EntityProxy end1 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(guid1)); + EntityProxy end2 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(guid2)); + + InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, DEPENDENCY_SUMMARY_PROPERTY, dependencySummary, methodName); + + archiveBuilder.addRelationship(archiveHelper.getRelationship(PROJECT_DEPENDENCY_RELATIONSHIP_NAME, + idToGUIDMap.getGUID(guid1 + "_to_" + guid2 + "_project_dependency_relationship"), + properties, + InstanceStatus.ACTIVE, + end1, + end2)); + } + + + + /** + * Link a project to a team. A project may have multiple teams. + * + * @param personQName qualified name of the person profile + * @param personRoleQName qualified name of the person role + * @param teamRole role of this team in the project + */ + public void addProjectTeamRelationship(String personQName, + String personRoleQName, + String teamRole) + { + final String methodName = "addProjectTeamRelationship"; + + String guid1 = idToGUIDMap.getGUID(personQName); + String guid2 = idToGUIDMap.getGUID(personRoleQName); + + EntityProxy end1 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(guid1)); + EntityProxy end2 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(guid2)); + + InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, TEAM_ROLE_PROPERTY, teamRole, methodName); + + archiveBuilder.addRelationship(archiveHelper.getRelationship(PROJECT_TEAM_RELATIONSHIP_NAME, + idToGUIDMap.getGUID(guid1 + "_to_" + guid2 + "_project_team_relationship"), + properties, + InstanceStatus.ACTIVE, + end1, + end2)); + } + + + /** + * Link a project to a person role that represents the project manager(s). + * + * @param projectQName qualified name of the project + * @param projectManagerRoleQName qualified name of the person role + */ + public void addProjectManagementRelationship(String projectQName, + String projectManagerRoleQName) + { + String guid1 = idToGUIDMap.getGUID(projectQName); + String guid2 = idToGUIDMap.getGUID(projectManagerRoleQName); + + EntityProxy end1 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(guid1)); + EntityProxy end2 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(guid2)); + + archiveBuilder.addRelationship(archiveHelper.getRelationship(PROJECT_MANAGEMENT_RELATIONSHIP_NAME, + idToGUIDMap.getGUID(guid1 + "_to_" + guid2 + "_project_management_relationship"), + null, + InstanceStatus.ACTIVE, + end1, + end2)); + } + + + /** + * Add a new community. + * + * @param suppliedTypeName subtype information + * @param qualifiedName qualified name of community + * @param name display name + * @param description description + * @param mission why is the community formed? + * @param additionalProperties are there any additional properties to add + * @param extendedProperties any additional properties associated with a subtype + * @return unique identifier of the new profile + */ + public String addCommunity(String suppliedTypeName, + String qualifiedName, + String name, + String description, + String mission, + Map additionalProperties, + Map extendedProperties) + { + final String methodName = "addCommunity"; + + String typeName = suppliedTypeName; + + if (typeName == null) + { + typeName = COMMUNITY_TYPE_NAME; + } + + InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, QUALIFIED_NAME_PROPERTY, qualifiedName, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, NAME_PROPERTY, name, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, DESCRIPTION_PROPERTY, description, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, MISSION_PROPERTY, mission, methodName); + properties = archiveHelper.addStringMapPropertyToInstance(archiveRootName, properties, ADDITIONAL_PROPERTIES_PROPERTY, additionalProperties, methodName); + properties = archiveHelper.addPropertyMapToInstance(archiveRootName, properties, extendedProperties, methodName); + + EntityDetail project = archiveHelper.getEntityDetail(typeName, + idToGUIDMap.getGUID(qualifiedName), + properties, + InstanceStatus.ACTIVE, + null); + + archiveBuilder.addEntity(project); + + return project.getGUID(); + } + + + /** + * Link a community to a person role. + * + * @param communityQName qualified name of the community + * @param membershipRoleQName qualified name of the membership role + * @param membershipType ordinal of enum + */ + public void addCommunityMembershipRelationship(String communityQName, + String membershipRoleQName, + int membershipType) + { + final String methodName = "addCommunityMembershipRelationship"; + + EnumElementDef enumElement = archiveHelper.getEnumElement(COMMUNITY_MEMBERSHIP_TYPE_ENUM_NAME, membershipType); + + String guid1 = idToGUIDMap.getGUID(communityQName); + String guid2 = idToGUIDMap.getGUID(membershipRoleQName); + + EntityProxy end1 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(guid1)); + EntityProxy end2 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(guid2)); + + InstanceProperties properties = archiveHelper.addEnumPropertyToInstance(archiveRootName, null, MEMBERSHIP_TYPE_PROPERTY, enumElement.getOrdinal(), enumElement.getValue(), enumElement.getDescription(), methodName); + + archiveBuilder.addRelationship(archiveHelper.getRelationship(COMMUNITY_MEMBERSHIP_RELATIONSHIP_NAME, + idToGUIDMap.getGUID(guid1 + "_to_" + guid2 + "_community_membership_relationship"), + properties, + InstanceStatus.ACTIVE, + end1, + end2)); + } + + + + /** + * Create a governance definition entity. + * + * @param suppliedTypeName type of collection + * @param classificationName name of classification to attach + * @param qualifiedName unique name for the collection entity + * @param displayName display name for the collection + * @param description description about the collection + * @param additionalProperties any other properties + * @param extendedProperties additional properties defined in the subtype + * + * @return unique identifier for subject area (collectionGUID) + */ + public String addCollection(String suppliedTypeName, + String classificationName, + String qualifiedName, + String displayName, + String description, + Map additionalProperties, + Map extendedProperties) + { + final String methodName = "addCollection"; + + String typeName = COLLECTION_TYPE_NAME; + + if (suppliedTypeName != null) + { + typeName = suppliedTypeName; + } + + List classifications = null; + + if (classificationName != null) + { + classifications = new ArrayList<>(); + + Classification classification = archiveHelper.getClassification(classificationName, null, InstanceStatus.ACTIVE); + + classifications.add(classification); + } + + InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, QUALIFIED_NAME_PROPERTY, qualifiedName, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, NAME_PROPERTY, displayName, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, DESCRIPTION_PROPERTY, description, methodName); + properties = archiveHelper.addStringMapPropertyToInstance(archiveRootName, properties, ADDITIONAL_PROPERTIES_PROPERTY, additionalProperties, methodName); + properties = archiveHelper.addPropertyMapToInstance(archiveRootName, properties, extendedProperties, methodName); + + EntityDetail newEntity = archiveHelper.getEntityDetail(typeName, + idToGUIDMap.getGUID(qualifiedName), + properties, + InstanceStatus.ACTIVE, + classifications); + + archiveBuilder.addEntity(newEntity); + + return newEntity.getGUID(); + } + + + /** + * Add a member to a collection. + * + * @param collectionGUID unique identifier of the collection + * @param memberGUID unique identifier of the member + * @param membershipRationale why is this member in this collection + */ + public void addMemberToCollection(String collectionGUID, + String memberGUID, + String membershipRationale) + { + final String methodName = "addMemberToCollection"; + + EntityDetail entity1 = archiveBuilder.getEntity(collectionGUID); + EntityDetail entity2 = archiveBuilder.getEntity(memberGUID); + + EntityProxy end1 = archiveHelper.getEntityProxy(entity1); + EntityProxy end2 = archiveHelper.getEntityProxy(entity2); + + InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, MEMBERSHIP_RATIONALE_PROPERTY, membershipRationale, methodName); + + archiveBuilder.addRelationship(archiveHelper.getRelationship(COLLECTION_MEMBER_RELATIONSHIP_NAME, + idToGUIDMap.getGUID(collectionGUID + "_to_" + memberGUID + "_collection_membership_relationship"), + properties, + InstanceStatus.ACTIVE, + end1, + end2)); + } + + + /** + * Create a governance domain description entity. + * + * @param qualifiedName unique name for the governance domain entity + * @param domainIdentifier unique identifier of the governance domain + * @param displayName display name for the governance domain + * @param description description about the governance domain + * @param additionalProperties any other properties + * @param governanceDomainSetGUID unique identifier of the collection for the domain definitions + * + * @return unique identifier for the governance domain (governanceDomainGUID) + */ + public String addGovernanceDomainDescription(String governanceDomainSetGUID, + String qualifiedName, + int domainIdentifier, + String displayName, + String description, + Map additionalProperties) + { + final String methodName = "addGovernanceDomainDescription"; + + InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, QUALIFIED_NAME_PROPERTY, qualifiedName, methodName); + properties = archiveHelper.addIntPropertyToInstance(archiveRootName, properties, DOMAIN_IDENTIFIER_PROPERTY, domainIdentifier, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, DISPLAY_NAME_PROPERTY, displayName, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, DESCRIPTION_PROPERTY, description, methodName); + properties = archiveHelper.addStringMapPropertyToInstance(archiveRootName, properties, ADDITIONAL_PROPERTIES_PROPERTY, additionalProperties, methodName); + + EntityDetail newEntity = archiveHelper.getEntityDetail(GOVERNANCE_DOMAIN_DESCRIPTION_TYPE_NAME, + idToGUIDMap.getGUID(qualifiedName), + properties, + InstanceStatus.ACTIVE, + null); + + archiveBuilder.addEntity(newEntity); + + if (governanceDomainSetGUID != null) + { + addMemberToCollection(governanceDomainSetGUID, newEntity.getGUID(), null); + } + + return newEntity.getGUID(); + } + + + /** + * Create a governance definition entity. + * + * @param suppliedTypeName type of governance definition to add + * @param qualifiedName unique name for the governance definition entity + * @param title title for the governance definition + * @param summary short description for the governance definition + * @param description description about the governance definition + * @param scope scope where the governance definition is used + * @param priority how important is the governance definition + * @param domainIdentifier unique identifier of the governance domain + * @param implications expected impact of adopting this definition + * @param outcomes expected outcomes from adopting this definition + * @param results results from adopting this definition + * @param additionalProperties any other properties + * @param extendedProperties additional properties defined in the subtype + * + * @return unique identifier for governance definition (governanceDefinitionGUID) + */ + public String addGovernanceDefinition(String suppliedTypeName, + String qualifiedName, + String title, + String summary, + String description, + String scope, + int domainIdentifier, + String priority, + List implications, + List outcomes, + List results, + Map additionalProperties, + Map extendedProperties) + { + final String methodName = "addGovernanceDefinition"; + + String typeName = GOVERNANCE_DEFINITION_TYPE_NAME; + + if (suppliedTypeName != null) + { + typeName = suppliedTypeName; + } + + InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, QUALIFIED_NAME_PROPERTY, qualifiedName, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, TITLE_PROPERTY, title, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, SUMMARY_PROPERTY, summary, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, DESCRIPTION_PROPERTY, description, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, SCOPE_PROPERTY, scope, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, PRIORITY_PROPERTY, priority, methodName); + properties = archiveHelper.addIntPropertyToInstance(archiveRootName, properties, DOMAIN_IDENTIFIER_PROPERTY, domainIdentifier, methodName); + properties = archiveHelper.addStringArrayPropertyToInstance(archiveRootName, properties, IMPLICATIONS_PROPERTY, implications, methodName); + properties = archiveHelper.addStringArrayPropertyToInstance(archiveRootName, properties, OUTCOMES_PROPERTY, outcomes, methodName); + properties = archiveHelper.addStringArrayPropertyToInstance(archiveRootName, properties, RESULTS_PROPERTY, results, methodName); + properties = archiveHelper.addStringMapPropertyToInstance(archiveRootName, properties, ADDITIONAL_PROPERTIES_PROPERTY, additionalProperties, methodName); + properties = archiveHelper.addPropertyMapToInstance(archiveRootName, properties, extendedProperties, methodName); + + EntityDetail newEntity = archiveHelper.getEntityDetail(typeName, + idToGUIDMap.getGUID(qualifiedName), + properties, + InstanceStatus.ACTIVE, + null); + + archiveBuilder.addEntity(newEntity); + + return newEntity.getGUID(); + } + + + /** + * Link a referenceable to a governance definition to define the scope there it applies. + * + * @param referenceableQName qualified name of the referenceable + * @param governanceDefinitionQName qualified name of the governance definition + */ + public void addGovernanceDefinitionScopeRelationship(String referenceableQName, + String governanceDefinitionQName) + { + String guid1 = idToGUIDMap.getGUID(referenceableQName); + String guid2 = idToGUIDMap.getGUID(governanceDefinitionQName); + + EntityProxy end1 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(guid1)); + EntityProxy end2 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(guid2)); + + archiveBuilder.addRelationship(archiveHelper.getRelationship(GOVERNANCE_DEFINITION_SCOPE_RELATIONSHIP_NAME, + idToGUIDMap.getGUID(guid1 + "_to_" + guid2 + "_governance_definition_scope_relationship"), + null, + InstanceStatus.ACTIVE, + end1, + end2)); + } + + + /** + * Link a referenceable to a governance definition to indicate that it is governed by the governance definition. + * + * @param referenceableQName qualified name of the referenceable + * @param governanceDefinitionQName qualified name of the governance definition + */ + public void addGovernedByRelationship(String referenceableQName, + String governanceDefinitionQName) + { + String guid1 = idToGUIDMap.getGUID(referenceableQName); + String guid2 = idToGUIDMap.getGUID(governanceDefinitionQName); + + EntityProxy end1 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(guid1)); + EntityProxy end2 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(guid2)); + + archiveBuilder.addRelationship(archiveHelper.getRelationship(GOVERNED_BY_RELATIONSHIP_NAME, + idToGUIDMap.getGUID(guid1 + "_to_" + guid2 + "_governed_by_relationship"), + null, + InstanceStatus.ACTIVE, + end1, + end2)); + } + - if (typeName != null) - { - elementTypeName = typeName; - } + /** + * Link two governance definitions at the same level. + * + * @param relationshipTypeName type of relationship + * @param governanceDefinition1QName qualified name of the referenceable + * @param governanceDefinition2QName qualified name of the governance definition + * @param description description of the peer relationship + */ + public void addGovernanceDefinitionPeerRelationship(String relationshipTypeName, + String governanceDefinition1QName, + String governanceDefinition2QName, + String description) + { + final String methodName = "addGovernanceDefinitionPeerRelationship"; - InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, QUALIFIED_NAME_PROPERTY, qualifiedName, methodName); - properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, DISPLAY_NAME_PROPERTY, displayName, methodName); - properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, REFERENCE_TITLE_PROPERTY, referenceTitle, methodName); - properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, REFERENCE_ABSTRACT_PROPERTY, referenceAbstract, methodName); - properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, DESCRIPTION_PROPERTY, description, methodName); - properties = archiveHelper.addStringArrayPropertyToInstance(archiveRootName, properties, AUTHORS_PROPERTY, authors, methodName); - properties = archiveHelper.addIntPropertyToInstance(archiveRootName, properties, NUMBER_OF_PAGES_PROPERTY, numberOfPages, methodName); - properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, PAGE_RANGE_PROPERTY, pageRange, methodName); - properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, ORGANIZATION_PROPERTY, authorOrganization, methodName); - properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, REFERENCE_VERSION_PROPERTY, versionNumber, methodName); - properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, PUBLICATION_SERIES_PROPERTY, publicationSeries, methodName); - properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, PUBLICATION_SERIES_VOLUME_PROPERTY, publicationSeriesVolume, methodName); - properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, EDITION_PROPERTY, edition, methodName); - properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, URL_PROPERTY, referenceURL, methodName); - properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, PUBLISHER_PROPERTY, publisher, methodName); - properties = archiveHelper.addDatePropertyToInstance(archiveRootName, properties, FIRST_PUBLICATION_DATE_PROPERTY, firstPublicationDate, methodName); - properties = archiveHelper.addDatePropertyToInstance(archiveRootName, properties, PUBLICATION_DATE_PROPERTY, publicationDate, methodName); - properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, PUBLICATION_CITY_PROPERTY, publicationCity, methodName); - properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, PUBLICATION_YEAR_PROPERTY, publicationYear, methodName); - properties = archiveHelper.addStringArrayPropertyToInstance(archiveRootName, properties, PUBLICATION_NUMBERS_PROPERTY, publicationNumbers, methodName); - properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, LICENSE_PROPERTY, license, methodName); - properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, COPYRIGHT_PROPERTY, copyright, methodName); - properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, ATTRIBUTION_PROPERTY, attribution, methodName); - properties = archiveHelper.addStringMapPropertyToInstance(archiveRootName, properties, ADDITIONAL_PROPERTIES_PROPERTY, additionalProperties, methodName); - properties = archiveHelper.addPropertyMapToInstance(archiveRootName, properties, extendedProperties, methodName); + String guid1 = idToGUIDMap.getGUID(governanceDefinition1QName); + String guid2 = idToGUIDMap.getGUID(governanceDefinition2QName); - EntityDetail externalReferenceEntity = archiveHelper.getEntityDetail(elementTypeName, - idToGUIDMap.getGUID(qualifiedName), - properties, - InstanceStatus.ACTIVE, - null); + EntityProxy end1 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(guid1)); + EntityProxy end2 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(guid2)); - archiveBuilder.addEntity(externalReferenceEntity); + InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, DESCRIPTION_PROPERTY, description, methodName); - if (searchKeywords != null) - { - for (String keyword : searchKeywords) - { - if (keyword != null) - { - String keywordGUID = idToGUIDMap.queryGUID(SEARCH_KEYWORD_TYPE_NAME + ":" + keyword); - EntityDetail keywordEntity = null; + archiveBuilder.addRelationship(archiveHelper.getRelationship(relationshipTypeName, + idToGUIDMap.getGUID(guid1 + "_to_" + guid2 + "_governance_definition_" + relationshipTypeName + "_peer_relationship"), + properties, + InstanceStatus.ACTIVE, + end1, + end2)); + } - InstanceProperties keywordProperties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, KEYWORD_PROPERTY, keyword, methodName); - if (keywordGUID != null) - { - keywordEntity = archiveBuilder.queryEntity(keywordGUID); - } + /** + * Link two governance definitions at the same level. + * + * @param relationshipTypeName type of relationship + * @param governanceDefinition1QName qualified name of the referenceable + * @param governanceDefinition2QName qualified name of the governance definition + * @param rationale description of the delegation relationship + */ + public void addGovernanceDefinitionDelegationRelationship(String relationshipTypeName, + String governanceDefinition1QName, + String governanceDefinition2QName, + String rationale) + { + final String methodName = "addGovernanceDefinitionDelegationRelationship"; - if (keywordEntity == null) - { - keywordEntity = archiveHelper.getEntityDetail(SEARCH_KEYWORD_TYPE_NAME, - idToGUIDMap.getGUID(SEARCH_KEYWORD_TYPE_NAME + ":" + keyword), - keywordProperties, - InstanceStatus.ACTIVE, - null); - archiveBuilder.addEntity(keywordEntity); - } + String guid1 = idToGUIDMap.getGUID(governanceDefinition1QName); + String guid2 = idToGUIDMap.getGUID(governanceDefinition2QName); - if (keywordEntity != null) - { - EntityProxy end1 = archiveHelper.getEntityProxy(externalReferenceEntity); - EntityProxy end2 = archiveHelper.getEntityProxy(keywordEntity); + EntityProxy end1 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(guid1)); + EntityProxy end2 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(guid2)); - archiveBuilder.addRelationship(archiveHelper.getRelationship(SEARCH_KEYWORD_LINK_RELATIONSHIP_NAME, - idToGUIDMap.getGUID(externalReferenceEntity.getGUID() + "_to_" + keywordEntity.getGUID() + "_search_keyword_link_relationship"), - null, - InstanceStatus.ACTIVE, - end1, - end2)); - } - } - } - } + InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, RATIONALE_PROPERTY, rationale, methodName); - return externalReferenceEntity.getGUID(); + archiveBuilder.addRelationship(archiveHelper.getRelationship(relationshipTypeName, + idToGUIDMap.getGUID(guid1 + "_to_" + guid2 + "_governance_definition_" + relationshipTypeName + "_delegation_relationship"), + properties, + InstanceStatus.ACTIVE, + end1, + end2)); } /** - * Create the relationship between a design mode group and one of its members. + * Create a governance zone entity. * - * @param referenceableGUID unique identifier of the element making the reference - * @param externalReferenceGUID unique identifier of the external reference - * @param referenceId unique reference id for this referenceable - * @param description description of the relevance of the external reference - * @param pages relevant pages in the external reference + * @param qualifiedName unique name for the zone entity + * @param zoneName unique name for the zone + * @param displayName display name for the zone + * @param description description about the zone + * @param scope scope where the zone is used + * @param criteria what is the common characteristic of assets in this zone? + * @param domainIdentifier unique identifier of the governance domain (0 means all/any) + * @param additionalProperties any other properties + * + * @return unique identifier for governance zone (governanceZoneGUID) */ - public void addExternalReferenceLink(String referenceableGUID, - String externalReferenceGUID, - String referenceId, - String description, - String pages) + public String addGovernanceZone(String qualifiedName, + String zoneName, + String displayName, + String description, + String criteria, + String scope, + int domainIdentifier, + Map additionalProperties) { - final String methodName = "addExternalReferenceLink"; + final String methodName = "addGovernanceZone"; - EntityDetail referenceableEntity = archiveBuilder.getEntity(referenceableGUID); - EntityDetail externalReferenceEntity = archiveBuilder.getEntity(externalReferenceGUID); + InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, QUALIFIED_NAME_PROPERTY, qualifiedName, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, ZONE_NAME_PROPERTY, zoneName, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, DISPLAY_NAME_PROPERTY, displayName, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, DESCRIPTION_PROPERTY, description, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, SCOPE_PROPERTY, scope, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, CRITERIA_PROPERTY, criteria, methodName); + properties = archiveHelper.addIntPropertyToInstance(archiveRootName, properties, DOMAIN_IDENTIFIER_PROPERTY, domainIdentifier, methodName); + properties = archiveHelper.addStringMapPropertyToInstance(archiveRootName, properties, ADDITIONAL_PROPERTIES_PROPERTY, additionalProperties, methodName); - EntityProxy end1 = archiveHelper.getEntityProxy(referenceableEntity); - EntityProxy end2 = archiveHelper.getEntityProxy(externalReferenceEntity); + EntityDetail newEntity = archiveHelper.getEntityDetail(GOVERNANCE_ZONE_TYPE_NAME, + idToGUIDMap.getGUID(qualifiedName), + properties, + InstanceStatus.ACTIVE, + null); - InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, REFERENCE_ID_PROPERTY, referenceId, methodName); - properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, DESCRIPTION_PROPERTY, description, methodName); - properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, PAGES_PROPERTY, pages, methodName); + archiveBuilder.addEntity(newEntity); - archiveBuilder.addRelationship(archiveHelper.getRelationship(EXTERNAL_GLOSSARY_LINK_TYPE_NAME, - idToGUIDMap.getGUID(referenceableGUID + "_to_" + externalReferenceGUID + "_external_reference_link_relationship" + referenceId), - properties, + return newEntity.getGUID(); + } + + + /** + * Create the relationship between a governance zone and one of its nested governance zones. + * + * @param broaderGovernanceZoneGUID unique identifier of the broader zone + * @param nestedGovernanceZoneGUID unique identifier of the nested (narrower) zone + */ + public void addZoneHierarchy(String broaderGovernanceZoneGUID, + String nestedGovernanceZoneGUID) + { + EntityDetail entity1 = archiveBuilder.getEntity(broaderGovernanceZoneGUID); + EntityDetail entity2 = archiveBuilder.getEntity(nestedGovernanceZoneGUID); + + EntityProxy end1 = archiveHelper.getEntityProxy(entity1); + EntityProxy end2 = archiveHelper.getEntityProxy(entity2); + + archiveBuilder.addRelationship(archiveHelper.getRelationship(ZONE_HIERARCHY_RELATIONSHIP_NAME, + idToGUIDMap.getGUID(broaderGovernanceZoneGUID + "_to_" + nestedGovernanceZoneGUID + "_zone_hierarchy_relationship"), + null, InstanceStatus.ACTIVE, end1, end2)); @@ -579,9 +2430,36 @@ public void addExternalReferenceLink(String referenceableGUID, /** - * Create a subject area entity. + * Add the asset zone membership classification to the requested asset. + * + * @param assetGUID unique identifier of the asset to classify + * @param zones list of zones that the asset is a member of. + */ + public void addAssetZoneMembershipClassification(String assetGUID, + List zones) + { + final String methodName = "addAssetZoneMembershipClassification"; + + EntityDetail assetEntity = archiveBuilder.getEntity(assetGUID); + EntityProxy entityProxy = archiveHelper.getEntityProxy(assetEntity); + + Classification classification = archiveHelper.getClassification(ASSET_ZONE_MEMBERSHIP_CLASSIFICATION_NAME, + archiveHelper.addStringArrayPropertyToInstance(archiveRootName, + null, + ZONE_MEMBERSHIP_PROPERTY, + zones, + methodName), + InstanceStatus.ACTIVE); + + archiveBuilder.addClassification(archiveHelper.getClassificationEntityExtension(entityProxy, classification)); + } + + + /** + * Create a subject area definition entity. * - * @param qualifiedName unique name for the subject area + * @param qualifiedName unique name for the subject area entity + * @param subjectAreaName unique name for the subject area * @param displayName display name for the subject area * @param description description about the subject area * @param scope scope where the subject area is used @@ -593,6 +2471,7 @@ public void addExternalReferenceLink(String referenceableGUID, * @return unique identifier for subject area (subjectAreaGUID) */ public String addSubjectAreaDefinition(String qualifiedName, + String subjectAreaName, String displayName, String description, String scope, @@ -604,7 +2483,8 @@ public String addSubjectAreaDefinition(String qualifiedName, final String methodName = "addSubjectAreaDefinition"; InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, QUALIFIED_NAME_PROPERTY, qualifiedName, methodName); - properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, DISPLAY_NAME_PROPERTY, displayName, methodName); // it's an asset + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, SUBJECT_AREA_NAME_PROPERTY, subjectAreaName, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, DISPLAY_NAME_PROPERTY, displayName, methodName); properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, DESCRIPTION_PROPERTY, description, methodName); properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, SCOPE_PROPERTY, scope, methodName); properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, USAGE_PROPERTY, usage, methodName); @@ -625,7 +2505,7 @@ public String addSubjectAreaDefinition(String qualifiedName, /** - * Create the relationship between a design mode group and one of its members. + * Create the relationship between a subject area and one of its nested subject areas. * * @param broaderSubjectAreaGUID unique identifier of the broader subject area * @param nestedSubjectAreaGUID unique identifier of the nested (narrower) subject area @@ -1000,7 +2880,7 @@ public String addAsset(String typeName, /** - * Create an process entity. + * Create a process entity. * * @param typeName name of asset subtype to use - default is Asset * @param qualifiedName unique name for the asset @@ -1218,15 +3098,37 @@ public void addConnectionForAsset(String assetGUID, public void addDataContentForDataSet(String dataContentGUID, String dataSetGUID) { + addDataContentForDataSet(dataContentGUID, dataSetGUID, null, null); + } + + + /** + * Create the relationship between a data set and an asset that is providing all or part of its content. + * + * @param dataContentGUID unique identifier of the data store + * @param dataSetGUID unique identifier of the consuming data set + * @param queryId identifier of the query used to combine results in a broader formula of the data set + * @param query query to issue against this data content + */ + public void addDataContentForDataSet(String dataContentGUID, + String dataSetGUID, + String queryId, + String query) + { + final String methodName = "addDataContentForDataSet"; + EntityDetail dataContentEntity = archiveBuilder.getEntity(dataContentGUID); EntityDetail dataSetEntity = archiveBuilder.getEntity(dataSetGUID); EntityProxy end1 = archiveHelper.getEntityProxy(dataContentEntity); EntityProxy end2 = archiveHelper.getEntityProxy(dataSetEntity); + InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, QUERY_ID_PROPERTY, queryId, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, QUERY_PROPERTY, query, methodName); + archiveBuilder.addRelationship(archiveHelper.getRelationship(DATA_CONTENT_FOR_DATA_SET_TYPE_NAME, idToGUIDMap.getGUID(dataContentGUID + "_to_" + dataSetGUID + "_data_content_for_data_set_relationship"), - null, + properties, InstanceStatus.ACTIVE, end1, end2)); @@ -1319,8 +3221,8 @@ public String addAPIOperation(String apiSchemaTypeGUID, InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, QUALIFIED_NAME_PROPERTY, qualifiedName, methodName); properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, DISPLAY_NAME_PROPERTY, displayName, methodName); properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, DESCRIPTION_PROPERTY, description, methodName); - properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, PATH_TYPE_PROPERTY, path, methodName); - properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, COMMAND_TYPE_PROPERTY, command, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, PATH_PROPERTY, path, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, COMMAND_PROPERTY, command, methodName); properties = archiveHelper.addStringMapPropertyToInstance(archiveRootName, properties, ADDITIONAL_PROPERTIES_PROPERTY, additionalProperties, methodName); EntityDetail schemaTypeEntity = archiveHelper.getEntityDetail(API_OPERATION_TYPE_NAME, @@ -1413,6 +3315,78 @@ public String addAPIParameterList(String apiOperationGUID, } + /** + * Create a schema attribute with a TypeEmbeddedAttribute classification. + * + * @param typeName name of schema attribute subtype to use - default is SchemaAttribute + * @param schemaTypeName name of schema type subtype to use - default is PrimitiveSchemaType + * @param qualifiedName unique name for the schema attribute + * @param displayName display name for the schema attribute + * @param description description about the schema attribute + * @param dataType data type for the schema attribute + * @param length length of the storage used by the schema attribute + * @param position position in the schema at this level + * @param parameterType type of parameter + * @param additionalProperties any other properties. + * + * @return id for the schema attribute + */ + public String addAPIParameter(String typeName, + String schemaTypeName, + String qualifiedName, + String displayName, + String description, + String dataType, + int length, + int position, + String parameterType, + Map additionalProperties) + { + final String methodName = "addAPIParameter"; + + String schemaAttributeTypeName = API_PARAMETER_TYPE_NAME; + + if (typeName != null) + { + schemaAttributeTypeName = typeName; + } + + String schemaTypeTypeName = PRIMITIVE_SCHEMA_TYPE_TYPE_NAME; + + if (schemaTypeName != null) + { + schemaTypeTypeName = schemaTypeName; + } + + InstanceProperties entityProperties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, QUALIFIED_NAME_PROPERTY, qualifiedName, methodName); + entityProperties = archiveHelper.addStringPropertyToInstance(archiveRootName, entityProperties, DISPLAY_NAME_PROPERTY, displayName, methodName); + entityProperties = archiveHelper.addStringPropertyToInstance(archiveRootName, entityProperties, DESCRIPTION_PROPERTY, description, methodName); + entityProperties = archiveHelper.addIntPropertyToInstance(archiveRootName, entityProperties, POSITION_PROPERTY, position, methodName); + entityProperties = archiveHelper.addStringPropertyToInstance(archiveRootName, entityProperties, PARAMETER_TYPE_PROPERTY, parameterType, methodName); + entityProperties = archiveHelper.addStringMapPropertyToInstance(archiveRootName, entityProperties, ADDITIONAL_PROPERTIES_PROPERTY, additionalProperties, methodName); + + InstanceProperties classificationProperties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, SCHEMA_TYPE_NAME_PROPERTY, schemaTypeTypeName, methodName); + classificationProperties = archiveHelper.addStringPropertyToInstance(archiveRootName, classificationProperties, DATA_TYPE_PROPERTY, dataType, methodName); + classificationProperties = archiveHelper.addIntPropertyToInstance(archiveRootName, classificationProperties, LENGTH_PROPERTY, length, methodName); + + Classification classification = archiveHelper.getClassification(TYPE_EMBEDDED_ATTRIBUTE_TYPE_NAME, classificationProperties, InstanceStatus.ACTIVE); + + List classifications = new ArrayList<>(); + + classifications.add(classification); + + EntityDetail schemaAttributeEntity = archiveHelper.getEntityDetail(schemaAttributeTypeName, + idToGUIDMap.getGUID(qualifiedName), + entityProperties, + InstanceStatus.ACTIVE, + classifications); + + archiveBuilder.addEntity(schemaAttributeEntity); + + return schemaAttributeEntity.getGUID(); + } + + /** * Create the relationship between a SchemaTypeChoice element and a child element using the SchemaTypeOption relationship. * @@ -1529,6 +3503,7 @@ public String addSchemaAttribute(String typeName, InstanceProperties entityProperties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, QUALIFIED_NAME_PROPERTY, qualifiedName, methodName); entityProperties = archiveHelper.addStringPropertyToInstance(archiveRootName, entityProperties, DISPLAY_NAME_PROPERTY, displayName, methodName); entityProperties = archiveHelper.addStringPropertyToInstance(archiveRootName, entityProperties, DESCRIPTION_PROPERTY, description, methodName); + entityProperties = archiveHelper.addIntPropertyToInstance(archiveRootName, entityProperties, POSITION_PROPERTY, position, methodName); entityProperties = archiveHelper.addStringMapPropertyToInstance(archiveRootName, entityProperties, ADDITIONAL_PROPERTIES_PROPERTY, additionalProperties, methodName); InstanceProperties classificationProperties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, SCHEMA_TYPE_NAME_PROPERTY, schemaTypeTypeName, methodName); @@ -1818,7 +3793,7 @@ protected String addConnectorType(String connectorCategoryGUID, /** * Create a connector category entity. * - * @param connectorTypeDirectoryGUID unique identifier of connector type directory that this connector connector belongs to - or null for an independent connector category + * @param connectorTypeDirectoryGUID unique identifier of connector type directory that this connector belongs to - or null for an independent connector category * @param qualifiedName unique name for the connector category * @param displayName display name for the connector category * @param description description about the connector category @@ -1869,7 +3844,7 @@ public String addConnectorCategory(String connectorTypeDirector EntityProxy end1 = archiveHelper.getEntityProxy(connectorTypeDirectoryEntity); EntityProxy end2 = archiveHelper.getEntityProxy(connectorCategoryEntity); - archiveBuilder.addRelationship(archiveHelper.getRelationship(COLLECTION_MEMBER_TYPE_NAME, + archiveBuilder.addRelationship(archiveHelper.getRelationship(COLLECTION_MEMBER_RELATIONSHIP_NAME, idToGUIDMap.getGUID(qualifiedName + "_connector_type_directory_relationship"), null, InstanceStatus.ACTIVE, @@ -2691,39 +4666,59 @@ public String addValidValue(String typeName, } - public void addValidValueMembershipRelationship(String setQName, String memberQName) + /** + * Link a valid value as a member of a valid value set. + * + * @param setQName qualified name of the set to add to + * @param memberQName qualified name of the member to add + * @param isDefaultValue is this the default value (only set to true for one member). + */ + public void addValidValueMembershipRelationship(String setQName, + String memberQName, + boolean isDefaultValue) { + final String methodName = "addValidValuesAssignmentRelationship"; + String setId = idToGUIDMap.getGUID(setQName); String memberId = idToGUIDMap.getGUID(memberQName); EntityProxy end1 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(setId)); EntityProxy end2 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(memberId)); + InstanceProperties properties = archiveHelper.addBooleanPropertyToInstance(archiveRootName, null, IS_DEFAULT_VALUE_PROPERTY, isDefaultValue, methodName); + archiveBuilder.addRelationship(archiveHelper.getRelationship(VALID_VALUE_MEMBER_TYPE_NAME, idToGUIDMap.getGUID(setId + "_to_" + memberId + "_valid_value_member_relationship"), - null, + properties, InstanceStatus.ACTIVE, end1, end2)); } - public void addValidValuesAssignmentRelationship(String setQName, - String memberQName, + /** + * Link an element that represents a data field (either directly or indirectly) to a valid value (typically a valid value set). + * + * @param dataFieldQName qualified name of element that represents the data field + * @param validValueQName qualified name of the valid value set/definition + * @param strictRequirement do the valid values mandate the values stored in the data field? + */ + public void addValidValuesAssignmentRelationship(String dataFieldQName, + String validValueQName, boolean strictRequirement) { final String methodName = "addValidValuesAssignmentRelationship"; - String setId = idToGUIDMap.getGUID(setQName); - String memberId = idToGUIDMap.getGUID(memberQName); + String dataFieldId = idToGUIDMap.getGUID(dataFieldQName); + String validValueId = idToGUIDMap.getGUID(validValueQName); - EntityProxy end1 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(setId)); - EntityProxy end2 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(memberId)); + EntityProxy end1 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(dataFieldId)); + EntityProxy end2 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(validValueId)); InstanceProperties properties = archiveHelper.addBooleanPropertyToInstance(archiveRootName, null, STRICT_REQUIREMENT_PROPERTY, strictRequirement, methodName); archiveBuilder.addRelationship(archiveHelper.getRelationship(VALID_VALUES_ASSIGNMENT_TYPE_NAME, - idToGUIDMap.getGUID(setId + "_to_" + memberId + "_valid_values_assignment_relationship"), + idToGUIDMap.getGUID(dataFieldId + "_to_" + validValueId + "_valid_values_assignment_relationship"), properties, InstanceStatus.ACTIVE, end1, @@ -2739,6 +4734,8 @@ public void addValidValuesAssignmentRelationship(String setQName, * @param associationDescription a description of the meaning of the association * @param confidence how likely is the relationship correct - 0=unlikely; 100=certainty * @param steward who was the steward that made the link + * @param stewardTypeName what is the type of the element used to represent the steward? + * @param stewardPropertyName what is the name of the property used to represent the steward? * @param notes any notes on the relationship. */ public void addValidValuesMappingRelationship(String matchingValue1QName, @@ -2746,6 +4743,8 @@ public void addValidValuesMappingRelationship(String matchingValue1QName, String associationDescription, int confidence, String steward, + String stewardTypeName, + String stewardPropertyName, String notes) { final String methodName = "addValidValuesMappingRelationship"; @@ -2756,9 +4755,11 @@ public void addValidValuesMappingRelationship(String matchingValue1QName, EntityProxy end1 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(matchingValue1Id)); EntityProxy end2 = archiveHelper.getEntityProxy(archiveBuilder.getEntity(matchingValueId)); - InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, SYMBOLIC_NAME_PROPERTY, associationDescription, methodName); + InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, ASSOCIATION_DESCRIPTION_PROPERTY, associationDescription, methodName); properties = archiveHelper.addIntPropertyToInstance(archiveRootName, properties, CONFIDENCE_PROPERTY, confidence, methodName); properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, STEWARD_PROPERTY, steward, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, STEWARD_TYPE_NAME_PROPERTY, stewardTypeName, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, STEWARD_PROPERTY_NAME_PROPERTY, stewardPropertyName, methodName); properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, NOTES_PROPERTY, notes, methodName); archiveBuilder.addRelationship(archiveHelper.getRelationship(VALID_VALUES_MAPPING_TYPE_NAME, @@ -2777,12 +4778,16 @@ public void addValidValuesMappingRelationship(String matchingValue1QName, * @param validValueQName qualified name of valid value * @param confidence how likely is the relationship correct - 0=unlikely; 100=certainty * @param steward who was the steward that made the link + * @param stewardTypeName what is the type of the element used to represent the steward? + * @param stewardPropertyName what is the name of the property used to represent the steward? * @param notes any notes on the relationship. */ public void addReferenceValueAssignmentRelationship(String referenceableQName, String validValueQName, int confidence, String steward, + String stewardTypeName, + String stewardPropertyName, String notes) { final String methodName = "addReferenceValueAssignmentRelationship"; @@ -2795,6 +4800,8 @@ public void addReferenceValueAssignmentRelationship(String referenceableQName, InstanceProperties properties = archiveHelper.addIntPropertyToInstance(archiveRootName, null, CONFIDENCE_PROPERTY, confidence, methodName); properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, STEWARD_PROPERTY, steward, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, STEWARD_TYPE_NAME_PROPERTY, stewardTypeName, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, STEWARD_PROPERTY_NAME_PROPERTY, stewardPropertyName, methodName); properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, NOTES_PROPERTY, notes, methodName); archiveBuilder.addRelationship(archiveHelper.getRelationship(REFERENCE_VALUE_ASSIGNMENT_TYPE_NAME, @@ -2840,4 +4847,23 @@ public void addValidValuesImplementationRelationship(String validVa end1, end2)); } + + + /** + * Add the ReferenceData classification to the requested element. + * + * @param assetGUID unique identifier of the element to classify + */ + public void addReferenceDataClassification(String assetGUID) + { + EntityDetail assetEntity = archiveBuilder.getEntity(assetGUID); + + EntityProxy referenceableEntityProxy = archiveHelper.getEntityProxy(assetEntity); + + Classification classification = archiveHelper.getClassification(REFERENCE_DATA_CLASSIFICATION_NAME, + null, + InstanceStatus.ACTIVE); + + archiveBuilder.addClassification(archiveHelper.getClassificationEntityExtension(referenceableEntityProxy, classification)); + } } diff --git a/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive.java b/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive.java index ab368368034..b8cf1a1b025 100644 --- a/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive.java +++ b/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive.java @@ -8,10 +8,12 @@ import org.odpi.openmetadata.repositoryservices.connectors.stores.archivestore.properties.OpenMetadataArchive; import org.odpi.openmetadata.repositoryservices.connectors.stores.archivestore.properties.OpenMetadataArchiveType; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.ClassificationPropagationRule; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.EntityDef; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.RelationshipDef; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.RelationshipEndCardinality; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.RelationshipEndDef; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefAttribute; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefAttributeStatus; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefPatch; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefStatus; import org.odpi.openmetadata.repositoryservices.ffdc.OMRSErrorCode; @@ -162,8 +164,12 @@ public void getOriginalTypes() * Calls for new and changed types go here */ update0010BaseModel(); + update0025Locations(); update0110ActorProfile(); + update0130Projects(); updateResponsibilityAssignments(); + update04xxExplicitNames(); + update04xxNewGovernanceRoles(); update04xxMultiLinkGovernanceActionTypes(); update0545ValidValues(); update07xxImplementationRelationships(); @@ -259,12 +265,231 @@ private TypeDefPatch updateDataContentForDataSet() * ------------------------------------------------------------------------------------------------------- */ + private void update0025Locations() + { + this.archiveBuilder.addTypeDefPatch(updateLocation()); + } + + + private TypeDefPatch updateLocation() + { + /* + * Create the Patch + */ + final String typeName = "Location"; + + TypeDefPatch typeDefPatch = archiveBuilder.getPatchForType(typeName); + + typeDefPatch.setUpdatedBy(originatorName); + typeDefPatch.setUpdateTime(creationDate); + + /* + * Build the attributes + */ + List properties = new ArrayList<>(); + TypeDefAttribute property; + + final String attribute1Name = "identifier"; + final String attribute1Description = "Code value or symbol used to identify the location - typically unique."; + final String attribute1DescriptionGUID = null; + + property = archiveHelper.getStringTypeDefAttribute(attribute1Name, + attribute1Description, + attribute1DescriptionGUID); + properties.add(property); + + typeDefPatch.setPropertyDefinitions(properties); + + return typeDefPatch; + } + + /* + * ------------------------------------------------------------------------------------------------------- + */ private void update0110ActorProfile() { + this.archiveBuilder.addTypeDefPatch(updateUserIdentity()); + this.archiveBuilder.addTypeDefPatch(updatePerson()); + this.archiveBuilder.addTypeDefPatch(updatePersonRole()); + this.archiveBuilder.addTypeDefPatch(updateTeam()); + this.archiveBuilder.addTypeDefPatch(updateContactDetails()); this.archiveBuilder.addRelationshipDef(getProfileLocationRelationship()); } + + private TypeDefPatch updateUserIdentity() + { + /* + * Create the Patch + */ + final String typeName = "UserIdentity"; + + TypeDefPatch typeDefPatch = archiveBuilder.getPatchForType(typeName); + + typeDefPatch.setUpdatedBy(originatorName); + typeDefPatch.setUpdateTime(creationDate); + + /* + * Build the attributes + */ + List properties = new ArrayList<>(); + TypeDefAttribute property; + + final String attribute1Name = "userId"; + final String attribute1Description = "Identifier of the user account - if null use qualifiedName."; + final String attribute1DescriptionGUID = null; + + property = archiveHelper.getStringTypeDefAttribute(attribute1Name, + attribute1Description, + attribute1DescriptionGUID); + properties.add(property); + + typeDefPatch.setPropertyDefinitions(properties); + + return typeDefPatch; + } + + + private TypeDefPatch updatePerson() + { + /* + * Create the Patch + */ + final String typeName = "Person"; + + TypeDefPatch typeDefPatch = archiveBuilder.getPatchForType(typeName); + + typeDefPatch.setUpdatedBy(originatorName); + typeDefPatch.setUpdateTime(creationDate); + + /* + * Build the attributes + */ + List properties = new ArrayList<>(); + TypeDefAttribute property; + + final String attribute1Name = "pronouns"; + final String attribute1Description = "Preferred pronouns to use when addressing this person."; + final String attribute1DescriptionGUID = null; + + property = archiveHelper.getStringTypeDefAttribute(attribute1Name, + attribute1Description, + attribute1DescriptionGUID); + properties.add(property); + + typeDefPatch.setPropertyDefinitions(properties); + + return typeDefPatch; + } + + + private TypeDefPatch updatePersonRole() + { + /* + * Create the Patch + */ + final String typeName = "PersonRole"; + + TypeDefPatch typeDefPatch = archiveBuilder.getPatchForType(typeName); + + typeDefPatch.setUpdatedBy(originatorName); + typeDefPatch.setUpdateTime(creationDate); + + /* + * Build the attributes + */ + List properties = new ArrayList<>(); + TypeDefAttribute property; + + final String attribute1Name = "identifier"; + final String attribute1Description = "Code value or symbol used to identify the role - typically unique."; + final String attribute1DescriptionGUID = null; + + property = archiveHelper.getStringTypeDefAttribute(attribute1Name, + attribute1Description, + attribute1DescriptionGUID); + properties.add(property); + + typeDefPatch.setPropertyDefinitions(properties); + + return typeDefPatch; + } + + + private TypeDefPatch updateTeam() + { + /* + * Create the Patch + */ + final String typeName = "Team"; + + TypeDefPatch typeDefPatch = archiveBuilder.getPatchForType(typeName); + + typeDefPatch.setUpdatedBy(originatorName); + typeDefPatch.setUpdateTime(creationDate); + + /* + * Build the attributes + */ + List properties = new ArrayList<>(); + TypeDefAttribute property; + + final String attribute1Name = "identifier"; + final String attribute1Description = "Code value or symbol used to identify the team - typically unique."; + final String attribute1DescriptionGUID = null; + + property = archiveHelper.getStringTypeDefAttribute(attribute1Name, + attribute1Description, + attribute1DescriptionGUID); + properties.add(property); + + typeDefPatch.setPropertyDefinitions(properties); + + return typeDefPatch; + } + + + private TypeDefPatch updateContactDetails() + { + /* + * Create the Patch + */ + final String typeName = "ContactDetails"; + + TypeDefPatch typeDefPatch = archiveBuilder.getPatchForType(typeName); + + typeDefPatch.setUpdatedBy(originatorName); + typeDefPatch.setUpdateTime(creationDate); + + /* + * Build the attributes + */ + List properties = new ArrayList<>(); + TypeDefAttribute property; + + final String attribute1Name = "name"; + final String attribute1Description = "Name of contact method."; + final String attribute1DescriptionGUID = null; + final String attribute2Name = "contactType"; + final String attribute2Description = "Type of contact - such as home address, work mobile, emergency contact ..."; + final String attribute2DescriptionGUID = null; + + property = archiveHelper.getStringTypeDefAttribute(attribute1Name, + attribute1Description, + attribute1DescriptionGUID); + properties.add(property); + property = archiveHelper.getStringTypeDefAttribute(attribute2Name, + attribute2Description, + attribute2DescriptionGUID); + properties.add(property); + + typeDefPatch.setPropertyDefinitions(properties); + + return typeDefPatch; + } + + private RelationshipDef getProfileLocationRelationship() { final String guid = "4d652ef7-99c7-4ec3-a2fd-b10c0a1ab4b4"; @@ -303,7 +528,7 @@ private RelationshipDef getProfileLocationRelationship() * Set up end 2. */ final String end2EntityType = "Location"; - final String end2AttributeName = "associatedLocation"; + final String end2AttributeName = "associatedLocations"; final String end2AttributeDescription = "Locations that the actor is associated with."; final String end2AttributeDescriptionGUID = null; final RelationshipEndCardinality end2Cardinality = RelationshipEndCardinality.ANY_NUMBER; @@ -336,12 +561,145 @@ private RelationshipDef getProfileLocationRelationship() } + /* + * ------------------------------------------------------------------------------------------------------- + */ + + + private void update0130Projects() + { + this.archiveBuilder.addTypeDefPatch(deprecateProjectStatusAttribute()); + this.archiveBuilder.addRelationshipDef(getStakeholderRelationship()); + } + + private TypeDefPatch deprecateProjectStatusAttribute() + { + /* + * Create the Patch + */ + final String typeName = "Project"; + + TypeDefPatch typeDefPatch = archiveBuilder.getPatchForType(typeName); + + typeDefPatch.setUpdatedBy(originatorName); + typeDefPatch.setUpdateTime(creationDate); + + /* + * Build the attributes + */ + List properties = new ArrayList<>(); + TypeDefAttribute property; + + final String attribute1Name = "projectStatus"; + final String attribute1Description = "Short description on current status of the project."; + final String attribute1DescriptionGUID = null; + final String attribute2Name = "status"; + final String attribute2Description = "(Deprecated) Short description on current status of the project."; + final String attribute2DescriptionGUID = null; + final String attribute3Name = "identifier"; + final String attribute3Description = "Code value or symbol used to identify the project - typically unique."; + final String attribute3DescriptionGUID = null; + + property = archiveHelper.getStringTypeDefAttribute(attribute1Name, + attribute1Description, + attribute1DescriptionGUID); + properties.add(property); + + property = archiveHelper.getStringTypeDefAttribute(attribute2Name, + attribute2Description, + attribute2DescriptionGUID); + property.setAttributeStatus(TypeDefAttributeStatus.DEPRECATED_ATTRIBUTE); + property.setReplacedByAttribute(attribute1Name); + properties.add(property); + + property = archiveHelper.getStringTypeDefAttribute(attribute3Name, + attribute3Description, + attribute3DescriptionGUID); + properties.add(property); + + typeDefPatch.setPropertyDefinitions(properties); + + return typeDefPatch; + } + + + private RelationshipDef getStakeholderRelationship() + { + final String guid = "efd8a136-0aea-4668-b91a-30f947e38b82"; + final String name = "Stakeholder"; + final String description = "Identifies the Actor Profiles that commissioned work (such as a project or a community) or a capability, service or assets."; + final String descriptionGUID = null; + + final ClassificationPropagationRule classificationPropagationRule = ClassificationPropagationRule.NONE; + + RelationshipDef relationshipDef = archiveHelper.getBasicRelationshipDef(guid, + name, + null, + description, + descriptionGUID, + classificationPropagationRule); + + RelationshipEndDef relationshipEndDef; + + /* + * Set up end 1. + */ + final String end1EntityType = "Referenceable"; + final String end1AttributeName = "commissioned"; + final String end1AttributeDescription = "Team, project, community, asset, service, ... that was commissioned by the stakeholders."; + final String end1AttributeDescriptionGUID = null; + final RelationshipEndCardinality end1Cardinality = RelationshipEndCardinality.ANY_NUMBER; + + relationshipEndDef = archiveHelper.getRelationshipEndDef(this.archiveBuilder.getEntityDef(end1EntityType), + end1AttributeName, + end1AttributeDescription, + end1AttributeDescriptionGUID, + end1Cardinality); + relationshipDef.setEndDef1(relationshipEndDef); + + /* + * Set up end 2. + */ + final String end2EntityType = "Referenceable"; + final String end2AttributeName = "commissionedBy"; + final String end2AttributeDescription = "Profiles of actors or roles that are stakeholders."; + final String end2AttributeDescriptionGUID = null; + final RelationshipEndCardinality end2Cardinality = RelationshipEndCardinality.ANY_NUMBER; + + relationshipEndDef = archiveHelper.getRelationshipEndDef(this.archiveBuilder.getEntityDef(end2EntityType), + end2AttributeName, + end2AttributeDescription, + end2AttributeDescriptionGUID, + end2Cardinality); + relationshipDef.setEndDef2(relationshipEndDef); + + /* + * Build the attributes + */ + List properties = new ArrayList<>(); + TypeDefAttribute property; + + final String attribute1Name = "stakeholderRole"; + final String attribute1Description = "Identifier that describes the role that the stakeholders will play in the operation of the Referenceable."; + final String attribute1DescriptionGUID = null; + + property = archiveHelper.getStringTypeDefAttribute(attribute1Name, + attribute1Description, + attribute1DescriptionGUID); + properties.add(property); + + relationshipDef.setPropertiesDefinition(properties); + + return relationshipDef; + } + + /* * ------------------------------------------------------------------------------------------------------- */ /** - * Add new relationship called properties to . + * Add new relationship called AssignmentScope to show the scope of someone or a team's responsibility. * Deprecate more specialist relationships: ProjectScope and GovernanceRoleAssignment. */ private void updateResponsibilityAssignments() @@ -465,6 +823,224 @@ private RelationshipDef getAssignmentScopeRelationship() * ------------------------------------------------------------------------------------------------------- */ + + private void update04xxExplicitNames() + { + this.archiveBuilder.addTypeDefPatch(updateGovernanceZoneDefinition()); + this.archiveBuilder.addTypeDefPatch(updateSubjectAreaDefinition()); + this.archiveBuilder.addTypeDefPatch(updateBusinessCapability()); + this.archiveBuilder.addTypeDefPatch(deprecateBusinessCapabilityControls()); + } + + + private TypeDefPatch updateGovernanceZoneDefinition() + { + /* + * Create the Patch + */ + final String typeName = "GovernanceZone"; + + TypeDefPatch typeDefPatch = archiveBuilder.getPatchForType(typeName); + + typeDefPatch.setUpdatedBy(originatorName); + typeDefPatch.setUpdateTime(creationDate); + + /* + * Build the attributes + */ + List properties = new ArrayList<>(); + TypeDefAttribute property; + + final String attribute1Name = "zoneName"; + final String attribute1Description = "Identifier of the zone - if null use qualifiedName."; + final String attribute1DescriptionGUID = null; + + property = archiveHelper.getStringTypeDefAttribute(attribute1Name, + attribute1Description, + attribute1DescriptionGUID); + properties.add(property); + + typeDefPatch.setPropertyDefinitions(properties); + + return typeDefPatch; + } + + + private TypeDefPatch updateSubjectAreaDefinition() + { + /* + * Create the Patch + */ + final String typeName = "SubjectAreaDefinition"; + + TypeDefPatch typeDefPatch = archiveBuilder.getPatchForType(typeName); + + typeDefPatch.setUpdatedBy(originatorName); + typeDefPatch.setUpdateTime(creationDate); + + /* + * Build the attributes + */ + List properties = new ArrayList<>(); + TypeDefAttribute property; + + final String attribute1Name = "subjectAreaName"; + final String attribute1Description = "Identifier of the subject area - if null use qualifiedName."; + final String attribute1DescriptionGUID = null; + + property = archiveHelper.getStringTypeDefAttribute(attribute1Name, + attribute1Description, + attribute1DescriptionGUID); + properties.add(property); + + typeDefPatch.setPropertyDefinitions(properties); + + return typeDefPatch; + } + + + private TypeDefPatch updateBusinessCapability() + { + /* + * Create the Patch + */ + final String typeName = "BusinessCapability"; + + TypeDefPatch typeDefPatch = archiveBuilder.getPatchForType(typeName); + + typeDefPatch.setUpdatedBy(originatorName); + typeDefPatch.setUpdateTime(creationDate); + + /* + * Build the attributes + */ + List properties = new ArrayList<>(); + TypeDefAttribute property; + + final String attribute1Name = "identifier"; + final String attribute1Description = "Identifier of the business capability - if null use qualifiedName."; + final String attribute1DescriptionGUID = null; + final String attribute2Name = "displayName"; + final String attribute2Description = "Short displayable name for the business capability."; + final String attribute2DescriptionGUID = null; + + property = archiveHelper.getStringTypeDefAttribute(attribute1Name, + attribute1Description, + attribute1DescriptionGUID); + properties.add(property); + property = archiveHelper.getStringTypeDefAttribute(attribute2Name, + attribute2Description, + attribute2DescriptionGUID); + properties.add(property); + + typeDefPatch.setPropertyDefinitions(properties); + + return typeDefPatch; + } + + + private TypeDefPatch deprecateBusinessCapabilityControls() + { + /* + * Create the Patch + */ + final String typeName = "BusinessCapabilityControls"; + + TypeDefPatch typeDefPatch = archiveBuilder.getPatchForType(typeName); + + typeDefPatch.setUpdatedBy(originatorName); + typeDefPatch.setUpdateTime(creationDate); + typeDefPatch.setTypeDefStatus(TypeDefStatus.DEPRECATED_TYPEDEF); + + return typeDefPatch; + } + + + /* + * ------------------------------------------------------------------------------------------------------- + */ + + private void update04xxNewGovernanceRoles() + { + archiveBuilder.addEntityDef(getGovernanceRepresentativeEntity()); + archiveBuilder.addEntityDef(getLocationOwnerEntity()); + archiveBuilder.addEntityDef(getBusinessOwnerEntity()); + archiveBuilder.addEntityDef(getSolutionOwnerEntity()); + } + + private EntityDef getGovernanceRepresentativeEntity() + { + final String guid = "6046bdf8-a37e-4bc4-b51d-325d8c31a96c"; + final String name = "GovernanceRepresentative"; + final String description = "A role defining a responsibility to contribute to the operation of a governance activity. Often represents the views of one or more interested parties."; + final String descriptionGUID = null; + + final String superTypeName = "GovernanceRole"; + + return archiveHelper.getDefaultEntityDef(guid, + name, + this.archiveBuilder.getEntityDef(superTypeName), + description, + descriptionGUID); + } + + + private EntityDef getLocationOwnerEntity() + { + final String guid = "3437fd1d-5098-426c-9b55-c94d1fc5dc0e"; + final String name = "LocationOwner"; + final String description = "A role defining a responsibility for activity at a particular location."; + final String descriptionGUID = null; + + final String superTypeName = "GovernanceRole"; + + return archiveHelper.getDefaultEntityDef(guid, + name, + this.archiveBuilder.getEntityDef(superTypeName), + description, + descriptionGUID); + } + + + private EntityDef getBusinessOwnerEntity() + { + final String guid = "0e83bb5f-f2f5-4a85-92eb-f71e92a181f5"; + final String name = "BusinessOwner"; + final String description = "A role defining a responsibility to manage a part of the organization's business. Often responsible for profit and loss"; + final String descriptionGUID = null; + + final String superTypeName = "GovernanceRole"; + + return archiveHelper.getDefaultEntityDef(guid, + name, + this.archiveBuilder.getEntityDef(superTypeName), + description, + descriptionGUID); + } + + + private EntityDef getSolutionOwnerEntity() + { + final String guid = "e44d5019-37e5-4965-8b89-2bef412833bf"; + final String name = "SolutionOwner"; + final String description = "A role defining a responsibility for an IT solution."; + final String descriptionGUID = null; + + final String superTypeName = "GovernanceRole"; + + return archiveHelper.getDefaultEntityDef(guid, + name, + this.archiveBuilder.getEntityDef(superTypeName), + description, + descriptionGUID); + } + + + /* + * ------------------------------------------------------------------------------------------------------- + */ + + /** * Add multi-link flags and extend properties to be able to record proper attributions. */ @@ -510,6 +1086,7 @@ private TypeDefPatch updateGovernanceActionProcess() return typeDefPatch; } + private TypeDefPatch updateGovernanceActionFlowRelationship() { /* @@ -527,6 +1104,7 @@ private TypeDefPatch updateGovernanceActionFlowRelationship() return typeDefPatch; } + private TypeDefPatch updateNextGovernanceActionTypeRelationship() { /* @@ -592,6 +1170,7 @@ private void update0545ValidValues() this.archiveBuilder.addTypeDefPatch(updateReferenceValueAssignment()); this.archiveBuilder.addTypeDefPatch(updateValidValuesMapping()); this.archiveBuilder.addTypeDefPatch(updateValidValuesImplementation()); + this.archiveBuilder.addTypeDefPatch(updateValidValueMember()); } @@ -692,6 +1271,40 @@ private TypeDefPatch updateValidValuesImplementation() return typeDefPatch; } + + private TypeDefPatch updateValidValueMember() + { + /* + * Create the Patch + */ + final String typeName = "ValidValueMember"; + + TypeDefPatch typeDefPatch = archiveBuilder.getPatchForType(typeName); + + typeDefPatch.setUpdatedBy(originatorName); + typeDefPatch.setUpdateTime(creationDate); + + /* + * Build the attributes + */ + List properties = new ArrayList<>(); + TypeDefAttribute property; + + final String attribute1Name = "isDefaultValue"; + final String attribute1Description = "Is the member the default value in the set?"; + final String attribute1DescriptionGUID = null; + + property = archiveHelper.getBooleanTypeDefAttribute(attribute1Name, + attribute1Description, + attribute1DescriptionGUID); + properties.add(property); + + typeDefPatch.setPropertyDefinitions(properties); + + return typeDefPatch; + } + + /* * ------------------------------------------------------------------------------------------------------- */ @@ -710,6 +1323,7 @@ private void update07xxImplementationRelationships() } + private TypeDefPatch deprecateDigitalServiceImplementationRelationship() { /* @@ -743,6 +1357,7 @@ private TypeDefPatch deprecateInformationSupplyChainImplementationRelationship() return typeDefPatch; } + private TypeDefPatch deprecateSolutionComponentImplementationRelationship() { /* @@ -885,6 +1500,7 @@ private TypeDefPatch updateDigitalServiceManagementRelationship() return typeDefPatch; } + /* * ------------------------------------------------------------------------------------------------------- */ @@ -951,7 +1567,5 @@ private RelationshipDef getSolutionPortSchemaRelationship() /* * ------------------------------------------------------------------------------------------------------- */ - - } diff --git a/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive1_2.java b/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive1_2.java index 5bf091f44dc..a6b829e30c5 100644 --- a/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive1_2.java +++ b/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive1_2.java @@ -5152,7 +5152,7 @@ private RelationshipDef getResourceListRelationship() { final String guid = "73cf5658-6a73-4ebc-8f4d-44fdfac0b437"; final String name = "ResourceList"; - final String description = "Links supporting resources to an anchor object (typically an Actor Profile, Project, Meeting or Community)."; + final String description = "Links supporting resources to a referenceable (typically an Actor Profile, Governance Domain, Project, Meeting or Community)."; final String descriptionGUID = null; final ClassificationPropagationRule classificationPropagationRule = ClassificationPropagationRule.NONE; diff --git a/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive2_10.java b/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive2_10.java index f1eb9b2c814..f964b6721ba 100644 --- a/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive2_10.java +++ b/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive2_10.java @@ -179,7 +179,7 @@ private void update0130Projects() /** * This change means that the campaign classification connects to a referenceable. It should have connected to a project -but - * a mistake connected it to a Collection. This change allows it to be connected to a Project without braking backward compatibility. + * a mistake connected it to a Collection. This change allows it to be connected to a Project without breaking backward compatibility. * * @return patched type */ diff --git a/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-create-csv-sample/src/main/java/org/odpi/openmetadata/accessservices/assetowner/samples/createcsvfile/CreateCSVFileAssetSample.java b/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-create-csv-sample/src/main/java/org/odpi/openmetadata/accessservices/assetowner/samples/createcsvfile/CreateCSVFileAssetSample.java index 3695e8225a9..efa97195aed 100644 --- a/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-create-csv-sample/src/main/java/org/odpi/openmetadata/accessservices/assetowner/samples/createcsvfile/CreateCSVFileAssetSample.java +++ b/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-create-csv-sample/src/main/java/org/odpi/openmetadata/accessservices/assetowner/samples/createcsvfile/CreateCSVFileAssetSample.java @@ -7,15 +7,14 @@ import org.odpi.openmetadata.http.HttpHelper; /** - * CreateCSVFileAssetSample creates a simple asset definition in the open metadata repositories for - * a file. + * CreateCSVFileAssetSample creates a simple asset definition in the open metadata repositories for a file. */ public class CreateCSVFileAssetSample { - private String fileName; - private String serverName; - private String serverURLRoot; - private String clientUserId; + private final String fileName; + private final String serverName; + private final String serverURLRoot; + private final String clientUserId; /** diff --git a/open-metadata-resources/open-metadata-samples/access-services-samples/governance-program-client-samples/governance-leadership-sample/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/samples/leadership/GovernanceLeadershipSample.java b/open-metadata-resources/open-metadata-samples/access-services-samples/governance-program-client-samples/governance-leadership-sample/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/samples/leadership/GovernanceLeadershipSample.java index 799e30b6a0f..d144e847a84 100644 --- a/open-metadata-resources/open-metadata-samples/access-services-samples/governance-program-client-samples/governance-leadership-sample/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/samples/leadership/GovernanceLeadershipSample.java +++ b/open-metadata-resources/open-metadata-samples/access-services-samples/governance-program-client-samples/governance-leadership-sample/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/samples/leadership/GovernanceLeadershipSample.java @@ -56,15 +56,15 @@ public class GovernanceLeadershipSample /* - * These are the names of the properties that are not represented in the open metadata types + * These are the names of the properties that are not represented in the open metadata types, * and so they are stored as additional properties. */ private static final String workLocationPropertyName = "WorkLocation"; private static final String contactTypePropertyName = "ContactType"; - private String serverName; - private String serverURLRoot; - private String clientUserId; + private final String serverName; + private final String serverURLRoot; + private final String clientUserId; @@ -326,7 +326,9 @@ public void run() throws InvalidParameterException, governanceRoleProperties = new GovernanceRoleProperties(); + governanceRoleProperties.setTypeName("GovernanceOfficer"); governanceRoleProperties.setDomainIdentifier(GovernanceDomain.DATA.getOrdinal()); + governanceRoleProperties.setQualifiedName("GovernanceOfficer:" + cdoAppointmentId); governanceRoleProperties.setRoleId(cdoAppointmentId); governanceRoleProperties.setTitle("Chief Data Role (CDO)"); @@ -336,7 +338,9 @@ public void run() throws InvalidParameterException, governanceRoleProperties = new GovernanceRoleProperties(); + governanceRoleProperties.setTypeName("GovernanceOfficer"); governanceRoleProperties.setDomainIdentifier(GovernanceDomain.PRIVACY.getOrdinal()); + governanceRoleProperties.setQualifiedName("GovernanceOfficer:" + cpoAppointmentId); governanceRoleProperties.setRoleId(cpoAppointmentId); governanceRoleProperties.setTitle("Chief Privacy Role (CPO)"); @@ -346,7 +350,9 @@ public void run() throws InvalidParameterException, governanceRoleProperties = new GovernanceRoleProperties(); + governanceRoleProperties.setTypeName("GovernanceOfficer"); governanceRoleProperties.setDomainIdentifier(GovernanceDomain.SECURITY.getOrdinal()); + governanceRoleProperties.setQualifiedName("GovernanceOfficer:" + csoAppointmentId); governanceRoleProperties.setRoleId(csoAppointmentId); governanceRoleProperties.setTitle("Chief Security Role (CSO)"); @@ -459,7 +465,7 @@ public void run() throws InvalidParameterException, } /* - * Update Jule's job title + * Update Jules' job title */ ppmClient.updatePersonalProfile(clientUserId, null, @@ -500,7 +506,9 @@ public void run() throws InvalidParameterException, governanceRoleProperties = new GovernanceRoleProperties(); + governanceRoleProperties.setTypeName("GovernanceOfficer"); governanceRoleProperties.setDomainIdentifier(GovernanceDomain.DATA.getOrdinal()); + governanceRoleProperties.setQualifiedName("GovernanceOfficer:" + cdoForITAppointmentId); governanceRoleProperties.setRoleId(cdoForITAppointmentId); governanceRoleProperties.setScope("IT Systems"); governanceRoleProperties.setTitle("Chief Data Role (CDO) for IT"); @@ -518,7 +526,7 @@ public void run() throws InvalidParameterException, /* - * Appointing Gary Geeke as as the governance officer for IT infrastructure. + * Appointing Gary Geeke as the governance officer for IT infrastructure. */ System.out.println("Creating profile for Gary"); @@ -541,7 +549,9 @@ public void run() throws InvalidParameterException, governanceRoleProperties = new GovernanceRoleProperties(); + governanceRoleProperties.setTypeName("GovernanceOfficer"); governanceRoleProperties.setDomainIdentifier(GovernanceDomain.IT_INFRASTRUCTURE.getOrdinal()); + governanceRoleProperties.setQualifiedName("GovernanceOfficer:" + infraGovForITAppointmentId); governanceRoleProperties.setRoleId(infraGovForITAppointmentId); governanceRoleProperties.setTitle("Chief Infrastructure Architect"); @@ -558,7 +568,7 @@ public void run() throws InvalidParameterException, /* - * Appointing Polly Tasker as as the governance officer for software development. + * Appointing Polly Tasker as the governance officer for software development. */ System.out.println("Creating profile for Polly"); @@ -581,7 +591,9 @@ public void run() throws InvalidParameterException, governanceRoleProperties = new GovernanceRoleProperties(); + governanceRoleProperties.setTypeName("GovernanceOfficer"); governanceRoleProperties.setDomainIdentifier(GovernanceDomain.SOFTWARE_DEVELOPMENT.getOrdinal()); + governanceRoleProperties.setQualifiedName("GovernanceOfficer:" + projLeadForITAppointmentId); governanceRoleProperties.setRoleId(projLeadForITAppointmentId); governanceRoleProperties.setTitle("Chief Project Lead for Software"); @@ -597,7 +609,7 @@ public void run() throws InvalidParameterException, this.printGovernanceRole(gplClient, clientUserId, projLeadForITGUID); /* - * Appointing Reggie Mint as as the corporate governance officer. + * Appointing Reggie Mint as the corporate governance officer. */ System.out.println("Creating profile for Reggie"); @@ -620,7 +632,9 @@ public void run() throws InvalidParameterException, governanceRoleProperties = new GovernanceRoleProperties(); + governanceRoleProperties.setTypeName("GovernanceOfficer"); governanceRoleProperties.setDomainIdentifier(GovernanceDomain.CORPORATE.getOrdinal()); + governanceRoleProperties.setQualifiedName("GovernanceOfficer:" + corpAppointmentId); governanceRoleProperties.setRoleId(corpAppointmentId); governanceRoleProperties.setTitle("Corporate Governance Role"); @@ -663,7 +677,7 @@ public void run() throws InvalidParameterException, System.out.println("Deleting all profiles and governance officers"); /* - * Delete all of the governance officers + * Delete all the governance officers */ gplClient.deleteGovernanceRole(clientUserId, cdoGUID); gplClient.deleteGovernanceRole(clientUserId, cdoForITGUID); @@ -675,7 +689,7 @@ public void run() throws InvalidParameterException, /* - * Delete all of the personal profiles + * Delete all the personal profiles */ ppmClient.deletePersonalProfile(clientUserId, null, null, julesKeeperProfileGUID, julesKeeperEmpNo); ppmClient.deletePersonalProfile(clientUserId, null, null, ivorPadlockProfileGUID, ivorPadlockEmpNo); diff --git a/open-metadata-resources/open-metadata-samples/access-services-samples/governance-program-client-samples/governance-subject-area-sample/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/samples/subjectareas/CreateSubjectAreasSample.java b/open-metadata-resources/open-metadata-samples/access-services-samples/governance-program-client-samples/governance-subject-area-sample/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/samples/subjectareas/CreateSubjectAreasSample.java index 4bb66fbbd25..fc548ac03b1 100644 --- a/open-metadata-resources/open-metadata-samples/access-services-samples/governance-program-client-samples/governance-subject-area-sample/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/samples/subjectareas/CreateSubjectAreasSample.java +++ b/open-metadata-resources/open-metadata-samples/access-services-samples/governance-program-client-samples/governance-subject-area-sample/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/samples/subjectareas/CreateSubjectAreasSample.java @@ -19,11 +19,11 @@ */ public class CreateSubjectAreasSample { - private String serverName; - private String serverURLRoot; - private String clientUserId; + private final String serverName; + private final String serverURLRoot; + private final String clientUserId; - private Map subjectAreaMap = new HashMap<>(); + private final Map subjectAreaMap = new HashMap<>(); private SubjectAreaManager client = null; @@ -71,17 +71,18 @@ private void createSubjectAreaDefinition(String subjectAreaDefinitionName, System.out.println("------------------------------------------------------------------------"); System.out.println(subjectAreaDefinitionName); System.out.println("------------------------------------------------------------------------"); - System.out.println(" ==> qualifiedName: " + subjectAreaDefinitionName); - System.out.println(" ==> displayName: " + displayName); - System.out.println(" ==> description: " + description); - System.out.println(" ==> scope: " + scope); - System.out.println(" ==> usage: " + usage); - System.out.println(" ==> domain: " + domainIdentifier); + System.out.println(" ==> subjectAreaName: " + subjectAreaDefinitionName); + System.out.println(" ==> displayName: " + displayName); + System.out.println(" ==> description: " + description); + System.out.println(" ==> scope: " + scope); + System.out.println(" ==> usage: " + usage); + System.out.println(" ==> domain: " + domainIdentifier); System.out.println(" "); SubjectAreaProperties properties = new SubjectAreaProperties(); - properties.setQualifiedName(subjectAreaDefinitionName); + properties.setQualifiedName("SubjectArea:" + subjectAreaDefinitionName); + properties.setSubjectAreaName(subjectAreaDefinitionName); properties.setDisplayName(displayName); properties.setDescription(description); properties.setScope(scope); diff --git a/open-metadata-resources/open-metadata-samples/access-services-samples/governance-program-client-samples/governance-subject-area-sample/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/samples/subjectareas/SubjectAreaSampleDefinitions.java b/open-metadata-resources/open-metadata-samples/access-services-samples/governance-program-client-samples/governance-subject-area-sample/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/samples/subjectareas/SubjectAreaSampleDefinitions.java index 8091000caf8..ca5b215d46e 100644 --- a/open-metadata-resources/open-metadata-samples/access-services-samples/governance-program-client-samples/governance-subject-area-sample/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/samples/subjectareas/SubjectAreaSampleDefinitions.java +++ b/open-metadata-resources/open-metadata-samples/access-services-samples/governance-program-client-samples/governance-subject-area-sample/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/samples/subjectareas/SubjectAreaSampleDefinitions.java @@ -187,13 +187,13 @@ public enum SubjectAreaSampleDefinitions ; - private String subjectAreaName; - private String parentName; - private String displayName; - private String description; - private String scope; - private String usage; - private int domain; + private final String subjectAreaName; + private final String parentName; + private final String displayName; + private final String description; + private final String scope; + private final String usage; + private final int domain; SubjectAreaSampleDefinitions(String name, @@ -205,6 +205,7 @@ public enum SubjectAreaSampleDefinitions int domain) { this.subjectAreaName = name; + this.parentName = parentName; this.displayName = displayName; this.description = description; this.scope = scope; @@ -227,7 +228,7 @@ public String getSubjectAreaName() /** * Return the name of the parent subject area - null for top level. * - * @return subject area name. + * @return parent subject area name. */ public String getParentName() { @@ -268,8 +269,9 @@ public String getScope() /** - * Get the typical usage of the subject area; - * @return + * Get the typical usage of the subject area. + * + * @return text */ public String getUsage() { @@ -305,4 +307,5 @@ public String toString() ", usage='" + usage + '\'' + ", domain=" + domain + '}'; - }} + } +} diff --git a/open-metadata-resources/open-metadata-samples/access-services-samples/governance-program-client-samples/governance-zone-create-sample/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/samples/zonecreate/CreateGovernanceZoneSample.java b/open-metadata-resources/open-metadata-samples/access-services-samples/governance-program-client-samples/governance-zone-create-sample/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/samples/zonecreate/CreateGovernanceZoneSample.java index 46847a3eb31..8ee13004af8 100644 --- a/open-metadata-resources/open-metadata-samples/access-services-samples/governance-program-client-samples/governance-zone-create-sample/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/samples/zonecreate/CreateGovernanceZoneSample.java +++ b/open-metadata-resources/open-metadata-samples/access-services-samples/governance-program-client-samples/governance-zone-create-sample/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/samples/zonecreate/CreateGovernanceZoneSample.java @@ -3,12 +3,14 @@ package org.odpi.openmetadata.accessservices.governanceprogram.samples.zonecreate; import org.odpi.openmetadata.accessservices.governanceprogram.client.GovernanceZoneManager; +import org.odpi.openmetadata.accessservices.governanceprogram.metadataelements.GovernanceZoneElement; import org.odpi.openmetadata.accessservices.governanceprogram.properties.GovernanceZoneProperties; import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; import org.odpi.openmetadata.http.HttpHelper; +import java.util.List; /** @@ -17,9 +19,9 @@ */ public class CreateGovernanceZoneSample { - private String serverName; - private String serverURLRoot; - private String clientUserId; + private final String serverName; + private final String serverURLRoot; + private final String clientUserId; private GovernanceZoneManager client = null; @@ -61,7 +63,7 @@ private void createZone(String zoneName, System.out.println("------------------------------------------------------------------------"); System.out.println(zoneName); System.out.println("------------------------------------------------------------------------"); - System.out.println(" ==> qualifiedName: " + zoneName); + System.out.println(" ==> zoneName: " + zoneName); System.out.println(" ==> displayName: " + displayName); System.out.println(" ==> description: " + description); System.out.println(" ==> criteria: " + criteria); @@ -69,7 +71,8 @@ private void createZone(String zoneName, GovernanceZoneProperties zoneProperties = new GovernanceZoneProperties(); - zoneProperties.setQualifiedName(zoneName); + zoneProperties.setQualifiedName("GovernanceZone:" + zoneName); + zoneProperties.setZoneName(zoneName); zoneProperties.setDisplayName(displayName); zoneProperties.setDescription(description); zoneProperties.setCriteria(criteria); @@ -97,7 +100,34 @@ public void run() zoneDefinition.getCriteria()); } + List zones = client.getGovernanceZonesForDomain(clientUserId, 0, 0, 0); + int matchingZones = 0; + + for (GovernanceZoneElement zone : zones) + { + for (GovernanceZoneSampleDefinitions zoneDefinition : zoneSampleDefinitions) + { + if (zoneDefinition.getZoneName().equals(zone.getGovernanceZoneProperties().getZoneName())) + { + if ((zoneDefinition.getDisplayName().equals(zone.getGovernanceZoneProperties().getDisplayName())) && + (zoneDefinition.getDisplayName().equals(zone.getGovernanceZoneProperties().getDisplayName())) && + (zoneDefinition.getDisplayName().equals(zone.getGovernanceZoneProperties().getDisplayName()))) + { + matchingZones++; + } + else + { + System.out.println("Retrieved zone: " + zone + " does not match zone definition: " + zoneDefinition); + } + } + } + } + + if (matchingZones != zoneSampleDefinitions.length) + { + System.out.println("Retrieved " + matchingZones + " zones: " + zones); + } } catch (Exception error) { diff --git a/open-metadata-resources/open-metadata-samples/sample-metadata/simple-catalogs/src/main/java/org/odpi/openmetadata/archiveutilities/simplecatalogs/catalogcontent/SimpleDataCatalogArchiveBuilder.java b/open-metadata-resources/open-metadata-samples/sample-metadata/simple-catalogs/src/main/java/org/odpi/openmetadata/archiveutilities/simplecatalogs/catalogcontent/SimpleDataCatalogArchiveBuilder.java index fa6668f2082..b661d384f22 100644 --- a/open-metadata-resources/open-metadata-samples/sample-metadata/simple-catalogs/src/main/java/org/odpi/openmetadata/archiveutilities/simplecatalogs/catalogcontent/SimpleDataCatalogArchiveBuilder.java +++ b/open-metadata-resources/open-metadata-samples/sample-metadata/simple-catalogs/src/main/java/org/odpi/openmetadata/archiveutilities/simplecatalogs/catalogcontent/SimpleDataCatalogArchiveBuilder.java @@ -144,7 +144,7 @@ public OpenMetadataArchive getOpenMetadataArchive() null, null); - archiveHelper.addDataContentForDataSet(databaseGUID, databaseSchemaGUID); + archiveHelper.addDataContentForDataSet(databaseGUID, databaseSchemaGUID, null, null); String topLevelSchemaTypeGUID = archiveHelper.addTopLevelSchemaType(databaseSchemaGUID, relationalTopLevelSchemaTypeName, diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/digital-architecture-fvt/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/fvt/validvalues/CreateValidValuesSetTest.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/digital-architecture-fvt/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/fvt/validvalues/CreateValidValuesSetTest.java index 0e8cd0a8be3..013534ed940 100644 --- a/open-metadata-test/open-metadata-fvt/access-services-fvt/digital-architecture-fvt/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/fvt/validvalues/CreateValidValuesSetTest.java +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/digital-architecture-fvt/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/fvt/validvalues/CreateValidValuesSetTest.java @@ -292,6 +292,7 @@ private void createValidValueDefinitions(ValidValuesManager client, String validValue1GUID = client.createValidValueDefinition(userId, validValueSetGUID, + true, validValue1Name, validValue1DisplayName, validValue1Description, @@ -474,6 +475,7 @@ else if (validValueList.size() != 1) { client.createValidValueDefinition(userId, validValueSetGUID, + false, validValue1Name, validValue1DisplayName, validValue1Description, @@ -496,6 +498,7 @@ else if (validValueList.size() != 1) */ String validValue2GUID = client.createValidValueDefinition(userId, validValueSetGUID, + false, validValue2Name, validValue2DisplayName, validValue2Description, @@ -854,7 +857,7 @@ else if (validValueList.size() != 1) /* * Now reattach value 2 and check it reappears in the set. */ - client.attachValidValueToSet(userId, validValueSetGUID, validValue2GUID); + client.attachValidValueToSet(userId, validValueSetGUID, validValue2GUID, true); validValueList = client.getValidValueSetMembers(userId, validValueSetGUID, 0, maxPageSize); diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/governance-program-fvt/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/fvt/definitions/CreateDefinitionTest.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/governance-program-fvt/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/fvt/definitions/CreateDefinitionTest.java index 9bae12ce60f..cb16bdd9614 100644 --- a/open-metadata-test/open-metadata-fvt/access-services-fvt/governance-program-fvt/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/fvt/definitions/CreateDefinitionTest.java +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/governance-program-fvt/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/fvt/definitions/CreateDefinitionTest.java @@ -3,12 +3,22 @@ package org.odpi.openmetadata.accessservices.governanceprogram.fvt.definitions; +import org.odpi.openmetadata.accessservices.governanceprogram.client.GovernanceDomainManager; +import org.odpi.openmetadata.accessservices.governanceprogram.client.rest.GovernanceProgramRESTClient; +import org.odpi.openmetadata.accessservices.governanceprogram.metadataelements.GovernanceDomainElement; +import org.odpi.openmetadata.accessservices.governanceprogram.metadataelements.GovernanceDomainSetElement; +import org.odpi.openmetadata.accessservices.governanceprogram.properties.GovernanceDomainProperties; +import org.odpi.openmetadata.accessservices.governanceprogram.properties.GovernanceDomainSetProperties; import org.odpi.openmetadata.adminservices.configuration.registration.AccessServiceDescription; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; import org.odpi.openmetadata.fvt.utilities.FVTResults; import org.odpi.openmetadata.fvt.utilities.auditlog.FVTAuditLogDestination; import org.odpi.openmetadata.fvt.utilities.exceptions.FVTUnexpectedCondition; +import java.util.List; /** @@ -17,39 +27,10 @@ public class CreateDefinitionTest { private final static String testCaseName = "CreateDefinitionTest"; - private final static int maxPageSize = 100; - /* - * The database manager name is constant - the guid is created as part of the test. - */ - private final static String databaseManagerName = "TestDefinitionManager"; - private final static String databaseManagerDisplayName = "DefinitionManager displayName"; - private final static String databaseManagerDescription = "DefinitionManager description"; - private final static String databaseManagerTypeDescription = "DefinitionManager type"; - private final static String databaseManagerVersion = "DefinitionManager version"; - - private final static String databaseName = "TestDefinition"; - private final static String databaseDisplayName = "Definition displayName"; - private final static String databaseDescription = "Definition description"; - private final static String databaseType = "Definition type"; - private final static String databaseVersion = "Definition version"; - - private final static String databaseSchemaName = "TestDefinitionSchema"; - private final static String databaseSchemaDisplayName = "DefinitionSchema displayName"; - private final static String databaseSchemaDescription = "DefinitionSchema description"; - private final static String databaseSchemaZone = "DefinitionSchema Zone"; - private final static String databaseSchemaOwner = "DefinitionSchema Owner"; - - private final static String databaseTableName = "TestDefinitionTable"; - private final static String databaseTableDisplayName = "DefinitionTable displayName"; - private final static String databaseTableDescription = "DefinitionTable description"; - private final static String databaseTableType = "DefinitionTable type"; - private final static String databaseTableVersion = "DefinitionTable version"; - - /** - * Run all of the defined tests and capture the results. + * Run all the defined tests and capture the results. * * @param serverName name of the server to connect to * @param serverPlatformRootURL the network address of the server running the OMAS REST servers @@ -78,7 +59,7 @@ public static FVTResults performFVT(String serverName, /** - * Run all of the tests in this class. + * Run all the tests in this class. * * @param serverPlatformRootURL root url of the server * @param serverName name of the server @@ -91,6 +72,8 @@ private static void runIt(String serverPlatformRootURL, String userId, FVTAuditLogDestination auditLogDestination) throws FVTUnexpectedCondition { + final String governanceDomainSetName = "CocoPharmaceuticals"; + CreateDefinitionTest thisTest = new CreateDefinitionTest(); AuditLog auditLog = new AuditLog(auditLogDestination, @@ -100,7 +83,195 @@ private static void runIt(String serverPlatformRootURL, AccessServiceDescription.GOVERNANCE_PROGRAM_OMAS.getAccessServiceDescription(), AccessServiceDescription.GOVERNANCE_PROGRAM_OMAS.getAccessServiceWiki()); + GovernanceDomainManager domainManagerClient = thisTest.getDomainManagerClient(serverName, serverPlatformRootURL); + + String activityName = "newDomain"; + try + { + String newDomainGUID = thisTest.createGovernanceDomain(domainManagerClient, userId, governanceDomainSetName); + + thisTest.addStandardGovernanceDomains(domainManagerClient, userId, governanceDomainSetName); + + } + catch (Exception unexpectedError) + { + throw new FVTUnexpectedCondition(testCaseName, activityName, unexpectedError); + } + } + + + /** + * Create and return a governance domain manager client. + * + * @param serverName name of the server to connect to + * @param serverPlatformRootURL the network address of the server running the OMAS REST servers + * @return client + * @throws FVTUnexpectedCondition the test case failed + */ + private GovernanceDomainManager getDomainManagerClient(String serverName, + String serverPlatformRootURL) throws FVTUnexpectedCondition + { + final String activityName = "getDomainManagerClient"; + + try + { + GovernanceProgramRESTClient restClient = new GovernanceProgramRESTClient(serverName, serverPlatformRootURL); + + return new GovernanceDomainManager(serverName, serverPlatformRootURL, restClient, maxPageSize); + } + catch (Exception unexpectedError) + { + throw new FVTUnexpectedCondition(testCaseName, activityName, unexpectedError); + } } + /** + * Set up the standard domains and add them to Coco's domain set. + * + * @param domainManagerClient client to manage domains + * @param userId userId for requests + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + * @throws FVTUnexpectedCondition the test case failed + */ + private void addStandardGovernanceDomains(GovernanceDomainManager domainManagerClient, + String userId, + String domainSetName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException, + FVTUnexpectedCondition + { + final String activityName = "addStandardGovernanceDomains"; + final String standardGovernanceDomainSetName = "EgeriaStandardDomains"; + + + List domainSets = domainManagerClient.findGovernanceDomainSets(userId, + ".*", + 0, + 0); + + if (domainSets == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(No domain sets returned)"); + } + if (domainSets.size() != 1) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Too many domain sets returned)"); + } + + + GovernanceDomainSetElement cocoDomainSet = domainSets.get(0); + if (cocoDomainSet == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(No " + domainSetName + " domain set returned)"); + } + if (! domainSetName.equals(cocoDomainSet.getProperties().getDisplayName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad values in " + domainSetName + ": " + cocoDomainSet + ")"); + } + + String standardDomainSetGUID = domainManagerClient.createStandardGovernanceDomains(userId); + + GovernanceDomainSetElement standardDomainSet = domainManagerClient.getGovernanceDomainSetByGUID(userId, standardDomainSetGUID); + + if (standardDomainSet == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(No new domain set)"); + } + if (standardDomainSet.getElementHeader() == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(No new domain set header: " + standardDomainSet + ")"); + } + if (standardDomainSet.getProperties() == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(No new domain set properties: " + standardDomainSet + ")"); + } + if (! standardDomainSetGUID.equals(standardDomainSet.getElementHeader().getGUID())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad set GUID: " + standardDomainSet + ")"); + } + if (standardDomainSet.getDomains() == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(No domains in set: " + standardDomainSet + ")"); + } + if (standardDomainSet.getDomains().isEmpty()) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Empty domains in set: " + standardDomainSet + ")"); + } + + + } + + + /** + * Set up a new domain for product assurance. + * + * @param domainManagerClient client to manage domains + * @param userId userId for requests + * @return unique identifier of the governance domain + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + * @throws FVTUnexpectedCondition the test case failed + */ + private String createGovernanceDomain(GovernanceDomainManager domainManagerClient, + String userId, + String domainSetName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException, + FVTUnexpectedCondition + { + final String activityName = "createGovernanceDomain"; + + final String domainSetDescription = "Governance Domains for Coco Pharmaceuticals"; + + final int governanceDomainIdentifier = 8; + final String governanceDomainName = "Product Assurance"; + final String governanceDomainDescription = "Ensuring Coco Pharmaceutical products are developed in an ethical manner that complies with the regulations and provides efficacious treatments."; + + List domainSets = domainManagerClient.getGovernanceDomainSetsByName(userId, domainSetName, 0, 0); + if (domainSets != null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Too many domain sets returned: " + domainSets +")"); + } + + GovernanceDomainSetProperties setProperties = new GovernanceDomainSetProperties(); + setProperties.setQualifiedName("GovernanceDomainSet:" + domainSetName); + setProperties.setDisplayName(domainSetName); + setProperties.setDescription(domainSetDescription); + + String domainSetGUID = domainManagerClient.createGovernanceDomainSet(userId, setProperties); + + GovernanceDomainProperties properties = new GovernanceDomainProperties(); + + properties.setDomainIdentifier(governanceDomainIdentifier); + properties.setQualifiedName("GovernanceDomain:" + governanceDomainIdentifier); + properties.setDisplayName(governanceDomainName); + properties.setDescription(governanceDomainDescription); + + String domainGUID = domainManagerClient.createGovernanceDomain(userId, domainSetGUID, properties); + + GovernanceDomainElement newDomain = domainManagerClient.getGovernanceDomainByGUID(userId, domainGUID); + + if (newDomain == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(No new domain)"); + } + if (newDomain.getElementHeader() == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(No new domain header: " + newDomain + ")"); + } + if (newDomain.getProperties() == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(No new domain properties: " + newDomain + ")"); + } + if (! domainGUID.equals(newDomain.getElementHeader().getGUID())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad GUID: " + newDomain + ")"); + } + + return domainGUID; + } } From ebf7598392e1777cff6e7a88e86bb3458a47ec2e Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Mon, 15 Aug 2022 11:08:49 +0100 Subject: [PATCH 3/8] Fix Javadoc Signed-off-by: Mandy Chessell --- .../api/RelatedElementsManagementInterface.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/RelatedElementsManagementInterface.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/RelatedElementsManagementInterface.java index 1a78095f4ba..6c4ad7133c8 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/RelatedElementsManagementInterface.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/RelatedElementsManagementInterface.java @@ -72,6 +72,7 @@ void clearMoreInformation(String userId, * @param startFrom index of the list to start from (0 for start) * @param pageSize maximum number of elements to return. * + * @return list of related elements * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) @@ -92,6 +93,7 @@ List getMoreInformation(String userId, * @param startFrom index of the list to start from (0 for start) * @param pageSize maximum number of elements to return. * + * @return list of related elements * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) @@ -158,6 +160,7 @@ void clearStakeholder(String userId, * @param startFrom index of the list to start from (0 for start) * @param pageSize maximum number of elements to return. * + * @return list of related elements * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) @@ -178,6 +181,7 @@ List getStakeholders(String userId, * @param startFrom index of the list to start from (0 for start) * @param pageSize maximum number of elements to return. * + * @return list of related elements * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) @@ -244,6 +248,7 @@ void clearAssignmentScope(String userId, * @param startFrom index of the list to start from (0 for start) * @param pageSize maximum number of elements to return. * + * @return list of related elements * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) @@ -264,6 +269,7 @@ List getAssignedScopes(String userId, * @param startFrom index of the list to start from (0 for start) * @param pageSize maximum number of elements to return. * + * @return list of related elements * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) @@ -330,6 +336,7 @@ void clearResource(String userId, * @param startFrom index of the list to start from (0 for start) * @param pageSize maximum number of elements to return. * + * @return list of related elements * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) @@ -350,6 +357,7 @@ List getResourceList(String userId, * @param startFrom index of the list to start from (0 for start) * @param pageSize maximum number of elements to return. * + * @return list of related elements * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) From 2c24175b3d41bd7f22cc852a20483c0659729232 Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Mon, 15 Aug 2022 11:10:36 +0100 Subject: [PATCH 4/8] Add Overrides Signed-off-by: Mandy Chessell --- .../communityprofile/converters/PersonRoleConverter.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/PersonRoleConverter.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/PersonRoleConverter.java index 76754d7fbf3..b67d6aca47d 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/PersonRoleConverter.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/PersonRoleConverter.java @@ -51,6 +51,7 @@ public PersonRoleConverter(OMRSRepositoryHelper repositoryHelper, * @return bean populated with properties from the entity supplied * @throws PropertyServerException there is a problem instantiating the bean */ + @Override public B getNewBean(Class beanClass, EntityDetail entity, String methodName) throws PropertyServerException @@ -127,6 +128,7 @@ public B getNewBean(Class beanClass, * @return bean populated with properties from the instances supplied * @throws PropertyServerException there is a problem instantiating the bean */ + @Override public B getNewBean(Class beanClass, EntityDetail entity, Relationship relationship, From d55dd727e6352dc9d5dba4bed81ba0ea1b69be17 Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Wed, 17 Aug 2022 08:22:29 +0100 Subject: [PATCH 5/8] Initial calls for Project Management OMAS Signed-off-by: Mandy Chessell --- .../api/CommunityManagementInterface.java | 4 - .../community-profile-client/pom.xml | 2 +- .../client/CommunityProfileBaseClient.java | 11 +- .../converters/RelatedElementConverter.java | 81 - .../server/CommunityRESTServices.java | 8 +- .../access-services/pom.xml | 2 +- .../project-management-api/build.gradle | 1 + .../project-management-api/pom.xml | 7 +- .../api/ProjectsInterface.java | 333 +++ .../api/RelatedElementsInterface.java | 371 +++ .../metadataelements/ActorProfileElement.java | 409 +++ .../ContactMethodElement.java | 149 ++ .../ContributionRecordElement.java | 149 ++ .../ElementClassification.java | 158 ++ .../metadataelements/ElementHeader.java | 278 +++ .../metadataelements/ElementOrigin.java | 225 ++ .../ElementOriginCategory.java | 108 + .../metadataelements/ElementStatus.java | 124 + .../metadataelements/ElementStub.java | 138 + .../metadataelements/ElementType.java | 235 ++ .../metadataelements/ElementVersions.java | 253 ++ .../metadataelements/MetadataElement.java | 26 + .../metadataelements/PersonRoleElement.java | 177 ++ .../ProfileIdentityElement.java | 148 ++ .../ProfileLocationElement.java | 148 ++ .../metadataelements/ProjectElement.java | 177 ++ .../metadataelements/RelatedElement.java | 173 ++ .../metadataelements/RelationshipElement.java | 199 ++ .../metadataelements/UserIdentityElement.java | 177 ++ .../properties/ActorProfileProperties.java | 158 ++ .../properties/AssignmentScopeProperties.java | 152 ++ .../properties/ClassificationProperties.java | 188 ++ .../properties/ContactMethodProperties.java | 341 +++ .../properties/ContactMethodType.java | 130 + .../properties/ContributionRecord.java | 187 ++ .../properties/MetadataSourceProperties.java | 265 ++ .../properties/PersonRoleProperties.java | 166 ++ .../properties/PersonalRoleProperties.java | 418 ++++ .../properties/ProfileIdentityProperties.java | 172 ++ .../properties/ProfileLocationProperties.java | 128 + .../properties/ProjectProperties.java | 278 +++ .../properties/ProjectTeamProperties.java | 127 + .../properties/ReferenceableProperties.java | 334 +++ .../properties/RelationshipProperties.java | 200 ++ .../properties/ResourceListProperties.java | 150 ++ .../properties/StakeholderProperties.java | 127 + .../properties/TemplateProperties.java | 201 ++ .../properties/UserIdentityProperties.java | 157 ++ .../rest/ActorProfileListResponse.java | 150 ++ .../rest/ClassificationRequestBody.java | 129 + .../rest/ElementStubsResponse.java | 151 ++ .../rest/ExternalSourceRequestBody.java | 145 ++ .../rest/PersonRoleListResponse.java | 150 ++ .../rest/PersonRoleRequestBody.java | 126 + .../rest/PersonRoleResponse.java | 138 + .../rest/ProjectListResponse.java | 150 ++ .../ProjectManagementOMASAPIRequestBody.java | 61 + .../rest/ProjectResponse.java | 138 + .../rest/ReferenceableRequestBody.java | 129 + .../rest/RelatedElementListResponse.java | 148 ++ .../rest/RelationshipElementResponse.java | 139 ++ .../rest/RelationshipElementsResponse.java | 150 ++ .../rest/RelationshipRequestBody.java | 129 + .../rest/TemplateRequestBody.java | 165 ++ .../project-management-client/build.gradle | 13 + .../project-management-client/pom.xml | 22 +- .../client/ProjectManagement.java | 655 +++++ .../client/ProjectManagementBaseClient.java | 1171 +++++++++ .../rest/ProjectManagementRESTClient.java | 329 +++ .../project-management-server/build.gradle | 1 + .../project-management-server/pom.xml | 5 + .../converters/ActorProfileConverter.java | 366 +++ .../converters/PersonRoleConverter.java | 142 ++ .../converters/ProjectConverter.java | 123 + .../ProjectManagementOMASConverter.java | 659 +++++ .../converters/RelatedElementConverter.java | 63 + .../converters/package-info.java | 13 + .../ProjectManagementInstanceHandler.java | 138 + .../server/ProjectManagementRESTServices.java | 2215 ++++++++++++++++- .../server/ProjectManagementRegistration.java | 2 +- .../ProjectManagementServicesInstance.java | 139 +- .../project-management-spring/build.gradle | 2 + .../project-management-spring/pom.xml | 10 + .../spring/ProjectManagementResource.java | 790 +++++- .../rest-client-connectors/pom.xml | 2 +- .../SimpleCatalogArchiveHelper.java | 63 + .../community-profile-fvt/build.gradle | 2 +- .../fvt/CommunityProfileOMASFVTSuite.java | 2 +- .../fvt/errorhandling/package-info.java | 2 +- .../communityprofile/fvt/package-info.java | 2 +- .../test/script/configureStartServer.groovy | 2 +- 91 files changed, 17172 insertions(+), 109 deletions(-) create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/api/ProjectsInterface.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/api/RelatedElementsInterface.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ActorProfileElement.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ContactMethodElement.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ContributionRecordElement.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ElementClassification.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ElementHeader.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ElementOrigin.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ElementOriginCategory.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ElementStatus.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ElementStub.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ElementType.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ElementVersions.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/MetadataElement.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/PersonRoleElement.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ProfileIdentityElement.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ProfileLocationElement.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ProjectElement.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/RelatedElement.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/RelationshipElement.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/UserIdentityElement.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ActorProfileProperties.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/AssignmentScopeProperties.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ClassificationProperties.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ContactMethodProperties.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ContactMethodType.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ContributionRecord.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/MetadataSourceProperties.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/PersonRoleProperties.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/PersonalRoleProperties.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ProfileIdentityProperties.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ProfileLocationProperties.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ProjectProperties.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ProjectTeamProperties.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ReferenceableProperties.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/RelationshipProperties.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ResourceListProperties.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/StakeholderProperties.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/TemplateProperties.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/UserIdentityProperties.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/ActorProfileListResponse.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/ClassificationRequestBody.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/ElementStubsResponse.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/ExternalSourceRequestBody.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/PersonRoleListResponse.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/PersonRoleRequestBody.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/PersonRoleResponse.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/ProjectListResponse.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/ProjectManagementOMASAPIRequestBody.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/ProjectResponse.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/ReferenceableRequestBody.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/RelatedElementListResponse.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/RelationshipElementResponse.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/RelationshipElementsResponse.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/RelationshipRequestBody.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/TemplateRequestBody.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-client/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/client/ProjectManagement.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-client/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/client/ProjectManagementBaseClient.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-client/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/client/rest/ProjectManagementRESTClient.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/converters/ActorProfileConverter.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/converters/PersonRoleConverter.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/converters/ProjectConverter.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/converters/ProjectManagementOMASConverter.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/converters/RelatedElementConverter.java create mode 100644 open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/converters/package-info.java diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/CommunityManagementInterface.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/CommunityManagementInterface.java index 2a3b57f79e7..a3455142825 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/CommunityManagementInterface.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/CommunityManagementInterface.java @@ -5,17 +5,13 @@ import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.CommunityElement; import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.PersonRoleElement; import org.odpi.openmetadata.accessservices.communityprofile.properties.CommunityMembershipProperties; -import org.odpi.openmetadata.accessservices.communityprofile.properties.CommunityMembershipType; import org.odpi.openmetadata.accessservices.communityprofile.properties.CommunityProperties; -import org.odpi.openmetadata.accessservices.communityprofile.properties.ResourceListProperties; import org.odpi.openmetadata.accessservices.communityprofile.properties.TemplateProperties; -import org.odpi.openmetadata.accessservices.communityprofile.rest.PersonRoleListResponse; import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; import java.util.List; -import java.util.Map; /** * The CommunityManagementInterface provides methods for managing communities, their membership and content. diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-client/pom.xml b/open-metadata-implementation/access-services/community-profile/community-profile-client/pom.xml index 4b7be922e71..eafdf274cae 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-client/pom.xml +++ b/open-metadata-implementation/access-services/community-profile/community-profile-client/pom.xml @@ -16,7 +16,7 @@ scm:git:git://github.com/odpi/egeria.git scm:git:ssh://github.com/odpi/egeria.git - http://github.com/odpi/egeria/tree/master + https://github.com/odpi/egeria/tree/master Community Profile OMAS Client diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityProfileBaseClient.java b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityProfileBaseClient.java index 0f32d322688..75a86c83282 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityProfileBaseClient.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityProfileBaseClient.java @@ -530,7 +530,7 @@ void clearRelationship(String userId, /** - * Remove a relationship. + * Retrieve a relationship. * * @param userId calling user * @param startingElementGUID unique identifier of the primary element @@ -540,6 +540,7 @@ void clearRelationship(String userId, * @param pageSize maximum number of elements to return. * @param methodName calling method * + * @return list of related elements * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) @@ -702,6 +703,7 @@ public void clearMoreInformation(String userId, * @param startFrom index of the list to start from (0 for start) * @param pageSize maximum number of elements to return. * + * @return list of related elements * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) @@ -731,6 +733,7 @@ public List getMoreInformation(String userId, * @param startFrom index of the list to start from (0 for start) * @param pageSize maximum number of elements to return. * + * @return list of related elements * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) @@ -843,6 +846,7 @@ public void clearStakeholder(String userId, * @param startFrom index of the list to start from (0 for start) * @param pageSize maximum number of elements to return. * + * @return list of related elements * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) @@ -872,6 +876,7 @@ public List getStakeholders(String userId, * @param startFrom index of the list to start from (0 for start) * @param pageSize maximum number of elements to return. * + * @return list of related elements * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) @@ -977,6 +982,7 @@ public void clearAssignmentScope(String userId, * @param startFrom index of the list to start from (0 for start) * @param pageSize maximum number of elements to return. * + * @return list of related elements * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) @@ -1006,6 +1012,7 @@ public List getAssignedScopes(String userId, * @param startFrom index of the list to start from (0 for start) * @param pageSize maximum number of elements to return. * + * @return list of related elements * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) @@ -1111,6 +1118,7 @@ public void clearResource(String userId, * @param startFrom index of the list to start from (0 for start) * @param pageSize maximum number of elements to return. * + * @return list of related elements * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) @@ -1140,6 +1148,7 @@ public List getResourceList(String userId, * @param startFrom index of the list to start from (0 for start) * @param pageSize maximum number of elements to return. * + * @return list of related elements * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/RelatedElementConverter.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/RelatedElementConverter.java index fb72d5a415e..b4dc7979cf0 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/RelatedElementConverter.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/RelatedElementConverter.java @@ -72,85 +72,4 @@ public B getNewBean(Class beanClass, return null; } - - /** - * Retrieve and delete the CollectionOrder enum property from the instance properties of an entity - * - * @param properties entity properties - * @return CollectionOrder enum value - */ - private CollectionOrder removeCollectionOrderFromProperties(InstanceProperties properties) - { - CollectionOrder collectionOrder = this.getCollectionOrderFromProperties(properties); - - if (properties != null) - { - Map instancePropertiesMap = properties.getInstanceProperties(); - - if (instancePropertiesMap != null) - { - instancePropertiesMap.remove(OpenMetadataAPIMapper.ORDER_BY_PROPERTY_NAME); - } - - properties.setInstanceProperties(instancePropertiesMap); - } - - return collectionOrder; - } - - - /** - * Retrieve the CollectionOrder enum property from the instance properties of an entity - * - * @param properties entity properties - * @return CollectionOrder enum value - */ - private CollectionOrder getCollectionOrderFromProperties(InstanceProperties properties) - { - CollectionOrder collectionOrder = CollectionOrder.NAME; - - if (properties != null) - { - Map instancePropertiesMap = properties.getInstanceProperties(); - - if (instancePropertiesMap != null) - { - InstancePropertyValue instancePropertyValue = instancePropertiesMap.get(OpenMetadataAPIMapper.ORDER_PROPERTY_NAME_PROPERTY_NAME); - - if (instancePropertyValue instanceof EnumPropertyValue) - { - EnumPropertyValue enumPropertyValue = (EnumPropertyValue) instancePropertyValue; - - switch (enumPropertyValue.getOrdinal()) - { - case 0: - collectionOrder = CollectionOrder.NAME; - break; - - case 1: - collectionOrder = CollectionOrder.OWNER; - break; - - case 2: - collectionOrder = CollectionOrder.DATE_ADDED; - break; - - case 3: - collectionOrder = CollectionOrder.DATE_UPDATED; - break; - - case 4: - collectionOrder = CollectionOrder.DATE_CREATED; - break; - - case 99: - collectionOrder = CollectionOrder.OTHER; - break; - } - } - } - } - - return collectionOrder; - } } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/CommunityRESTServices.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/CommunityRESTServices.java index fb2182f2a74..fedfd8ef37c 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/CommunityRESTServices.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/CommunityRESTServices.java @@ -291,12 +291,12 @@ public VoidResponse updateCommunity(String serverName, /** - * Create a relationship between a community and a connector type. + * Create a relationship between a community and a person role. * * @param serverName name of the service to route the request to. * @param userId calling user * @param communityGUID unique identifier of the community in the external data manager - * @param communityRoleGUID unique identifier of the connector type in the external data manager + * @param communityRoleGUID unique identifier of the person role in the external data manager * @param requestBody relationship properties * * @return void or @@ -392,12 +392,12 @@ else if (requestBody.getProperties() == null) /** - * Remove a relationship between a community and a connector type. + * Remove a relationship between a community and a role. * * @param serverName name of the service to route the request to. * @param userId calling user * @param communityGUID unique identifier of the community in the external data manager - * @param communityRoleGUID unique identifier of the connector type in the external data manager + * @param communityRoleGUID unique identifier of the role in the external data manager * @param requestBody external source identifiers * * @return void or diff --git a/open-metadata-implementation/access-services/pom.xml b/open-metadata-implementation/access-services/pom.xml index e40291dae1b..249b61ec909 100644 --- a/open-metadata-implementation/access-services/pom.xml +++ b/open-metadata-implementation/access-services/pom.xml @@ -18,7 +18,7 @@ scm:git:git://github.com/odpi/egeria.git scm:git:ssh://github.com/odpi/egeria.git - http://github.com/odpi/egeria/tree/master + https://github.com/odpi/egeria/tree/master Open Metadata Access Services (OMAS) diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/build.gradle b/open-metadata-implementation/access-services/project-management/project-management-api/build.gradle index a7caaca16f6..5441fb53633 100644 --- a/open-metadata-implementation/access-services/project-management/project-management-api/build.gradle +++ b/open-metadata-implementation/access-services/project-management/project-management-api/build.gradle @@ -8,6 +8,7 @@ dependencies { compileOnly 'com.fasterxml.jackson.core:jackson-annotations' implementation project(':open-metadata-implementation:common-services:ffdc-services') implementation project(':open-metadata-implementation:frameworks:audit-log-framework') + implementation project(':open-metadata-implementation:frameworks:open-connector-framework') implementation project(':open-metadata-implementation:repository-services:repository-services-apis') testImplementation project(':open-metadata-test:open-metadata-ut') testImplementation 'org.testng:testng' diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/pom.xml b/open-metadata-implementation/access-services/project-management/project-management-api/pom.xml index 4ed25426f30..215fabdbf3b 100644 --- a/open-metadata-implementation/access-services/project-management/project-management-api/pom.xml +++ b/open-metadata-implementation/access-services/project-management/project-management-api/pom.xml @@ -18,7 +18,7 @@ scm:git:git://github.com/odpi/egeria.git scm:git:ssh://github.com/odpi/egeria.git - http://github.com/odpi/egeria/tree/master + https://github.com/odpi/egeria/tree/master Project Management OMAS API @@ -45,6 +45,11 @@ audit-log-framework + + org.odpi.egeria + open-connector-framework + + org.odpi.egeria repository-services-apis diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/api/ProjectsInterface.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/api/ProjectsInterface.java new file mode 100644 index 00000000000..6d14fb4d0d4 --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/api/ProjectsInterface.java @@ -0,0 +1,333 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.api; + +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.ActorProfileElement; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.ProjectElement; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.PersonRoleElement; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.ProjectTeamProperties; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.ProjectProperties; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.TemplateProperties; +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; + +import java.util.List; + +/** + * The ProjectManagementInterface provides methods for managing projects, their membership and content. + * Projects allow groups of subject-matter experts to work together and share content and ideas. + */ +public interface ProjectsInterface +{ + /** + * Create a new metadata element to represent the project. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param projectProperties properties to store + * + * @return unique identifier of the new metadata element + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + String createProject(String userId, + String externalSourceGUID, + String externalSourceName, + ProjectProperties projectProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Create a new metadata element to represent a project using an existing metadata element as a template. + * The template defines additional classifications and relationships that should be added to the new project. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param templateGUID unique identifier of the metadata element to copy + * @param templateProperties properties that override the template + * + * @return unique identifier of the new metadata element + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + String createProjectFromTemplate(String userId, + String externalSourceGUID, + String externalSourceName, + String templateGUID, + TemplateProperties templateProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Update the metadata element representing a project. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param projectGUID unique identifier of the metadata element to update + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param projectProperties new properties for this element + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void updateProject(String userId, + String externalSourceGUID, + String externalSourceName, + String projectGUID, + boolean isMergeUpdate, + ProjectProperties projectProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Create a ProjectManagement relationship between a project and a person role to show that anyone appointed to the role is a manager of the project. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param projectGUID unique identifier of the project + * @param personRoleGUID unique identifier of the role + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void setupProjectManagementRole(String userId, + String externalSourceGUID, + String externalSourceName, + String projectGUID, + String personRoleGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove a membership relationship between a project and a person role. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param projectGUID unique identifier of the project + * @param personRoleGUID unique identifier of the role + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void clearProjectManagementRole(String userId, + String externalSourceGUID, + String externalSourceName, + String projectGUID, + String personRoleGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + + /** + * Create a ProjectTeam relationship between a project and an actor profile (typically a team). + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param projectGUID unique identifier of the project + * @param properties describes the permissions that the role has in the project + * @param actorProfileGUID unique identifier of the actor + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void setupProjectTeam(String userId, + String externalSourceGUID, + String externalSourceName, + String projectGUID, + ProjectTeamProperties properties, + String actorProfileGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove a ProjectTeam relationship between a project and an actor profile (typically a team). + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param projectGUID unique identifier of the project + * @param actorProfileGUID unique identifier of the actor + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void clearProjectTeam(String userId, + String externalSourceGUID, + String externalSourceName, + String projectGUID, + String actorProfileGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the metadata element representing a project. This will delete all anchored + * elements such as comments. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param projectGUID unique identifier of the metadata element to remove + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void removeProject(String userId, + String externalSourceGUID, + String externalSourceName, + String projectGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param userId calling user + * @param searchString string to find in the properties + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + List findProjects(String userId, + String searchString, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param userId calling user + * @param name name to search for + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + List getProjectsByName(String userId, + String name, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of projects. + * + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + List getProjects(String userId, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Return information about the project management roles linked to a project. + * + * @param userId calling user + * @param projectGUID unique identifier for the project + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching actor profiles (hopefully only one) + * + * @throws InvalidParameterException name or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + List getProjectManagementRoles(String userId, + String projectGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + + /** + * Return information about the actors linked to a project. + * + * @param userId calling user + * @param projectGUID unique identifier for the project + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching actor profiles (hopefully only one) + * + * @throws InvalidParameterException name or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + List getProjectActors(String userId, + String projectGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the project metadata element with the supplied unique identifier. + * + * @param userId calling user + * @param projectGUID unique identifier of the requested metadata element + * + * @return matching metadata element + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + ProjectElement getProjectByGUID(String userId, + String projectGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/api/RelatedElementsInterface.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/api/RelatedElementsInterface.java new file mode 100644 index 00000000000..9db832d70a9 --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/api/RelatedElementsInterface.java @@ -0,0 +1,371 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.api; + +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.RelatedElement; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.AssignmentScopeProperties; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.RelationshipProperties; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.ResourceListProperties; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.StakeholderProperties; +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; + +import java.util.List; + +/** + * Defines the interface that is common to multiple element types + */ +public interface RelatedElementsInterface +{ + /** + * Create a "MoreInformation" relationship between an element that is descriptive and one that is providing the detail. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element that is descriptive + * @param properties properties of the relationship + * @param detailGUID unique identifier of the element that provides the detail + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void setupMoreInformation(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + RelationshipProperties properties, + String detailGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove a "MoreInformation" relationship between two referenceables. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element that is descriptive + * @param detailGUID unique identifier of the element that provides the detail + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void clearMoreInformation(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String detailGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the detail elements linked via a "MoreInformation" relationship between two referenceables. + * + * @param userId calling user + * @param elementGUID unique identifier of the element that is descriptive + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of related elements + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + List getMoreInformation(String userId, + String elementGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the descriptive elements linked via a "MoreInformation" relationship between two referenceables. + * + * @param userId calling user + * @param detailGUID unique identifier of the element that provides the detail + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of related elements + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + List getDescriptiveElements(String userId, + String detailGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Create a "Stakeholder" relationship between an element and its stakeholder. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param properties properties of the relationship + * @param stakeholderGUID unique identifier of the stakeholder + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void setupStakeholder(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + StakeholderProperties properties, + String stakeholderGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove a "Stakeholder" relationship between two referenceables. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param stakeholderGUID unique identifier of the stakeholder + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void clearStakeholder(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String stakeholderGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the stakeholder elements linked via the "Stakeholder" relationship between two referenceables. + * + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of related elements + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + List getStakeholders(String userId, + String elementGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the elements commissioned by a stakeholder, linked via the "Stakeholder" relationship between two referenceables. + * + * @param userId calling user + * @param stakeholderGUID unique identifier of the stakeholder + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of related elements + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + List getStakeholderCommissionedElements(String userId, + String stakeholderGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Create an "AssignmentScope" relationship between an element and its scope. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param properties properties of the relationship + * @param scopeGUID unique identifier of the scope + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void setupAssignmentScope(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + AssignmentScopeProperties properties, + String scopeGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove an "AssignmentScope" relationship between two referenceables. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param scopeGUID unique identifier of the scope + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void clearAssignmentScope(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String scopeGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the assigned scopes linked by the "AssignmentScope" relationship between two referenceables. + * + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of related elements + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + List getAssignedScopes(String userId, + String elementGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the assigned actors linked by the "AssignmentScope" relationship between two referenceables. + * + * @param userId calling user + * @param scopeGUID unique identifier of the scope + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of related elements + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + List getAssignedActors(String userId, + String scopeGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Create a "ResourceList" relationship between a consuming element and an element that represents resources. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param properties properties of the relationship + * @param resourceGUID unique identifier of the resource + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void setupResource(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + ResourceListProperties properties, + String resourceGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove a "ResourceList" relationship between two referenceables. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param resourceGUID unique identifier of the resource + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void clearResource(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String resourceGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of resources assigned to an element via the "ResourceList" relationship between two referenceables. + * + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of related elements + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + List getResourceList(String userId, + String elementGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of elements assigned to a resource via the "ResourceList" relationship between two referenceables. + * + * @param userId calling user + * @param resourceGUID unique identifier of the resource + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of related elements + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + List getSupportedByResource(String userId, + String resourceGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ActorProfileElement.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ActorProfileElement.java new file mode 100644 index 00000000000..6dd6d054415 --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ActorProfileElement.java @@ -0,0 +1,409 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.metadataelements; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.ActorProfileProperties; + +import java.io.Serializable; +import java.util.List; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + + +/** + * The ActorProfileElement describes an individual, system, team or organization. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ActorProfileElement implements Serializable, MetadataElement +{ + private static final long serialVersionUID = 1L; + + private ElementHeader elementHeader = null; + private ActorProfileProperties profileProperties = null; + private List contactMethods = null; + private ContributionRecordElement contributionRecord = null; /* Person only */ + private List personRoles = null; /* Person only */ + private List locations = null; + private List userIdentities = null; + private ElementStub superTeam = null; /* Team only */ + private List subTeams = null; /* Team only */ + private List teamLeaderRoles = null; /* Team only */ + private List teamMemberRoles = null; /* Team only */ + private List linkedInfrastructure = null; /* ITProfile only */ + + + /** + * Default Constructor + */ + public ActorProfileElement() + { + } + + + /** + * Copy/clone Constructor - the resulting object. + * + * @param template object being copied + */ + public ActorProfileElement(ActorProfileElement template) + { + if (template != null) + { + elementHeader = template.getElementHeader(); + profileProperties = template.getProfileProperties(); + contactMethods = template.getContactMethods(); + contributionRecord = template.getContributionRecord(); + personRoles = template.getPersonRoles(); + locations = template.getLocations(); + userIdentities = template.getUserIdentities(); + superTeam = template.getSuperTeam(); + subTeams = template.getSubTeams(); + teamLeaderRoles = template.getTeamLeaderRoles(); + teamMemberRoles = template.getTeamMemberRoles(); + linkedInfrastructure = template.getLinkedInfrastructure(); + } + } + + + /** + * Return the element header associated with the properties. + * + * @return element header object + */ + public ElementHeader getElementHeader() + { + return elementHeader; + } + + + /** + * Set up the element header associated with the properties. + * + * @param elementHeader element header object + */ + public void setElementHeader(ElementHeader elementHeader) + { + this.elementHeader = elementHeader; + } + + + /** + * Return the properties of the profile. + * + * @return properties + */ + public ActorProfileProperties getProfileProperties() + { + return profileProperties; + } + + + /** + * Set up the profile properties. + * + * @param profileProperties properties + */ + public void setProfileProperties(ActorProfileProperties profileProperties) + { + this.profileProperties = profileProperties; + } + + + /** + * Return the contact methods for this profile. + * + * @return list of contact methods + */ + public List getContactMethods() + { + return contactMethods; + } + + + /** + * Set up the contact methods for this profile. + * + * @param contactMethods list of contact methods + */ + public void setContactMethods(List contactMethods) + { + this.contactMethods = contactMethods; + } + + + /** + * Return the contribution record (only if this profile is for a person). + * + * @return contribution record + */ + public ContributionRecordElement getContributionRecord() + { + return contributionRecord; + } + + + /** + * Set up the contribution record (only if this profile is for a person). + * + * @param contributionRecord contribution record + */ + public void setContributionRecord(ContributionRecordElement contributionRecord) + { + this.contributionRecord = contributionRecord; + } + + + /** + * Return the headers of the person roles that this actor is appointed to. + * + * @return role stubs + */ + public List getPersonRoles() + { + return personRoles; + } + + + /** + * Set up the headers of the person roles that this actor is appointed to. + * + * @param personRoles role stubs + */ + public void setPersonRoles(List personRoles) + { + this.personRoles = personRoles; + } + + + + /** + * Return the headers of the location that this actor is linked to. + * + * @return location stubs + */ + public List getLocations() + { + return locations; + } + + + /** + * Set up the headers of the person roles that this actor is linked to. + * + * @param locations location stubs + */ + public void setLocations(List locations) + { + this.locations = locations; + } + + + /** + * Return the list of user identities for this profile. + * + * @return list of userIds + */ + public List getUserIdentities() + { + return userIdentities; + } + + + /** + * Set up the list of user identities for this profile. + * + * @param userIdentities list of userIds + */ + public void setUserIdentities(List userIdentities) + { + this.userIdentities = userIdentities; + } + + + /** + * Return a summary of the team that is above this team in the organizational hierarchy. + * + * @return team stub + */ + public ElementStub getSuperTeam() + { + return superTeam; + } + + + /** + * Set up a summary of the team that is above this team in the organizational hierarchy. + * + * @param superTeam team stub + */ + public void setSuperTeam(ElementStub superTeam) + { + this.superTeam = superTeam; + } + + + /** + * Return the list of team that report to this team. + * + * @return list of team stubs + */ + public List getSubTeams() + { + return subTeams; + } + + + /** + * Set up the list of team that report to this team. + * + * @param subTeams list of team stubs + */ + public void setSubTeams(List subTeams) + { + this.subTeams = subTeams; + } + + + /** + * Return the list of leader roles assigned to this team. + * + * @return list of role stubs + */ + public List getTeamLeaderRoles() + { + return teamLeaderRoles; + } + + + /** + * Set up the list of leader roles assigned to this team. + * + * @param teamLeaderRoles list of role stubs + */ + public void setTeamLeaderRoles(List teamLeaderRoles) + { + this.teamLeaderRoles = teamLeaderRoles; + } + + + /** + * Return the list of member roles assigned to this team. + * + * @return list of role stubs + */ + public List getTeamMemberRoles() + { + return teamMemberRoles; + } + + + /** + * Set up the list of member roles assigned to this team. + * + * @param teamMemberRoles list of role stubs + */ + public void setTeamMemberRoles(List teamMemberRoles) + { + this.teamMemberRoles = teamMemberRoles; + } + + + /** + * Return the stubs of the pieces of IT infrastructure linked to the profile. + * + * @return list of element stubs + */ + public List getLinkedInfrastructure() + { + return linkedInfrastructure; + } + + + /** + * Set up the stubs of the pieces of IT infrastructure linked to the profile. + * + * @param linkedInfrastructure list of element stubs + */ + public void setLinkedInfrastructure(List linkedInfrastructure) + { + this.linkedInfrastructure = linkedInfrastructure; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ActorProfileElement{" + + "elementHeader=" + elementHeader + + ", profileProperties=" + profileProperties + + ", contactMethods=" + contactMethods + + ", contributionRecord=" + contributionRecord + + ", personRoles=" + personRoles + + ", locations=" + locations + + ", userIdentities=" + userIdentities + + ", superTeam=" + superTeam + + ", subTeams=" + subTeams + + ", teamLeaderRoles=" + teamLeaderRoles + + ", teamMemberRoles=" + teamMemberRoles + + ", linkedInfrastructure=" + linkedInfrastructure + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + ActorProfileElement that = (ActorProfileElement) objectToCompare; + return Objects.equals(elementHeader, that.elementHeader) && + Objects.equals(profileProperties, that.profileProperties) && + Objects.equals(contactMethods, that.contactMethods) && + Objects.equals(contributionRecord, that.contributionRecord) && + Objects.equals(personRoles, that.personRoles) && + Objects.equals(locations, that.locations) && + Objects.equals(userIdentities, that.userIdentities) && + Objects.equals(superTeam, that.superTeam) && + Objects.equals(subTeams, that.subTeams) && + Objects.equals(teamLeaderRoles, that.teamLeaderRoles) && + Objects.equals(teamMemberRoles, that.teamMemberRoles) && + Objects.equals(linkedInfrastructure, that.linkedInfrastructure); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(elementHeader, profileProperties, contactMethods, contributionRecord, userIdentities, superTeam, subTeams, + teamLeaderRoles, personRoles, locations, teamMemberRoles, linkedInfrastructure); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ContactMethodElement.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ContactMethodElement.java new file mode 100644 index 00000000000..204addd210a --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ContactMethodElement.java @@ -0,0 +1,149 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.projectmanagement.metadataelements; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.ContactMethodProperties; + +import java.io.Serializable; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ContactMethodElement contains the properties and header for a contract method retrieved from the metadata repository. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ContactMethodElement implements MetadataElement, Serializable +{ + private static final long serialVersionUID = 1L; + + private ElementHeader elementHeader = null; + private ContactMethodProperties properties = null; + + + /** + * Default constructor + */ + public ContactMethodElement() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ContactMethodElement(ContactMethodElement template) + { + if (template != null) + { + elementHeader = template.getElementHeader(); + properties = template.getProperties(); + } + } + + + /** + * Return the element header associated with the properties. + * + * @return element header object + */ + @Override + public ElementHeader getElementHeader() + { + return elementHeader; + } + + + /** + * Set up the element header associated with the properties. + * + * @param elementHeader element header object + */ + @Override + public void setElementHeader(ElementHeader elementHeader) + { + this.elementHeader = elementHeader; + } + + + /** + * Return the properties of the contact method. + * + * @return properties + */ + public ContactMethodProperties getProperties() + { + return properties; + } + + + /** + * Set up the contract method properties. + * + * @param properties properties + */ + public void setProperties(ContactMethodProperties properties) + { + this.properties = properties; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ContactMethodElement{" + + "elementHeader=" + elementHeader + + ", properties=" + properties + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + ContactMethodElement that = (ContactMethodElement) objectToCompare; + return Objects.equals(elementHeader, that.elementHeader) && + Objects.equals(properties, that.properties); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), elementHeader, properties); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ContributionRecordElement.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ContributionRecordElement.java new file mode 100644 index 00000000000..111e76b8bbd --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ContributionRecordElement.java @@ -0,0 +1,149 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.projectmanagement.metadataelements; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.ContributionRecord; + +import java.io.Serializable; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ContributionRecordElement contains the properties and header for a contribution record retrieved from the metadata repository. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ContributionRecordElement implements MetadataElement, Serializable +{ + private static final long serialVersionUID = 1L; + + private ElementHeader elementHeader = null; + private ContributionRecord properties = null; + + + /** + * Default constructor + */ + public ContributionRecordElement() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ContributionRecordElement(ContributionRecordElement template) + { + if (template != null) + { + elementHeader = template.getElementHeader(); + properties = template.getProperties(); + } + } + + + /** + * Return the element header associated with the properties. + * + * @return element header object + */ + @Override + public ElementHeader getElementHeader() + { + return elementHeader; + } + + + /** + * Set up the element header associated with the properties. + * + * @param elementHeader element header object + */ + @Override + public void setElementHeader(ElementHeader elementHeader) + { + this.elementHeader = elementHeader; + } + + + /** + * Return the properties of the contribution record. + * + * @return properties + */ + public ContributionRecord getProperties() + { + return properties; + } + + + /** + * Set up the contribution record properties. + * + * @param properties properties + */ + public void setProperties(ContributionRecord properties) + { + this.properties = properties; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ContributionRecordElement{" + + "elementHeader=" + elementHeader + + ", properties=" + properties + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + ContributionRecordElement that = (ContributionRecordElement) objectToCompare; + return Objects.equals(elementHeader, that.elementHeader) && + Objects.equals(properties, that.properties); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), elementHeader, properties); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ElementClassification.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ElementClassification.java new file mode 100644 index 00000000000..f3eea74f9dc --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ElementClassification.java @@ -0,0 +1,158 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.metadataelements; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.io.Serializable; +import java.util.Map; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * The ElementClassification bean defines a single classification for an asset. This can be used for REST calls and other + * JSON based functions. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ElementClassification implements Serializable +{ + private static final long serialVersionUID = 1L; + + private String classificationName = null; + private Map classificationProperties = null; + + /** + * Default constructor + */ + public ElementClassification() + { + } + + + /** + * Copy/clone constructor + * + * @param templateClassification template to copy + */ + public ElementClassification(ElementClassification templateClassification) + { + if (templateClassification != null) + { + classificationName = templateClassification.getClassificationName(); + classificationProperties = templateClassification.getClassificationProperties(); + } + } + + + /** + * Set up the name of the classification + * + * @param classificationName name of classification + */ + public void setClassificationName(String classificationName) + { + this.classificationName = classificationName; + } + + + /** + * Return the name of the classification + * + * @return String name + */ + public String getClassificationName() + { + return classificationName; + } + + + /** + * Set up a collection of the additional stored properties for the classification. + * If no stored properties are present then null is returned. + * + * @param classificationProperties properties for the classification + */ + public void setClassificationProperties(Map classificationProperties) + { + this.classificationProperties = classificationProperties; + } + + + /** + * Return a collection of the additional stored properties for the classification. + * If no stored properties are present then null is returned. + * + * @return properties map + */ + public Map getClassificationProperties() + { + if (classificationProperties == null) + { + return null; + } + else if (classificationProperties.isEmpty()) + { + return null; + } + else + { + return classificationProperties; + } + } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "ElementClassification{" + + "classificationName='" + classificationName + '\'' + + ", classificationProperties=" + classificationProperties + + '}'; + } + + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (!(objectToCompare instanceof ElementClassification)) + { + return false; + } + ElementClassification that = (ElementClassification) objectToCompare; + return Objects.equals(getClassificationName(), that.getClassificationName()) && + Objects.equals(getClassificationProperties(), that.getClassificationProperties()); + } + + + /** + * Create a hash code for this element type. + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(getClassificationName()); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ElementHeader.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ElementHeader.java new file mode 100644 index 00000000000..b1081cc48c9 --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ElementHeader.java @@ -0,0 +1,278 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.metadataelements; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ElementHeader provides the common identifier and type information for all properties objects + * that link off of the asset and have a guid associated with them. This typically means it is + * represented by an entity in the metadata repository. + * + * In addition are useful attachments that are found connected to the metadata element. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ElementHeader implements Serializable +{ + private static final long serialVersionUID = 1L; + + /* + * Common header for first class elements from a metadata repository + */ + private String guid = null; + private ElementStatus status = null; + private ElementType type = null; + private ElementOrigin origin = null; + private ElementVersions versions = null; + + private List classifications = null; + + + /** + * Default constructor used by subclasses + */ + public ElementHeader() + { + } + + + /** + * Copy/clone constructor. + * + * @param template element to copy + */ + public ElementHeader(ElementHeader template) + { + if (template != null) + { + guid = template.getGUID(); + status = template.getStatus(); + type = template.getType(); + origin = template.getOrigin(); + versions = template.getVersions(); + classifications = template.getClassifications(); + } + } + + + /** + * Return the unique id for the properties object. Null means no guid is assigned. + * + * @return String unique id + */ + public String getGUID() + { + return guid; + } + + + /** + * Set up the guid for the element. + * + * @param guid String unique identifier + */ + public void setGUID(String guid) + { + this.guid = guid; + } + + + /** + * Return the current status of the element - typically ACTIVE. + * + * @return status enum + */ + public ElementStatus getStatus() + { + return status; + } + + + /** + * Set up the current status of the element - typically ACTIVE. + * + * @param status status enum + */ + public void setStatus(ElementStatus status) + { + this.status = status; + } + + + /** + * Return the element type properties for this properties object. These values are set up by the metadata repository + * and define details to the metadata entity used to represent this element. + * + * @return ElementType type information. + */ + public ElementType getType() + { + if (type == null) + { + return null; + } + else + { + return type; + } + } + + + /** + * Set up the type of this element. + * + * @param type element type properties + */ + public void setType(ElementType type) + { + this.type = type; + } + + + /** + * Return information about the origin of the element. This includes the metadata collection and license. + * + * @return element origin object + */ + public ElementOrigin getOrigin() + { + return origin; + } + + + /** + * Set up information about the origin of the element. This includes the metadata collection and license. + * + * @param origin element origin object + */ + public void setOrigin(ElementOrigin origin) + { + this.origin = origin; + } + + + /** + * Return detail of the element's current version and the users responsible for maintaining it. + * + * @return ElementVersion object + */ + public ElementVersions getVersions() + { + return versions; + } + + + /** + * Set up detail of the element's current version and the users responsible for maintaining it. + * + * @param versions ElementVersion object + */ + public void setVersions(ElementVersions versions) + { + this.versions = versions; + } + + + /** + * Return the list of classifications associated with the metadata element. + * + * @return Classifications list of classifications + */ + public List getClassifications() + { + if (classifications == null) + { + return null; + } + else if (classifications.isEmpty()) + { + return null; + } + else + { + return new ArrayList<>(classifications); + } + } + + + /** + * Set up the classifications associated with this metadata element. + * + * @param classifications list of classifications + */ + public void setClassifications(List classifications) + { + this.classifications = classifications; + } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "ElementBase{" + + "guid='" + guid + '\'' + + ", status=" + status + + ", type=" + type + + ", origin=" + origin + + ", versions=" + versions + + ", classifications=" + classifications + + ", GUID='" + getGUID() + '\'' + + '}'; + } + + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + ElementHeader that = (ElementHeader) objectToCompare; + return Objects.equals(guid, that.guid) && + status == that.status && + Objects.equals(type, that.type) && + Objects.equals(origin, that.origin) && + Objects.equals(versions, that.versions) && + Objects.equals(classifications, that.classifications); + } + + + /** + * Create a hash code for this element type. + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(guid, status, type, origin, versions, classifications); + } +} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ElementOrigin.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ElementOrigin.java new file mode 100644 index 00000000000..13d0e9e1279 --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ElementOrigin.java @@ -0,0 +1,225 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.metadataelements; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.io.Serializable; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * The ElementType bean provides details of the type information associated with a metadata element. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ElementOrigin implements Serializable +{ + private static final long serialVersionUID = 1L; + + private String sourceServer = null; + private ElementOriginCategory originCategory = null; + private String homeMetadataCollectionId = null; + private String homeMetadataCollectionName = null; + private String license = null; + + + /** + * Default constructor + */ + public ElementOrigin() + { + } + + + /** + * Copy/clone constructor + * + * @param templateType type to clone + */ + public ElementOrigin(ElementOrigin templateType) + { + if (templateType != null) + { + sourceServer = templateType.getSourceServer(); + originCategory = templateType.getOriginCategory(); + homeMetadataCollectionId = templateType.getHomeMetadataCollectionId(); + homeMetadataCollectionName = templateType.getHomeMetadataCollectionName(); + license = templateType.getLicense(); + } + } + + + /** + * Set up the name of the server where the element was retrieved from. Typically this is + * a server where the OMAS interfaces are activated. If no name is known for the server then null is returned. + * + * @param sourceServer URL of the server + */ + public void setSourceServer(String sourceServer) + { + this.sourceServer = sourceServer; + } + + + /** + * Return the name of the server where the element was retrieved from. Typically this is + * a server where the OMAS interfaces are activated. If no name is known for the server then null is returned. + * + * @return elementSourceServerURL the url of the server where the element came from + */ + public String getSourceServer() + { + return sourceServer; + } + + + /** + * Set up the details of this element's origin. + * + * @param originCategory see ElementOriginCategory enum + */ + public void setOriginCategory(ElementOriginCategory originCategory) + { + this.originCategory = originCategory; + } + + + /** + * Return the origin of the metadata element. + * + * @return ElementOriginCategory enum + */ + public ElementOriginCategory getOriginCategory() { return originCategory; } + + + /** + * Returns the OMRS identifier for the metadata collection that is managed by the repository + * where the element originates (its home repository). + * + * @return String metadata collection id + */ + public String getHomeMetadataCollectionId() + { + return homeMetadataCollectionId; + } + + + /** + * Set up the unique identifier for the metadata collection that is managed by the repository + * where the element originates (its home repository). + * + * @param homeMetadataCollectionId String unique identifier for the home metadata repository + */ + public void setHomeMetadataCollectionId(String homeMetadataCollectionId) + { + this.homeMetadataCollectionId = homeMetadataCollectionId; + } + + + /** + * Return the name of the metadata collection that this asset belongs to. + * + * @return name string + */ + public String getHomeMetadataCollectionName() + { + return homeMetadataCollectionName; + } + + + /** + * Set up the name of the metadata collection that this asset belongs to. + * + * @param homeMetadataCollectionName name string + */ + public void setHomeMetadataCollectionName(String homeMetadataCollectionName) + { + this.homeMetadataCollectionName = homeMetadataCollectionName; + } + + + /** + * Return the license associated with this metadata element (null means none). + * + * @return string license name + */ + public String getLicense() + { + return license; + } + + + /** + * Set up the license associated with this metadata element (null means none) + * + * @param license string license name + */ + public void setLicense(String license) + { + this.license = license; + } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "ElementOrigin{" + + "sourceServer='" + sourceServer + '\'' + + ", originCategory=" + originCategory + + ", homeMetadataCollectionId='" + homeMetadataCollectionId + '\'' + + ", homeMetadataCollectionName='" + homeMetadataCollectionName + '\'' + + ", license='" + license + '\'' + + '}'; + } + + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (!(objectToCompare instanceof ElementOrigin)) + { + return false; + } + ElementOrigin that = (ElementOrigin) objectToCompare; + return Objects.equals(getSourceServer(), that.getSourceServer()) && + getOriginCategory() == that.getOriginCategory() && + Objects.equals(getHomeMetadataCollectionId(), that.getHomeMetadataCollectionId()) && + Objects.equals(getHomeMetadataCollectionName(), that.getHomeMetadataCollectionName()) && + Objects.equals(getLicense(), that.getLicense()); + } + + + /** + * Create a hash code for this element type. + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(getSourceServer(), getOriginCategory(), + getHomeMetadataCollectionId(), getHomeMetadataCollectionName(), + getLicense()); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ElementOriginCategory.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ElementOriginCategory.java new file mode 100644 index 00000000000..88b302fca22 --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ElementOriginCategory.java @@ -0,0 +1,108 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.metadataelements; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.io.Serializable; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ElementOriginCategory defines where the metadata comes from. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public enum ElementOriginCategory implements Serializable +{ + UNKNOWN (0, "", "Unknown provenance"), + LOCAL_COHORT (1, "Local to cohort", "The element is being maintained within one of the local cohort members. " + + "The metadata collection id is for one of the repositories in the cohort. " + + "This metadata collection id identifies the home repository for this element. "), + EXPORT_ARCHIVE (2, "Export Archive", "The element was created from an export archive. " + + "The metadata collection id for the element is the metadata collection id of the originating server. " + + "If the originating server later joins the cohort with the same metadata collection Id " + + "then these elements will be refreshed from the originating server's current repository."), + CONTENT_PACK (3, "Content Pack", "The element comes from an open metadata content pack. " + + "The metadata collection id of the elements is set to the GUID of the pack."), + DEREGISTERED_REPOSITORY (4, "Deregistered Repository", "The element comes from a metadata repository that " + + "used to be a member of the one of the local repository's cohorts but it has been deregistered. " + + "The metadata collection id remains the same. If the repository rejoins the cohort " + + "then these elements can be refreshed from the rejoining repository."), + CONFIGURATION (5, "Configuration", "The element is part of a service's configuration. The metadata collection id is null."), + EXTERNAL_SOURCE (6, "External Source", "The element is maintained by an external technology. The metadata collection id is the guid of the technology's descriptive entity."); + + private static final long serialVersionUID = 1L; + + private final int originCode; + private final String originName; + private final String originDescription; + + + /** + * Constructor for the enum. + * + * @param originCode code number for origin + * @param originName name for origin + * @param originDescription description for origin + */ + ElementOriginCategory(int originCode, String originName, String originDescription) + { + this.originCode = originCode; + this.originName = originName; + this.originDescription = originDescription; + } + + + /** + * Return the code for metadata element. + * + * @return int code for the origin + */ + public int getOrdinal() + { + return originCode; + } + + + /** + * Return the name of the metadata element origin. + * + * @return String name + */ + public String getName() + { + return originName; + } + + + /** + * Return the description of the metadata element origin. + * + * @return String description + */ + public String getDescription() + { + return originDescription; + } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "ElementOriginCategory{" + + "originCode=" + originCode + + ", originName='" + originName + '\'' + + ", originDescription='" + originDescription + '\'' + + '}'; + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ElementStatus.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ElementStatus.java new file mode 100644 index 00000000000..90c6e305730 --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ElementStatus.java @@ -0,0 +1,124 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.metadataelements; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.io.Serializable; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * The ElementStatus defines the status of an element in the metadata collection. It effectively + * defines its visibility to different types of queries. Most queries by default will only return instances not in the + * deleted status. + *
            + *
          • Unknown: Unknown instance status.
          • + *
          • Draft: The content is incomplete.
          • + *
          • Proposed: The content is in review.
          • + *
          • Approved: The content is approved.
          • + *
          • Rejected: The request or proposal is rejected.
          • + *
          • Approved concept: The request or proposal is approved for development.
          • + *
          • Under development: The instance is being developed.
          • + *
          • Development complete: The development of the instance is complete.
          • + *
          • Approved for deployment: The instance is approved for deployment.
          • + *
          • StandBy: The instance is deployed in standby mode.
          • + *
          • Active: The instance is approved and in use.
          • + *
          • Failed: The instance is not in use due to failure.
          • + *
          • Disabled: The instance is shutdown or disabled.
          • + *
          • Complete: The activity associated with the instance is complete.
          • + *
          • Deprecated: The instance is out of date and should not be used.
          • + *
          • Other: The instance is in a locally defined state.
          • + *
          • Deleted: The instance has been deleted and is waiting to be purged. It is kept in the metadata collection + * to support a restore request. It is not returned on normal queries.
          • + *
          + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public enum ElementStatus implements Serializable +{ + UNKNOWN (0, "", "Unknown instance status."), + DRAFT (1, "Draft", "The content is incomplete."), + PREPARED (2, "Prepared", "The content is ready for review."), + PROPOSED (3, "Proposed", "The content is in review."), + APPROVED (4, "Approved", "The content is approved."), + REJECTED (5, "Rejected", "The request or proposal is rejected."), + APPROVED_CONCEPT (6, "Approved concept", "The request or proposal is approved for development."), + UNDER_DEVELOPMENT (7, "Under development", "The instance is being developed."), + DEVELOPMENT_COMPLETE (8, "Development complete", "The development of the instance is complete."), + APPROVED_FOR_DEPLOYMENT (9, "Approved for deployment", "The instance is approved for deployment."), + STANDBY (10, "StandBy", "The instance is deployed in standby mode."), + ACTIVE (15, "Active", "The instance is approved and in use."), + FAILED (20, "Failed", "The instance is not in use due to failure."), + DISABLED (21, "Disabled", "The instance is shutdown or disabled."), + COMPLETE (22, "Complete", "The activity associated with the instance is complete."), + DEPRECATED (30, "Deprecated", "The instance is out of date and should not be used."), + OTHER (50, "Other", "The instance is in a locally defined state."); + + private static final long serialVersionUID = 1L; + + private int ordinal; + private String name; + private String description; + + + /** + * Default constructor sets up the specific values for an enum instance. + * + * @param ordinal int enum value ordinal + * @param name String name + * @param description String description + */ + ElementStatus(int ordinal, + String name, + String description) + { + this.ordinal = ordinal; + this.name = name; + this.description = description; + } + + + /** + * Return the numerical value for the enum. + * + * @return int enum value ordinal + */ + public int getOrdinal() { return ordinal; } + + + /** + * Return the descriptive name for the enum. + * + * @return String name + */ + public String getName() { return name; } + + + /** + * Return the description for the enum. + * + * @return String description + */ + public String getDescription() { return description; } + + + /** + * toString() JSON-style + * + * @return string description + */ + @Override + public String toString() + { + return "InstanceStatus{" + + "ordinal=" + ordinal + + ", name='" + name + '\'' + + ", description='" + description + '\'' + + '}'; + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ElementStub.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ElementStub.java new file mode 100644 index 00000000000..f465a45a92c --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ElementStub.java @@ -0,0 +1,138 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.metadataelements; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ElementStub is used to identify an element. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ElementStub extends ElementHeader +{ + private static final long serialVersionUID = 1L; + + private String uniqueName = null; + + /** + * Default constructor + */ + public ElementStub() + { + } + + + /** + * Copy/clone constructor. Note, this is a deep copy + * + * @param template object to copy + */ + public ElementStub(ElementStub template) + { + super(template); + + if (template != null) + { + this.uniqueName = template.getUniqueName(); + } + } + + + /** + * Copy/clone constructor. Note, this is a deep copy + * + * @param template object to copy + */ + public ElementStub(ElementHeader template) + { + super(template); + } + + + /** + * Return the unique name - if known + * + * @return string name + */ + public String getUniqueName() + { + return uniqueName; + } + + + /** + * Set up unique name - if known + * + * @param uniqueName string name + */ + public void setUniqueName(String uniqueName) + { + this.uniqueName = uniqueName; + } + + + /** + * JSON-style toString. + * + * @return list of properties and their values. + */ + @Override + public String toString() + { + return "ElementStub{" + + "uniqueName='" + uniqueName + '\'' + + ", type=" + getType() + + ", GUID='" + getGUID() + '\'' + + ", origin=" + getOrigin() + + ", versions=" + getVersions() + + ", classifications=" + getClassifications() + + '}'; + } + + + /** + * Equals method that returns true if containing properties are the same. + * + * @param objectToCompare object to compare + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + ElementStub that = (ElementStub) objectToCompare; + return Objects.equals(uniqueName, that.uniqueName); + } + + + /** + * Hash of properties + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), uniqueName); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ElementType.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ElementType.java new file mode 100644 index 00000000000..37c4d9cf712 --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ElementType.java @@ -0,0 +1,235 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.metadataelements; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * The ElementType bean provides details of the type information associated with a metadata element. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ElementType implements Serializable +{ + private static final long serialVersionUID = 1L; + + private String typeId = null; + private String typeName = null; + private List superTypeNames = null; + private long typeVersion = 0; + private String typeDescription = null; + + + /** + * Default constructor + */ + public ElementType() + { + } + + + /** + * Copy/clone constructor + * + * @param templateType type to clone + */ + public ElementType(ElementType templateType) + { + if (templateType != null) + { + typeId = templateType.getTypeId(); + typeName = templateType.getTypeName(); + superTypeNames = templateType.getSuperTypeNames(); + typeVersion = templateType.getTypeVersion(); + typeDescription = templateType.getTypeDescription(); + } + } + + + /** + * Set up the unique identifier for the element's type. + * + * @param typeId String identifier + */ + public void setTypeId(String typeId) + { + this.typeId = typeId; + } + + + /** + * Return unique identifier for the element's type. + * + * @return element type id + */ + public String getTypeId() + { + return typeId; + } + + + /** + * Set up the name of this element's type + * + * @param typeName String name + */ + public void setTypeName(String typeName) + { + this.typeName = typeName; + } + + + /** + * Return name of element's type. + * + * @return elementTypeName + */ + public String getTypeName() + { + return typeName; + } + + + /** + * Set up the list of type names for this type's supertypes. + * + * @param superTypeNames list of type names + */ + public void setSuperTypeNames(List superTypeNames) + { + this.superTypeNames = superTypeNames; + } + + + /** + * Return the list of type names for this type's supertypes. + * + * @return list of type names + */ + public List getSuperTypeNames() + { + if (superTypeNames == null) + { + return null; + } + else if (superTypeNames.isEmpty()) + { + return null; + } + else + { + return new ArrayList<>(superTypeNames); + } + } + + + /** + * Set up the version number for this element's type + * + * @param typeVersion version number for the element type. + */ + public void setTypeVersion(long typeVersion) + { + this.typeVersion = typeVersion; + } + + + /** + * Return the version number for this element's type. + * + * @return elementTypeVersion version number for the element type. + */ + public long getTypeVersion() + { + return typeVersion; + } + + + /** + * Set up a short description of this element's type. + * + * @param typeDescription set up the description for this element's type + */ + public void setTypeDescription(String typeDescription) + { + this.typeDescription = typeDescription; + } + + + /** + * Return the description for this element's type. + * + * @return elementTypeDescription String description for the element type + */ + public String getTypeDescription() + { + return typeDescription; + } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "ElementType{" + + "elementTypeId='" + typeId + '\'' + + ", elementTypeName='" + typeName + '\'' + + ", elementSuperTypeNames=" + superTypeNames + + ", elementTypeVersion=" + typeVersion + + ", elementTypeDescription='" + typeDescription + + '}'; + } + + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (!(objectToCompare instanceof ElementType)) + { + return false; + } + ElementType that = (ElementType) objectToCompare; + return getTypeVersion() == that.getTypeVersion() && + Objects.equals(getTypeId(), that.getTypeId()) && + Objects.equals(getTypeName(), that.getTypeName()) && + Objects.equals(getSuperTypeNames(), that.getSuperTypeNames()) && + Objects.equals(getTypeDescription(), that.getTypeDescription()); + } + + + /** + * Create a hash code for this element type. + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(getTypeId(), getTypeName(), getSuperTypeNames(), getTypeVersion(), getTypeDescription()); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ElementVersions.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ElementVersions.java new file mode 100644 index 00000000000..f832921331f --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ElementVersions.java @@ -0,0 +1,253 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.metadataelements; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ElementVersions provides the version information for the element plus details of the creation time and last + * update time. Finally it lists all the users that have made changes to this element. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ElementVersions implements Serializable +{ + private static final long serialVersionUID = 1L; + + private String createdBy = null; + private String updatedBy = null; + private List maintainedBy = null; + private Date createTime = null; + private Date updateTime = null; + private long version = 0L; + + + /** + * Default constructor used by subclasses + */ + public ElementVersions() + { + } + + + /** + * Copy/clone constructor. + * + * @param template element to copy + */ + public ElementVersions(ElementVersions template) + { + if (template != null) + { + this.createdBy = template.getCreatedBy(); + this.updatedBy = template.getUpdatedBy(); + this.maintainedBy = template.getMaintainedBy(); + this.createTime = template.getCreateTime(); + this.updateTime = template.getUpdateTime(); + this.version = template.getVersion(); + } + } + + + /** + * Return the name of the user that created this instance. + * + * @return String user name + */ + public String getCreatedBy() { return createdBy; } + + + /** + * Set up the name of the user that created this instance. + * + * @param createdBy String user name + */ + public void setCreatedBy(String createdBy) { this.createdBy = createdBy; } + + + /** + * Return the name of the user that last updated this instance. + * + * @return String user name + */ + public String getUpdatedBy() { return updatedBy; } + + + /** + * Set up the name of the user that last updated this instance. + * + * @param updatedBy String user name + */ + public void setUpdatedBy(String updatedBy) { this.updatedBy = updatedBy; } + + + /** + * Return the list of users responsible for maintaining this instance. + * + * @return list of user identifiers + */ + public List getMaintainedBy() + { + if (maintainedBy == null) + { + return null; + } + else if (maintainedBy.isEmpty()) + { + return null; + } + else + { + return new ArrayList<>(maintainedBy); + } + } + + + /** + * Set up the list of users responsible for maintaining this instance. + * + * @param maintainedBy list of user identifiers + */ + public void setMaintainedBy(List maintainedBy) + { + this.maintainedBy = maintainedBy; + } + + + /** + * Return the date/time that this instance was created. + * + * @return Date/Time of creation + */ + public Date getCreateTime() + { + if (createTime == null) + { + return null; + } + else + { + return new Date(createTime.getTime()); + } + } + + + /** + * Set up the time that this instance was created. + * + * @param createTime Date/Time of creation + */ + public void setCreateTime(Date createTime) { this.createTime = createTime; } + + + /** + * Return what was the late time this instance was updated. + * + * @return Date/Time last updated + */ + public Date getUpdateTime() + { + if (updateTime == null) + { + return null; + } + else + { + return new Date(updateTime.getTime()); + } + } + + + /** + * Set up the last update time for this instance. + * + * @param updateTime Date/Time last updated + */ + public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; } + + + /** + * Return the version number for this instance. + * + * @return Long version number + */ + public long getVersion() { return version; } + + + /** + * Set up the version number for this instance. + * + * @param version Long version number + */ + public void setVersion(long version) { this.version = version; } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "ElementVersions{" + + "createdBy='" + createdBy + '\'' + + ", updatedBy='" + updatedBy + '\'' + + ", maintainedBy=" + maintainedBy + + ", createTime=" + createTime + + ", updateTime=" + updateTime + + ", version=" + version + + '}'; + } + + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + ElementVersions that = (ElementVersions) objectToCompare; + return version == that.version && + Objects.equals(createdBy, that.createdBy) && + Objects.equals(updatedBy, that.updatedBy) && + Objects.equals(maintainedBy, that.maintainedBy) && + Objects.equals(createTime, that.createTime) && + Objects.equals(updateTime, that.updateTime); + } + + + /** + * Create a hash code for this element type. + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(createdBy, updatedBy, maintainedBy, createTime, updateTime, version); + } +} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/MetadataElement.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/MetadataElement.java new file mode 100644 index 00000000000..2ce50f52f9b --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/MetadataElement.java @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.projectmanagement.metadataelements; + +/** + * MetadataElement is the common interface for all metadata elements. It adds the header information that is stored with the properties. + * This includes detains of its unique identifier, type and origin. + */ +public interface MetadataElement +{ + /** + * Return the element header associated with the properties. + * + * @return element header object + */ + ElementHeader getElementHeader(); + + + /** + * Set up the element header associated with the properties. + * + * @param header element header object + */ + void setElementHeader(ElementHeader header); +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/PersonRoleElement.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/PersonRoleElement.java new file mode 100644 index 00000000000..e7f68f744f2 --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/PersonRoleElement.java @@ -0,0 +1,177 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.projectmanagement.metadataelements; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.PersonRoleProperties; + +import java.io.Serializable; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * PersonalRoleElement contains the properties and header for a person role assigned to a profile retrieved from the metadata repository. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class PersonRoleElement implements MetadataElement, Serializable +{ + private static final long serialVersionUID = 1L; + + private ElementHeader elementHeader = null; + private PersonRoleProperties properties = null; + private RelatedElement relatedElement = null; + + + /** + * Default constructor + */ + public PersonRoleElement() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public PersonRoleElement(PersonRoleElement template) + { + if (template != null) + { + elementHeader = template.getElementHeader(); + properties = template.getProperties(); + relatedElement = template.getRelatedElement(); + } + } + + + /** + * Return the element header associated with the properties. + * + * @return element header object + */ + @Override + public ElementHeader getElementHeader() + { + return elementHeader; + } + + + /** + * Set up the element header associated with the properties. + * + * @param header element header object + */ + @Override + public void setElementHeader(ElementHeader header) + { + this.elementHeader = header; + } + + + /** + * Return the properties of the role. + * + * @return properties + */ + public PersonRoleProperties getProperties() + { + return properties; + } + + + /** + * Set up the role properties. + * + * @param properties properties + */ + public void setProperties(PersonRoleProperties properties) + { + this.properties = properties; + } + + + /** + * Return details of the relationship used to retrieve this element. + * Will be null if the element was retrieved directly rather than via a relationship. + * + * @return list of element stubs + */ + public RelatedElement getRelatedElement() + { + return relatedElement; + } + + + /** + * Set up details of the relationship used to retrieve this element. + * Will be null if the element was retrieved directly rather than via a relationship. + * + * @param relatedElement relationship details + */ + public void setRelatedElement(RelatedElement relatedElement) + { + this.relatedElement = relatedElement; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "PersonRoleElement{" + + "elementHeader=" + elementHeader + + ", properties=" + properties + + ", relatedElement=" + relatedElement + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + PersonRoleElement that = (PersonRoleElement) objectToCompare; + return Objects.equals(elementHeader, that.elementHeader) && + Objects.equals(properties, that.properties) && + Objects.equals(relatedElement, that.relatedElement); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), elementHeader, properties, relatedElement); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ProfileIdentityElement.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ProfileIdentityElement.java new file mode 100644 index 00000000000..9d4fadf481f --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ProfileIdentityElement.java @@ -0,0 +1,148 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.projectmanagement.metadataelements; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.ProfileIdentityProperties; + +import java.io.Serializable; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ProfileIdentityElement contains the properties and header for a relationship between a profile and a user identity retrieved + * from the metadata repository. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ProfileIdentityElement implements Serializable +{ + private static final long serialVersionUID = 1L; + + private ProfileIdentityProperties profileIdentity = null; + private UserIdentityElement properties = null; + + + /** + * Default constructor + */ + public ProfileIdentityElement() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ProfileIdentityElement(ProfileIdentityElement template) + { + if (template != null) + { + profileIdentity = template.getProfileIdentity(); + properties = template.getProperties(); + } + } + + + /** + * Return the properties from the profile identity relationship. + * + * @return profile identity + */ + public ProfileIdentityProperties getProfileIdentity() + { + return profileIdentity; + } + + + /** + * Set up the properties from the profile identity relationship. + * + * @param profileIdentity profile identity + */ + public void setProfileIdentity(ProfileIdentityProperties profileIdentity) + { + this.profileIdentity = profileIdentity; + } + + + /** + * Return the properties of the userId. + * + * @return properties + */ + public UserIdentityElement getProperties() + { + return properties; + } + + + /** + * Set up the userId properties. + * + * @param properties properties + */ + public void setProperties(UserIdentityElement properties) + { + this.properties = properties; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ProfileIdentityElement{" + + "profileIdentity=" + profileIdentity + + ", properties=" + properties + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + ProfileIdentityElement that = (ProfileIdentityElement) objectToCompare; + return Objects.equals(profileIdentity, that.profileIdentity) && + Objects.equals(properties, that.properties); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), profileIdentity, properties); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ProfileLocationElement.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ProfileLocationElement.java new file mode 100644 index 00000000000..b2bbcc92eb2 --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ProfileLocationElement.java @@ -0,0 +1,148 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.projectmanagement.metadataelements; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.ProfileLocationProperties; + +import java.io.Serializable; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ProfileLocationElement contains the properties and header for a relationship between a profile and a user identity retrieved + * from the metadata repository. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ProfileLocationElement implements Serializable +{ + private static final long serialVersionUID = 1L; + + private ProfileLocationProperties properties = null; + private ElementStub location = null; + + + /** + * Default constructor + */ + public ProfileLocationElement() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ProfileLocationElement(ProfileLocationElement template) + { + if (template != null) + { + properties = template.getProperties(); + location = template.getLocation(); + } + } + + + /** + * Return the properties from the profile location relationship. + * + * @return profile identity + */ + public ProfileLocationProperties getProperties() + { + return properties; + } + + + /** + * Set up the properties from the profile location relationship. + * + * @param properties profile identity + */ + public void setProperties(ProfileLocationProperties properties) + { + this.properties = properties; + } + + + /** + * Return the properties of the location. + * + * @return properties + */ + public ElementStub getLocation() + { + return location; + } + + + /** + * Set up the userId properties. + * + * @param location properties + */ + public void setLocation(ElementStub location) + { + this.location = location; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ProfileLocationElement{" + + "properties=" + properties + + ", location=" + location + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + ProfileLocationElement that = (ProfileLocationElement) objectToCompare; + return Objects.equals(properties, that.properties) && + Objects.equals(location, that.location); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), properties, location); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ProjectElement.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ProjectElement.java new file mode 100644 index 00000000000..ed07301086e --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/ProjectElement.java @@ -0,0 +1,177 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.projectmanagement.metadataelements; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.ProjectProperties; + +import java.io.Serializable; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ProjectElement contains the properties and header for a community. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ProjectElement implements MetadataElement, Serializable +{ + private static final long serialVersionUID = 1L; + + private ElementHeader elementHeader = null; + private ProjectProperties properties = null; + private RelatedElement relatedElement = null; + + + /** + * Default constructor + */ + public ProjectElement() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ProjectElement(ProjectElement template) + { + if (template != null) + { + elementHeader = template.getElementHeader(); + properties = template.getProperties(); + relatedElement = template.getRelatedElement(); + } + } + + + /** + * Return the element header associated with the properties. + * + * @return element header object + */ + @Override + public ElementHeader getElementHeader() + { + return elementHeader; + } + + + /** + * Set up the element header associated with the properties. + * + * @param elementHeader element header object + */ + @Override + public void setElementHeader(ElementHeader elementHeader) + { + this.elementHeader = elementHeader; + } + + + /** + * Return the properties of the community. + * + * @return properties + */ + public ProjectProperties getProperties() + { + return properties; + } + + + /** + * Set up the community properties. + * + * @param properties properties + */ + public void setProperties(ProjectProperties properties) + { + this.properties = properties; + } + + + /** + * Return details of the relationship used to retrieve this element. + * Will be null if the element was retrieved directly rather than via a relationship. + * + * @return list of element stubs + */ + public RelatedElement getRelatedElement() + { + return relatedElement; + } + + + /** + * Set up details of the relationship used to retrieve this element. + * Will be null if the element was retrieved directly rather than via a relationship. + * + * @param relatedElement relationship details + */ + public void setRelatedElement(RelatedElement relatedElement) + { + this.relatedElement = relatedElement; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ProjectElement{" + + "elementHeader=" + elementHeader + + ", properties=" + properties + + ", relatedElement=" + relatedElement + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + ProjectElement that = (ProjectElement) objectToCompare; + return Objects.equals(elementHeader, that.elementHeader) && + Objects.equals(properties, that.properties) && + Objects.equals(relatedElement, that.relatedElement); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), elementHeader, properties, relatedElement); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/RelatedElement.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/RelatedElement.java new file mode 100644 index 00000000000..e4d0babe128 --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/RelatedElement.java @@ -0,0 +1,173 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.projectmanagement.metadataelements; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.RelationshipProperties; + +import java.io.Serializable; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * RelatedElement contains the properties and header for a relationship retrieved from the metadata repository along with the stub + * of the related element. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class RelatedElement implements Serializable +{ + private static final long serialVersionUID = 1L; + + private ElementHeader relationshipHeader = null; + private RelationshipProperties relationshipProperties = null; + private ElementStub relatedElement = null; + + /** + * Default constructor + */ + public RelatedElement() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public RelatedElement(RelatedElement template) + { + if (template != null) + { + relationshipHeader = template.getRelationshipHeader(); + relationshipProperties = template.getRelationshipProperties(); + relatedElement = template.getRelatedElement(); + } + } + + + /** + * Return the element header associated with the relationship. + * + * @return element header object + */ + public ElementHeader getRelationshipHeader() + { + return relationshipHeader; + } + + + /** + * Set up the element header associated with the relationship. + * + * @param relationshipHeader element header object + */ + public void setRelationshipHeader(ElementHeader relationshipHeader) + { + this.relationshipHeader = relationshipHeader; + } + + + /** + * Return details of the relationship + * + * @return relationship properties + */ + public RelationshipProperties getRelationshipProperties() + { + return relationshipProperties; + } + + + /** + * Set up relationship properties + * + * @param relationshipProperties relationship properties + */ + public void setRelationshipProperties(RelationshipProperties relationshipProperties) + { + this.relationshipProperties = relationshipProperties; + } + + + /** + * Return the element header associated with end 1 of the relationship. + * + * @return element stub object + */ + public ElementStub getRelatedElement() + { + return relatedElement; + } + + + /** + * Set up the element header associated with end 1 of the relationship. + * + * @param relatedElement element stub object + */ + public void setRelatedElement(ElementStub relatedElement) + { + this.relatedElement = relatedElement; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "RelatedElement{" + + "relationshipHeader=" + relationshipHeader + + ", relationshipProperties=" + relationshipProperties + + ", relatedElement=" + relatedElement + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + RelatedElement that = (RelatedElement) objectToCompare; + return Objects.equals(getRelationshipHeader(), that.getRelationshipHeader()) && + Objects.equals(getRelationshipProperties(), that.getRelationshipProperties()) && + Objects.equals(getRelatedElement(), that.getRelatedElement()); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), relationshipHeader, relationshipProperties, relatedElement); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/RelationshipElement.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/RelationshipElement.java new file mode 100644 index 00000000000..c9c1eb8b5d4 --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/RelationshipElement.java @@ -0,0 +1,199 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.projectmanagement.metadataelements; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.RelationshipProperties; + +import java.io.Serializable; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * RelationshipElement contains the properties and header for a relationship retrieved from the metadata repository. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class RelationshipElement implements Serializable +{ + private static final long serialVersionUID = 1L; + + private ElementHeader relationshipHeader = null; + private RelationshipProperties relationshipProperties = null; + private ElementHeader end1GUID = null; + private ElementHeader end2GUID = null; + + /** + * Default constructor + */ + public RelationshipElement() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public RelationshipElement(RelationshipElement template) + { + if (template != null) + { + relationshipHeader = template.getRelationshipHeader(); + relationshipProperties = template.getRelationshipProperties(); + end1GUID = template.getEnd1GUID(); + end2GUID = template.getEnd2GUID(); + } + } + + + /** + * Return the element header associated with the relationship. + * + * @return element header object + */ + public ElementHeader getRelationshipHeader() + { + return relationshipHeader; + } + + + /** + * Set up the element header associated with the relationship. + * + * @param relationshipHeader element header object + */ + public void setRelationshipHeader(ElementHeader relationshipHeader) + { + this.relationshipHeader = relationshipHeader; + } + + + /** + * Return details of the relationship + * + * @return relationship properties + */ + public RelationshipProperties getRelationshipProperties() + { + return relationshipProperties; + } + + + /** + * Set up relationship properties + * + * @param relationshipProperties relationship properties + */ + public void setRelationshipProperties(RelationshipProperties relationshipProperties) + { + this.relationshipProperties = relationshipProperties; + } + + + /** + * Return the element header associated with end 1 of the relationship. + * + * @return element header object + */ + public ElementHeader getEnd1GUID() + { + return end1GUID; + } + + + /** + * Set up the element header associated with end 1 of the relationship. + * + * @param end1GUID element header object + */ + public void setEnd1GUID(ElementHeader end1GUID) + { + this.end1GUID = end1GUID; + } + + + + /** + * Return the element header associated with end 2 of the relationship. + * + * @return element header object + */ + public ElementHeader getEnd2GUID() + { + return end2GUID; + } + + + /** + * Set up the element header associated with end 2 of the relationship. + * + * @param end2GUID element header object + */ + public void setEnd2GUID(ElementHeader end2GUID) + { + this.end2GUID = end2GUID; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "RelationshipElement{" + + "relationshipHeader=" + relationshipHeader + + ", relationshipProperties=" + relationshipProperties + + ", end1GUID=" + end1GUID + + ", end2GUID=" + end2GUID + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + RelationshipElement that = (RelationshipElement) objectToCompare; + return Objects.equals(getRelationshipHeader(), that.getRelationshipHeader()) && + Objects.equals(getRelationshipProperties(), that.getRelationshipProperties()) && + Objects.equals(getEnd1GUID(), that.getEnd1GUID()) && + Objects.equals(getEnd2GUID(), that.getEnd2GUID()); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), relationshipHeader, relationshipProperties, end1GUID, end2GUID); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/UserIdentityElement.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/UserIdentityElement.java new file mode 100644 index 00000000000..c632dc69ca7 --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/metadataelements/UserIdentityElement.java @@ -0,0 +1,177 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.projectmanagement.metadataelements; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.UserIdentityProperties; + +import java.io.Serializable; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * UserIdentityElement contains the properties and header for a user identity retrieved from the metadata repository. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class UserIdentityElement implements MetadataElement, Serializable +{ + private static final long serialVersionUID = 1L; + + private ElementHeader elementHeader = null; + private UserIdentityProperties properties = null; + private RelatedElement relatedElement = null; + + + /** + * Default constructor + */ + public UserIdentityElement() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public UserIdentityElement(UserIdentityElement template) + { + if (template != null) + { + elementHeader = template.getElementHeader(); + properties = template.getProperties(); + relatedElement = template.getRelatedElement(); + } + } + + + /** + * Return the element header associated with the properties. + * + * @return element header object + */ + @Override + public ElementHeader getElementHeader() + { + return elementHeader; + } + + + /** + * Set up the element header associated with the properties. + * + * @param elementHeader element header object + */ + @Override + public void setElementHeader(ElementHeader elementHeader) + { + this.elementHeader = elementHeader; + } + + + /** + * Return the properties of the userId. + * + * @return properties + */ + public UserIdentityProperties getProperties() + { + return properties; + } + + + /** + * Set up the userId properties. + * + * @param properties properties + */ + public void setProperties(UserIdentityProperties properties) + { + this.properties = properties; + } + + + /** + * Return details of the relationship used to retrieve this element. + * Will be null if the element was retrieved directly rather than via a relationship. + * + * @return list of element stubs + */ + public RelatedElement getRelatedElement() + { + return relatedElement; + } + + + /** + * Set up details of the relationship used to retrieve this element. + * Will be null if the element was retrieved directly rather than via a relationship. + * + * @param relatedElement relationship details + */ + public void setRelatedElement(RelatedElement relatedElement) + { + this.relatedElement = relatedElement; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "UserIdentityElement{" + + "elementHeader=" + elementHeader + + ", properties=" + properties + + ", relatedElement=" + relatedElement + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + UserIdentityElement that = (UserIdentityElement) objectToCompare; + return Objects.equals(elementHeader, that.elementHeader) && + Objects.equals(properties, that.properties) && + Objects.equals(relatedElement, that.relatedElement); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), elementHeader, properties, relatedElement); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ActorProfileProperties.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ActorProfileProperties.java new file mode 100644 index 00000000000..48f09e0907f --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ActorProfileProperties.java @@ -0,0 +1,158 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + + +/** + * The ActorProfileProperties describes the common properties of a Personal Profile, IT Profile and Team Profile. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ActorProfileProperties extends ReferenceableProperties +{ + private static final long serialVersionUID = 1L; + + private String knownName = null; + private String description = null; + + + /** + * Default Constructor + */ + public ActorProfileProperties() + { + super(); + } + + + /** + * Copy/clone Constructor - the resulting object. + * + * @param template object being copied + */ + public ActorProfileProperties(ActorProfileProperties template) + { + super (template); + + if (template != null) + { + this.knownName = template.getKnownName(); + this.description = template.getDescription(); + } + } + + + /** + * Return the name that the person/automated agent/team is known as. + * + * @return string name + */ + public String getKnownName() + { + return knownName; + } + + + /** + * Set up the name that the person/automated agent/team is known as. + * + * @param knownName string name + */ + public void setKnownName(String knownName) + { + this.knownName = knownName; + } + + + /** + * Return description of the person/automated agent/team. + * + * @return text + */ + public String getDescription() + { + return description; + } + + + /** + * Set up description of the person/automated agent/team. + * + * @param description text + */ + public void setDescription(String description) + { + this.description = description; + } + + + /** + * JSON-style toString. + * + * @return list of properties and their values. + */ + @Override + public String toString() + { + return "ActorProfileProperties{" + + "knownName='" + knownName + '\'' + + ", description='" + description + '\'' + + ", qualifiedName='" + getQualifiedName() + '\'' + + ", additionalProperties=" + getAdditionalProperties() + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", vendorProperties=" + getVendorProperties() + + ", typeName='" + getTypeName() + '\'' + + ", extendedProperties=" + getExtendedProperties() + + '}'; + } + + + /** + * Equals method that returns true if containing properties are the same. + * + * @param objectToCompare object to compare + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + ActorProfileProperties that = (ActorProfileProperties) objectToCompare; + return Objects.equals(knownName, that.knownName) && + Objects.equals(description, that.description); + } + + + /** + * Just use the GUID for the hash code as it should be unique. + * + * @return int code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), knownName, description); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/AssignmentScopeProperties.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/AssignmentScopeProperties.java new file mode 100644 index 00000000000..178054a5dc1 --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/AssignmentScopeProperties.java @@ -0,0 +1,152 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.properties; + + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * AssignmentScopeProperties provides a details of the scope of work/influence expected by the assigned actor(s). + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class AssignmentScopeProperties extends RelationshipProperties +{ + private static final long serialVersionUID = 1L; + + String assignmentType = null; + String description = null; + + /** + * Default constructor + */ + public AssignmentScopeProperties() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public AssignmentScopeProperties(AssignmentScopeProperties template) + { + super(template); + + if (template != null) + { + this.assignmentType = template.getAssignmentType(); + this.description = template.getDescription(); + } + } + + + /** + * Return the expectations with respect to the scope. + * + * @return type of assignment + */ + public String getAssignmentType() + { + return assignmentType; + } + + + /** + * Set up the expectations with respect to the scope. + * + * @param assignmentType type of assignment + */ + public void setAssignmentType(String assignmentType) + { + this.assignmentType = assignmentType; + } + + + /** + * Return additional descriptive text. + * + * @return text + */ + public String getDescription() + { + return description; + } + + + /** + * Set up additional descriptive text. + * + * @param description text + */ + public void setDescription(String description) + { + this.description = description; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "AssignmentScopeProperties{" + + "assignmentType='" + assignmentType + '\'' + + ", description='" + description + '\'' + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", extendedProperties=" + getExtendedProperties() + + '}'; + } + + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (! super.equals(objectToCompare)) + { + return false; + } + AssignmentScopeProperties that = (AssignmentScopeProperties) objectToCompare; + return Objects.equals(assignmentType, that.assignmentType) && Objects.equals(description, that.description); + } + + + /** + * Return has code based on properties. + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), assignmentType, description); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ClassificationProperties.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ClassificationProperties.java new file mode 100644 index 00000000000..0510785633b --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ClassificationProperties.java @@ -0,0 +1,188 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.io.Serializable; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * RelationshipProperties provides the base class for relationships items. This provides extended properties with the ability to + * set effectivity dates. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ClassificationProperties implements Serializable +{ + private static final long serialVersionUID = 1L; + + private Date effectiveFrom = null; + private Date effectiveTo = null; + + private Map extendedProperties = null; + + + /** + * Default constructor + */ + public ClassificationProperties() + { + super(); + } + + + /** + * Copy/clone constructor. Retrieve values from the supplied template + * + * @param template element to copy + */ + public ClassificationProperties(ClassificationProperties template) + { + if (template != null) + { + effectiveFrom = template.getEffectiveFrom(); + effectiveTo = template.getEffectiveTo(); + extendedProperties = template.getExtendedProperties(); + } + } + + + /** + * Return the date/time that this element is effective from (null means effective from the epoch). + * + * @return date object + */ + public Date getEffectiveFrom() + { + return effectiveFrom; + } + + + /** + * Set up the date/time that this element is effective from (null means effective from the epoch). + * + * @param effectiveFrom date object + */ + public void setEffectiveFrom(Date effectiveFrom) + { + this.effectiveFrom = effectiveFrom; + } + + + /** + * Return the date/time that element is effective to (null means that it is effective indefinitely into the future). + * + * @return date object + */ + public Date getEffectiveTo() + { + return effectiveTo; + } + + + /** + * Set the date/time that element is effective to (null means that it is effective indefinitely into the future). + * + * @param effectiveTo date object + */ + public void setEffectiveTo(Date effectiveTo) + { + this.effectiveTo = effectiveTo; + } + + + /** + * Return the properties that have been defined for a subtype of this object that are not supported explicitly + * by this bean. + * + * @return property map + */ + public Map getExtendedProperties() + { + if (extendedProperties == null) + { + return null; + } + else if (extendedProperties.isEmpty()) + { + return null; + } + else + { + return new HashMap<>(extendedProperties); + } + } + + + /** + * Set up the properties that have been defined for a subtype of this object that are not supported explicitly + * by this bean. + * + * @param extendedProperties property map + */ + public void setExtendedProperties(Map extendedProperties) + { + this.extendedProperties = extendedProperties; + } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "RelationshipProperties{" + + "effectiveFrom=" + effectiveFrom + + ", effectiveTo=" + effectiveTo + + ", extendedProperties=" + extendedProperties + + '}'; + } + + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + ClassificationProperties that = (ClassificationProperties) objectToCompare; + return Objects.equals(effectiveFrom, that.effectiveFrom) && + Objects.equals(effectiveTo, that.effectiveTo); + } + + + /** + * Return has code based on properties. + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(effectiveFrom, effectiveTo); + } +} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ContactMethodProperties.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ContactMethodProperties.java new file mode 100644 index 00000000000..c23f63eb0ae --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ContactMethodProperties.java @@ -0,0 +1,341 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.io.Serializable; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ContactMethodProperties describes a single mechanism that can be used to contact an individual. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ContactMethodProperties implements Serializable +{ + private static final long serialVersionUID = 1L; + + private String name = null; + private String contactType = null; + + private ContactMethodType contactMethodType = null; + private String contactMethodService = null; + private String contactMethodValue = null; + + private Date effectiveFrom = null; + private Date effectiveTo = null; + + private String typeName = null; + private Map extendedProperties = null; + + + /** + * Default constructor + */ + public ContactMethodProperties() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ContactMethodProperties(ContactMethodProperties template) + { + if (template != null) + { + contactMethodType = template.getContactMethodType(); + contactMethodService = template.getContactMethodService(); + contactMethodValue = template.getContactMethodValue(); + effectiveFrom = template.getEffectiveFrom(); + effectiveTo = template.getEffectiveTo(); + typeName = template.getTypeName(); + extendedProperties = template.getExtendedProperties(); + } + } + + + /** + * Return the name to give this contact method (imagine a list of contact methods). + * + * @return string + */ + public String getName() + { + return name; + } + + + /** + * Set up the name to give this contact method (imagine a list of contact methods). + * + * @param name string + */ + public void setName(String name) + { + this.name = name; + } + + + /** + * Return the type of contact - is it related to work or personal etc. + * + * @return string type name - often controlled by a valid value set + */ + public String getContactType() + { + return contactType; + } + + + /** + * Set up the type of contact - is it related to work or personal etc. + * + * @param contactType string type name - often controlled by a valid value set + */ + public void setContactType(String contactType) + { + this.contactType = contactType; + } + + + /** + * Return the type of the contact method. + * + * @return contact method type enum + */ + public ContactMethodType getContactMethodType() + { + return contactMethodType; + } + + + /** + * Set up the type of the contact method. + * + * @param contactMethodType contact method type enum + */ + public void setContactMethodType(ContactMethodType contactMethodType) + { + this.contactMethodType = contactMethodType; + } + + + /** + * Return the URL of the service used to contact the individual. + * + * @return service URL + */ + public String getContactMethodService() + { + return contactMethodService; + } + + + /** + * Set up theURL of the service used to contact the individual. + * + * @param contactMethodService service URL + */ + public void setContactMethodService(String contactMethodService) + { + this.contactMethodService = contactMethodService; + } + + + /** + * Return the account name or similar value used to direct the message to the individual. + * + * @return value string + */ + public String getContactMethodValue() + { + return contactMethodValue; + } + + + /** + * Set up the account name or similar value used to direct the message to the individual. + * + * @param contactMethodValue value string + */ + public void setContactMethodValue(String contactMethodValue) + { + this.contactMethodValue = contactMethodValue; + } + + + + /** + * Return the date/time that this element is effective from (null means effective from the epoch). + * + * @return date object + */ + public Date getEffectiveFrom() + { + return effectiveFrom; + } + + + /** + * Set up the date/time that this element is effective from (null means effective from the epoch). + * + * @param effectiveFrom date object + */ + public void setEffectiveFrom(Date effectiveFrom) + { + this.effectiveFrom = effectiveFrom; + } + + + /** + * Return the date/time that element is effective to (null means that it is effective indefinitely into the future). + * + * @return date object + */ + public Date getEffectiveTo() + { + return effectiveTo; + } + + + /** + * Set the date/time that element is effective to (null means that it is effective indefinitely into the future). + * + * @param effectiveTo date object + */ + public void setEffectiveTo(Date effectiveTo) + { + this.effectiveTo = effectiveTo; + } + + + /** + * Return the name of the open metadata type for this metadata element. + * + * @return string name + */ + public String getTypeName() + { + return typeName; + } + + + /** + * Set up the name of the open metadata type for this element. + * + * @param typeName string name + */ + public void setTypeName(String typeName) + { + this.typeName = typeName; + } + + + /** + * Return the properties that have been defined for a subtype of this object that are not supported explicitly + * by this bean. + * + * @return property map + */ + public Map getExtendedProperties() + { + if (extendedProperties == null) + { + return null; + } + else if (extendedProperties.isEmpty()) + { + return null; + } + else + { + return new HashMap<>(extendedProperties); + } + } + + + /** + * Set up the properties that have been defined for a subtype of this object that are not supported explicitly + * by this bean. + * + * @param extendedProperties property map + */ + public void setExtendedProperties(Map extendedProperties) + { + this.extendedProperties = extendedProperties; + } + + + /** + * JSON-style toString. + * + * @return list of properties and their values. + */ + @Override + public String toString() + { + return "ContactMethodProperties{" + + "type=" + contactMethodType + + ", service='" + contactMethodService + '\'' + + ", value='" + contactMethodValue + '\'' + + ", effectiveFrom=" + effectiveFrom + + ", effectiveTo=" + effectiveTo + + ", typeName='" + typeName + '\'' + + ", extendedProperties=" + extendedProperties + + '}'; + } + + + /** + * Equals method that returns true if containing properties are the same. + * + * @param objectToCompare object to compare + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + ContactMethodProperties that = (ContactMethodProperties) objectToCompare; + return contactMethodType == that.contactMethodType && + Objects.equals(contactMethodService, that.contactMethodService) && + Objects.equals(contactMethodValue, that.contactMethodValue) && + Objects.equals(effectiveFrom, that.effectiveFrom) && + Objects.equals(effectiveTo, that.effectiveTo) && + Objects.equals(typeName, that.typeName) && + Objects.equals(extendedProperties, that.extendedProperties); + } + + + /** + * Hash code for this object + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(contactMethodType, contactMethodService, contactMethodValue, effectiveFrom, effectiveTo, typeName, extendedProperties); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ContactMethodType.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ContactMethodType.java new file mode 100644 index 00000000000..b55b754131a --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ContactMethodType.java @@ -0,0 +1,130 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.io.Serializable; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ContactMethodType specifies the contact mechanism to use to contact an individual. + *
            + *
          • EMAIL
          • + *
          • PHONE
          • + *
          • CHAT
          • + *
          • PROFILE
          • + *
          • ACCOUNT
          • + *
          • OTHER
          • + *
          + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public enum ContactMethodType implements Serializable +{ + EMAIL (0, 0, "Email", "Send email"), + PHONE (1, 1, "Phone", "Call by phone."), + CHAT (2, 2, "Chat", "Send chat message."), + PROFILE (3, 3, "Profile", "Send comment to personal profile."), + ACCOUNT (4, 4, "Account", "Send comment to a social media account."), + OTHER (99,99, "Other", "Another mechanism."); + + private static final long serialVersionUID = 1L; + + public static final String ENUM_TYPE_GUID = "30e7d8cd-df01-46e8-9247-a24c5650910d"; + public static final String ENUM_TYPE_NAME = "ContactMethodType"; + + private final int openTypeOrdinal; + + private final int ordinal; + private final String name; + private final String description; + + + /** + * Constructor to set up the instance of this enum. + * + * @param ordinal code number + * @param openTypeOrdinal code number from the equivalent Enum Type + * @param name default name + * @param description default description + */ + ContactMethodType(int ordinal, + int openTypeOrdinal, + String name, + String description) + { + this.ordinal = ordinal; + this.openTypeOrdinal = openTypeOrdinal; + this.name = name; + this.description = description; + } + + + /** + * Return the code for this enum that comes from the Open Metadata Type that this enum represents. + * + * @return int code number + */ + public int getOpenTypeOrdinal() + { + return openTypeOrdinal; + } + + + /** + * Return the unique identifier for the open metadata enum type that this enum class represents. + * + * @return string guid + */ + public String getOpenTypeGUID() { return ENUM_TYPE_GUID; } + + + /** + * Return the unique name for the open metadata enum type that this enum class represents. + * + * @return string name + */ + public String getOpenTypeName() { return ENUM_TYPE_NAME; } + + + /** + * Return the numeric representation of the enumeration. + * + * @return int ordinal + */ + public int getOrdinal() { return ordinal; } + + + /** + * Return the default name of the enumeration. + * + * @return String name + */ + public String getName() { return name; } + + + /** + * Return the default description of the enumeration. + * + * @return String description + */ + public String getDescription() { return description; } + + + /** + * toString() JSON-style + * + * @return string description + */ + @Override + public String toString() + { + return "ContactMethodType : " + name; + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ContributionRecord.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ContributionRecord.java new file mode 100644 index 00000000000..f374d10854f --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ContributionRecord.java @@ -0,0 +1,187 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + + +/** + * The ContributionRecord holds the information about an individual's contribution to the open metadata + * ecosystem. The base types provide support for karma points. This can be extended using the + * open metadata type system and these new properties can be maintained using the extended properties. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ContributionRecord extends ReferenceableProperties +{ + private static final long serialVersionUID = 1L; + + private long karmaPoints = 0; + private long karmaPointPlateau = 0; + private boolean isPublic = false; + + + + /** + * Default Constructor + */ + public ContributionRecord() + { + super(); + } + + + /** + * Copy/clone Constructor - the resulting object. + * + * @param template object being copied + */ + public ContributionRecord(ContributionRecord template) + { + super (template); + + if (template != null) + { + this.karmaPoints = template.getKarmaPoints(); + this.karmaPointPlateau = template.getKarmaPointPlateau(); + this.isPublic = template.getIsPublic(); + } + } + + + /** + * Return the karma points awarded to this person. + * + * @return count + */ + public long getKarmaPoints() + { + return karmaPoints; + } + + + /** + * Set up the karma points for this person. + * + * @param karmaPoints count + */ + public void setKarmaPoints(long karmaPoints) + { + this.karmaPoints = karmaPoints; + } + + + /** + * Return the current karma point plateau level for this person. + * + * @return count + */ + public long getKarmaPointPlateau() + { + return karmaPointPlateau; + } + + + /** + * Set up the karma point plateau level for this person. + * + * @param karmaPointPlateau count + */ + public void setKarmaPointPlateau(long karmaPointPlateau) + { + this.karmaPointPlateau = karmaPointPlateau; + } + + + /** + * Return whether this record can be shared with colleagues. + * + * @return flag + */ + public boolean getIsPublic() + { + return isPublic; + } + + + /** + * Set up whether this record can be shared with colleagues. + * + * @param isPublic flag + */ + public void setIsPublic(boolean isPublic) + { + this.isPublic = isPublic; + } + + + /** + * JSON-style toString. + * + * @return list of properties and their values. + */ + @Override + public String toString() + { + return "ContributionRecord{" + + "karmaPoints=" + karmaPoints + + ", karmaPointPlateau=" + karmaPointPlateau + + ", isPublic=" + isPublic + + ", qualifiedName='" + getQualifiedName() + '\'' + + ", additionalProperties=" + getAdditionalProperties() + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", vendorProperties=" + getVendorProperties() + + ", typeName='" + getTypeName() + '\'' + + ", extendedProperties=" + getExtendedProperties() + + '}'; + } + + + /** + * Equals method that returns true if containing properties are the same. + * + * @param objectToCompare object to compare + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (! super.equals(objectToCompare)) + { + return false; + } + ContributionRecord that = (ContributionRecord) objectToCompare; + return karmaPoints == that.karmaPoints && + karmaPointPlateau == that.karmaPointPlateau && + isPublic == that.isPublic; + } + + + /** + * Just use the GUID for the hash code as it should be unique. + * + * @return int code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), karmaPoints, karmaPointPlateau, isPublic); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/MetadataSourceProperties.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/MetadataSourceProperties.java new file mode 100644 index 00000000000..7432bb625d8 --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/MetadataSourceProperties.java @@ -0,0 +1,265 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * MetadataSourceProperties describe the properties for a capability that is supplying profile + * information to the Community Profile OMAS. This entity is stored as a SoftwareServerCapability and + * its GUID and qualifiedName is passed as the externalSourceGUID and externalSourceName on the profile + * management requests. + */ +@JsonAutoDetect(getterVisibility = PUBLIC_ONLY, setterVisibility = PUBLIC_ONLY, fieldVisibility = NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public class MetadataSourceProperties extends ReferenceableProperties +{ + private static final long serialVersionUID = 1L; + + private String displayName = null; + private String description = null; + private String typeDescription = null; + private String version = null; + private String patchLevel = null; + private String source = null; + + + /** + * Default constructor. + */ + public MetadataSourceProperties() + { + super(); + } + + + /** + * Copy/clone constructor. + * + * @param template object to copy + */ + public MetadataSourceProperties(MetadataSourceProperties template) + { + super(template); + + if (template != null) + { + displayName = template.getDisplayName(); + description = template.getDescription(); + typeDescription = template.getTypeDescription(); + version = template.getVersion(); + patchLevel = template.getPatchLevel(); + source = template.getSource(); + } + } + + + /** + * Return the display name for messages and UI. + * + * @return string name + */ + public String getDisplayName() + { + return displayName; + } + + + /** + * Set up the display name for messages and UI. + * + * @param displayName string name + */ + public void setDisplayName(String displayName) + { + this.displayName = displayName; + } + + + /** + * Return the description of the capability. + * + * @return string description + */ + public String getDescription() + { + return description; + } + + + /** + * Set up the description of the capability. + * + * @param description string + */ + public void setDescription(String description) + { + this.description = description; + } + + + /** + * Return the description of the type of capability this is. + * + * @return string description + */ + public String getTypeDescription() + { + return typeDescription; + } + + + /** + * Set up the description of the type of capability this is. + * + * @param typeDescription string + */ + public void setTypeDescription(String typeDescription) + { + this.typeDescription = typeDescription; + } + + + /** + * Return the version of the capability. + * + * @return version string + */ + public String getVersion() + { + return version; + } + + + /** + * Set up the version string of the capability. + * + * @param version string + */ + public void setVersion(String version) + { + this.version = version; + } + + + /** + * Return the patch level of the capability. + * + * @return patch level string + */ + public String getPatchLevel() + { + return patchLevel; + } + + + /** + * Set up the patch level of the capability. + * + * @param patchLevel string + */ + public void setPatchLevel(String patchLevel) + { + this.patchLevel = patchLevel; + } + + + /** + * Return the source of the capability implementation. + * + * @return string url + */ + public String getSource() + { + return source; + } + + + /** + * Set up the source of the capability implementation. + * + * @param source string url + */ + public void setSource(String source) + { + this.source = source; + } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "MetadataSourceProperties{" + + "displayName='" + displayName + '\'' + + ", description='" + description + '\'' + + ", typeDescription='" + typeDescription + '\'' + + ", version='" + version + '\'' + + ", patchLevel='" + patchLevel + '\'' + + ", source='" + source + '\'' + + ", qualifiedName='" + getQualifiedName() + '\'' + + ", additionalProperties=" + getAdditionalProperties() + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", vendorProperties=" + getVendorProperties() + + ", typeName='" + getTypeName() + '\'' + + ", extendedProperties=" + getExtendedProperties() + + '}'; + } + + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + MetadataSourceProperties that = (MetadataSourceProperties) objectToCompare; + return Objects.equals(getDisplayName(), that.getDisplayName()) && + Objects.equals(getDescription(), that.getDescription()) && + Objects.equals(getTypeDescription(), that.getTypeDescription()) && + Objects.equals(getVersion(), that.getVersion()) && + Objects.equals(getPatchLevel(), that.getPatchLevel()) && + Objects.equals(getSource(), that.getSource()); + } + + + /** + * Create a hash code for this element type. + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), getDisplayName(), getDescription(), getTypeDescription(), getVersion(), + getPatchLevel(), getSource()); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/PersonRoleProperties.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/PersonRoleProperties.java new file mode 100644 index 00000000000..4c9511e1c76 --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/PersonRoleProperties.java @@ -0,0 +1,166 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.properties; + + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * PersonRoleProperties covers a role that has been defined in an organization. One of more people + * can be assigned to a role. The optional headCount determines the maximum number of people that should be + * appointed (open metadata does not enforce this level but sends a notification if the headCount + * level is breached.) It also returns how many people are currently appointed to the role. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class PersonRoleProperties extends PersonalRoleProperties +{ + private static final long serialVersionUID = 1L; + + private boolean headCountLimitSet = false; + private int headCount = 0; + + + /** + * Default constructor + */ + public PersonRoleProperties() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public PersonRoleProperties(PersonRoleProperties template) + { + super(template); + + if (template != null) + { + this.headCountLimitSet = template.getHeadCountLimitSet(); + this.headCount = template.getHeadCount(); + } + } + + + /** + * Return the indicator whether the head count limit is set for a person role. + * + * @return boolean flag + */ + public boolean getHeadCountLimitSet() + { + return headCountLimitSet; + } + + + /** + * Set up the indicator whether the head count limit is set for a person role. + * + * @param headCountLimitSet boolean flag + */ + public void setHeadCountLimitSet(boolean headCountLimitSet) + { + this.headCountLimitSet = headCountLimitSet; + } + + + /** + * Return the head count limit (or zero if not set). + * + * @return int + */ + public int getHeadCount() + { + return headCount; + } + + + /** + * Set up the head count limit (or zero if not set). + * + * @param headCount int + */ + public void setHeadCount(int headCount) + { + this.headCount = headCount; + } + + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "PersonRoleProperties{" + + "headCountLimitSet=" + headCountLimitSet + + ", headCount=" + headCount + + ", qualifiedName='" + getQualifiedName() + '\'' + + ", roleId='" + getRoleId() + '\'' + + ", scope='" + getScope() + '\'' + + ", title='" + getTitle() + '\'' + + ", description='" + getDescription() + '\'' + + ", domainIdentifier=" + getDomainIdentifier() + + ", additionalProperties=" + getAdditionalProperties() + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", typeName='" + getTypeName() + '\'' + + ", extendedProperties=" + getExtendedProperties() + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + PersonRoleProperties that = (PersonRoleProperties) objectToCompare; + return getHeadCountLimitSet() == that.getHeadCountLimitSet() && + getHeadCount() == that.getHeadCount(); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), getHeadCountLimitSet(), getHeadCount()); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/PersonalRoleProperties.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/PersonalRoleProperties.java new file mode 100644 index 00000000000..fa9ec0f2ee6 --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/PersonalRoleProperties.java @@ -0,0 +1,418 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.projectmanagement.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.io.Serializable; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * PersonalRoleProperties provides a structure for describe a role assigned to a person. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class PersonalRoleProperties implements Serializable +{ + private static final long serialVersionUID = 1L; + + private String qualifiedName = null; /* qualifiedName */ + private String roleId = null; /* identifier */ + private String scope = null; /* scope */ + private String title = null; /* name */ + private String description = null; /* description */ + + private int domainIdentifier = 0; /* Zero means not specific to a governance domain */ + + private Map additionalProperties = null; + + private Date effectiveFrom = null; + private Date effectiveTo = null; + + private String typeName = null; + private Map extendedProperties = null; + + + /** + * Default constructor + */ + public PersonalRoleProperties() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public PersonalRoleProperties(PersonalRoleProperties template) + { + if (template != null) + { + this.qualifiedName = template.getQualifiedName(); + this.roleId = template.getRoleId(); + this.scope = template.getScope(); + this.title = template.getTitle(); + this.description = template.getDescription(); + this.domainIdentifier = template.getDomainIdentifier(); + this.additionalProperties = template.getAdditionalProperties(); + this.effectiveFrom = template.getEffectiveFrom(); + this.effectiveTo = template.getEffectiveTo(); + this.typeName = template.getTypeName(); + this.extendedProperties = template.getExtendedProperties(); + } + } + + + + /** + * Return the unique name for element in open metadata ecosystem. + * + * @return unique name + */ + public String getQualifiedName() + { + return qualifiedName; + } + + + /** + * Set up the unique name for element in open metadata ecosystem. + * + * @param qualifiedName unique name + */ + public void setQualifiedName(String qualifiedName) + { + this.qualifiedName = qualifiedName; + } + + + /** + * Return the unique identifier for this job role/appointment typically from an HR system. + * + * @return unique identifier + */ + public String getRoleId() + { + return roleId; + } + + + /** + * Set up the unique identifier for this job role/appointment. + * + * @param roleId unique identifier + */ + public void setRoleId(String roleId) + { + this.roleId = roleId; + } + + + + /** + * Return the context in which the person is appointed. This may be an organizational scope, + * location, or scope of assets. + * + * @return string description + */ + public String getScope() + { + return scope; + } + + + /** + * Set up the context in which the person is appointed. This may be an organizational scope, + * location, or scope of assets. + * + * @param scope string description + */ + public void setScope(String scope) + { + this.scope = scope; + } + + + /** + * Return the job role title. + * + * @return string name + */ + public String getTitle() + { + return title; + } + + + /** + * Set up the job role title. + * + * @param title string name + */ + public void setTitle(String title) + { + this.title = title; + } + + + /** + * Return the description of the job role. + * + * @return string description + */ + public String getDescription() + { + return description; + } + + + /** + * Set up the description of the job role. + * + * @param description string description + */ + public void setDescription(String description) + { + this.description = description; + } + + + /** + * Return the identifier of the governance domain that this role belongs to. Zero means that the + * role is not specific to any domain. + * + * @return int + */ + public int getDomainIdentifier() + { + return domainIdentifier; + } + + + /** + * Set up the identifier of the governance domain that this role belongs to. Zero means that the + * role is not specific to any domain. + * + * @param domainIdentifier int + */ + public void setDomainIdentifier(int domainIdentifier) + { + this.domainIdentifier = domainIdentifier; + } + + + /** + * Return a copy of the additional properties. Null means no additional properties are available. + * + * @return AdditionalProperties map + */ + public Map getAdditionalProperties() + { + if (additionalProperties == null) + { + return null; + } + else if (additionalProperties.isEmpty()) + { + return null; + } + else + { + return new HashMap<>(additionalProperties); + } + } + + + /** + * Set up additional properties. + * + * @param additionalProperties Additional properties map + */ + public void setAdditionalProperties(Map additionalProperties) + { + this.additionalProperties = additionalProperties; + } + + + /** + * Return the date/time that this element is effective from (null means effective from the epoch). + * + * @return date object + */ + public Date getEffectiveFrom() + { + return effectiveFrom; + } + + + /** + * Set up the date/time that this element is effective from (null means effective from the epoch). + * + * @param effectiveFrom date object + */ + public void setEffectiveFrom(Date effectiveFrom) + { + this.effectiveFrom = effectiveFrom; + } + + + /** + * Return the date/time that element is effective to (null means that it is effective indefinitely into the future). + * + * @return date object + */ + public Date getEffectiveTo() + { + return effectiveTo; + } + + + /** + * Set the date/time that element is effective to (null means that it is effective indefinitely into the future). + * + * @param effectiveTo date object + */ + public void setEffectiveTo(Date effectiveTo) + { + this.effectiveTo = effectiveTo; + } + + + /** + * Return the open metadata type name of this object - this is used to create a subtype of + * the referenceable. Any properties associated with this subtype are passed as extended properties. + * + * @return string type name + */ + public String getTypeName() + { + return typeName; + } + + + /** + * Set up the open metadata type name of this object - this is used to create a subtype of + * the referenceable. Any properties associated with this subtype are passed as extended properties. + * + * @param typeName string type name + */ + public void setTypeName(String typeName) + { + this.typeName = typeName; + } + + + /** + * Return the properties that are defined for a subtype of referenceable but are not explicitly + * supported by the bean. + * + * @return map of properties + */ + public Map getExtendedProperties() + { + if (extendedProperties == null) + { + return null; + } + else if (extendedProperties.isEmpty()) + { + return null; + } + else + { + return new HashMap<>(extendedProperties); + } + } + + + /** + * Set up the properties that are defined for a subtype of referenceable but are not explicitly + * supported by the bean. + * + * @param extendedProperties map of properties + */ + public void setExtendedProperties(Map extendedProperties) + { + this.extendedProperties = extendedProperties; + } + + + /** + * JSON-style toString. + * + * @return list of properties and their values. + */ + @Override + public String toString() + { + return "PersonalRoleProperties{" + + "qualifiedName='" + qualifiedName + '\'' + + ", roleId='" + roleId + '\'' + + ", scope='" + scope + '\'' + + ", title='" + title + '\'' + + ", description='" + description + '\'' + + ", domainIdentifier=" + domainIdentifier + + ", additionalProperties=" + additionalProperties + + ", effectiveFrom=" + effectiveFrom + + ", effectiveTo=" + effectiveTo + + ", typeName='" + typeName + '\'' + + ", extendedProperties=" + extendedProperties + + '}'; + } + + + /** + * Equals method that returns true if containing properties are the same. + * + * @param objectToCompare object to compare + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + PersonalRoleProperties that = (PersonalRoleProperties) objectToCompare; + return domainIdentifier == that.domainIdentifier && + Objects.equals(qualifiedName, that.qualifiedName) && + Objects.equals(roleId, that.roleId) && + Objects.equals(scope, that.scope) && + Objects.equals(title, that.title) && + Objects.equals(description, that.description) && + Objects.equals(additionalProperties, that.additionalProperties) && + Objects.equals(effectiveFrom, that.effectiveFrom) && + Objects.equals(effectiveTo, that.effectiveTo) && + Objects.equals(typeName, that.typeName) && + Objects.equals(extendedProperties, that.extendedProperties); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(qualifiedName, roleId, scope, title, description, domainIdentifier, additionalProperties, effectiveFrom, effectiveTo, typeName, extendedProperties); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ProfileIdentityProperties.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ProfileIdentityProperties.java new file mode 100644 index 00000000000..af23de6513c --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ProfileIdentityProperties.java @@ -0,0 +1,172 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.io.Serializable; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ProfileIdentityProperties describes the properties for the ProfileIdentity relationship between a profile + * and a user identity. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ProfileIdentityProperties implements Serializable +{ + private static final long serialVersionUID = 1L; + + private String roleTypeName = null; + private String roleGUID = null; + private String description = null; + + + /** + * Default constructor + */ + public ProfileIdentityProperties() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ProfileIdentityProperties(ProfileIdentityProperties template) + { + if (template != null) + { + roleTypeName = template.getRoleTypeName(); + roleGUID = template.getRoleGUID(); + description = template.getDescription(); + } + } + + + /** + * Return the type of the role. + * + * @return name + */ + public String getRoleTypeName() + { + return roleTypeName; + } + + + /** + * Set up the type of the role. + * + * @param roleTypeName name + */ + public void setRoleTypeName(String roleTypeName) + { + this.roleTypeName = roleTypeName; + } + + + /** + * Return the instance of the role. + * + * @return guid + */ + public String getRoleGUID() + { + return roleGUID; + } + + + /** + * Set up the instance of the role. + * + * @param roleGUID guid + */ + public void setRoleGUID(String roleGUID) + { + this.roleGUID = roleGUID; + } + + + /** + * Return the description of the user identity with respect to the individual. + * + * @return value string + */ + public String getDescription() + { + return description; + } + + + /** + * Set up the description of the user identity with respect to the individual. + * + * @param description value string + */ + public void setDescription(String description) + { + this.description = description; + } + + + /** + * JSON-style toString. + * + * @return list of properties and their values. + */ + @Override + public String toString() + { + return "ProfileIdentityProperties{" + + "roleTypeName='" + roleTypeName + '\'' + + ", roleGUID='" + roleGUID + '\'' + + ", description='" + description + '\'' + + '}'; + } + + + /** + * Equals method that returns true if containing properties are the same. + * + * @param objectToCompare object to compare + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + ProfileIdentityProperties that = (ProfileIdentityProperties) objectToCompare; + return Objects.equals(roleTypeName, that.roleTypeName) && + Objects.equals(roleGUID, that.roleGUID) && + Objects.equals(description, that.description); + } + + + /** + * Hash code for this object + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(roleTypeName, roleGUID, description); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ProfileLocationProperties.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ProfileLocationProperties.java new file mode 100644 index 00000000000..7717f76c3de --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ProfileLocationProperties.java @@ -0,0 +1,128 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ProfileLocationProperties describes the properties for the ProfileLocation relationship between a profile + * and a location. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ProfileLocationProperties extends RelationshipProperties +{ + private static final long serialVersionUID = 1L; + + private String associationType = null; + + + /** + * Default constructor + */ + public ProfileLocationProperties() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ProfileLocationProperties(ProfileLocationProperties template) + { + super(template); + + if (template != null) + { + associationType = template.getAssociationType(); + } + } + + + /** + * Return the type of the association. + * + * @return string + */ + public String getAssociationType() + { + return associationType; + } + + + /** + * Set up the type of the association. + * + * @param associationType string + */ + public void setAssociationType(String associationType) + { + this.associationType = associationType; + } + + + /** + * JSON-style toString. + * + * @return list of properties and their values. + */ + @Override + public String toString() + { + return "ProfileLocationProperties{" + + "associationType='" + associationType + '\'' + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", extendedProperties=" + getExtendedProperties() + + '}'; + } + + + /** + * Equals method that returns true if containing properties are the same. + * + * @param objectToCompare object to compare + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (! super.equals(objectToCompare)) + { + return false; + } + ProfileLocationProperties that = (ProfileLocationProperties) objectToCompare; + return Objects.equals(associationType, that.associationType); + } + + + /** + * Hash code for this object + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), associationType); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ProjectProperties.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ProjectProperties.java new file mode 100644 index 00000000000..46160d8f7c4 --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ProjectProperties.java @@ -0,0 +1,278 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.Date; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ProjectProperties describes a project. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ProjectProperties extends ReferenceableProperties +{ + private static final long serialVersionUID = 1L; + + private String identifier = null; + private String name = null; + private String description = null; + private String status = null; + private Date startDate = null; + private Date plannedEndDate = null; + + + /** + * Default constructor + */ + public ProjectProperties() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ProjectProperties(ProjectProperties template) + { + super(template); + + if (template != null) + { + this.identifier = template.getIdentifier(); + this.name = template.getName(); + this.description = template.getDescription(); + this.status = template.getStatus(); + this.startDate = template.getStartDate(); + this.plannedEndDate = template.getPlannedEndDate(); + } + } + + + /** + * Return the code value or symbol used to identify the project - typically unique. + * + * @return string identifier + */ + public String getIdentifier() + { + return identifier; + } + + + /** + * Set up the code value or symbol used to identify the project - typically unique. + * + * @param identifier string identifier + */ + public void setIdentifier(String identifier) + { + this.identifier = identifier; + } + + + + /** + * Return the name of the project. + * + * @return string name + */ + public String getName() + { + return name; + } + + + /** + * Set up the name of the project. + * + * @param name string name + */ + public void setName(String name) + { + this.name = name; + } + + + /** + * Return the description of the project. + * + * @return text + */ + public String getDescription() + { + return description; + } + + + /** + * Set up the description of the project. + * + * @param description text + */ + public void setDescription(String description) + { + this.description = description; + } + + + + /** + * Return the status for this project. + * + * @return string id + */ + public String getStatus() + { + return status; + } + + + /** + * Set up the status for this project. + * + * @param status string id + */ + public void setStatus(String status) + { + this.status = status; + } + + + /** + * Return the date that the project was created. + * + * @return date + */ + public Date getStartDate() + { + if (startDate == null) + { + return null; + } + else + { + return new Date(startDate.getTime()); + } + } + + + /** + * Set up the date that the project was created. + * + * @param startDate date + */ + public void setStartDate(Date startDate) + { + this.startDate = startDate; + } + + + /** + * Return the date that the project is expected to complete. + * + * @return date + */ + public Date getPlannedEndDate() + { + if (plannedEndDate == null) + { + return null; + } + else + { + return new Date(plannedEndDate.getTime()); + } + } + + + /** + * Set up the date that the project is expected to complete. + * + * @param plannedEndDate date + */ + public void setPlannedEndDate(Date plannedEndDate) + { + this.plannedEndDate = plannedEndDate; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ProjectProperties{" + + "identifier='" + identifier + '\'' + + ", name='" + name + '\'' + + ", description='" + description + '\'' + + ", status='" + status + '\'' + + ", startDate=" + startDate + + ", plannedEndDate=" + plannedEndDate + + ", qualifiedName='" + getQualifiedName() + '\'' + + ", additionalProperties=" + getAdditionalProperties() + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", vendorProperties=" + getVendorProperties() + + ", typeName='" + getTypeName() + '\'' + + ", extendedProperties=" + getExtendedProperties() + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (! super.equals(objectToCompare)) + { + return false; + } + ProjectProperties that = (ProjectProperties) objectToCompare; + return Objects.equals(identifier, that.identifier) && + Objects.equals(name, that.name) && + Objects.equals(description, that.description) && + Objects.equals(status, that.status) && + Objects.equals(startDate, that.startDate) && + Objects.equals(plannedEndDate, that.plannedEndDate); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), identifier, name, description, status, startDate, plannedEndDate); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ProjectTeamProperties.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ProjectTeamProperties.java new file mode 100644 index 00000000000..c9dcc6a9e8e --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ProjectTeamProperties.java @@ -0,0 +1,127 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.properties; + + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ProjectTeamProperties provides a details of the purpose (and privileges) of the membership role. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ProjectTeamProperties extends RelationshipProperties +{ + private static final long serialVersionUID = 1L; + + String teamRole = null; + + /** + * Default constructor + */ + public ProjectTeamProperties() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ProjectTeamProperties(ProjectTeamProperties template) + { + super(template); + + if (template != null) + { + this.teamRole = template.getTeamRole(); + } + } + + + /** + * Return the membership type. + * + * @return membership type + */ + public String getTeamRole() + { + return teamRole; + } + + + /** + * Set up the membership type. + * + * @param teamRole membership type + */ + public void setTeamRole(String teamRole) + { + this.teamRole = teamRole; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ProjectTeamProperties{" + + "membershipType=" + teamRole + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", extendedProperties=" + getExtendedProperties() + + '}'; + } + + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (! super.equals(objectToCompare)) + { + return false; + } + ProjectTeamProperties that = (ProjectTeamProperties) objectToCompare; + return Objects.equals(teamRole, that.teamRole); + } + + + /** + * Return has code based on properties. + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), teamRole); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ReferenceableProperties.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ReferenceableProperties.java new file mode 100644 index 00000000000..ddc6030998f --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ReferenceableProperties.java @@ -0,0 +1,334 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + +import java.io.Serializable; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * Many open metadata entities are referenceable. It means that they have a qualified name and additional + * properties. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "class") +@JsonSubTypes( + { + @JsonSubTypes.Type(value = ActorProfileProperties.class, name = "ActorProfileProperties"), + @JsonSubTypes.Type(value = ContributionRecord.class, name = "ContributionRecord"), + @JsonSubTypes.Type(value = MetadataSourceProperties.class, name = "MetadataSourceProperties"), + @JsonSubTypes.Type(value = ProjectProperties.class, name = "ProjectProperties"), + @JsonSubTypes.Type(value = UserIdentityProperties.class, name = "UserIdentityProperties"), + }) +public class ReferenceableProperties implements Serializable +{ + private static final long serialVersionUID = 1L; + + + private String qualifiedName = null; + private Map additionalProperties = null; + + private Date effectiveFrom = null; + private Date effectiveTo = null; + + private Map vendorProperties = null; + + private String typeName = null; + private Map extendedProperties = null; + + /** + * Default constructor + */ + public ReferenceableProperties() + { + super(); + } + + + /** + * Copy/clone constructor. Retrieves values from the supplied template + * + * @param template element to copy + */ + public ReferenceableProperties(ReferenceableProperties template) + { + if (template != null) + { + qualifiedName = template.getQualifiedName(); + additionalProperties = template.getAdditionalProperties(); + + effectiveFrom = template.getEffectiveFrom(); + effectiveTo = template.getEffectiveTo(); + + vendorProperties = template.getVendorProperties(); + + typeName = template.getTypeName(); + extendedProperties = template.getExtendedProperties(); + } + } + + + /** + * Set up the fully qualified name. + * + * @param qualifiedName String name + */ + public void setQualifiedName(String qualifiedName) + { + this.qualifiedName = qualifiedName; + } + + + /** + * Returns the stored qualified name property for the metadata entity. + * If no qualified name is available then the empty string is returned. + * + * @return qualifiedName + */ + public String getQualifiedName() + { + return qualifiedName; + } + + + /** + * Set up additional properties. + * + * @param additionalProperties Additional properties object + */ + public void setAdditionalProperties(Map additionalProperties) + { + this.additionalProperties = additionalProperties; + } + + + /** + * Return a copy of the additional properties. Null means no additional properties are available. + * + * @return AdditionalProperties + */ + public Map getAdditionalProperties() + { + if (additionalProperties == null) + { + return null; + } + else if (additionalProperties.isEmpty()) + { + return null; + } + else + { + return new HashMap<>(additionalProperties); + } + } + + + /** + * Return the date/time that this element is effective from (null means effective from the epoch). + * + * @return date object + */ + public Date getEffectiveFrom() + { + return effectiveFrom; + } + + + /** + * Set up the date/time that this element is effective from (null means effective from the epoch). + * + * @param effectiveFrom date object + */ + public void setEffectiveFrom(Date effectiveFrom) + { + this.effectiveFrom = effectiveFrom; + } + + + /** + * Return the date/time that element is effective to (null means that it is effective indefinitely into the future). + * + * @return date object + */ + public Date getEffectiveTo() + { + return effectiveTo; + } + + + /** + * Set the date/time that element is effective to (null means that it is effective indefinitely into the future). + * + * @param effectiveTo date object + */ + public void setEffectiveTo(Date effectiveTo) + { + this.effectiveTo = effectiveTo; + } + + + /** + * Return specific properties for the data manager vendor. + * + * @return name value pairs + */ + public Map getVendorProperties() + { + if (vendorProperties == null) + { + return null; + } + else if (vendorProperties.isEmpty()) + { + return null; + } + else + { + return new HashMap<>(vendorProperties); + } + } + + + /** + * Set up specific properties for the data manager vendor. + * + * @param vendorProperties name value pairs + */ + public void setVendorProperties(Map vendorProperties) + { + this.vendorProperties = vendorProperties; + } + + + /** + * Return the name of the open metadata type for this metadata element. + * + * @return string name + */ + public String getTypeName() + { + return typeName; + } + + + /** + * Set up the name of the open metadata type for this element. + * + * @param typeName string name + */ + public void setTypeName(String typeName) + { + this.typeName = typeName; + } + + + /** + * Return the properties that have been defined for a subtype of this object that are not supported explicitly + * by this bean. + * + * @return property map + */ + public Map getExtendedProperties() + { + if (extendedProperties == null) + { + return null; + } + else if (extendedProperties.isEmpty()) + { + return null; + } + else + { + return new HashMap<>(extendedProperties); + } + } + + + /** + * Set up the properties that have been defined for a subtype of this object that are not supported explicitly + * by this bean. + * + * @param extendedProperties property map + */ + public void setExtendedProperties(Map extendedProperties) + { + this.extendedProperties = extendedProperties; + } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "ReferenceableProperties{" + + "qualifiedName='" + qualifiedName + '\'' + + ", additionalProperties=" + additionalProperties + + ", effectiveFrom=" + effectiveFrom + + ", effectiveTo=" + effectiveTo + + ", vendorProperties=" + vendorProperties + + ", typeName='" + typeName + '\'' + + ", extendedProperties=" + extendedProperties + + '}'; + } + + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + ReferenceableProperties that = (ReferenceableProperties) objectToCompare; + return Objects.equals(qualifiedName, that.qualifiedName) && + Objects.equals(additionalProperties, that.additionalProperties) && + Objects.equals(effectiveFrom, that.effectiveFrom) && + Objects.equals(effectiveTo, that.effectiveTo) && + Objects.equals(vendorProperties, that.vendorProperties) && + Objects.equals(typeName, that.typeName) && + Objects.equals(extendedProperties, that.extendedProperties); + } + + + /** + * Return has code based on properties. + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(qualifiedName, additionalProperties, effectiveFrom, effectiveTo, vendorProperties, typeName, extendedProperties); + } +} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/RelationshipProperties.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/RelationshipProperties.java new file mode 100644 index 00000000000..2be2383df8e --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/RelationshipProperties.java @@ -0,0 +1,200 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + +import java.io.Serializable; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * RelationshipProperties provides the base class for relationships items. This provides extended properties with the ability to + * set effectivity dates. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "class") +@JsonSubTypes( + { + @JsonSubTypes.Type(value = ResourceListProperties.class, name = "ResourceListProperties"), + @JsonSubTypes.Type(value = AssignmentScopeProperties.class, name = "AssignmentScopeProperties"), + @JsonSubTypes.Type(value = StakeholderProperties.class, name = "StakeholderProperties"), + @JsonSubTypes.Type(value = ProfileLocationProperties.class, name = "ProfileLocationProperties"), + }) +public class RelationshipProperties implements Serializable +{ + private static final long serialVersionUID = 1L; + + private Date effectiveFrom = null; + private Date effectiveTo = null; + + private Map extendedProperties = null; + + + /** + * Default constructor + */ + public RelationshipProperties() + { + super(); + } + + + /** + * Copy/clone constructor. Retrieve values from the supplied template + * + * @param template element to copy + */ + public RelationshipProperties(RelationshipProperties template) + { + if (template != null) + { + effectiveFrom = template.getEffectiveFrom(); + effectiveTo = template.getEffectiveTo(); + extendedProperties = template.getExtendedProperties(); + } + } + + + /** + * Return the date/time that this element is effective from (null means effective from the epoch). + * + * @return date object + */ + public Date getEffectiveFrom() + { + return effectiveFrom; + } + + + /** + * Set up the date/time that this element is effective from (null means effective from the epoch). + * + * @param effectiveFrom date object + */ + public void setEffectiveFrom(Date effectiveFrom) + { + this.effectiveFrom = effectiveFrom; + } + + + /** + * Return the date/time that element is effective to (null means that it is effective indefinitely into the future). + * + * @return date object + */ + public Date getEffectiveTo() + { + return effectiveTo; + } + + + /** + * Set the date/time that element is effective to (null means that it is effective indefinitely into the future). + * + * @param effectiveTo date object + */ + public void setEffectiveTo(Date effectiveTo) + { + this.effectiveTo = effectiveTo; + } + + + /** + * Return the properties that have been defined for a subtype of this object that are not supported explicitly + * by this bean. + * + * @return property map + */ + public Map getExtendedProperties() + { + if (extendedProperties == null) + { + return null; + } + else if (extendedProperties.isEmpty()) + { + return null; + } + else + { + return new HashMap<>(extendedProperties); + } + } + + + /** + * Set up the properties that have been defined for a subtype of this object that are not supported explicitly + * by this bean. + * + * @param extendedProperties property map + */ + public void setExtendedProperties(Map extendedProperties) + { + this.extendedProperties = extendedProperties; + } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "RelationshipProperties{" + + "effectiveFrom=" + effectiveFrom + + ", effectiveTo=" + effectiveTo + + ", extendedProperties=" + extendedProperties + + '}'; + } + + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + RelationshipProperties that = (RelationshipProperties) objectToCompare; + return Objects.equals(effectiveFrom, that.effectiveFrom) && + Objects.equals(effectiveTo, that.effectiveTo); + } + + + /** + * Return has code based on properties. + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(effectiveFrom, effectiveTo); + } +} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ResourceListProperties.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ResourceListProperties.java new file mode 100644 index 00000000000..b3321f4f37e --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/ResourceListProperties.java @@ -0,0 +1,150 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.properties; + + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ResourceListProperties provides a details of why an element providing resources (such as a community) has been attached to an initiative + * such as a governance domain. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ResourceListProperties extends RelationshipProperties +{ + private static final long serialVersionUID = 1L; + + String resourceUse = null; + boolean watchResource = false; + + /** + * Default constructor + */ + public ResourceListProperties() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ResourceListProperties(ResourceListProperties template) + { + super(template); + + if (template != null) + { + this.resourceUse = template.getResourceUse(); + this.watchResource = template.getWatchResource(); + } + } + + + /** + * Return the reason why the resource has been attached to the initiative. + * + * @return description + */ + public String getResourceUse() + { + return resourceUse; + } + + + /** + * Set up the reason why the resource has been attached to the initiative. + * + * @param resourceUse description + */ + public void setResourceUse(String resourceUse) + { + this.resourceUse = resourceUse; + } + + + /** + * Return whether changes to the resource result in notifications to the initiative. + * + * @return flag + */ + public boolean getWatchResource() + { + return watchResource; + } + + + /** + * Set up whether changes to the resource result in notifications to the initiative. + * + * @param watchResource flag + */ + public void setWatchResource(boolean watchResource) + { + this.watchResource = watchResource; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ResourceListProperties{" + + "resourceUse='" + resourceUse + '\'' + + ", watchResource=" + watchResource + + '}'; + } + + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (! super.equals(objectToCompare)) + { + return false; + } + ResourceListProperties that = (ResourceListProperties) objectToCompare; + return watchResource == that.watchResource && Objects.equals(resourceUse, that.resourceUse); + } + + + /** + * Return has code based on properties. + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), resourceUse, watchResource); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/StakeholderProperties.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/StakeholderProperties.java new file mode 100644 index 00000000000..75ca78854be --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/StakeholderProperties.java @@ -0,0 +1,127 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.properties; + + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * StakeholderProperties provides a details of a stakeholder for an initiative. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class StakeholderProperties extends RelationshipProperties +{ + private static final long serialVersionUID = 1L; + + String stakeholderRole = null; + + /** + * Default constructor + */ + public StakeholderProperties() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public StakeholderProperties(StakeholderProperties template) + { + super(template); + + if (template != null) + { + this.stakeholderRole = template.getStakeholderRole(); + } + } + + + /** + * Return the role of the stakeholder to the initiative. + * + * @return role type + */ + public String getStakeholderRole() + { + return stakeholderRole; + } + + + /** + * Set up the role of the stakeholder to the initiative. + * + * @param stakeholderRole role type + */ + public void setStakeholderRole(String stakeholderRole) + { + this.stakeholderRole = stakeholderRole; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "StakeholderProperties{" + + "effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", extendedProperties=" + getExtendedProperties() + + ", stakeholderRole='" + stakeholderRole + '\'' + + '}'; + } + + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (! super.equals(objectToCompare)) + { + return false; + } + StakeholderProperties that = (StakeholderProperties) objectToCompare; + return Objects.equals(stakeholderRole, that.stakeholderRole); + } + + + /** + * Return has code based on properties. + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), stakeholderRole); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/TemplateProperties.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/TemplateProperties.java new file mode 100644 index 00000000000..f6bfbabfaf6 --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/TemplateProperties.java @@ -0,0 +1,201 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.projectmanagement.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.io.Serializable; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * TemplateProperties defined the properties that can be overridden from the template object + * when creating an object from a template. + */ +@JsonAutoDetect(getterVisibility = PUBLIC_ONLY, setterVisibility = PUBLIC_ONLY, fieldVisibility = NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public class TemplateProperties implements Serializable +{ + private static final long serialVersionUID = 1L; + + private String qualifiedName = null; + private String identifier = null; + private String displayName = null; + private String description = null; + + /** + * Default constructor + */ + public TemplateProperties() + { + super(); + } + + + /** + * Copy/clone constructor for the template properties. + * + * @param template template object to copy. + */ + public TemplateProperties(TemplateProperties template) + { + if (template != null) + { + qualifiedName = template.getQualifiedName(); + identifier = template.getIdentifier(); + displayName = template.getDisplayName(); + description = template.getDescription(); + } + } + + + /** + * Returns the stored qualified name property for the metadata entity. + * If no qualified name is available then the empty string is returned. + * + * @return qualifiedName + */ + public String getQualifiedName() + { + return qualifiedName; + } + + + /** + * Set up the fully qualified name. + * + * @param qualifiedName String name + */ + public void setQualifiedName(String qualifiedName) + { + this.qualifiedName = qualifiedName; + } + + + /** + * Return the code value or symbol used to identify the element - typically unique. + * + * @return string identifier + */ + public String getIdentifier() + { + return identifier; + } + + + /** + * Set up the code value or symbol used to identify the element - typically unique. + * + * @param identifier string identifier + */ + public void setIdentifier(String identifier) + { + this.identifier = identifier; + } + + + /** + * Returns the stored display name property for the metadata entity. + * If no display name is available then null is returned. + * + * @return String name + */ + public String getDisplayName() + { + return displayName; + } + + + /** + * Set up the stored display name property for the metadata entity. + * + * @param displayName String name + */ + public void setDisplayName(String displayName) + { + this.displayName = displayName; + } + + + /** + * Returns the stored description property for the metadata entity. + * If no description is provided then null is returned. + * + * @return description String text + */ + public String getDescription() + { + return description; + } + + + /** + * Set up the stored description property associated with the metadata entity. + * + * @param description String text + */ + public void setDescription(String description) + { + this.description = description; + } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "TemplateProperties{" + + "qualifiedName='" + qualifiedName + '\'' + + ", identifier='" + identifier + '\'' + + ", displayName='" + displayName + '\'' + + ", description='" + description + '\'' + + '}'; + } + + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + TemplateProperties that = (TemplateProperties) objectToCompare; + return Objects.equals(qualifiedName, that.qualifiedName) && + Objects.equals(identifier, that.identifier) && + Objects.equals(displayName, that.displayName) && + Objects.equals(description, that.description); + } + + + /** + * Return has code based on properties. + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(qualifiedName, identifier, displayName, description); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/UserIdentityProperties.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/UserIdentityProperties.java new file mode 100644 index 00000000000..85d1c7f718d --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/properties/UserIdentityProperties.java @@ -0,0 +1,157 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * UserIdentityProperties describes an element that is linked to a single userId. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class UserIdentityProperties extends ReferenceableProperties +{ + private static final long serialVersionUID = 1L; + + private String userId = null; + private String distinguishedName = null; + + + /** + * Default constructor + */ + public UserIdentityProperties() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public UserIdentityProperties(UserIdentityProperties template) + { + super(template); + + if (template != null) + { + this.userId = template.getUserId(); + this.distinguishedName = template.getDistinguishedName(); + } + } + + + /** + * Return the identifier of the user's account + * + * @return string + */ + public String getUserId() + { + return userId; + } + + + /** + * Return the identifier of the user's account. + * + * @param userId string + */ + public void setUserId(String userId) + { + this.userId = userId; + } + + + /** + * Return the unique name in LDAP. + * + * @return string name + */ + public String getDistinguishedName() + { + return distinguishedName; + } + + + /** + * Set up the unique name in LDAP. + * + * @param distinguishedName string name + */ + public void setDistinguishedName(String distinguishedName) + { + this.distinguishedName = distinguishedName; + } + + + /** + * JSON-style toString. + * + * @return list of properties and their values. + */ + @Override + public String toString() + { + return "UserIdentityProperties{" + + "qualifiedName='" + getQualifiedName() + '\'' + + ", additionalProperties=" + getAdditionalProperties() + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", vendorProperties=" + getVendorProperties() + + ", typeName='" + getTypeName() + '\'' + + ", extendedProperties=" + getExtendedProperties() + + ", userId='" + userId + '\'' + + ", distinguishedName='" + distinguishedName + '\'' + + '}'; + } + + + /** + * Equals method that returns true if containing properties are the same. + * + * @param objectToCompare object to compare + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (! super.equals(objectToCompare)) + { + return false; + } + UserIdentityProperties that = (UserIdentityProperties) objectToCompare; + return Objects.equals(userId, that.userId) && + Objects.equals(distinguishedName, that.distinguishedName); + } + + + /** + * Just use the GUID for the hash code as it should be unique. + * + * @return int code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), userId, distinguishedName); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/ActorProfileListResponse.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/ActorProfileListResponse.java new file mode 100644 index 00000000000..ae4eb1a09b7 --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/ActorProfileListResponse.java @@ -0,0 +1,150 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.ActorProfileElement; + +import java.util.Arrays; +import java.util.List; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + + +/** + * ActorProfileListResponse is the response structure used on the OMAS REST API calls that return + * a list of profile elements. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ActorProfileListResponse extends ProjectManagementOMASAPIResponse +{ + private static final long serialVersionUID = 1L; + + private List elements = null; + + + /** + * Default constructor + */ + public ActorProfileListResponse() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ActorProfileListResponse(ActorProfileListResponse template) + { + super(template); + + if (template != null) + { + this.elements = template.getElements(); + } + } + + + /** + * Return the profile result. + * + * @return unique identifier + */ + public List getElements() + { + if (elements == null) + { + return null; + } + else if (elements.isEmpty()) + { + return null; + } + else + { + return elements; + } + } + + + /** + * Set up the profile result. + * + * @param elements - unique identifier + */ + public void setElements(List elements) + { + this.elements = elements; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ActorProfileListResponse{" + + "elements=" + elements + + ", exceptionClassName='" + getExceptionClassName() + '\'' + + ", exceptionCausedBy='" + getExceptionCausedBy() + '\'' + + ", actionDescription='" + getActionDescription() + '\'' + + ", relatedHTTPCode=" + getRelatedHTTPCode() + + ", exceptionErrorMessage='" + getExceptionErrorMessage() + '\'' + + ", exceptionErrorMessageId='" + getExceptionErrorMessageId() + '\'' + + ", exceptionErrorMessageParameters=" + Arrays.toString(getExceptionErrorMessageParameters()) + + ", exceptionSystemAction='" + getExceptionSystemAction() + '\'' + + ", exceptionUserAction='" + getExceptionUserAction() + '\'' + + ", exceptionProperties=" + getExceptionProperties() + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (!(objectToCompare instanceof ActorProfileListResponse)) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + ActorProfileListResponse that = (ActorProfileListResponse) objectToCompare; + return Objects.equals(getElements(), that.getElements()); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), elements); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/ClassificationRequestBody.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/ClassificationRequestBody.java new file mode 100644 index 00000000000..2fad7392d27 --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/ClassificationRequestBody.java @@ -0,0 +1,129 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.rest; + + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.ClassificationProperties; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + + +/** + * ClassificationRequestBody describes the request body used when attaching classification to elements. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ClassificationRequestBody extends ExternalSourceRequestBody +{ + private static final long serialVersionUID = 1L; + + private ClassificationProperties properties = null; + + + /** + * Default constructor + */ + public ClassificationRequestBody() + { + super(); + } + + + /** + * Copy/clone constructor. + * + * @param template object to copy + */ + public ClassificationRequestBody(ClassificationRequestBody template) + { + super(template); + + if (template != null) + { + properties = template.getProperties(); + } + } + + + /** + * Return the properties for the classification. + * + * @return properties object + */ + public ClassificationProperties getProperties() + { + return properties; + } + + + /** + * Set up the properties for the classification. + * + * @param properties properties object + */ + public void setProperties(ClassificationProperties properties) + { + this.properties = properties; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ClassificationRequestBody{" + + "externalSourceGUID='" + getExternalSourceGUID() + '\'' + + ", externalSourceName='" + getExternalSourceName() + '\'' + + ", properties=" + properties + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + ClassificationRequestBody that = (ClassificationRequestBody) objectToCompare; + return Objects.equals(getProperties(), that.getProperties()); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), properties); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/ElementStubsResponse.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/ElementStubsResponse.java new file mode 100644 index 00000000000..d72f0805ad0 --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/ElementStubsResponse.java @@ -0,0 +1,151 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.ElementStub; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + + +/** + * ElementStubListResponse is the response structure used on the OMAS REST API calls that return a + * list of element identifiers as a response. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ElementStubsResponse extends ProjectManagementOMASAPIResponse +{ + private static final long serialVersionUID = 1L; + + private List elements = null; + + + /** + * Default constructor + */ + public ElementStubsResponse() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ElementStubsResponse(ElementStubsResponse template) + { + super(template); + + if (template != null) + { + this.elements = template.getElements(); + } + } + + + /** + * Return the list of element identifiers. + * + * @return list of objects or null + */ + public List getElements() + { + if (elements == null) + { + return null; + } + else if (elements.isEmpty()) + { + return null; + } + else + { + return new ArrayList<>(elements); + } + } + + + /** + * Set up the list of element identifiers. + * + * @param elements - list of objects or null + */ + public void setElements(List elements) + { + this.elements = elements; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ElementStubListResponse{" + + "elements=" + elements + + ", exceptionClassName='" + getExceptionClassName() + '\'' + + ", exceptionCausedBy='" + getExceptionCausedBy() + '\'' + + ", actionDescription='" + getActionDescription() + '\'' + + ", relatedHTTPCode=" + getRelatedHTTPCode() + + ", exceptionErrorMessage='" + getExceptionErrorMessage() + '\'' + + ", exceptionErrorMessageId='" + getExceptionErrorMessageId() + '\'' + + ", exceptionErrorMessageParameters=" + Arrays.toString(getExceptionErrorMessageParameters()) + + ", exceptionSystemAction='" + getExceptionSystemAction() + '\'' + + ", exceptionUserAction='" + getExceptionUserAction() + '\'' + + ", exceptionProperties=" + getExceptionProperties() + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (!(objectToCompare instanceof ElementStubsResponse)) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + ElementStubsResponse that = (ElementStubsResponse) objectToCompare; + return Objects.equals(this.getElements(), that.getElements()); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(elements, super.hashCode()); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/ExternalSourceRequestBody.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/ExternalSourceRequestBody.java new file mode 100644 index 00000000000..abafe4de91c --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/ExternalSourceRequestBody.java @@ -0,0 +1,145 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ExternalSourceRequestBody carries the parameters for marking an element as external. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ExternalSourceRequestBody extends ProjectManagementOMASAPIRequestBody +{ + private static final long serialVersionUID = 1L; + + private String externalSourceGUID = null; + private String externalSourceName = null; + + + /** + * Default constructor + */ + public ExternalSourceRequestBody() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ExternalSourceRequestBody(ExternalSourceRequestBody template) + { + super(template); + + if (template != null) + { + externalSourceGUID = template.getExternalSourceGUID(); + externalSourceName = template.getExternalSourceName(); + } + } + + + /** + * Return the unique identifier of the software server capability entity that represented the external source - null for local. + * + * @return string guid + */ + public String getExternalSourceGUID() + { + return externalSourceGUID; + } + + + /** + * Set up the unique identifier of the software server capability entity that represented the external source - null for local. + * + * @param externalSourceGUID string guid + */ + public void setExternalSourceGUID(String externalSourceGUID) + { + this.externalSourceGUID = externalSourceGUID; + } + + + /** + * Return the unique name of the software server capability entity that represented the external source. + * + * @return string name + */ + public String getExternalSourceName() + { + return externalSourceName; + } + + + /** + * Set up the unique name of the software server capability entity that represented the external source. + * + * @param externalSourceName string name + */ + public void setExternalSourceName(String externalSourceName) + { + this.externalSourceName = externalSourceName; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ExternalSourceRequestBody{" + + "externalSourceGUID='" + externalSourceGUID + '\'' + + ", externalSourceName='" + externalSourceName + '\'' + + '}'; + } + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + ExternalSourceRequestBody that = (ExternalSourceRequestBody) objectToCompare; + return Objects.equals(externalSourceGUID, that.externalSourceGUID) && + Objects.equals(externalSourceName, that.externalSourceName); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), externalSourceGUID, externalSourceName); + } +} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/PersonRoleListResponse.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/PersonRoleListResponse.java new file mode 100644 index 00000000000..514d895ba36 --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/PersonRoleListResponse.java @@ -0,0 +1,150 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.PersonRoleElement; + +import java.util.Arrays; +import java.util.List; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + + +/** + * PersonRoleListResponse is the response structure used on the OMAS REST API calls that return + * a list of person role elements. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class PersonRoleListResponse extends ProjectManagementOMASAPIResponse +{ + private static final long serialVersionUID = 1L; + + private List elements = null; + + + /** + * Default constructor + */ + public PersonRoleListResponse() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public PersonRoleListResponse(PersonRoleListResponse template) + { + super(template); + + if (template != null) + { + this.elements = template.getElements(); + } + } + + + /** + * Return the person role result. + * + * @return unique identifier + */ + public List getElements() + { + if (elements == null) + { + return null; + } + else if (elements.isEmpty()) + { + return null; + } + else + { + return elements; + } + } + + + /** + * Set up the person role result. + * + * @param elements - unique identifier + */ + public void setElements(List elements) + { + this.elements = elements; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "PersonRoleListResponse{" + + "elements=" + elements + + ", exceptionClassName='" + getExceptionClassName() + '\'' + + ", exceptionCausedBy='" + getExceptionCausedBy() + '\'' + + ", actionDescription='" + getActionDescription() + '\'' + + ", relatedHTTPCode=" + getRelatedHTTPCode() + + ", exceptionErrorMessage='" + getExceptionErrorMessage() + '\'' + + ", exceptionErrorMessageId='" + getExceptionErrorMessageId() + '\'' + + ", exceptionErrorMessageParameters=" + Arrays.toString(getExceptionErrorMessageParameters()) + + ", exceptionSystemAction='" + getExceptionSystemAction() + '\'' + + ", exceptionUserAction='" + getExceptionUserAction() + '\'' + + ", exceptionProperties=" + getExceptionProperties() + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (!(objectToCompare instanceof PersonRoleListResponse)) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + PersonRoleListResponse that = (PersonRoleListResponse) objectToCompare; + return Objects.equals(getElements(), that.getElements()); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), elements); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/PersonRoleRequestBody.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/PersonRoleRequestBody.java new file mode 100644 index 00000000000..893eadcefcb --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/PersonRoleRequestBody.java @@ -0,0 +1,126 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.PersonRoleProperties; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * PersonRoleRequestBody provides the request body payload for working on PersonRole entities. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class PersonRoleRequestBody extends ExternalSourceRequestBody +{ + private static final long serialVersionUID = 1L; + + private PersonRoleProperties properties = null; + + + /** + * Default constructor + */ + public PersonRoleRequestBody() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public PersonRoleRequestBody(PersonRoleRequestBody template) + { + super(template); + + if (template != null) + { + properties = template.getProperties(); + } + } + + + /** + * Return the properties for this person role. + * + * @return properties bean + */ + public PersonRoleProperties getProperties() + { + return properties; + } + + + /** + * Set up the properties for this person role. + * + * @param properties properties bean + */ + public void setProperties(PersonRoleProperties properties) + { + this.properties = properties; + } + + + /** + * JSON-style toString. + * + * @return list of properties and their values. + */ + @Override + public String toString() + { + return "PersonRoleRequestBody{" + + "properties=" + properties + + ", externalSourceGUID='" + getExternalSourceGUID() + '\'' + + ", externalSourceName='" + getExternalSourceName() + '\'' + + '}'; + } + + + /** + * Equals method that returns true if containing properties are the same. + * + * @param objectToCompare object to compare + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + PersonRoleRequestBody that = (PersonRoleRequestBody) objectToCompare; + return Objects.equals(properties, that.properties); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), properties); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/PersonRoleResponse.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/PersonRoleResponse.java new file mode 100644 index 00000000000..3e38bb160fd --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/PersonRoleResponse.java @@ -0,0 +1,138 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.PersonRoleElement; + +import java.util.Arrays; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + + +/** + * PersonRoleResponse is the response structure used on the OMAS REST API calls that return a + * PersonRoleElement object as a response. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class PersonRoleResponse extends ProjectManagementOMASAPIResponse +{ + private static final long serialVersionUID = 1L; + + private PersonRoleElement element = null; + + + /** + * Default constructor + */ + public PersonRoleResponse() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public PersonRoleResponse(PersonRoleResponse template) + { + super(template); + + if (template != null) + { + this.element = template.getElement(); + } + } + + + /** + * Return the element result. + * + * @return details of person role + */ + public PersonRoleElement getElement() + { + return element; + } + + + /** + * Set up the element result. + * + * @param element details of person role + */ + public void setElement(PersonRoleElement element) + { + this.element = element; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "PersonRoleResponse{" + + "element=" + element + + ", exceptionClassName='" + getExceptionClassName() + '\'' + + ", exceptionCausedBy='" + getExceptionCausedBy() + '\'' + + ", actionDescription='" + getActionDescription() + '\'' + + ", relatedHTTPCode=" + getRelatedHTTPCode() + + ", exceptionErrorMessage='" + getExceptionErrorMessage() + '\'' + + ", exceptionErrorMessageId='" + getExceptionErrorMessageId() + '\'' + + ", exceptionErrorMessageParameters=" + Arrays.toString(getExceptionErrorMessageParameters()) + + ", exceptionSystemAction='" + getExceptionSystemAction() + '\'' + + ", exceptionUserAction='" + getExceptionUserAction() + '\'' + + ", exceptionProperties=" + getExceptionProperties() + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (!(objectToCompare instanceof PersonRoleResponse)) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + PersonRoleResponse that = (PersonRoleResponse) objectToCompare; + return Objects.equals(element, that.element); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), element); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/ProjectListResponse.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/ProjectListResponse.java new file mode 100644 index 00000000000..e63ba458410 --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/ProjectListResponse.java @@ -0,0 +1,150 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.ProjectElement; + +import java.util.Arrays; +import java.util.List; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + + +/** + * ProjectListResponse is the response structure used on the OMAS REST API calls that return + * a list of project elements. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ProjectListResponse extends ProjectManagementOMASAPIResponse +{ + private static final long serialVersionUID = 1L; + + private List elements = null; + + + /** + * Default constructor + */ + public ProjectListResponse() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ProjectListResponse(ProjectListResponse template) + { + super(template); + + if (template != null) + { + this.elements = template.getElements(); + } + } + + + /** + * Return the project result. + * + * @return unique identifier + */ + public List getElements() + { + if (elements == null) + { + return null; + } + else if (elements.isEmpty()) + { + return null; + } + else + { + return elements; + } + } + + + /** + * Set up the project result. + * + * @param elements - unique identifier + */ + public void setElements(List elements) + { + this.elements = elements; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ProjectListResponse{" + + "elements=" + elements + + ", exceptionClassName='" + getExceptionClassName() + '\'' + + ", exceptionCausedBy='" + getExceptionCausedBy() + '\'' + + ", actionDescription='" + getActionDescription() + '\'' + + ", relatedHTTPCode=" + getRelatedHTTPCode() + + ", exceptionErrorMessage='" + getExceptionErrorMessage() + '\'' + + ", exceptionErrorMessageId='" + getExceptionErrorMessageId() + '\'' + + ", exceptionErrorMessageParameters=" + Arrays.toString(getExceptionErrorMessageParameters()) + + ", exceptionSystemAction='" + getExceptionSystemAction() + '\'' + + ", exceptionUserAction='" + getExceptionUserAction() + '\'' + + ", exceptionProperties=" + getExceptionProperties() + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (!(objectToCompare instanceof ProjectListResponse)) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + ProjectListResponse that = (ProjectListResponse) objectToCompare; + return Objects.equals(getElements(), that.getElements()); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), elements); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/ProjectManagementOMASAPIRequestBody.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/ProjectManagementOMASAPIRequestBody.java new file mode 100644 index 00000000000..a4d61785096 --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/ProjectManagementOMASAPIRequestBody.java @@ -0,0 +1,61 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.projectmanagement.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ProjectManagementOMASAPIRequestBody provides a common header for Community Profile OMAS request bodies for its REST API. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "class") +@JsonSubTypes( + { + @JsonSubTypes.Type(value = ExternalSourceRequestBody.class, name = "ExternalSourceRequestBody"), + }) +public abstract class ProjectManagementOMASAPIRequestBody implements java.io.Serializable +{ + private static final long serialVersionUID = 1L; + + + /** + * Default constructor + */ + public ProjectManagementOMASAPIRequestBody() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ProjectManagementOMASAPIRequestBody(ProjectManagementOMASAPIRequestBody template) + { + } + + + /** + * JSON-like toString + * + * @return string containing the class name + */ + @Override + public String toString() + { + return "CommunityProfileOMASAPIRequestBody{}"; + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/ProjectResponse.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/ProjectResponse.java new file mode 100644 index 00000000000..725ffe19b36 --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/ProjectResponse.java @@ -0,0 +1,138 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.ProjectElement; + +import java.util.Arrays; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + + +/** + * ProjectResponse is the response structure used on the OMAS REST API calls that return a + * ProjectElement object as a response. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ProjectResponse extends ProjectManagementOMASAPIResponse +{ + private static final long serialVersionUID = 1L; + + private ProjectElement element = null; + + + /** + * Default constructor + */ + public ProjectResponse() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ProjectResponse(ProjectResponse template) + { + super(template); + + if (template != null) + { + this.element = template.getElement(); + } + } + + + /** + * Return the element result. + * + * @return details of person role + */ + public ProjectElement getElement() + { + return element; + } + + + /** + * Set up the element result. + * + * @param element details of person role + */ + public void setElement(ProjectElement element) + { + this.element = element; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ProjectResponse{" + + "element=" + element + + ", exceptionClassName='" + getExceptionClassName() + '\'' + + ", exceptionCausedBy='" + getExceptionCausedBy() + '\'' + + ", actionDescription='" + getActionDescription() + '\'' + + ", relatedHTTPCode=" + getRelatedHTTPCode() + + ", exceptionErrorMessage='" + getExceptionErrorMessage() + '\'' + + ", exceptionErrorMessageId='" + getExceptionErrorMessageId() + '\'' + + ", exceptionErrorMessageParameters=" + Arrays.toString(getExceptionErrorMessageParameters()) + + ", exceptionSystemAction='" + getExceptionSystemAction() + '\'' + + ", exceptionUserAction='" + getExceptionUserAction() + '\'' + + ", exceptionProperties=" + getExceptionProperties() + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (!(objectToCompare instanceof ProjectResponse)) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + ProjectResponse that = (ProjectResponse) objectToCompare; + return Objects.equals(element, that.element); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), element); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/ReferenceableRequestBody.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/ReferenceableRequestBody.java new file mode 100644 index 00000000000..10e9baa6a7a --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/ReferenceableRequestBody.java @@ -0,0 +1,129 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.rest; + + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.ReferenceableProperties; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + + +/** + * RelationshipRequestBody describes the request body used when linking elements together. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ReferenceableRequestBody extends ExternalSourceRequestBody +{ + private static final long serialVersionUID = 1L; + + private ReferenceableProperties properties = null; + + + /** + * Default constructor + */ + public ReferenceableRequestBody() + { + super(); + } + + + /** + * Copy/clone constructor. + * + * @param template object to copy + */ + public ReferenceableRequestBody(ReferenceableRequestBody template) + { + super(template); + + if (template != null) + { + properties = template.getProperties(); + } + } + + + /** + * Return the properties for the relationship. + * + * @return properties object + */ + public ReferenceableProperties getProperties() + { + return properties; + } + + + /** + * Set up the properties for the relationship. + * + * @param properties properties object + */ + public void setProperties(ReferenceableProperties properties) + { + this.properties = properties; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ReferenceableRequestBody{" + + "externalSourceGUID='" + getExternalSourceGUID() + '\'' + + ", externalSourceName='" + getExternalSourceName() + '\'' + + ", properties=" + properties + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + ReferenceableRequestBody that = (ReferenceableRequestBody) objectToCompare; + return Objects.equals(getProperties(), that.getProperties()); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), properties); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/RelatedElementListResponse.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/RelatedElementListResponse.java new file mode 100644 index 00000000000..9d21ea721dd --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/RelatedElementListResponse.java @@ -0,0 +1,148 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.projectmanagement.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.RelatedElement; + +import java.util.Arrays; +import java.util.List; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * RelatedElementListResponse is a response object for passing back a list of relatedElement objects. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class RelatedElementListResponse extends ProjectManagementOMASAPIResponse +{ + private static final long serialVersionUID = 1L; + + private List elements = null; + + + /** + * Default constructor + */ + public RelatedElementListResponse() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public RelatedElementListResponse(RelatedElementListResponse template) + { + super(template); + + if (template != null) + { + elements = template.getElements(); + } + } + + + /** + * Return the list of metadata elements. + * + * @return result object + */ + public List getElements() + { + if (elements == null) + { + return null; + } + else if (elements.isEmpty()) + { + return null; + } + else + { + return elements; + } + } + + + /** + * Set up the list of metadata elements to return. + * + * @param elements result object + */ + public void setElements(List elements) + { + this.elements = elements; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "RelatedElementListResponse{" + + "element=" + elements + + ", exceptionClassName='" + getExceptionClassName() + '\'' + + ", exceptionCausedBy='" + getExceptionCausedBy() + '\'' + + ", actionDescription='" + getActionDescription() + '\'' + + ", relatedHTTPCode=" + getRelatedHTTPCode() + + ", exceptionErrorMessage='" + getExceptionErrorMessage() + '\'' + + ", exceptionErrorMessageId='" + getExceptionErrorMessageId() + '\'' + + ", exceptionErrorMessageParameters=" + Arrays.toString(getExceptionErrorMessageParameters()) + + ", exceptionSystemAction='" + getExceptionSystemAction() + '\'' + + ", exceptionUserAction='" + getExceptionUserAction() + '\'' + + ", exceptionProperties=" + getExceptionProperties() + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + RelatedElementListResponse that = (RelatedElementListResponse) objectToCompare; + return Objects.equals(elements, that.elements); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), elements); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/RelationshipElementResponse.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/RelationshipElementResponse.java new file mode 100644 index 00000000000..9d5b6511dbc --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/RelationshipElementResponse.java @@ -0,0 +1,139 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.projectmanagement.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.RelationshipElement; + +import java.util.Arrays; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + + +/** + * RelationshipElementResponse is the response structure used on the OMAS REST API calls that return the properties + * for a relationship. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class RelationshipElementResponse extends ProjectManagementOMASAPIResponse +{ + private static final long serialVersionUID = 1L; + + private RelationshipElement element = null; + + + /** + * Default constructor + */ + public RelationshipElementResponse() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public RelationshipElementResponse(RelationshipElementResponse template) + { + super(template); + + if (template != null) + { + this.element = template.getElement(); + } + } + + + /** + * Return the element result. + * + * @return bean + */ + public RelationshipElement getElement() + { + return element; + } + + + /** + * Set up the element result. + * + * @param element bean + */ + public void setElement(RelationshipElement element) + { + this.element = element; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "RelationshipElementResponse{" + + "element=" + element + + ", exceptionClassName='" + getExceptionClassName() + '\'' + + ", exceptionCausedBy='" + getExceptionCausedBy() + '\'' + + ", actionDescription='" + getActionDescription() + '\'' + + ", relatedHTTPCode=" + getRelatedHTTPCode() + + ", exceptionErrorMessage='" + getExceptionErrorMessage() + '\'' + + ", exceptionErrorMessageId='" + getExceptionErrorMessageId() + '\'' + + ", exceptionErrorMessageParameters=" + Arrays.toString(getExceptionErrorMessageParameters()) + + ", exceptionSystemAction='" + getExceptionSystemAction() + '\'' + + ", exceptionUserAction='" + getExceptionUserAction() + '\'' + + ", exceptionProperties=" + getExceptionProperties() + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (!(objectToCompare instanceof RelationshipElementResponse)) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + RelationshipElementResponse that = (RelationshipElementResponse) objectToCompare; + return Objects.equals(element, that.element); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(element); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/RelationshipElementsResponse.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/RelationshipElementsResponse.java new file mode 100644 index 00000000000..1eb858d6308 --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/RelationshipElementsResponse.java @@ -0,0 +1,150 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.projectmanagement.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.RelationshipElement; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * RelationshipElementsResponse is a response object for passing back a list of relationships + * or an exception if the request failed. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class RelationshipElementsResponse extends ProjectManagementOMASAPIResponse +{ + private static final long serialVersionUID = 1L; + + private List elementList = null; + + + /** + * Default constructor + */ + public RelationshipElementsResponse() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public RelationshipElementsResponse(RelationshipElementsResponse template) + { + super(template); + + if (template != null) + { + elementList = template.getElementList(); + } + } + + + /** + * Return the list of metadata elements. + * + * @return result object + */ + public List getElementList() + { + if (elementList == null) + { + return null; + } + else if (elementList.isEmpty()) + { + return null; + } + else + { + return new ArrayList<>(elementList); + } + } + + + /** + * Set up the metadata element to return. + * + * @param elementList result object + */ + public void setElementList(List elementList) + { + this.elementList = elementList; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "RelationshipElementsResponse{" + + "elementList=" + elementList + + ", exceptionClassName='" + getExceptionClassName() + '\'' + + ", exceptionCausedBy='" + getExceptionCausedBy() + '\'' + + ", actionDescription='" + getActionDescription() + '\'' + + ", relatedHTTPCode=" + getRelatedHTTPCode() + + ", exceptionErrorMessage='" + getExceptionErrorMessage() + '\'' + + ", exceptionErrorMessageId='" + getExceptionErrorMessageId() + '\'' + + ", exceptionErrorMessageParameters=" + Arrays.toString(getExceptionErrorMessageParameters()) + + ", exceptionSystemAction='" + getExceptionSystemAction() + '\'' + + ", exceptionUserAction='" + getExceptionUserAction() + '\'' + + ", exceptionProperties=" + getExceptionProperties() + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + RelationshipElementsResponse that = (RelationshipElementsResponse) objectToCompare; + return Objects.equals(elementList, that.elementList); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), elementList); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/RelationshipRequestBody.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/RelationshipRequestBody.java new file mode 100644 index 00000000000..9fb19345672 --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/RelationshipRequestBody.java @@ -0,0 +1,129 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.rest; + + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.RelationshipProperties; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + + +/** + * RelationshipRequestBody describes the request body used when linking elements together. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class RelationshipRequestBody extends ExternalSourceRequestBody +{ + private static final long serialVersionUID = 1L; + + private RelationshipProperties properties = null; + + + /** + * Default constructor + */ + public RelationshipRequestBody() + { + super(); + } + + + /** + * Copy/clone constructor. + * + * @param template object to copy + */ + public RelationshipRequestBody(RelationshipRequestBody template) + { + super(template); + + if (template != null) + { + properties = template.getProperties(); + } + } + + + /** + * Return the properties for the relationship. + * + * @return properties object + */ + public RelationshipProperties getProperties() + { + return properties; + } + + + /** + * Set up the properties for the relationship. + * + * @param properties properties object + */ + public void setProperties(RelationshipProperties properties) + { + this.properties = properties; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "RelationshipRequestBody{" + + "externalSourceGUID='" + getExternalSourceGUID() + '\'' + + ", externalSourceName='" + getExternalSourceName() + '\'' + + ", properties=" + properties + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + RelationshipRequestBody that = (RelationshipRequestBody) objectToCompare; + return Objects.equals(getProperties(), that.getProperties()); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), properties); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/TemplateRequestBody.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/TemplateRequestBody.java new file mode 100644 index 00000000000..0473bd9662f --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/rest/TemplateRequestBody.java @@ -0,0 +1,165 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.TemplateProperties; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * TemplateRequestBody carries the parameters for creating a new asset using a template. + * The external source identifiers indicate whether the new asset should be created as an external element or not. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class TemplateRequestBody extends TemplateProperties +{ + private static final long serialVersionUID = 1L; + + private String externalSourceGUID = null; + private String externalSourceName = null; + + + /** + * Default constructor + */ + public TemplateRequestBody() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public TemplateRequestBody(TemplateRequestBody template) + { + super(template); + + if (template != null) + { + externalSourceGUID = template.getExternalSourceGUID(); + externalSourceName = template.getExternalSourceName(); + } + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public TemplateRequestBody(TemplateProperties template) + { + super(template); + } + + + /** + * Return the unique identifier of the software server capability entity that represented the external source - null for local. + * + * @return string guid + */ + public String getExternalSourceGUID() + { + return externalSourceGUID; + } + + + /** + * Set up the unique identifier of the software server capability entity that represented the external source - null for local. + * + * @param externalSourceGUID string guid + */ + public void setExternalSourceGUID(String externalSourceGUID) + { + this.externalSourceGUID = externalSourceGUID; + } + + + /** + * Return the unique name of the software server capability entity that represented the external source. + * + * @return string name + */ + public String getExternalSourceName() + { + return externalSourceName; + } + + + /** + * Set up the unique name of the software server capability entity that represented the external source. + * + * @param externalSourceName string name + */ + public void setExternalSourceName(String externalSourceName) + { + this.externalSourceName = externalSourceName; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "TemplateRequestBody{" + + "externalSourceGUID='" + externalSourceGUID + '\'' + + ", externalSourceName='" + externalSourceName + '\'' + + ", qualifiedName='" + getQualifiedName() + '\'' + + ", displayName='" + getDisplayName() + '\'' + + ", description='" + getDescription() + '\'' + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + TemplateRequestBody that = (TemplateRequestBody) objectToCompare; + return Objects.equals(externalSourceGUID, that.externalSourceGUID) && + Objects.equals(externalSourceName, that.externalSourceName); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), externalSourceGUID, externalSourceName); + } +} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/project-management/project-management-client/build.gradle b/open-metadata-implementation/access-services/project-management/project-management-client/build.gradle index 78048b16c96..450ffe403e3 100644 --- a/open-metadata-implementation/access-services/project-management/project-management-client/build.gradle +++ b/open-metadata-implementation/access-services/project-management/project-management-client/build.gradle @@ -6,6 +6,19 @@ description = 'Project Management OMAS Client' + +dependencies { + implementation project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-api') + implementation project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-client') + implementation project(':open-metadata-implementation:repository-services:repository-services-apis') + implementation project(':open-metadata-implementation:access-services:project-management:project-management-api') + implementation project(':open-metadata-implementation:frameworks:audit-log-framework') + implementation project(':open-metadata-implementation:frameworks:open-connector-framework') + implementation project(':open-metadata-implementation:common-services:ffdc-services') + implementation 'org.springframework:spring-core' + compileOnly 'com.fasterxml.jackson.core:jackson-annotations' + +} java { withJavadocJar() } diff --git a/open-metadata-implementation/access-services/project-management/project-management-client/pom.xml b/open-metadata-implementation/access-services/project-management/project-management-client/pom.xml index 6e7bc098994..caf8ea550a4 100644 --- a/open-metadata-implementation/access-services/project-management/project-management-client/pom.xml +++ b/open-metadata-implementation/access-services/project-management/project-management-client/pom.xml @@ -18,7 +18,7 @@ scm:git:git://github.com/odpi/egeria.git scm:git:ssh://github.com/odpi/egeria.git - http://github.com/odpi/egeria/tree/master + https://github.com/odpi/egeria/tree/master Project Management OMAS Client @@ -30,6 +30,26 @@ + + org.odpi.egeria + project-management-api + + + + org.odpi.egeria + audit-log-framework + + + + org.odpi.egeria + open-connector-framework + + + + org.odpi.egeria + ffdc-services + + diff --git a/open-metadata-implementation/access-services/project-management/project-management-client/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/client/ProjectManagement.java b/open-metadata-implementation/access-services/project-management/project-management-client/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/client/ProjectManagement.java new file mode 100644 index 00000000000..5bb72f0a4c7 --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-client/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/client/ProjectManagement.java @@ -0,0 +1,655 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.client; + +import org.odpi.openmetadata.accessservices.projectmanagement.api.ProjectsInterface; +import org.odpi.openmetadata.accessservices.projectmanagement.client.rest.ProjectManagementRESTClient; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.ActorProfileElement; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.ProjectElement; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.PersonRoleElement; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.ProjectProperties; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.ProjectTeamProperties; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.TemplateProperties; +import org.odpi.openmetadata.accessservices.projectmanagement.rest.ActorProfileListResponse; +import org.odpi.openmetadata.accessservices.projectmanagement.rest.ProjectResponse; +import org.odpi.openmetadata.accessservices.projectmanagement.rest.ProjectListResponse; +import org.odpi.openmetadata.accessservices.projectmanagement.rest.PersonRoleListResponse; +import org.odpi.openmetadata.commonservices.ffdc.rest.NameRequestBody; +import org.odpi.openmetadata.commonservices.ffdc.rest.SearchStringRequestBody; +import org.odpi.openmetadata.frameworks.auditlog.AuditLog; +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; + +import java.util.List; + +/** + * ProjectManagerClient supports the APIs to maintain projects and their related objects. + */ +public class ProjectManagement extends ProjectManagementBaseClient implements ProjectsInterface +{ + private static final String projectURLTemplatePrefix = "/servers/{0}/open-metadata/access-services/project-profile/users/{1}/projects"; + + + /** + * Create a new client with no authentication embedded in the HTTP request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @param auditLog logging destination + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public ProjectManagement(String serverName, + String serverPlatformURLRoot, + AuditLog auditLog) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot, auditLog); + } + + + /** + * Create a new client with no authentication embedded in the HTTP request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public ProjectManagement(String serverName, + String serverPlatformURLRoot) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot); + } + + + /** + * Create a new client that passes userId and password in each HTTP request. This is the + * userId/password of the calling server. The end user's userId is sent on each request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @param userId caller's userId embedded in all HTTP requests + * @param password caller's userId embedded in all HTTP requests + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public ProjectManagement(String serverName, + String serverPlatformURLRoot, + String userId, + String password) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot, userId, password); + } + + + /** + * Create a new client that passes userId and password in each HTTP request. This is the + * userId/password of the calling server. The end user's userId is sent on each request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @param userId caller's userId embedded in all HTTP requests + * @param password caller's userId embedded in all HTTP requests + * @param auditLog logging destination + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public ProjectManagement(String serverName, + String serverPlatformURLRoot, + String userId, + String password, + AuditLog auditLog) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot, userId, password, auditLog); + } + + + /** + * Create a new client that is going to be used in an OMAG Server. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @param restClient client that issues the REST API calls + * @param maxPageSize maximum number of results supported by this server + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public ProjectManagement(String serverName, + String serverPlatformURLRoot, + ProjectManagementRESTClient restClient, + int maxPageSize) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot, restClient, maxPageSize); + } + + + /* ===================================================================================================================== + * A Project is the top level object for working with connectors + */ + + /** + * Create a new metadata element to represent a project. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param projectProperties properties about the project to store + * + * @return unique identifier of the new project + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public String createProject(String userId, + String externalSourceGUID, + String externalSourceName, + ProjectProperties projectProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "createProject"; + final String propertiesParameterName = "projectProperties"; + final String urlTemplate = serverPlatformURLRoot + projectURLTemplatePrefix; + + return super.createReferenceable(userId, externalSourceGUID, externalSourceName, projectProperties, propertiesParameterName, urlTemplate, methodName); + } + + + /** + * Create a new metadata element to represent a project using an existing metadata element as a template. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param templateGUID unique identifier of the metadata element to copy + * @param templateProperties properties that override the template + * + * @return unique identifier of the new project + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public String createProjectFromTemplate(String userId, + String externalSourceGUID, + String externalSourceName, + String templateGUID, + TemplateProperties templateProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "createProjectFromTemplate"; + final String urlTemplate = serverPlatformURLRoot + projectURLTemplatePrefix + "/from-template/{2}"; + + return super.createReferenceableFromTemplate(userId, externalSourceGUID, externalSourceName, templateGUID, templateProperties, urlTemplate, methodName); + } + + + /** + * Update the metadata element representing a project. It is possible to use the subtype property classes or + * set up specialized properties in extended properties. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param projectGUID unique identifier of the metadata element to update + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param projectProperties new properties for the metadata element + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void updateProject(String userId, + String externalSourceGUID, + String externalSourceName, + String projectGUID, + boolean isMergeUpdate, + ProjectProperties projectProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "updateProject"; + final String elementGUIDParameterName = "projectGUID"; + final String propertiesParameterName = "projectProperties"; + final String urlTemplate = serverPlatformURLRoot + projectURLTemplatePrefix + "/{2}?isMergeUpdate={3}"; + + super.updateReferenceable(userId, externalSourceGUID, externalSourceName, projectGUID, elementGUIDParameterName, isMergeUpdate, projectProperties, propertiesParameterName, urlTemplate, methodName); + } + + + /** + * Create a membership relationship between a project and a person role to show that anyone appointed to the role is a member of the project. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param projectGUID unique identifier of the project in the external data manager + * @param personRoleGUID unique identifier of the person role in the external data manager + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void setupProjectManagementRole(String userId, + String externalSourceGUID, + String externalSourceName, + String projectGUID, + String personRoleGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "setupProjectRole"; + final String projectGUIDParameterName = "projectGUID"; + final String personRoleGUIDParameterName = "personRoleGUID"; + + final String urlTemplate = serverPlatformURLRoot + projectURLTemplatePrefix + "/{2}/project-management-roles/{3}"; + + super.setupRelationship(userId, externalSourceGUID, externalSourceName, projectGUID, projectGUIDParameterName, null, personRoleGUID, personRoleGUIDParameterName, urlTemplate, methodName); + } + + + /** + * Remove a membership relationship between a project and a person role. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param projectGUID unique identifier of the project in the external data manager + * @param personRoleGUID unique identifier of the person role in the external data manager + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void clearProjectManagementRole(String userId, + String externalSourceGUID, + String externalSourceName, + String projectGUID, + String personRoleGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "clearProjectRole"; + final String projectGUIDParameterName = "projectGUID"; + final String personRoleGUIDParameterName = "personRoleGUID"; + final String urlTemplate = serverPlatformURLRoot + projectURLTemplatePrefix + "/{2}/project-management-roles/{3}/delete"; + + super.clearRelationship(userId, + externalSourceGUID, + externalSourceName, + projectGUID, + projectGUIDParameterName, + personRoleGUID, + personRoleGUIDParameterName, + urlTemplate, + methodName); + } + + + + /** + * Create a project team relationship between a project and a person role to show that anyone appointed to the role is a member of the project. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param projectGUID unique identifier of the project + * @param properties describes the permissions that the role has in the project + * @param actorProfileGUID unique identifier of the person role + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void setupProjectTeam(String userId, + String externalSourceGUID, + String externalSourceName, + String projectGUID, + ProjectTeamProperties properties, + String actorProfileGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "setupProjectRole"; + final String projectGUIDParameterName = "projectGUID"; + final String personRoleGUIDParameterName = "personRoleGUID"; + + final String urlTemplate = serverPlatformURLRoot + projectURLTemplatePrefix + "/{2}/project-teams/{3}"; + + super.setupRelationship(userId, externalSourceGUID, externalSourceName, projectGUID, projectGUIDParameterName, properties, actorProfileGUID, personRoleGUIDParameterName, urlTemplate, methodName); + } + + + /** + * Remove a membership relationship between a project and a person role. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param projectGUID unique identifier of the project in the external data manager + * @param actorProfileGUID unique identifier of the person role in the external data manager + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void clearProjectTeam(String userId, + String externalSourceGUID, + String externalSourceName, + String projectGUID, + String actorProfileGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "clearProjectRole"; + final String projectGUIDParameterName = "projectGUID"; + final String personRoleGUIDParameterName = "personRoleGUID"; + final String urlTemplate = serverPlatformURLRoot + projectURLTemplatePrefix + "/{2}/project-teams/{3}/delete"; + + super.clearRelationship(userId, + externalSourceGUID, + externalSourceName, + projectGUID, + projectGUIDParameterName, + actorProfileGUID, + personRoleGUIDParameterName, + urlTemplate, + methodName); + } + + + /** + * Remove the metadata element representing a project. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param projectGUID unique identifier of the metadata element to remove + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void removeProject(String userId, + String externalSourceGUID, + String externalSourceName, + String projectGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "removeProject"; + final String elementGUIDParameterName = "projectGUID"; + final String urlTemplate = serverPlatformURLRoot + projectURLTemplatePrefix + "/{2}/delete"; + + super.removeReferenceable(userId, externalSourceGUID, externalSourceName, projectGUID, elementGUIDParameterName, urlTemplate, methodName); + } + + + /** + * Retrieve the list of metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param userId calling user + * @param searchString string to find in the properties + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public List findProjects(String userId, + String searchString, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "findProject"; + final String searchStringParameterName = "searchString"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateSearchString(searchString, searchStringParameterName, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = serverPlatformURLRoot + projectURLTemplatePrefix + "/by-search-string?startFrom={2}&pageSize={3}"; + + SearchStringRequestBody requestBody = new SearchStringRequestBody(); + + requestBody.setSearchString(searchString); + requestBody.setSearchStringParameterName(searchStringParameterName); + + ProjectListResponse restResult = restClient.callProjectListPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + startFrom, + validatedPageSize); + + return restResult.getElements(); + } + + + /** + * Retrieve the list of metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param userId calling user + * @param name name to search for + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public List getProjectsByName(String userId, + String name, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getProjectByName"; + final String nameParameterName = "name"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateName(name, nameParameterName, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = serverPlatformURLRoot + projectURLTemplatePrefix + "/by-name?startFrom={2}&pageSize={3}"; + + NameRequestBody requestBody = new NameRequestBody(); + + requestBody.setName(name); + requestBody.setNamePropertyName(nameParameterName); + + ProjectListResponse restResult = restClient.callProjectListPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + startFrom, + validatedPageSize); + + return restResult.getElements(); + } + + + /** + * Retrieve the list of projects. + * + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public List getProjects(String userId, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getProjects"; + + invalidParameterHandler.validateUserId(userId, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = serverPlatformURLRoot + projectURLTemplatePrefix + "?startFrom={2}&pageSize={3}"; + + ProjectListResponse restResult = restClient.callProjectListGetRESTCall(methodName, + urlTemplate, + serverName, + userId, + startFrom, + validatedPageSize); + + return restResult.getElements(); + } + + + + /** + * Return information about the person roles linked to a project. + * + * @param userId calling user + * @param projectGUID unique identifier for the project + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching actor profiles (hopefully only one) + * + * @throws InvalidParameterException name or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public List getProjectManagementRoles(String userId, + String projectGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getProjectManagementRoles"; + final String guidPropertyName = "projectGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(projectGUID, guidPropertyName, methodName); + + final String urlTemplate = serverPlatformURLRoot + projectURLTemplatePrefix + "/project-managers/by-project/{2}?startFrom={3}&pageSize={4}"; + + PersonRoleListResponse restResult = restClient.callPersonRoleListGetRESTCall(methodName, + urlTemplate, + serverName, + userId, + projectGUID, + Integer.toString(startFrom), + Integer.toString(pageSize)); + + return restResult.getElements(); + } + + + /** + * Return information about the actors linked to a project. + * + * @param userId calling user + * @param projectGUID unique identifier for the project + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching actor profiles (hopefully only one) + * + * @throws InvalidParameterException name or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public List getProjectActors(String userId, + String projectGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getProjectActors"; + final String guidPropertyName = "projectGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(projectGUID, guidPropertyName, methodName); + + final String urlTemplate = serverPlatformURLRoot + projectURLTemplatePrefix + "/project-actors/by-project/{2}?startFrom={3}&pageSize={4}"; + + ActorProfileListResponse restResult = restClient.callActorProfileListGetRESTCall(methodName, + urlTemplate, + serverName, + userId, + projectGUID, + Integer.toString(startFrom), + Integer.toString(pageSize)); + + return restResult.getElements(); + } + + + /** + * Retrieve the metadata element with the supplied unique identifier. + * + * @param userId calling user + * @param projectGUID unique identifier of the requested metadata element + * + * @return requested metadata element + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public ProjectElement getProjectByGUID(String userId, + String projectGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getProjectByGUID"; + final String guidParameterName = "projectGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(projectGUID, guidParameterName, methodName); + + final String urlTemplate = serverPlatformURLRoot + projectURLTemplatePrefix + "/{2}"; + + ProjectResponse restResult = restClient.callProjectGetRESTCall(methodName, + urlTemplate, + serverName, + userId, + projectGUID); + + return restResult.getElement(); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-client/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/client/ProjectManagementBaseClient.java b/open-metadata-implementation/access-services/project-management/project-management-client/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/client/ProjectManagementBaseClient.java new file mode 100644 index 00000000000..7ea6b9581a2 --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-client/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/client/ProjectManagementBaseClient.java @@ -0,0 +1,1171 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.client; + +import org.odpi.openmetadata.accessservices.projectmanagement.api.RelatedElementsInterface; +import org.odpi.openmetadata.accessservices.projectmanagement.client.rest.ProjectManagementRESTClient; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.RelatedElement; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.AssignmentScopeProperties; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.ClassificationProperties; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.ReferenceableProperties; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.RelationshipProperties; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.ResourceListProperties; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.StakeholderProperties; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.TemplateProperties; +import org.odpi.openmetadata.accessservices.projectmanagement.rest.ClassificationRequestBody; +import org.odpi.openmetadata.accessservices.projectmanagement.rest.RelatedElementListResponse; +import org.odpi.openmetadata.accessservices.projectmanagement.rest.ExternalSourceRequestBody; +import org.odpi.openmetadata.accessservices.projectmanagement.rest.ReferenceableRequestBody; +import org.odpi.openmetadata.accessservices.projectmanagement.rest.RelationshipRequestBody; +import org.odpi.openmetadata.accessservices.projectmanagement.rest.TemplateRequestBody; +import org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler; +import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDResponse; +import org.odpi.openmetadata.frameworks.auditlog.AuditLog; +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; + +import java.util.List; + +/** + * ProjectManagementBaseClient supports the common properties and functions for the Community Profile OMAS. + */ +public class ProjectManagementBaseClient implements RelatedElementsInterface +{ + final String serverName; /* Initialized in constructor */ + final String serverPlatformURLRoot; /* Initialized in constructor */ + + final InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); + final ProjectManagementRESTClient restClient; /* Initialized in constructor */ + + private static final String elementsURLTemplatePrefix = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/related-elements"; + + + /** + * Create a new client with no authentication embedded in the HTTP request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @param auditLog logging destination + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public ProjectManagementBaseClient(String serverName, + String serverPlatformURLRoot, + AuditLog auditLog) throws InvalidParameterException + { + final String methodName = "Client Constructor"; + + invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); + + this.serverName = serverName; + this.serverPlatformURLRoot = serverPlatformURLRoot; + + this.restClient = new ProjectManagementRESTClient(serverName, serverPlatformURLRoot, auditLog); + } + + + /** + * Create a new client with no authentication embedded in the HTTP request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public ProjectManagementBaseClient(String serverName, + String serverPlatformURLRoot) throws InvalidParameterException + { + final String methodName = "Client Constructor"; + + invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); + + this.serverName = serverName; + this.serverPlatformURLRoot = serverPlatformURLRoot; + + this.restClient = new ProjectManagementRESTClient(serverName, serverPlatformURLRoot); + } + + + /** + * Create a new client that passes userId and password in each HTTP request. This is the + * userId/password of the calling server. The end user's userId is sent on each request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @param userId caller's userId embedded in all HTTP requests + * @param password caller's userId embedded in all HTTP requests + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public ProjectManagementBaseClient(String serverName, + String serverPlatformURLRoot, + String userId, + String password) throws InvalidParameterException + { + final String methodName = "Client Constructor"; + + invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); + + this.serverName = serverName; + this.serverPlatformURLRoot = serverPlatformURLRoot; + + this.restClient = new ProjectManagementRESTClient(serverName, serverPlatformURLRoot, userId, password); + } + + + /** + * Create a new client that passes userId and password in each HTTP request. This is the + * userId/password of the calling server. The end user's userId is sent on each request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @param userId caller's userId embedded in all HTTP requests + * @param password caller's userId embedded in all HTTP requests + * @param auditLog logging destination + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public ProjectManagementBaseClient(String serverName, + String serverPlatformURLRoot, + String userId, + String password, + AuditLog auditLog) throws InvalidParameterException + { + final String methodName = "Client Constructor"; + + invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); + + this.serverName = serverName; + this.serverPlatformURLRoot = serverPlatformURLRoot; + + this.restClient = new ProjectManagementRESTClient(serverName, serverPlatformURLRoot, userId, password, auditLog); + } + + + /** + * Create a new client that is going to be used in an OMAG Server. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @param restClient client that issues the REST API calls + * @param maxPageSize maximum number of results supported by this server + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public ProjectManagementBaseClient(String serverName, + String serverPlatformURLRoot, + ProjectManagementRESTClient restClient, + int maxPageSize) throws InvalidParameterException + { + final String methodName = "Client Constructor"; + + invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); + + this.serverName = serverName; + this.serverPlatformURLRoot = serverPlatformURLRoot; + + invalidParameterHandler.setMaxPagingSize(maxPageSize); + + this.restClient = restClient; + } + + + /* ===================================================================================================================== + * Basic client methods + */ + + + /** + * Create a new metadata element. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param properties properties about the element to store + * @param propertiesParameterName name of parameter passing the properties + * @param urlTemplate URL to call (no expected placeholders) + * @param methodName calling method + * + * @return unique identifier of the new element + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + String createReferenceable(String userId, + String externalSourceGUID, + String externalSourceName, + ReferenceableProperties properties, + String propertiesParameterName, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String qualifiedNameParameterName = "qualifiedName"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateObject(properties, propertiesParameterName, methodName); + invalidParameterHandler.validateName(properties.getQualifiedName(), qualifiedNameParameterName, methodName); + + ReferenceableRequestBody requestBody = new ReferenceableRequestBody(); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + requestBody.setProperties(properties); + + GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId); + + return restResult.getGUID(); + } + + + /** + * Create a new metadata element to represent a community using an existing metadata element as a template. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param templateGUID unique identifier of the metadata element to copy + * @param templateProperties properties that override the template + * @param urlTemplate URL to call (with placeholders) + * @param methodName calling method + * + * @return unique identifier of the new community + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + String createReferenceableFromTemplate(String userId, + String externalSourceGUID, + String externalSourceName, + String templateGUID, + TemplateProperties templateProperties, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String templateGUIDParameterName = "templateGUID"; + final String propertiesParameterName = "templateProperties"; + final String qualifiedNameParameterName = "qualifiedName"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(templateGUID, templateGUIDParameterName, methodName); + invalidParameterHandler.validateObject(templateProperties, propertiesParameterName, methodName); + invalidParameterHandler.validateName(templateProperties.getQualifiedName(), qualifiedNameParameterName, methodName); + + TemplateRequestBody requestBody = new TemplateRequestBody(templateProperties); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + + GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + templateGUID); + + return restResult.getGUID(); + } + + + /** + * Update the metadata element. It is possible to use the subtype property classes or + * set up specialized properties in extended properties. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the metadata element to update + * @param elementGUIDParameterName name of parameter passing the elementGUID + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param properties new properties for the metadata element + * @param propertiesParameterName name of parameter passing the properties + * @param urlTemplate URL to call (no expected placeholders) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void updateReferenceable(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String elementGUIDParameterName, + boolean isMergeUpdate, + ReferenceableProperties properties, + String propertiesParameterName, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String qualifiedNameParameterName = "qualifiedName"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameterName, methodName); + invalidParameterHandler.validateObject(properties, propertiesParameterName, methodName); + + if (! isMergeUpdate) + { + invalidParameterHandler.validateName(properties.getQualifiedName(), qualifiedNameParameterName, methodName); + } + + ReferenceableRequestBody requestBody = new ReferenceableRequestBody(); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + requestBody.setProperties(properties); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + elementGUID, + isMergeUpdate); + } + + + /** + * Add or update classification on referenceable. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the metadata element to classify + * @param elementGUIDParameter parameter name for elementGUID + * @param properties properties of security at the site + * @param urlTemplate URL to call with placeholder for guid + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void setReferenceableClassification(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String elementGUIDParameter, + ClassificationProperties properties, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + + { + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameter, methodName); + + ClassificationRequestBody requestBody = new ClassificationRequestBody(); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + requestBody.setProperties(properties); + + restClient.callVoidPostRESTCall(methodName, + serverPlatformURLRoot + urlTemplate, + requestBody, + serverName, + userId, + elementGUID); + } + + + /** + * Remove classification from the referenceable. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the metadata element to classify + * @param elementGUIDParameter parameter name for elementGUID + * @param urlTemplate URL to call with placeholder for guid + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void removeReferenceableClassification(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String elementGUIDParameter, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + + { + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameter, methodName); + + ExternalSourceRequestBody requestBody = new ExternalSourceRequestBody(); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + + restClient.callVoidPostRESTCall(methodName, + serverPlatformURLRoot + urlTemplate, + requestBody, + serverName, + userId, + elementGUID); + } + + + /** + * Create a relationship between a primary element and a secondary element. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param primaryElementGUID unique identifier of the primary element + * @param primaryElementGUIDParameterName name of parameter passing the primaryElementGUID + * @param properties describes the properties for the relationship + * @param secondaryElementGUID unique identifier of the element to connect it to + * @param secondaryElementGUIDParameterName name of parameter passing the secondaryElementGUID + * @param urlTemplate URL to call (no expected placeholders) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void setupRelationship(String userId, + String externalSourceGUID, + String externalSourceName, + String primaryElementGUID, + String primaryElementGUIDParameterName, + RelationshipProperties properties, + String secondaryElementGUID, + String secondaryElementGUIDParameterName, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(primaryElementGUID, primaryElementGUIDParameterName, methodName); + invalidParameterHandler.validateGUID(secondaryElementGUID, secondaryElementGUIDParameterName, methodName); + + RelationshipRequestBody requestBody = new RelationshipRequestBody(); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + requestBody.setProperties(properties); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + primaryElementGUID, + secondaryElementGUID); + } + + + /** + * Remove a relationship. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param primaryElementGUID unique identifier of the primary element + * @param primaryElementGUIDParameterName name of parameter passing the primaryElementGUID + * @param secondaryElementGUID unique identifier of the element to connect it to + * @param secondaryElementGUIDParameterName name of parameter passing the secondaryElementGUID + * @param urlTemplate URL to call (no expected placeholders) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void clearRelationship(String userId, + String externalSourceGUID, + String externalSourceName, + String primaryElementGUID, + String primaryElementGUIDParameterName, + String secondaryElementGUID, + String secondaryElementGUIDParameterName, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(primaryElementGUID, primaryElementGUIDParameterName, methodName); + invalidParameterHandler.validateGUID(secondaryElementGUID, secondaryElementGUIDParameterName, methodName); + + ExternalSourceRequestBody requestBody = new ExternalSourceRequestBody(); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + primaryElementGUID, + secondaryElementGUID); + } + + + /** + * Retrieve a relationship. + * + * @param userId calling user + * @param startingElementGUID unique identifier of the primary element + * @param startingElementGUIDParameterName name of parameter passing the startingElementGUID + * @param urlTemplate URL to call (no expected placeholders) + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * @param methodName calling method + * + * @return list of related elements + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + List getRelatedElements(String userId, + String startingElementGUID, + String startingElementGUIDParameterName, + String urlTemplate, + int startFrom, + int pageSize, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(startingElementGUID, startingElementGUIDParameterName, methodName); + + RelatedElementListResponse restResult = restClient.callRelatedElementListGetRESTCall(methodName, + urlTemplate, + serverName, + userId, + startingElementGUID, + Integer.toString(startFrom), + Integer.toString(pageSize)); + + return restResult.getElements(); + } + + + /** + * Remove the metadata element. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the metadata element to remove + * @param elementGUIDParameterName name of parameter passing the elementGUID + * @param urlTemplate URL to call (no expected placeholders) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void removeReferenceable(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String elementGUIDParameterName, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameterName, methodName); + + ExternalSourceRequestBody requestBody = new ExternalSourceRequestBody(); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + elementGUID); + } + + + /** + * Create a "MoreInformation" relationship between an element that is descriptive and one that is providing the detail. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element that is descriptive + * @param properties properties of the relationship + * @param detailGUID unique identifier of the element that provides the detail + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void setupMoreInformation(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + RelationshipProperties properties, + String detailGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "setupMoreInformation"; + final String elementGUIDParameterName = "elementGUID"; + final String detailGUIDParameterName = "detailGUID"; + + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/{2}/more-information/{3}"; + + this.setupRelationship(userId, + externalSourceGUID, + externalSourceName, + elementGUID, + elementGUIDParameterName, + properties, + detailGUID, + detailGUIDParameterName, + urlTemplate, + methodName); + } + + + /** + * Remove a "MoreInformation" relationship between two referenceables. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element that is descriptive + * @param detailGUID unique identifier of the element that provides the detail + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void clearMoreInformation(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String detailGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "clearMoreInformation"; + final String elementGUIDParameterName = "elementGUID"; + final String detailGUIDParameterName = "detailGUID"; + + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/{2}/more-information/{3}/delete"; + + this.clearRelationship(userId, + externalSourceGUID, + externalSourceName, + elementGUID, + elementGUIDParameterName, + detailGUID, + detailGUIDParameterName, + urlTemplate, + methodName); + } + + + /** + * Retrieve the detail elements linked via a "MoreInformation" relationship between two referenceables. + * + * @param userId calling user + * @param elementGUID unique identifier of the element that is descriptive + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of related elements + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public List getMoreInformation(String userId, + String elementGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getMoreInformation"; + final String guidPropertyName = "elementGUID"; + + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/more-information/by-descriptive-element/{2}?startFrom={3}&pageSize={4}"; + + return this.getRelatedElements(userId, elementGUID, guidPropertyName, urlTemplate, startFrom, pageSize, methodName); + } + + + /** + * Retrieve the descriptive elements linked via a "MoreInformation" relationship between two referenceables. + * + * @param userId calling user + * @param detailGUID unique identifier of the element that provides the detail + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of related elements + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public List getDescriptiveElements(String userId, + String detailGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getDescriptiveElements"; + final String guidPropertyName = "detailGUID"; + + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/more-information/by-detail-element/{2}?startFrom={3}&pageSize={4}"; + + return this.getRelatedElements(userId, detailGUID, guidPropertyName, urlTemplate, startFrom, pageSize, methodName); + } + + + /** + * Create a "Stakeholder" relationship between an element and its stakeholder. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param properties properties of the relationship + * @param stakeholderGUID unique identifier of the stakeholder + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void setupStakeholder(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + StakeholderProperties properties, + String stakeholderGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "setupStakeholder"; + final String elementGUIDParameterName = "elementGUID"; + final String stakeholderGUIDParameterName = "stakeholderGUID"; + + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/{2}/stakeholders/{3}"; + + this.setupRelationship(userId, + externalSourceGUID, + externalSourceName, + elementGUID, + elementGUIDParameterName, + properties, + stakeholderGUID, + stakeholderGUIDParameterName, + urlTemplate, + methodName); + } + + + /** + * Remove a "Stakeholder" relationship between two referenceables. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param stakeholderGUID unique identifier of the stakeholder + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void clearStakeholder(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String stakeholderGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "clearStakeholder"; + final String elementGUIDParameterName = "elementGUID"; + final String stakeholderGUIDParameterName = "stakeholderGUID"; + + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/{2}/stakeholders/{3}/delete"; + + this.clearRelationship(userId, + externalSourceGUID, + externalSourceName, + elementGUID, + elementGUIDParameterName, + stakeholderGUID, + stakeholderGUIDParameterName, + urlTemplate, + methodName); + } + + + /** + * Retrieve the stakeholder elements linked via the "Stakeholder" relationship between two referenceables. + * + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of related elements + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public List getStakeholders(String userId, + String elementGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getStakeholders"; + final String guidPropertyName = "elementGUID"; + + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/stakeholders/by-commissioned-element/{2}?startFrom={3}&pageSize={4}"; + + return this.getRelatedElements(userId, elementGUID, guidPropertyName, urlTemplate, startFrom, pageSize, methodName); + } + + + /** + * Retrieve the elements commissioned by a stakeholder, linked via the "Stakeholder" relationship between two referenceables. + * + * @param userId calling user + * @param stakeholderGUID unique identifier of the stakeholder + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of related elements + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public List getStakeholderCommissionedElements(String userId, + String stakeholderGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getStakeholderCommissionedElements"; + final String guidPropertyName = "stakeholderGUID"; + + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/stakeholders/by-stakeholder/{2}?startFrom={3}&pageSize={4}"; + + return this.getRelatedElements(userId, stakeholderGUID, guidPropertyName, urlTemplate, startFrom, pageSize, methodName); + } + + + + /** + * Create an "AssignmentScope" relationship between an element and its scope. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param properties properties of the relationship + * @param scopeGUID unique identifier of the scope + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void setupAssignmentScope(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + AssignmentScopeProperties properties, + String scopeGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "setupAssignmentScope"; + final String elementGUIDParameterName = "elementGUID"; + final String scopeGUIDParameterName = "scopeGUID"; + + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/{2}/assignment-scopes/{3}"; + + this.setupRelationship(userId, + externalSourceGUID, + externalSourceName, + elementGUID, + elementGUIDParameterName, + properties, + scopeGUID, + scopeGUIDParameterName, + urlTemplate, + methodName); + } + + + /** + * Remove an "AssignmentScope" relationship between two referenceables. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param scopeGUID unique identifier of the scope + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void clearAssignmentScope(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String scopeGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "clearAssignmentScope"; + final String elementGUIDParameterName = "elementGUID"; + final String scopeGUIDParameterName = "scopeGUID"; + + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/{2}/assignment-scopes/{3}/delete"; + + this.clearRelationship(userId, externalSourceGUID, externalSourceName, elementGUID, elementGUIDParameterName, scopeGUID, scopeGUIDParameterName, urlTemplate, methodName); + } + + + /** + * Retrieve the assigned scopes linked by the "AssignmentScope" relationship between two referenceables. + * + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of related elements + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public List getAssignedScopes(String userId, + String elementGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getAssignedScopes"; + final String guidPropertyName = "elementGUID"; + + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/assignment-scopes/by-assigned-actor/{2}?startFrom={3}&pageSize={4}"; + + return this.getRelatedElements(userId, elementGUID, guidPropertyName, urlTemplate, startFrom, pageSize, methodName); + } + + + /** + * Retrieve the assigned actors linked by the "AssignmentScope" relationship between two referenceables. + * + * @param userId calling user + * @param scopeGUID unique identifier of the scope + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of related elements + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public List getAssignedActors(String userId, + String scopeGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getAssignedActors"; + final String guidPropertyName = "scopeGUID"; + + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/assignment-scopes/by-assigned-scope/{2}?startFrom={3}&pageSize={4}"; + + return this.getRelatedElements(userId, scopeGUID, guidPropertyName, urlTemplate, startFrom, pageSize, methodName); + } + + + + /** + * Create a "ResourceList" relationship between a consuming element and an element that represents resources. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param properties properties of the relationship + * @param resourceGUID unique identifier of the resource + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void setupResource(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + ResourceListProperties properties, + String resourceGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "setupResource"; + final String elementGUIDParameterName = "elementGUID"; + final String resourceGUIDParameterName = "resourceGUID"; + + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/{2}/resource-list/{3}"; + + this.setupRelationship(userId, + externalSourceGUID, + externalSourceName, + elementGUID, + elementGUIDParameterName, + properties, + resourceGUID, + resourceGUIDParameterName, + urlTemplate, + methodName); + } + + + /** + * Remove a "ResourceList" relationship between two referenceables. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param resourceGUID unique identifier of the resource + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void clearResource(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String resourceGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "clearResource"; + final String elementGUIDParameterName = "elementGUID"; + final String resourceGUIDParameterName = "resourceGUID"; + + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/{2}/resource-list/{3}/delete"; + + this.clearRelationship(userId, externalSourceGUID, externalSourceName, elementGUID, elementGUIDParameterName, resourceGUID, resourceGUIDParameterName, urlTemplate, methodName); + } + + + /** + * Retrieve the list of resources assigned to an element via the "ResourceList" relationship between two referenceables. + * + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of related elements + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public List getResourceList(String userId, + String elementGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getResourceList"; + final String guidPropertyName = "elementGUID"; + + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/resource-list/by-assignee/{2}?startFrom={3}&pageSize={4}"; + + return this.getRelatedElements(userId, elementGUID, guidPropertyName, urlTemplate, startFrom, pageSize, methodName); + } + + + /** + * Retrieve the list of elements assigned to a resource via the "ResourceList" relationship between two referenceables. + * + * @param userId calling user + * @param resourceGUID unique identifier of the resource + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of related elements + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public List getSupportedByResource(String userId, + String resourceGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getSupportedByResource"; + final String guidPropertyName = "resourceGUID"; + + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/resource-list/by-resource/{2}?startFrom={3}&pageSize={4}"; + + return this.getRelatedElements(userId, resourceGUID, guidPropertyName, urlTemplate, startFrom, pageSize, methodName); + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-client/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/client/rest/ProjectManagementRESTClient.java b/open-metadata-implementation/access-services/project-management/project-management-client/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/client/rest/ProjectManagementRESTClient.java new file mode 100644 index 00000000000..ae7793f4ac6 --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-client/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/client/rest/ProjectManagementRESTClient.java @@ -0,0 +1,329 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.client.rest; + +import org.odpi.openmetadata.accessservices.projectmanagement.rest.ActorProfileListResponse; +import org.odpi.openmetadata.accessservices.projectmanagement.rest.ElementStubsResponse; +import org.odpi.openmetadata.accessservices.projectmanagement.rest.PersonRoleListResponse; +import org.odpi.openmetadata.accessservices.projectmanagement.rest.PersonRoleResponse; +import org.odpi.openmetadata.accessservices.projectmanagement.rest.ProjectListResponse; +import org.odpi.openmetadata.accessservices.projectmanagement.rest.ProjectResponse; +import org.odpi.openmetadata.accessservices.projectmanagement.rest.RelatedElementListResponse; +import org.odpi.openmetadata.commonservices.ffdc.rest.FFDCRESTClient; +import org.odpi.openmetadata.frameworks.auditlog.AuditLog; +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; + +/** + * ProjectManagementRESTClient is responsible for issuing calls to the Project Profile OMAS REST APIs. + */ +public class ProjectManagementRESTClient extends FFDCRESTClient +{ + + /** + * Constructor for no authentication with audit log. + * + * @param serverName name of the OMAG Server to call + * @param serverPlatformURLRoot URL root of the server platform where the OMAG Server is running. + * @param auditLog destination for log messages. + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public ProjectManagementRESTClient(String serverName, + String serverPlatformURLRoot, + AuditLog auditLog) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot, auditLog); + } + + + /** + * Constructor for no authentication. + * + * @param serverName name of the OMAG Server to call + * @param serverPlatformURLRoot URL root of the server platform where the OMAG Server is running. + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public ProjectManagementRESTClient(String serverName, + String serverPlatformURLRoot) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot); + } + + + /** + * Constructor for simple userId and password authentication with audit log. + * + * @param serverName name of the OMAG Server to call + * @param serverPlatformURLRoot URL root of the server platform where the OMAG Server is running. + * @param userId user id for the HTTP request + * @param password password for the HTTP request + * @param auditLog destination for log messages. + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public ProjectManagementRESTClient(String serverName, + String serverPlatformURLRoot, + String userId, + String password, + AuditLog auditLog) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot, userId, password, auditLog); + } + + + /** + * Constructor for simple userId and password authentication. + * + * @param serverName name of the OMAG Server to call + * @param serverPlatformURLRoot URL root of the server platform where the OMAG Server is running. + * @param userId user id for the HTTP request + * @param password password for the HTTP request + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public ProjectManagementRESTClient(String serverName, + String serverPlatformURLRoot, + String userId, + String password) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot, userId, password); + } + + + /** + * Issue a GET REST call that returns a ProjectElement in a response object. + * + * @param methodName name of the method being called. + * @param urlTemplate REST API call URL template with place-holders for the parameters. + * @param params a list of parameters that are slotted into the url template. + * + * @return response object + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException something went wrong with the REST call stack. + */ + public ProjectResponse callProjectGetRESTCall(String methodName, + String urlTemplate, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + ProjectResponse restResult = this.callGetRESTCall(methodName, ProjectResponse.class, urlTemplate, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + + /** + * Issue a GET REST call that returns a list of ProjectElements in a response object. + * + * @param methodName name of the method being called + * @param urlTemplate REST API call URL template with place-holders for the parameters + * @param params a list of parameters that are slotted into the url template + * @return response object + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException something went wrong with the REST call stack. + */ + public ProjectListResponse callProjectListGetRESTCall(String methodName, + String urlTemplate, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + ProjectListResponse restResult = this.callGetRESTCall(methodName, ProjectListResponse.class, urlTemplate, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + + /** + * Issue a GET REST call that returns a list of ProjectElements in a response object. + * + * @param methodName name of the method being called + * @param urlTemplate REST API call URL template with place-holders for the parameters + * @param requestBody request body for the request + * @param params a list of parameters that are slotted into the url template + * @return response object + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException something went wrong with the REST call stack. + */ + public ProjectListResponse callProjectListPostRESTCall(String methodName, + String urlTemplate, + Object requestBody, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + ProjectListResponse restResult = this.callPostRESTCall(methodName, ProjectListResponse.class, urlTemplate, requestBody, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + + /** + * Issue a GET REST call that returns a PersonRoleElement in a response object. + * + * @param methodName name of the method being called. + * @param urlTemplate REST API call URL template with place-holders for the parameters. + * @param params a list of parameters that are slotted into the url template. + * + * @return response object + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException something went wrong with the REST call stack. + */ + public PersonRoleResponse callPersonRoleGetRESTCall(String methodName, + String urlTemplate, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + PersonRoleResponse restResult = this.callGetRESTCall(methodName, PersonRoleResponse.class, urlTemplate, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + + /** + * Issue a GET REST call that returns a list of PersonRoleElements in a response object. + * + * @param methodName name of the method being called + * @param urlTemplate REST API call URL template with place-holders for the parameters + * @param params a list of parameters that are slotted into the url template + * @return response object + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException something went wrong with the REST call stack. + */ + public PersonRoleListResponse callPersonRoleListGetRESTCall(String methodName, + String urlTemplate, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + PersonRoleListResponse restResult = this.callGetRESTCall(methodName, PersonRoleListResponse.class, urlTemplate, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + + /** + * Issue a POST REST call that returns a list of PersonRoleElements in a response object. + * + * @param methodName name of the method being called + * @param urlTemplate REST API call URL template with place-holders for the parameters + * @param requestBody request body for the request + * @param params a list of parameters that are slotted into the url template + * @return response object + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException something went wrong with the REST call stack. + */ + public PersonRoleListResponse callPersonRoleListPostRESTCall(String methodName, + String urlTemplate, + Object requestBody, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + PersonRoleListResponse restResult = this.callPostRESTCall(methodName, PersonRoleListResponse.class, urlTemplate, requestBody, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + + /** + * Issue a GET REST call that returns a list of ActorProfileElements in a response object. + * + * @param methodName name of the method being called + * @param urlTemplate REST API call URL template with place-holders for the parameters + * @param params a list of parameters that are slotted into the url template + * @return response object + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException something went wrong with the REST call stack. + */ + public ActorProfileListResponse callActorProfileListGetRESTCall(String methodName, + String urlTemplate, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + ActorProfileListResponse restResult = this.callGetRESTCall(methodName, ActorProfileListResponse.class, urlTemplate, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + + /** + * Issue a GET REST call that returns a ElementStubsResponse object. + * + * @param methodName name of the method being called. + * @param urlTemplate REST API call URL template with place-holders for the parameters. + * @param params a list of parameters that are slotted into the url template. + * + * @return response object + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException the repository is not available or not working properly. + */ + public ElementStubsResponse callElementStubsGetRESTCall(String methodName, + String urlTemplate, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + ElementStubsResponse restResult = this.callGetRESTCall(methodName, ElementStubsResponse.class, urlTemplate, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + + + /** + * Issue a GET REST call that returns a RelatedElementListResponse object. + * + * @param methodName name of the method being called. + * @param urlTemplate REST API call URL template with place-holders for the parameters. + * @param params a list of parameters that are slotted into the url template. + * + * @return response object + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException the repository is not available or not working properly. + */ + public RelatedElementListResponse callRelatedElementListGetRESTCall(String methodName, + String urlTemplate, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + RelatedElementListResponse restResult = this.callGetRESTCall(methodName, RelatedElementListResponse.class, urlTemplate, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-server/build.gradle b/open-metadata-implementation/access-services/project-management/project-management-server/build.gradle index c4b7d5d31d7..cbd7d6ae124 100644 --- a/open-metadata-implementation/access-services/project-management/project-management-server/build.gradle +++ b/open-metadata-implementation/access-services/project-management/project-management-server/build.gradle @@ -12,6 +12,7 @@ dependencies { implementation project(':open-metadata-implementation:admin-services:admin-services-registration') implementation 'org.slf4j:slf4j-api' implementation project(':open-metadata-implementation:access-services:project-management:project-management-api') + implementation project(':open-metadata-implementation:common-services:generic-handlers') implementation project(':open-metadata-implementation:common-services:multi-tenant') implementation project(':open-metadata-implementation:common-services:ffdc-services') implementation project(':open-metadata-implementation:common-services:repository-handler') diff --git a/open-metadata-implementation/access-services/project-management/project-management-server/pom.xml b/open-metadata-implementation/access-services/project-management/project-management-server/pom.xml index 07bb4479b5a..7816e1d876f 100644 --- a/open-metadata-implementation/access-services/project-management/project-management-server/pom.xml +++ b/open-metadata-implementation/access-services/project-management/project-management-server/pom.xml @@ -70,6 +70,11 @@ multi-tenant
          + + org.odpi.egeria + generic-handlers + + org.odpi.egeria ffdc-services diff --git a/open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/converters/ActorProfileConverter.java b/open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/converters/ActorProfileConverter.java new file mode 100644 index 00000000000..cb8ada5fff8 --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/converters/ActorProfileConverter.java @@ -0,0 +1,366 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.converters; + + +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.ActorProfileElement; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.ContactMethodElement; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.ContributionRecordElement; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.ElementStub; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.ProfileIdentityElement; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.ProfileLocationElement; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.UserIdentityElement; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.ActorProfileProperties; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.ContactMethodProperties; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.ContributionRecord; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.ProfileIdentityProperties; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.ProfileLocationProperties; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.UserIdentityProperties; +import org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIMapper; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityProxy; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefCategory; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper; + +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * ActorProfileConverter generates a ActorProfileElement bean from a ActorProfile entity. + */ +public class ActorProfileConverter extends ProjectManagementOMASConverter +{ + /** + * Constructor + * + * @param repositoryHelper helper object to parse entity + * @param serviceName name of this component + * @param serverName local server name + */ + public ActorProfileConverter(OMRSRepositoryHelper repositoryHelper, + String serviceName, + String serverName) + { + super(repositoryHelper, serviceName, serverName); + } + + + /** + * Using the supplied instances, return a new instance of the bean. It is used for beans such as + * a connection bean which made up of 3 entities (Connection, ConnectorType and Endpoint) plus the + * relationships between them. The relationships may be omitted if they do not have any properties. + * + * @param beanClass name of the class to create + * @param primaryEntity entity that is the root of the cluster of entities that make up the content of the bean + * @param supplementaryEntities entities connected to the primary entity by the relationships + * @param relationships relationships linking the entities + * @param methodName calling method + * @return bean populated with properties from the instances supplied + * @throws PropertyServerException there is a problem instantiating the bean + */ + @Override + public B getNewComplexBean(Class beanClass, + EntityDetail primaryEntity, + List supplementaryEntities, + List relationships, + String methodName) throws PropertyServerException + { + try + { + /* + * This is initial confirmation that the generic converter has been initialized with an appropriate bean class. + */ + B returnBean = beanClass.getDeclaredConstructor().newInstance(); + + if (returnBean instanceof ActorProfileElement) + { + ActorProfileElement bean = (ActorProfileElement) returnBean; + ActorProfileProperties profileProperties = new ActorProfileProperties(); + + if (primaryEntity != null) + { + bean.setElementHeader(this.getMetadataElementHeader(beanClass, primaryEntity, methodName)); + + /* + * The initial set of values come from the entity. + */ + InstanceProperties instanceProperties = new InstanceProperties(primaryEntity.getProperties()); + + profileProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); + profileProperties.setKnownName(this.removeName(instanceProperties)); + profileProperties.setDescription(this.removeDescription(instanceProperties)); + profileProperties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); + profileProperties.setEffectiveFrom(instanceProperties.getEffectiveFromTime()); + profileProperties.setEffectiveTo(instanceProperties.getEffectiveToTime()); + + /* + * Any remaining properties are returned in the extended properties. They are + * assumed to be defined in a subtype. + */ + profileProperties.setTypeName(bean.getElementHeader().getType().getTypeName()); + profileProperties.setExtendedProperties(this.getRemainingExtendedProperties(instanceProperties)); + + bean.setProfileProperties(profileProperties); + + Map userIdentities = new HashMap<>(); + + if (supplementaryEntities != null) + { + List contactMethods = new ArrayList<>(); + + for (EntityDetail entity : supplementaryEntities) + { + if ((entity != null) && (entity.getType() != null)) + { + String entityTypeName = entity.getType().getTypeDefName(); + + if (repositoryHelper.isTypeOf(serviceName, entityTypeName, OpenMetadataAPIMapper.USER_IDENTITY_TYPE_NAME)) + { + UserIdentityElement userBean = new UserIdentityElement(); + UserIdentityProperties userProperties = new UserIdentityProperties(); + + bean.setElementHeader(this.getMetadataElementHeader(beanClass, entity, methodName)); + + InstanceProperties entityProperties = new InstanceProperties(entity.getProperties()); + + userProperties.setQualifiedName(this.removeQualifiedName(entityProperties)); + userProperties.setUserId(this.removeUserId(instanceProperties)); + userProperties.setDistinguishedName(this.removeDistinguishedName(instanceProperties)); + userProperties.setAdditionalProperties(this.removeAdditionalProperties(entityProperties)); + + userProperties.setEffectiveFrom(entityProperties.getEffectiveFromTime()); + userProperties.setEffectiveTo(entityProperties.getEffectiveToTime()); + + userProperties.setTypeName(bean.getElementHeader().getType().getTypeName()); + userProperties.setExtendedProperties(this.getRemainingExtendedProperties(entityProperties)); + + userBean.setProperties(userProperties); + + userIdentities.put(entity.getGUID(), userBean); + } + else if (repositoryHelper.isTypeOf(serviceName, entityTypeName, OpenMetadataAPIMapper.CONTRIBUTION_RECORD_TYPE_NAME)) + { + ContributionRecordElement contributionBean = new ContributionRecordElement(); + ContributionRecord contributionRecord = new ContributionRecord(); + + contributionBean.setElementHeader(super.getMetadataElementHeader(beanClass, entity, methodName)); + + InstanceProperties entityProperties = new InstanceProperties(entity.getProperties()); + + contributionRecord.setQualifiedName(this.removeQualifiedName(entityProperties)); + contributionRecord.setAdditionalProperties(this.removeAdditionalProperties(entityProperties)); + contributionRecord.setKarmaPoints(this.removeKarmaPoints(entityProperties)); + if ((contributionRecord.getKarmaPoints() > 0) && (karmaPointPlateau > 0)) + { + contributionRecord.setKarmaPointPlateau(contributionRecord.getKarmaPoints() / karmaPointPlateau); + } + contributionRecord.setIsPublic(this.removeIsPublic(entityProperties)); + contributionRecord.setTypeName(bean.getElementHeader().getType().getTypeName()); + contributionRecord.setExtendedProperties(this.getRemainingExtendedProperties(entityProperties)); + + contributionBean.setProperties(contributionRecord); + bean.setContributionRecord(contributionBean); + } + else if (repositoryHelper.isTypeOf(serviceName, entityTypeName, OpenMetadataAPIMapper.CONTACT_DETAILS_TYPE_NAME)) + { + ContactMethodElement contactMethodBean = new ContactMethodElement(); + ContactMethodProperties contactMethodProperties = new ContactMethodProperties(); + + contactMethodBean.setElementHeader(super.getMetadataElementHeader(beanClass, entity, methodName)); + + InstanceProperties entityProperties = new InstanceProperties(entity.getProperties()); + + contactMethodProperties.setName(this.removeName(entityProperties)); + contactMethodProperties.setContactType(this.removeContactType(entityProperties)); + contactMethodProperties.setContactMethodType(this.getContactMethodTypeFromProperties(entityProperties)); + contactMethodProperties.setContactMethodService(this.removeContactMethodService(entityProperties)); + contactMethodProperties.setContactMethodValue(this.removeContactMethodValue(entityProperties)); + + contactMethodProperties.setEffectiveFrom(entityProperties.getEffectiveFromTime()); + contactMethodProperties.setEffectiveTo(entityProperties.getEffectiveToTime()); + + contactMethodProperties.setTypeName(bean.getElementHeader().getType().getTypeName()); + contactMethodProperties.setExtendedProperties(this.getRemainingExtendedProperties(entityProperties)); + + contactMethodBean.setProperties(contactMethodProperties); + + contactMethods.add(contactMethodBean); + } + } + else + { + handleBadEntity(beanClass.getName(), entity, methodName); + } + } + + if (! contactMethods.isEmpty()) + { + bean.setContactMethods(contactMethods); + } + } + + if (relationships != null) + { + ElementStub superTeam = null; + List subTeams = new ArrayList<>(); + List teamLeaders = new ArrayList<>(); + List teamMembers = new ArrayList<>(); + List profileIdentities = new ArrayList<>(); + List locations = new ArrayList<>(); + List roles = new ArrayList<>(); + List linkedInfrastructure = new ArrayList<>(); + + for (Relationship relationship : relationships) + { + if ((relationship != null) && (relationship.getType() != null)) + { + String relationshipTypeName = relationship.getType().getTypeDefName(); + + if (repositoryHelper.isTypeOf(serviceName, relationshipTypeName, OpenMetadataAPIMapper.TEAM_MEMBERSHIP_RELATIONSHIP_TYPE_NAME)) + { + EntityProxy entityProxy = repositoryHelper.getOtherEnd(serviceName, primaryEntity.getGUID(), relationship); + + ElementStub elementStub = super.getElementStub(beanClass, entityProxy, methodName); + + teamMembers.add(elementStub); + } + else if (repositoryHelper.isTypeOf(serviceName, relationshipTypeName, OpenMetadataAPIMapper.TEAM_LEADERSHIP_RELATIONSHIP_TYPE_NAME)) + { + EntityProxy entityProxy = repositoryHelper.getOtherEnd(serviceName, primaryEntity.getGUID(), relationship); + + ElementStub elementStub = super.getElementStub(beanClass, entityProxy, methodName); + + teamLeaders.add(elementStub); + } + else if (repositoryHelper.isTypeOf(serviceName, relationshipTypeName, OpenMetadataAPIMapper.PERSON_ROLE_APPOINTMENT_RELATIONSHIP_TYPE_NAME)) + { + EntityProxy entityProxy = repositoryHelper.getOtherEnd(serviceName, primaryEntity.getGUID(), relationship); + + ElementStub elementStub = super.getElementStub(beanClass, entityProxy, methodName); + + roles.add(elementStub); + } + else if (repositoryHelper.isTypeOf(serviceName, relationshipTypeName, OpenMetadataAPIMapper.IT_INFRASTRUCTURE_PROFILE_RELATIONSHIP_TYPE_NAME)) + { + EntityProxy entityProxy = repositoryHelper.getOtherEnd(serviceName, primaryEntity.getGUID(), relationship); + + ElementStub elementStub = super.getElementStub(beanClass, entityProxy, methodName); + + linkedInfrastructure.add(elementStub); + } + else if (repositoryHelper.isTypeOf(serviceName, relationshipTypeName, OpenMetadataAPIMapper.PROFILE_LOCATION_TYPE_NAME)) + { + EntityProxy entityProxy = relationship.getEntityTwoProxy(); + + ElementStub elementStub = super.getElementStub(beanClass, entityProxy, methodName); + + ProfileLocationElement locationElement = new ProfileLocationElement(); + ProfileLocationProperties locationProperties = new ProfileLocationProperties(); + + locationProperties.setAssociationType(this.removeAssociationType(relationship.getProperties())); + + locationElement.setLocation(elementStub); + locationElement.setProperties(locationProperties); + locations.add(locationElement); + } + else if (repositoryHelper.isTypeOf(serviceName, relationshipTypeName, OpenMetadataAPIMapper.PROFILE_IDENTITY_RELATIONSHIP_TYPE_NAME)) + { + EntityProxy entityProxy = repositoryHelper.getOtherEnd(serviceName, primaryEntity.getGUID(), relationship); + + ProfileIdentityElement profileIdentityElement = new ProfileIdentityElement(); + ProfileIdentityProperties profileIdentityProperties = new ProfileIdentityProperties(); + + InstanceProperties relationshipProperties = relationship.getProperties(); + + profileIdentityProperties.setRoleTypeName(this.removeDescription(relationshipProperties)); + profileIdentityProperties.setRoleGUID(this.removeDescription(relationshipProperties)); + profileIdentityProperties.setDescription(this.removeDescription(relationshipProperties)); + + profileIdentityElement.setProfileIdentity(profileIdentityProperties); + profileIdentityElement.setProperties(userIdentities.get(entityProxy.getGUID())); + + profileIdentities.add(profileIdentityElement); + } + else if (repositoryHelper.isTypeOf(serviceName, relationshipTypeName, OpenMetadataAPIMapper.TEAM_STRUCTURE_RELATIONSHIP_TYPE_NAME)) + { + EntityProxy entityProxy = relationship.getEntityOneProxy(); + + if (primaryEntity.getGUID().equals(entityProxy.getGUID())) + { + /* + * The primary entity is the super team - save subteam + */ + ElementStub elementStub = super.getElementStub(beanClass, relationship.getEntityTwoProxy(), methodName); + subTeams.add(elementStub); + } + else + { + superTeam = super.getElementStub(beanClass, entityProxy, methodName); + } + } + } + else + { + handleBadRelationship(beanClass.getName(), relationship, methodName); + } + } + + if (!profileIdentities.isEmpty()) + { + bean.setUserIdentities(profileIdentities); + } + + bean.setSuperTeam(superTeam); + if (! subTeams.isEmpty()) + { + bean.setSubTeams(subTeams); + } + + if (! teamLeaders.isEmpty()) + { + bean.setTeamLeaderRoles(teamLeaders); + } + + if (! teamMembers.isEmpty()) + { + bean.setTeamMemberRoles(teamMembers); + } + + if (! roles.isEmpty()) + { + bean.setPersonRoles(roles); + } + + if (! locations.isEmpty()) + { + bean.setLocations(locations); + } + + if (! linkedInfrastructure.isEmpty()) + { + bean.setLinkedInfrastructure(linkedInfrastructure); + } + } + } + else + { + handleMissingMetadataInstance(beanClass.getName(), TypeDefCategory.ENTITY_DEF, methodName); + } + } + + return returnBean; + } + catch (IllegalAccessException | InstantiationException | ClassCastException | NoSuchMethodException | InvocationTargetException error) + { + super.handleInvalidBeanClass(beanClass.getName(), error, methodName); + } + + return null; + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/converters/PersonRoleConverter.java b/open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/converters/PersonRoleConverter.java new file mode 100644 index 00000000000..887242eb67f --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/converters/PersonRoleConverter.java @@ -0,0 +1,142 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.converters; + + +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.PersonRoleElement; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.PersonRoleProperties; +import org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIMapper; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefCategory; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper; + +import java.lang.reflect.InvocationTargetException; + +/** + * PersonRoleConverter generates a PersonRoleProperties bean from an PersonRoleProperties entity and the relationships connected to it. + */ +public class PersonRoleConverter extends ProjectManagementOMASConverter +{ + /** + * Constructor + * + * @param repositoryHelper helper object to parse entity + * @param serviceName name of this component + * @param serverName local server name + */ + public PersonRoleConverter(OMRSRepositoryHelper repositoryHelper, + String serviceName, + String serverName) + { + super(repositoryHelper, serviceName, serverName); + } + + + /** + * Using the supplied entity, return a new instance of the bean. This is used for most beans that have + * a one to one correspondence with the repository instances. + * + * @param beanClass name of the class to create + * @param entity entity containing the properties + * @param methodName calling method + * @return bean populated with properties from the entity supplied + * @throws PropertyServerException there is a problem instantiating the bean + */ + @Override + public B getNewBean(Class beanClass, + EntityDetail entity, + String methodName) throws PropertyServerException + { + try + { + /* + * This is initial confirmation that the generic converter has been initialized with an appropriate bean class. + */ + B returnBean = beanClass.getDeclaredConstructor().newInstance(); + + if (returnBean instanceof PersonRoleElement) + { + PersonRoleElement bean = (PersonRoleElement) returnBean; + PersonRoleProperties roleProperties = new PersonRoleProperties(); + + if (entity != null) + { + bean.setElementHeader(this.getMetadataElementHeader(beanClass, entity, methodName)); + + /* + * The initial set of values come from the entity. + */ + InstanceProperties instanceProperties = new InstanceProperties(entity.getProperties()); + + roleProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); + roleProperties.setRoleId(this.removeIdentifier(instanceProperties)); + roleProperties.setTitle(this.removeTitle(instanceProperties)); + roleProperties.setDescription(this.removeDescription(instanceProperties)); + roleProperties.setScope(this.removeScope(instanceProperties)); + roleProperties.setDomainIdentifier(this.removeDomainIdentifier(instanceProperties)); + roleProperties.setHeadCountLimitSet(instanceProperties.getPropertyValue(OpenMetadataAPIMapper.HEAD_COUNT_PROPERTY_NAME) != null); + roleProperties.setHeadCount(this.removeHeadCount(instanceProperties)); + + roleProperties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); + roleProperties.setEffectiveFrom(instanceProperties.getEffectiveFromTime()); + roleProperties.setEffectiveTo(instanceProperties.getEffectiveToTime()); + + + /* + * Any remaining properties are returned in the extended properties. They are + * assumed to be defined in a subtype. + */ + roleProperties.setTypeName(bean.getElementHeader().getType().getTypeName()); + roleProperties.setExtendedProperties(this.getRemainingExtendedProperties(instanceProperties)); + + bean.setProperties(roleProperties); + } + else + { + handleMissingMetadataInstance(beanClass.getName(), TypeDefCategory.ENTITY_DEF, methodName); + } + } + + return returnBean; + } + catch (IllegalAccessException | InstantiationException | ClassCastException | NoSuchMethodException | InvocationTargetException error) + { + super.handleInvalidBeanClass(beanClass.getName(), error, methodName); + } + + return null; + } + + + /** + * Using the supplied instances, return a new instance of the bean. This is used for beans that + * contain a combination of the properties from an entity and that of a connected relationship. + * + * @param beanClass name of the class to create + * @param entity entity containing the properties + * @param relationship relationship containing the properties + * @param methodName calling method + * @return bean populated with properties from the instances supplied + * @throws PropertyServerException there is a problem instantiating the bean + */ + @Override + public B getNewBean(Class beanClass, + EntityDetail entity, + Relationship relationship, + String methodName) throws PropertyServerException + { + B returnBean = this.getNewBean(beanClass, entity, methodName); + + if (returnBean instanceof PersonRoleElement) + { + PersonRoleElement bean = (PersonRoleElement) returnBean; + + bean.setRelatedElement(super.getRelatedElement(beanClass, entity, relationship, methodName)); + } + + return returnBean; + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/converters/ProjectConverter.java b/open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/converters/ProjectConverter.java new file mode 100644 index 00000000000..45f43e05ba1 --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/converters/ProjectConverter.java @@ -0,0 +1,123 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.converters; + +import org.odpi.openmetadata.accessservices.projectmanagement.properties.ProjectProperties; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.ProjectElement; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefCategory; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper; + +import java.lang.reflect.InvocationTargetException; + + +/** + * ProjectConverter generates an ProjectCollectionMember bean from an Project entity + * and a ResourceList relationship to it. + */ +public class ProjectConverter extends ProjectManagementOMASConverter +{ + /** + * Constructor + * + * @param repositoryHelper helper object to parse entity + * @param serviceName name of this component + * @param serverName local server name + */ + public ProjectConverter(OMRSRepositoryHelper repositoryHelper, + String serviceName, + String serverName) + { + super(repositoryHelper, serviceName, serverName); + } + + + /** + * Using the supplied instances, return a new instance of the bean. This is used for beans that + * contain a combination of the properties from an entity and that of a connected relationship. + * + * @param beanClass name of the class to create + * @param entity entity containing the properties + * @param relationship relationship containing the properties + * @param methodName calling method + * @return bean populated with properties from the instances supplied + * @throws PropertyServerException there is a problem instantiating the bean + */ + @Override + public B getNewBean(Class beanClass, + EntityDetail entity, + Relationship relationship, + String methodName) throws PropertyServerException + { + try + { + /* + * This is initial confirmation that the generic converter has been initialized with an appropriate bean class. + */ + B returnBean = beanClass.getDeclaredConstructor().newInstance(); + + if (returnBean instanceof ProjectElement) + { + ProjectElement bean = (ProjectElement) returnBean; + ProjectProperties projectProperties = new ProjectProperties(); + + InstanceProperties instanceProperties; + + /* + * The initial set of values come from the entity. + */ + if (entity != null) + { + bean.setElementHeader(super.getMetadataElementHeader(beanClass, entity, methodName)); + + /* + * The initial set of values come from the entity. + */ + instanceProperties = new InstanceProperties(entity.getProperties()); + + projectProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); + projectProperties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); + + projectProperties.setIdentifier(this.removeIdentifier(instanceProperties)); + projectProperties.setName(this.removeName(instanceProperties)); + projectProperties.setDescription(this.removeDescription(instanceProperties)); + projectProperties.setStartDate(this.removeStartDate(instanceProperties)); + projectProperties.setPlannedEndDate(this.removePlannedEndDate(instanceProperties)); + projectProperties.setStatus(this.removeStatus(instanceProperties)); + projectProperties.setEffectiveFrom(instanceProperties.getEffectiveFromTime()); + projectProperties.setEffectiveTo(instanceProperties.getEffectiveToTime()); + + /* + * Any remaining properties are returned in the extended properties. They are + * assumed to be defined in a subtype. + */ + projectProperties.setTypeName(bean.getElementHeader().getType().getTypeName()); + projectProperties.setExtendedProperties(this.getRemainingExtendedProperties(instanceProperties)); + + } + else + { + handleMissingMetadataInstance(beanClass.getName(), TypeDefCategory.ENTITY_DEF, methodName); + } + + if (relationship != null) + { + bean.setRelatedElement(super.getRelatedElement(beanClass, entity, relationship, methodName)); + } + + bean.setProperties(projectProperties); + } + + return returnBean; + } + catch (IllegalAccessException | InstantiationException | ClassCastException | NoSuchMethodException | InvocationTargetException error) + { + super.handleInvalidBeanClass(beanClass.getName(), error, methodName); + } + + return null; + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/converters/ProjectManagementOMASConverter.java b/open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/converters/ProjectManagementOMASConverter.java new file mode 100644 index 00000000000..9162129b692 --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/converters/ProjectManagementOMASConverter.java @@ -0,0 +1,659 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.converters; + +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.ElementClassification; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.ElementHeader; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.ElementOrigin; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.ElementOriginCategory; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.ElementStatus; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.ElementStub; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.ElementType; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.ElementVersions; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.RelatedElement; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.ContactMethodType; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.RelationshipProperties; +import org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIGenericConverter; +import org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIMapper; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Classification; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityProxy; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceAuditHeader; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceHeader; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProvenanceType; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceType; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefCategory; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefLink; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper; + +import java.util.ArrayList; +import java.util.List; + + +/** + * ProjectManagementOMASConverter provides the generic methods for the Community Profile beans converters. Generic classes + * have limited knowledge of the classes these are working on and this means creating a new instance of a + * class from within a generic is a little involved. This class provides the generic method for creating + * and initializing a Community Profile bean. + */ +public class ProjectManagementOMASConverter extends OpenMetadataAPIGenericConverter +{ + long karmaPointPlateau = 0; + + + /** + * Constructor + * + * @param repositoryHelper helper object to parse entity + * @param serviceName name of this component + * @param serverName name of this server + */ + public ProjectManagementOMASConverter(OMRSRepositoryHelper repositoryHelper, + String serviceName, + String serverName) + { + super (repositoryHelper, serviceName, serverName); + } + + /** + * Constructor + * + * @param repositoryHelper helper object to parse entity + * @param serviceName name of this component + * @param serverName local server name + * @param karmaPointPlateau how many karma points to a plateau + */ + public ProjectManagementOMASConverter(OMRSRepositoryHelper repositoryHelper, + String serviceName, + String serverName, + int karmaPointPlateau) + { + this(repositoryHelper, serviceName, serverName); + + this.karmaPointPlateau = karmaPointPlateau; + } + + + /*=============================== + * Methods to fill out headers and enums + */ + + + /** + * Extract the properties from the entity. + * + * @param beanClass name of the class to create + * @param entity entity containing the properties + * @param methodName calling method + * @return filled out element header + * @throws PropertyServerException there is a problem in the use of the generic handlers because + * the converter has been configured with a type of bean that is incompatible with the handler + */ + ElementHeader getMetadataElementHeader(Class beanClass, + EntityDetail entity, + String methodName) throws PropertyServerException + { + if (entity != null) + { + return getMetadataElementHeader(beanClass, + entity, + entity.getClassifications(), + methodName); + } + else + { + super.handleMissingMetadataInstance(beanClass.getName(), + TypeDefCategory.ENTITY_DEF, + methodName); + } + + return null; + } + + + /** + * Extract the properties from the instance - called for entities, relationships and entity properties. + * + * @param beanClass name of the class to create + * @param header header from the entity containing the properties + * @param entityClassifications classifications (entity and entity proxy only) + * @param methodName calling method + * @return filled out element header + * @throws PropertyServerException there is a problem in the use of the generic handlers because + * the converter has been configured with a type of bean that is incompatible with the handler + */ + public ElementHeader getMetadataElementHeader(Class beanClass, + InstanceHeader header, + List entityClassifications, + String methodName) throws PropertyServerException + { + if (header != null) + { + ElementHeader elementHeader = new ElementHeader(); + + elementHeader.setGUID(header.getGUID()); + elementHeader.setStatus(this.getElementStatus(header.getStatus())); + elementHeader.setClassifications(this.getEntityClassifications(entityClassifications)); + elementHeader.setType(this.getElementType(header)); + + ElementOrigin elementOrigin = new ElementOrigin(); + + elementOrigin.setSourceServer(serverName); + elementOrigin.setOriginCategory(this.getElementOriginCategory(header.getInstanceProvenanceType())); + elementOrigin.setHomeMetadataCollectionId(header.getMetadataCollectionId()); + elementOrigin.setHomeMetadataCollectionName(header.getMetadataCollectionName()); + elementOrigin.setLicense(header.getInstanceLicense()); + + elementHeader.setOrigin(elementOrigin); + + elementHeader.setVersions(this.getElementVersions(header)); + + return elementHeader; + } + else + { + super.handleMissingMetadataInstance(beanClass.getName(), + TypeDefCategory.ENTITY_DEF, + methodName); + } + + return null; + } + + + /** + * Translate the repository services' InstanceStatus to an ElementStatus. + * + * @param instanceStatus value from the repository services + * @return ElementStatus enum + */ + ElementStatus getElementStatus(InstanceStatus instanceStatus) + { + if (instanceStatus != null) + { + switch (instanceStatus) + { + case UNKNOWN: + return ElementStatus.UNKNOWN; + + case DRAFT: + return ElementStatus.DRAFT; + + case PREPARED: + return ElementStatus.PREPARED; + + case PROPOSED: + return ElementStatus.PROPOSED; + + case APPROVED: + return ElementStatus.APPROVED; + + case REJECTED: + return ElementStatus.REJECTED; + + case APPROVED_CONCEPT: + return ElementStatus.APPROVED_CONCEPT; + + case UNDER_DEVELOPMENT: + return ElementStatus.UNDER_DEVELOPMENT; + + case DEVELOPMENT_COMPLETE: + return ElementStatus.DEVELOPMENT_COMPLETE; + + case APPROVED_FOR_DEPLOYMENT: + return ElementStatus.APPROVED_FOR_DEPLOYMENT; + + case STANDBY: + return ElementStatus.STANDBY; + + case ACTIVE: + return ElementStatus.ACTIVE; + + case FAILED: + return ElementStatus.FAILED; + + case DISABLED: + return ElementStatus.DISABLED; + + case COMPLETE: + return ElementStatus.COMPLETE; + + case DEPRECATED: + return ElementStatus.DEPRECATED; + + case OTHER: + return ElementStatus.OTHER; + } + } + + return ElementStatus.UNKNOWN; + } + + + /** + * Extract the properties from the entity. + * + * @param beanClass name of the class to create + * @param entityProxy entityProxy from the relationship containing the properties + * @param methodName calling method + * @return filled out element header + * @throws PropertyServerException there is a problem in the use of the generic handlers because + * the converter has been configured with a type of bean that is incompatible with the handler + */ + public ElementStub getElementStub(Class beanClass, + EntityProxy entityProxy, + String methodName) throws PropertyServerException + { + if (entityProxy != null) + { + ElementHeader elementHeader = getMetadataElementHeader(beanClass, entityProxy, entityProxy.getClassifications(), methodName); + ElementStub elementStub = new ElementStub(elementHeader); + + elementStub.setUniqueName(repositoryHelper.getStringProperty(serviceName, + OpenMetadataAPIMapper.QUALIFIED_NAME_PROPERTY_NAME, + entityProxy.getUniqueProperties(), + methodName)); + + return elementStub; + } + else + { + super.handleMissingMetadataInstance(beanClass.getName(), + TypeDefCategory.ENTITY_DEF, + methodName); + } + + return null; + } + + + /** + * Extract the properties from the entity. + * + * @param beanClass name of the class to create + * @param entity entity containing the properties + * @param methodName calling method + * @return filled out element header + * @throws PropertyServerException there is a problem in the use of the generic handlers because + * the converter has been configured with a type of bean that is incompatible with the handler + */ + public ElementStub getElementStub(Class beanClass, + EntityDetail entity, + String methodName) throws PropertyServerException + { + if (entity != null) + { + ElementHeader elementHeader = getMetadataElementHeader(beanClass, entity, methodName); + ElementStub elementStub = new ElementStub(elementHeader); + + elementStub.setUniqueName(repositoryHelper.getStringProperty(serviceName, + OpenMetadataAPIMapper.QUALIFIED_NAME_PROPERTY_NAME, + entity.getProperties(), + methodName)); + + return elementStub; + } + else + { + super.handleMissingMetadataInstance(beanClass.getName(), + TypeDefCategory.ENTITY_DEF, + methodName); + } + + return null; + } + + + /** + * Extract the properties from the relationship. + * + * @param beanClass name of the class to create + * @param relationship relationship containing the properties + * @param methodName calling method + * @return filled out element header + * @throws PropertyServerException there is a problem in the use of the generic handlers because + * the converter has been configured with a type of bean that is incompatible with the handler + */ + public ElementStub getElementStub(Class beanClass, + Relationship relationship, + String methodName) throws PropertyServerException + { + if (relationship != null) + { + ElementHeader elementHeader = getMetadataElementHeader(beanClass, relationship, null, methodName); + ElementStub elementStub = new ElementStub(elementHeader); + + return elementStub; + } + else + { + super.handleMissingMetadataInstance(beanClass.getName(), + TypeDefCategory.RELATIONSHIP_DEF, + methodName); + } + + return null; + } + + + /** + * Extract the classifications from the entity. + * + * @param entity entity containing the classifications + * @return list of bean classifications + */ + private List getEntityClassifications(EntityDetail entity) + { + if (entity != null) + { + return this.getEntityClassifications(entity.getClassifications()); + } + + return null; + } + + + /** + * Extract the classifications from the entity. + * + * @param entityClassifications classifications direct from the entity + * @return list of bean classifications + */ + private List getEntityClassifications(List entityClassifications) + { + List beanClassifications = null; + + if (entityClassifications != null) + { + beanClassifications = new ArrayList<>(); + + for (Classification entityClassification : entityClassifications) + { + if (entityClassification != null) + { + ElementClassification beanClassification = new ElementClassification(); + + beanClassification.setClassificationName(entityClassification.getName()); + beanClassification.setClassificationProperties(repositoryHelper.getInstancePropertiesAsMap(entityClassification.getProperties())); + + beanClassifications.add(beanClassification); + } + } + + } + + return beanClassifications; + } + + + /** + * Retrieve a specific named classification. + * + * @param classificationName name of classification + * @param beanClassifications list of classifications retrieved from the repositories + * @return null or the requested classification + */ + protected ElementClassification getClassification(String classificationName, + List beanClassifications) + { + if ((classificationName != null) && (beanClassifications != null)) + { + for (ElementClassification classification : beanClassifications) + { + if (classification != null) + { + if (classification.getClassificationName().equals(classificationName)) + { + return classification; + } + } + } + } + + return null; + } + + + /** + * Remove the requested classification from the bean classifications and return the resulting list. + * + * @param classificationName name of the classification + * @param beanClassifications list of classifications retrieved from the repositories + * @return null or a list of classifications + */ + protected List removeClassification(String classificationName, + List beanClassifications) + { + if ((classificationName != null) && (beanClassifications != null)) + { + List results = new ArrayList<>(); + + for (ElementClassification classification : beanClassifications) + { + if (classification != null) + { + if (! classification.getClassificationName().equals(classificationName)) + { + results.add(classification); + } + } + } + + if (! results.isEmpty()) + { + return results; + } + } + + return null; + } + + + /** + * Convert information from a repository instance into an Open Connector Framework ElementType. + * + * @param instanceHeader audit header from the repository + * @return OCF ElementType object + */ + ElementType getElementType(InstanceAuditHeader instanceHeader) + { + ElementType elementType = new ElementType(); + + InstanceType instanceType = instanceHeader.getType(); + + if (instanceType != null) + { + elementType.setTypeId(instanceType.getTypeDefGUID()); + elementType.setTypeName(instanceType.getTypeDefName()); + elementType.setTypeVersion(instanceType.getTypeDefVersion()); + elementType.setTypeDescription(instanceType.getTypeDefDescription()); + + List typeDefSuperTypes = instanceType.getTypeDefSuperTypes(); + + if ((typeDefSuperTypes != null) && (! typeDefSuperTypes.isEmpty())) + { + List superTypes = new ArrayList<>(); + + for (TypeDefLink typeDefLink : typeDefSuperTypes) + { + if (typeDefLink != null) + { + superTypes.add(typeDefLink.getName()); + } + } + + if (! superTypes.isEmpty()) + { + elementType.setSuperTypeNames(superTypes); + } + } + } + + return elementType; + } + + + /** + * Extract detail of the version of the element and the user's maintaining it. + * + * @param header audit header from the repository + * @return ElementVersions object + */ + ElementVersions getElementVersions(InstanceAuditHeader header) + { + ElementVersions elementVersions = new ElementVersions(); + + elementVersions.setCreatedBy(header.getCreatedBy()); + elementVersions.setCreateTime(header.getCreateTime()); + elementVersions.setUpdatedBy(header.getUpdatedBy()); + elementVersions.setUpdateTime(header.getUpdateTime()); + elementVersions.setMaintainedBy(header.getMaintainedBy()); + elementVersions.setVersion(header.getVersion()); + + return elementVersions; + } + + + /** + * Translate the repository services' InstanceProvenanceType to an ElementOrigin. + * + * @param instanceProvenanceType value from the repository services + * @return ElementOrigin enum + */ + ElementOriginCategory getElementOriginCategory(InstanceProvenanceType instanceProvenanceType) + { + if (instanceProvenanceType != null) + { + switch (instanceProvenanceType) + { + case DEREGISTERED_REPOSITORY: + return ElementOriginCategory.DEREGISTERED_REPOSITORY; + + case EXTERNAL_SOURCE: + return ElementOriginCategory.EXTERNAL_SOURCE; + + case EXPORT_ARCHIVE: + return ElementOriginCategory.EXPORT_ARCHIVE; + + case LOCAL_COHORT: + return ElementOriginCategory.LOCAL_COHORT; + + case CONTENT_PACK: + return ElementOriginCategory.CONTENT_PACK; + + case CONFIGURATION: + return ElementOriginCategory.CONFIGURATION; + + case UNKNOWN: + return ElementOriginCategory.UNKNOWN; + } + } + + return ElementOriginCategory.UNKNOWN; + } + + + /** + * Using the supplied instances, return a new instance of a relatedElement bean. This is used for beans that + * contain a combination of the properties from an entity and that of a connected relationship. + * + * @param beanClass name of the class to create + * @param entity entity containing the properties + * @param relationship relationship containing the properties + * @param methodName calling method + * @return bean populated with properties from the instances supplied + * @throws PropertyServerException there is a problem instantiating the bean + */ + public RelatedElement getRelatedElement(Class beanClass, + EntityDetail entity, + Relationship relationship, + String methodName) throws PropertyServerException + { + RelatedElement relatedElement = new RelatedElement(); + + relatedElement.setRelationshipHeader(this.getMetadataElementHeader(beanClass, relationship, null, methodName)); + + if (relationship != null) + { + InstanceProperties instanceProperties = new InstanceProperties(relationship.getProperties()); + + RelationshipProperties relationshipProperties = new RelationshipProperties(); + + relationshipProperties.setEffectiveFrom(instanceProperties.getEffectiveFromTime()); + relationshipProperties.setEffectiveTo(instanceProperties.getEffectiveToTime()); + relationshipProperties.setExtendedProperties(this.getRemainingExtendedProperties(instanceProperties)); + + relatedElement.setRelationshipProperties(relationshipProperties); + } + else + { + handleMissingMetadataInstance(beanClass.getName(), TypeDefCategory.RELATIONSHIP_DEF, methodName); + } + + + if (entity != null) + { + ElementStub elementStub = this.getElementStub(beanClass, entity, methodName); + + relatedElement.setRelatedElement(elementStub); + } + else + { + handleMissingMetadataInstance(beanClass.getName(), TypeDefCategory.ENTITY_DEF, methodName); + } + + return relatedElement; + } + + + /** + * Retrieve the ContactMethodType enum property from the instance properties of an entity + * + * @param properties entity properties + * @return ContactMethodType enum value + */ + ContactMethodType getContactMethodTypeFromProperties(InstanceProperties properties) + { + final String methodName = "getContactMethodTypeFromProperties"; + + ContactMethodType contactMethodType = ContactMethodType.OTHER; + + if (properties != null) + { + int ordinal = repositoryHelper.removeEnumPropertyOrdinal(serviceName, OpenMetadataAPIMapper.CONTACT_METHOD_TYPE_PROPERTY_NAME, properties, methodName); + + switch (ordinal) + { + case 0: + contactMethodType = ContactMethodType.EMAIL; + break; + + case 1: + contactMethodType = ContactMethodType.PHONE; + break; + + case 2: + contactMethodType = ContactMethodType.CHAT; + break; + + case 3: + contactMethodType = ContactMethodType.PROFILE; + break; + + case 4: + contactMethodType = ContactMethodType.ACCOUNT; + break; + + case 99: + contactMethodType = ContactMethodType.OTHER; + break; + } + } + + return contactMethodType; + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/converters/RelatedElementConverter.java b/open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/converters/RelatedElementConverter.java new file mode 100644 index 00000000000..d09fb0338b4 --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/converters/RelatedElementConverter.java @@ -0,0 +1,63 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.converters; + + + +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper; + + + +/** + * RelatedElementConverter generates a RelatedElement from a relationship and attached entity + */ +public class RelatedElementConverter extends ProjectManagementOMASConverter +{ + /** + * Constructor + * + * @param repositoryHelper helper object to parse entity + * @param serviceName name of this component + * @param serverName local server name + */ + public RelatedElementConverter(OMRSRepositoryHelper repositoryHelper, + String serviceName, + String serverName) + { + super(repositoryHelper, serviceName, serverName); + } + + + + /** + * Using the supplied instances, return a new instance of the bean. This is used for beans that + * contain a combination of the properties from an entity and that of a connected relationship. + * + * @param beanClass name of the class to create + * @param entity entity containing the properties + * @param relationship relationship containing the properties + * @param methodName calling method + * @return bean populated with properties from the instances supplied + * @throws PropertyServerException there is a problem instantiating the bean + */ + @Override + public B getNewBean(Class beanClass, + EntityDetail entity, + Relationship relationship, + String methodName) throws PropertyServerException + { + try + { + return (B)this.getRelatedElement(beanClass, entity, relationship, methodName); + } + catch (ClassCastException error) + { + super.handleInvalidBeanClass(beanClass.getName(), error, methodName); + } + + return null; + } +} diff --git a/open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/converters/package-info.java b/open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/converters/package-info.java new file mode 100644 index 00000000000..0723878e383 --- /dev/null +++ b/open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/converters/package-info.java @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.projectmanagement.converters; + +/** + * The converters are responsible for converting entities, classifications and relationships retrieved from the + * open metadata repositories into Community Profile OMAS beans. + * + * The inheritance structure follows closely to the inheritance structure of the beans themselves and the naming + * convention is consistent. The converter used is the one that corresponds to the desired bean. + * When a converter is created, it is passed the entity with its embedded classifications and a relationship if + * required on the constructor. The bean is retrieved by calling getBean(). + */ \ No newline at end of file diff --git a/open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/server/ProjectManagementInstanceHandler.java b/open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/server/ProjectManagementInstanceHandler.java index c03ecb77b76..81ef2269108 100644 --- a/open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/server/ProjectManagementInstanceHandler.java +++ b/open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/server/ProjectManagementInstanceHandler.java @@ -2,8 +2,22 @@ /* Copyright Contributors to the ODPi Egeria project. */ package org.odpi.openmetadata.accessservices.projectmanagement.server; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.ActorProfileElement; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.PersonRoleElement; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.ProjectElement; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.RelatedElement; import org.odpi.openmetadata.adminservices.configuration.registration.AccessServiceDescription; +import org.odpi.openmetadata.commonservices.generichandlers.ActorProfileHandler; +import org.odpi.openmetadata.commonservices.generichandlers.CommunityHandler; +import org.odpi.openmetadata.commonservices.generichandlers.ContributionRecordHandler; +import org.odpi.openmetadata.commonservices.generichandlers.PersonRoleHandler; +import org.odpi.openmetadata.commonservices.generichandlers.ProjectHandler; +import org.odpi.openmetadata.commonservices.generichandlers.ReferenceableHandler; +import org.odpi.openmetadata.commonservices.generichandlers.SoftwareCapabilityHandler; import org.odpi.openmetadata.commonservices.multitenant.OMASServiceInstanceHandler; +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; /** @@ -22,4 +36,128 @@ class ProjectManagementInstanceHandler extends OMASServiceInstanceHandler ProjectManagementRegistration.registerAccessService(); } + + + /** + * Retrieve the specific handler for the access service. + * + * @param userId calling user + * @param serverName name of the server tied to the request + * @param serviceOperationName name of the REST API call (typically the top-level methodName) + * @return handler for use by the requested instance + * @throws InvalidParameterException no available instance for the requested server + * @throws UserNotAuthorizedException user does not have access to the requested server + * @throws PropertyServerException the service name is not known - indicating a logic error + */ + ReferenceableHandler getRelatedElementHandler(String userId, + String serverName, + String serviceOperationName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + ProjectManagementServicesInstance instance = (ProjectManagementServicesInstance)super.getServerServiceInstance(userId, + serverName, + serviceOperationName); + + if (instance != null) + { + return instance.getRelatedElementHandler(); + } + + return null; + } + + + /** + * Retrieve the specific handler for the access service. + * + * @param userId calling user + * @param serverName name of the server tied to the request + * @param serviceOperationName name of the REST API call (typically the top-level methodName) + * @return handler for use by the requested instance + * @throws InvalidParameterException no available instance for the requested server + * @throws UserNotAuthorizedException user does not have access to the requested server + * @throws PropertyServerException the service name is not known - indicating a logic error + */ + ActorProfileHandler getActorProfileHandler(String userId, + String serverName, + String serviceOperationName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + ProjectManagementServicesInstance instance = (ProjectManagementServicesInstance)super.getServerServiceInstance(userId, + serverName, + serviceOperationName); + + if (instance != null) + { + return instance.getActorProfileHandler(); + } + + return null; + } + + + + /** + * Retrieve the specific handler for the access service. + * + * @param userId calling user + * @param serverName name of the server tied to the request + * @param serviceOperationName name of the REST API call (typically the top-level methodName) + * @return handler for use by the requested instance + * @throws InvalidParameterException no available instance for the requested server + * @throws UserNotAuthorizedException user does not have access to the requested server + * @throws PropertyServerException the service name is not known - indicating a logic error + */ + PersonRoleHandler getPersonRoleHandler(String userId, + String serverName, + String serviceOperationName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + ProjectManagementServicesInstance instance = (ProjectManagementServicesInstance)super.getServerServiceInstance(userId, + serverName, + serviceOperationName); + + if (instance != null) + { + return instance.getPersonRoleHandler(); + } + + return null; + } + + + + /** + * Retrieve the specific handler for the access service. + * + * @param userId calling user + * @param serverName name of the server tied to the request + * @param serviceOperationName name of the REST API call (typically the top-level methodName) + * @return handler for use by the requested instance + * @throws InvalidParameterException no available instance for the requested server + * @throws UserNotAuthorizedException user does not have access to the requested server + * @throws PropertyServerException the service name is not known - indicating a logic error + */ + ProjectHandler getProjectHandler(String userId, + String serverName, + String serviceOperationName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + ProjectManagementServicesInstance instance = (ProjectManagementServicesInstance)super.getServerServiceInstance(userId, + serverName, + serviceOperationName); + + if (instance != null) + { + return instance.getProjectHandler(); + } + + return null; + } + + } diff --git a/open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/server/ProjectManagementRESTServices.java b/open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/server/ProjectManagementRESTServices.java index 3770edc42db..ad0dadb7291 100644 --- a/open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/server/ProjectManagementRESTServices.java +++ b/open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/server/ProjectManagementRESTServices.java @@ -3,10 +3,45 @@ package org.odpi.openmetadata.accessservices.projectmanagement.server; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.ActorProfileElement; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.PersonRoleElement; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.ProjectElement; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.RelatedElement; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.AssignmentScopeProperties; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.ProjectProperties; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.ProjectTeamProperties; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.ResourceListProperties; +import org.odpi.openmetadata.accessservices.projectmanagement.properties.StakeholderProperties; +import org.odpi.openmetadata.accessservices.projectmanagement.rest.ActorProfileListResponse; +import org.odpi.openmetadata.accessservices.projectmanagement.rest.ExternalSourceRequestBody; +import org.odpi.openmetadata.accessservices.projectmanagement.rest.PersonRoleListResponse; +import org.odpi.openmetadata.accessservices.projectmanagement.rest.ProjectListResponse; +import org.odpi.openmetadata.accessservices.projectmanagement.rest.ProjectResponse; +import org.odpi.openmetadata.accessservices.projectmanagement.rest.ReferenceableRequestBody; +import org.odpi.openmetadata.accessservices.projectmanagement.rest.RelatedElementListResponse; +import org.odpi.openmetadata.accessservices.projectmanagement.rest.RelationshipRequestBody; +import org.odpi.openmetadata.accessservices.projectmanagement.rest.TemplateRequestBody; +import org.odpi.openmetadata.commonservices.ffdc.RESTCallLogger; +import org.odpi.openmetadata.commonservices.ffdc.RESTCallToken; import org.odpi.openmetadata.commonservices.ffdc.RESTExceptionHandler; -import org.slf4j.Logger; +import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDResponse; +import org.odpi.openmetadata.commonservices.ffdc.rest.NameRequestBody; +import org.odpi.openmetadata.commonservices.ffdc.rest.SearchStringRequestBody; +import org.odpi.openmetadata.commonservices.ffdc.rest.VoidResponse; +import org.odpi.openmetadata.commonservices.generichandlers.ActorProfileHandler; +import org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIMapper; +import org.odpi.openmetadata.commonservices.generichandlers.PersonRoleHandler; +import org.odpi.openmetadata.commonservices.generichandlers.ProjectHandler; +import org.odpi.openmetadata.commonservices.generichandlers.ReferenceableHandler; +import org.odpi.openmetadata.frameworks.auditlog.AuditLog; +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; import org.slf4j.LoggerFactory; +import java.util.Date; +import java.util.List; + /** * The ProjectManagementRESTServices provides the server-side implementation of the Stewardship Action Open Metadata @@ -15,11 +50,11 @@ */ public class ProjectManagementRESTServices { - private static ProjectManagementInstanceHandler instanceHandler = new ProjectManagementInstanceHandler(); - - private static final Logger log = LoggerFactory.getLogger(ProjectManagementRESTServices.class); + private static final ProjectManagementInstanceHandler instanceHandler = new ProjectManagementInstanceHandler(); - private RESTExceptionHandler restExceptionHandler = new RESTExceptionHandler(); + private final RESTExceptionHandler restExceptionHandler = new RESTExceptionHandler(); + private static final RESTCallLogger restCallLogger = new RESTCallLogger(LoggerFactory.getLogger(ProjectManagementRESTServices.class), + instanceHandler.getServiceName()); /** * Default constructor @@ -28,4 +63,2174 @@ public ProjectManagementRESTServices() { } + + /** + * Create a new metadata element to represent a project. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param requestBody properties to store + * + * @return unique identifier of the new metadata element or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public GUIDResponse createProject(String serverName, + String userId, + ReferenceableRequestBody requestBody) + { + final String methodName = "createProject"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + GUIDResponse response = new GUIDResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ProjectHandler handler = instanceHandler.getProjectHandler(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof ProjectProperties) + { + ProjectProperties properties = (ProjectProperties)requestBody.getProperties(); + + String projectGUID = handler.createProject(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + properties.getQualifiedName(), + properties.getIdentifier(), + properties.getName(), + properties.getDescription(), + properties.getStartDate(), + properties.getPlannedEndDate(), + properties.getStatus(), + properties.getAdditionalProperties(), + properties.getTypeName(), + properties.getExtendedProperties(), + false, + false, + null, + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + new Date(), + methodName); + + if (projectGUID != null) + { + handler.setVendorProperties(userId, + projectGUID, + properties.getVendorProperties(), + false, + false, + new Date(), + methodName); + } + + response.setGUID(projectGUID); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(ProjectProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Create a new metadata element to represent a project using an existing metadata element as a template. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param templateGUID unique identifier of the metadata element to copy + * @param requestBody properties that override the template + * + * @return unique identifier of the new metadata element or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public GUIDResponse createProjectFromTemplate(String serverName, + String userId, + String templateGUID, + TemplateRequestBody requestBody) + { + final String methodName = "createProjectFromTemplate"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + GUIDResponse response = new GUIDResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ProjectHandler handler = instanceHandler.getProjectHandler(userId, serverName, methodName); + + if (requestBody != null) + { + String projectGUID; + + projectGUID = handler.createProjectFromTemplate(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + templateGUID, + requestBody.getQualifiedName(), + requestBody.getIdentifier(), + requestBody.getDisplayName(), + requestBody.getDescription(), + methodName); + + response.setGUID(projectGUID); + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Update the metadata element representing a project. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param projectGUID unique identifier of the metadata element to update + * @param isMergeUpdate should the new properties be merged with the existing properties of overlay them? + * @param requestBody new properties for this element + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse updateProject(String serverName, + String userId, + String projectGUID, + boolean isMergeUpdate, + ReferenceableRequestBody requestBody) + { + final String methodName = "updateProject"; + final String projectGUIDParameterName = "projectGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ProjectHandler handler = instanceHandler.getProjectHandler(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof ProjectProperties) + { + ProjectProperties properties = (ProjectProperties) requestBody.getProperties(); + + handler.updateProject(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + projectGUID, + projectGUIDParameterName, + properties.getQualifiedName(), + properties.getIdentifier(), + properties.getName(), + properties.getDescription(), + properties.getStartDate(), + properties.getPlannedEndDate(), + properties.getStatus(), + properties.getAdditionalProperties(), + properties.getTypeName(), + properties.getExtendedProperties(), + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + isMergeUpdate, + false, + false, + new Date(), + methodName); + + if ((! isMergeUpdate) || (properties.getVendorProperties() != null)) + { + handler.setVendorProperties(userId, + projectGUID, + properties.getVendorProperties(), + false, + false, + new Date(), + methodName); + } + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(ProjectProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Create a ProjectTeam relationship between a project and an actor profile (typically a team). + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param projectGUID unique identifier of the project + * @param projectRoleGUID unique identifier of the actor + * @param requestBody relationship properties + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse setupProjectTeam(String serverName, + String userId, + String projectGUID, + String projectRoleGUID, + RelationshipRequestBody requestBody) + { + final String methodName = "setupProjectTeam"; + final String projectGUIDParameterName = "projectGUID"; + final String projectRoleGUIDParameterName = "projectRoleGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ProjectHandler handler = instanceHandler.getProjectHandler(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof ProjectTeamProperties) + { + ProjectTeamProperties properties = (ProjectTeamProperties) requestBody.getProperties(); + + handler.addActorToProject(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + projectGUID, + projectGUIDParameterName, + projectRoleGUID, + projectRoleGUIDParameterName, + properties.getTeamRole(), + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + false, + false, + new Date(), + methodName); + } + else if (requestBody.getProperties() == null) + { + handler.addActorToProject(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + projectGUID, + projectGUIDParameterName, + projectRoleGUID, + projectRoleGUIDParameterName, + null, + null, + null, + false, + false, + new Date(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(ProjectTeamProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Remove a ProjectTeam relationship between a project and an actor profile (typically a team). + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param projectGUID unique identifier of the project + * @param actorProfileGUID unique identifier of the actor + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse clearProjectTeam(String serverName, + String userId, + String projectGUID, + String actorProfileGUID, + ExternalSourceRequestBody requestBody) + { + final String methodName = "clearProjectTeam"; + final String projectGUIDParameterName = "projectGUID"; + final String actorProfileGUIDParameterName = "actorProfileGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ProjectHandler handler = instanceHandler.getProjectHandler(userId, serverName, methodName); + + if (requestBody != null) + { + handler.removeActorFromProject(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + projectGUID, + projectGUIDParameterName, + actorProfileGUID, + actorProfileGUIDParameterName, + false, + false, + new Date(), + methodName); + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Create a relationship between a project and a person role. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param projectGUID unique identifier of the project + * @param projectRoleGUID unique identifier of the person role + * @param requestBody relationship properties + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse setupProjectManagementRole(String serverName, + String userId, + String projectGUID, + String projectRoleGUID, + RelationshipRequestBody requestBody) + { + final String methodName = "setupProjectManagementRole"; + final String projectGUIDParameterName = "projectGUID"; + final String projectRoleGUIDParameterName = "projectRoleGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ProjectHandler handler = instanceHandler.getProjectHandler(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() != null) + { + ProjectTeamProperties properties = (ProjectTeamProperties) requestBody.getProperties(); + + handler.addProjectManager(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + projectGUID, + projectGUIDParameterName, + projectRoleGUID, + projectRoleGUIDParameterName, + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + false, + false, + new Date(), + methodName); + } + else + { + handler.addProjectManager(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + projectGUID, + projectGUIDParameterName, + projectRoleGUID, + projectRoleGUIDParameterName, + null, + null, + false, + false, + new Date(), + methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Remove a relationship between a project and a person role. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param projectGUID unique identifier of the project + * @param projectRoleGUID unique identifier of the person role + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse clearProjectManagementRole(String serverName, + String userId, + String projectGUID, + String projectRoleGUID, + ExternalSourceRequestBody requestBody) + { + final String methodName = "clearProjectManagementRole"; + final String projectGUIDParameterName = "projectGUID"; + final String projectRoleGUIDParameterName = "projectRoleGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ProjectHandler handler = instanceHandler.getProjectHandler(userId, serverName, methodName); + + if (requestBody != null) + { + handler.removeProjectManager(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + projectGUID, + projectGUIDParameterName, + projectRoleGUID, + projectRoleGUIDParameterName, + false, + false, + new Date(), + methodName); + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Remove the metadata element representing a project. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param projectGUID unique identifier of the metadata element to remove + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse removeProject(String serverName, + String userId, + String projectGUID, + ExternalSourceRequestBody requestBody) + { + final String methodName = "removeProject"; + final String projectGUIDParameterName = "projectGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + if (requestBody != null) + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ProjectHandler handler = instanceHandler.getProjectHandler(userId, serverName, methodName); + + handler.removeProject(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + projectGUID, + projectGUIDParameterName, + false, + false, + new Date(), + methodName); + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Retrieve the list of project metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param requestBody string to find in the properties + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public ProjectListResponse findProjects(String serverName, + String userId, + SearchStringRequestBody requestBody, + int startFrom, + int pageSize) + { + final String methodName = "findProjects"; + final String searchStringParameterName = "searchString"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + ProjectListResponse response = new ProjectListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + if (requestBody != null) + { + ProjectHandler handler = instanceHandler.getProjectHandler(userId, serverName, methodName); + + List projects = handler.findProjects(userId, + requestBody.getSearchString(), + searchStringParameterName, + startFrom, + pageSize, + false, + false, + new Date(), + methodName); + + response.setElements(setUpVendorProperties(userId, projects, handler, methodName)); + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Retrieve the list of project metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param requestBody name to search for + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public ProjectListResponse getProjectsByName(String serverName, + String userId, + NameRequestBody requestBody, + int startFrom, + int pageSize) + { + final String methodName = "getProjectsByName"; + final String nameParameterName = "name"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + ProjectListResponse response = new ProjectListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + if (requestBody != null) + { + ProjectHandler handler = instanceHandler.getProjectHandler(userId, serverName, methodName); + + List projects = handler.getProjectsByName(userId, + requestBody.getName(), + nameParameterName, + startFrom, + pageSize, + false, + false, + new Date(), + methodName); + + response.setElements(setUpVendorProperties(userId, projects, handler, methodName)); + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Return information about the project management roles linked to a project. + * + * @param serverName called server + * @param userId calling user + * @param projectGUID unique identifier for the project + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching person roles + * + * InvalidParameterException name or userId is null + * PropertyServerException problem accessing property server + * UserNotAuthorizedException security access problem + */ + public PersonRoleListResponse getProjectManagementRoles(String serverName, + String userId, + String projectGUID, + int startFrom, + int pageSize) + { + final String methodName = "getProjectManagementRoles"; + final String guidParameterName = "projectGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + PersonRoleListResponse response = new PersonRoleListResponse(); + AuditLog auditLog = null; + + try + { + PersonRoleHandler handler = instanceHandler.getPersonRoleHandler(userId, serverName, methodName); + + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + response.setElements(handler.getProjectManagerRoles(userId, + projectGUID, + guidParameterName, + startFrom, + pageSize, + false, + false, + new Date(), + methodName)); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + + + /** + * Return information about the actors linked to a project. + * + * @param serverName called server + * @param userId calling user + * @param projectGUID unique identifier for the project + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching person roles + * + * InvalidParameterException name or userId is null + * PropertyServerException problem accessing property server + * UserNotAuthorizedException security access problem + */ + public ActorProfileListResponse getProjectActors(String serverName, + String userId, + String projectGUID, + int startFrom, + int pageSize) + { + final String methodName = "getProjectActors"; + final String guidParameterName = "projectGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + ActorProfileListResponse response = new ActorProfileListResponse(); + AuditLog auditLog = null; + + try + { + ActorProfileHandler handler = instanceHandler.getActorProfileHandler(userId, serverName, methodName); + + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + response.setElements(handler.getActorsForProject(userId, + projectGUID, + guidParameterName, + startFrom, + pageSize, + false, + false, + new Date(), + methodName)); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Retrieve the list of project metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public ProjectListResponse getProjects(String serverName, + String userId, + int startFrom, + int pageSize) + { + final String methodName = "getProjects"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + ProjectListResponse response = new ProjectListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ProjectHandler handler = instanceHandler.getProjectHandler(userId, serverName, methodName); + + List projects = handler.getProjects(userId, + startFrom, + pageSize, + false, + false, + new Date(), + methodName); + + response.setElements(setUpVendorProperties(userId, projects, handler, methodName)); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Retrieve the project metadata element with the supplied unique identifier. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param guid unique identifier of the requested metadata element + * + * @return matching metadata element or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public ProjectResponse getProjectByGUID(String serverName, + String userId, + String guid) + { + final String methodName = "getProjectByGUID"; + final String guidParameterName = "projectGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + ProjectResponse response = new ProjectResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ProjectHandler handler = instanceHandler.getProjectHandler(userId, serverName, methodName); + + ProjectElement project = handler.getProjectByGUID(userId, + guid, + guidParameterName, + false, + false, + new Date(), + methodName); + + response.setElement(setUpVendorProperties(userId, project, handler, methodName)); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + + /** + * Set up the vendor properties in the retrieved elements. + * + * @param userId calling user + * @param retrievedResults results from the repositories + * @param handler handler used to retrieve the vendor properties + * @param methodName calling method + * + * @return updated results + * + * @throws InvalidParameterException one of the parameters is null or invalid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + private List setUpVendorProperties(String userId, + List retrievedResults, + ProjectHandler handler, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + if (retrievedResults != null) + { + for (ProjectElement element : retrievedResults) + { + if (element != null) + { + setUpVendorProperties(userId, element, handler, methodName); + } + } + } + + return retrievedResults; + } + + + /** + * Set up the vendor properties in the retrieved element. + * + * @param userId calling user + * @param element results from the repositories + * @param handler handler used to retrieve the vendor properties + * @param methodName calling method + * + * @return updated results + * + * @throws InvalidParameterException one of the parameters is null or invalid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + private ProjectElement setUpVendorProperties(String userId, + ProjectElement element, + ProjectHandler handler, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String elementGUIDParameterName = "element.getElementHeader().getGUID()"; + + if (element != null) + { + ProjectProperties properties = element.getProperties(); + + properties.setVendorProperties(handler.getVendorProperties(userId, + element.getElementHeader().getGUID(), + elementGUIDParameterName, + false, + false, + new Date(), + methodName)); + } + + return element; + } + + + + + /** + * Create a "MoreInformation" relationship between an element that is descriptive and one that is providing the detail. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element that is descriptive + * @param detailGUID unique identifier of the element that provides the detail + * @param requestBody relationship properties + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse setupMoreInformation(String serverName, + String userId, + String elementGUID, + String detailGUID, + RelationshipRequestBody requestBody) + { + final String methodName = "setupMoreInformation"; + final String elementGUIDParameterName = "elementGUID"; + final String detailGUIDParameterName = "detailGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ReferenceableHandler handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() != null) + { + handler.addMoreInformation(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + elementGUID, + elementGUIDParameterName, + detailGUID, + detailGUIDParameterName, + requestBody.getProperties().getEffectiveFrom(), + requestBody.getProperties().getEffectiveTo(), + false, + false, + new Date(), + methodName); + } + else + { + handler.addMoreInformation(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + elementGUID, + elementGUIDParameterName, + detailGUID, + detailGUIDParameterName, + null, + null, + false, + false, + new Date(), + methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Remove a "MoreInformation" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element that is descriptive + * @param detailGUID unique identifier of the element that provides the detail + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse clearMoreInformation(String serverName, + String userId, + String elementGUID, + String detailGUID, + ExternalSourceRequestBody requestBody) + { + final String methodName = "clearMoreInformation"; + final String elementGUIDParameterName = "elementGUID"; + final String detailGUIDParameterName = "detailGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ReferenceableHandler handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); + + if (requestBody != null) + { + handler.removeMoreInformation(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + elementGUID, + elementGUIDParameterName, + detailGUID, + detailGUIDParameterName, + false, + false, + new Date(), + methodName); + } + else + { + handler.removeMoreInformation(userId, + null, + null, + elementGUID, + elementGUIDParameterName, + detailGUID, + detailGUIDParameterName, + false, + false, + new Date(), + methodName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Retrieve the detail elements linked via a "MoreInformation" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element that is descriptive + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public RelatedElementListResponse getMoreInformation(String serverName, + String userId, + String elementGUID, + int startFrom, + int pageSize) + { + final String methodName = "getMoreInformation"; + final String guidPropertyName = "elementGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + RelatedElementListResponse response = new RelatedElementListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ReferenceableHandler handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); + + handler.getMoreInformation(userId, + elementGUID, + guidPropertyName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + startFrom, + pageSize, + false, + false, + new Date(), + methodName); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Retrieve the descriptive elements linked via a "MoreInformation" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param detailGUID unique identifier of the element that provides the detail + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public RelatedElementListResponse getDescriptiveElements(String serverName, + String userId, + String detailGUID, + int startFrom, + int pageSize) + { + final String methodName = "getDescriptiveElements"; + final String guidPropertyName = "detailGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + RelatedElementListResponse response = new RelatedElementListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ReferenceableHandler handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); + + handler.getDescriptiveElements(userId, + detailGUID, + guidPropertyName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + startFrom, + pageSize, + false, + false, + new Date(), + methodName); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Create a "Stakeholder" relationship between an element and its stakeholder. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param stakeholderGUID unique identifier of the stakeholder + * @param requestBody relationship properties + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse setupStakeholder(String serverName, + String userId, + String elementGUID, + String stakeholderGUID, + RelationshipRequestBody requestBody) + { + final String methodName = "setupStakeholder"; + final String elementGUIDParameterName = "elementGUID"; + final String stakeholderGUIDParameterName = "stakeholderGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ReferenceableHandler handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof StakeholderProperties) + { + StakeholderProperties properties = (StakeholderProperties) requestBody.getProperties(); + + handler.addStakeholder(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + elementGUID, + elementGUIDParameterName, + stakeholderGUID, + stakeholderGUIDParameterName, + properties.getStakeholderRole(), + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + false, + false, + new Date(), + methodName); + } + else if (requestBody.getProperties() == null) + { + handler.addMoreInformation(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + elementGUID, + elementGUIDParameterName, + stakeholderGUID, + stakeholderGUIDParameterName, + null, + null, + false, + false, + new Date(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(StakeholderProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Remove a "Stakeholder" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param stakeholderGUID unique identifier of the stakeholder + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse clearStakeholder(String serverName, + String userId, + String elementGUID, + String stakeholderGUID, + ExternalSourceRequestBody requestBody) + { + final String methodName = "clearStakeholder"; + final String elementGUIDParameterName = "elementGUID"; + final String stakeholderGUIDParameterName = "stakeholderGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ReferenceableHandler handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); + + if (requestBody != null) + { + handler.removeStakeholder(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + elementGUID, + elementGUIDParameterName, + stakeholderGUID, + stakeholderGUIDParameterName, + false, + false, + new Date(), + methodName); + } + else + { + handler.removeStakeholder(userId, + null, + null, + elementGUID, + elementGUIDParameterName, + stakeholderGUID, + stakeholderGUIDParameterName, + false, + false, + new Date(), + methodName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Retrieve the stakeholder elements linked via the "Stakeholder" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public RelatedElementListResponse getStakeholders(String serverName, + String userId, + String elementGUID, + int startFrom, + int pageSize) + { + final String methodName = "getStakeholders"; + final String guidPropertyName = "elementGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + RelatedElementListResponse response = new RelatedElementListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ReferenceableHandler handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); + + handler.getStakeholders(userId, + elementGUID, + guidPropertyName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + startFrom, + pageSize, + false, + false, + new Date(), + methodName); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Retrieve the elements commissioned by a stakeholder, linked via the "Stakeholder" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param stakeholderGUID unique identifier of the stakeholder + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public RelatedElementListResponse getStakeholderCommissionedElements(String serverName, + String userId, + String stakeholderGUID, + int startFrom, + int pageSize) + { + final String methodName = "getStakeholderCommissionedElements"; + final String guidPropertyName = "stakeholderGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + RelatedElementListResponse response = new RelatedElementListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ReferenceableHandler handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); + + handler.getCommissionedByStakeholder(userId, + stakeholderGUID, + guidPropertyName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + startFrom, + pageSize, + false, + false, + new Date(), + methodName); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Create an "AssignmentScope" relationship between an element and its scope. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param scopeGUID unique identifier of the scope + * @param requestBody relationship properties + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse setupAssignmentScope(String serverName, + String userId, + String elementGUID, + String scopeGUID, + RelationshipRequestBody requestBody) + { + final String methodName = "setupAssignmentScope"; + final String elementGUIDParameterName = "elementGUID"; + final String scopeGUIDParameterName = "scopeGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ReferenceableHandler handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof AssignmentScopeProperties) + { + AssignmentScopeProperties properties = (AssignmentScopeProperties) requestBody.getProperties(); + + handler.addAssignmentScope(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + elementGUID, + elementGUIDParameterName, + scopeGUID, + scopeGUIDParameterName, + properties.getAssignmentType(), + properties.getDescription(), + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + false, + false, + new Date(), + methodName); + } + else if (requestBody.getProperties() == null) + { + handler.addAssignmentScope(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + elementGUID, + elementGUIDParameterName, + scopeGUID, + scopeGUIDParameterName, + null, + null, + null, + null, + false, + false, + new Date(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(AssignmentScopeProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Remove an "AssignmentScope" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param scopeGUID unique identifier of the scope + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse clearAssignmentScope(String serverName, + String userId, + String elementGUID, + String scopeGUID, + ExternalSourceRequestBody requestBody) + { + final String methodName = "clearAssignmentScope"; + final String elementGUIDParameterName = "elementGUID"; + final String scopeGUIDParameterName = "scopeGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ReferenceableHandler handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); + + if (requestBody != null) + { + handler.removeAssignmentScope(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + elementGUID, + elementGUIDParameterName, + scopeGUID, + scopeGUIDParameterName, + false, + false, + new Date(), + methodName); + } + else + { + handler.removeAssignmentScope(userId, + null, + null, + elementGUID, + elementGUIDParameterName, + scopeGUID, + scopeGUIDParameterName, + false, + false, + new Date(), + methodName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Retrieve the assigned scopes linked by the "AssignmentScope" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public RelatedElementListResponse getAssignedScopes(String serverName, + String userId, + String elementGUID, + int startFrom, + int pageSize) + { + final String methodName = "getAssignedScopes"; + final String guidPropertyName = "elementGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + RelatedElementListResponse response = new RelatedElementListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ReferenceableHandler handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); + + handler.getAssignmentScope(userId, + elementGUID, + guidPropertyName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + startFrom, + pageSize, + false, + false, + new Date(), + methodName); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Retrieve the assigned actors linked by the "AssignmentScope" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param scopeGUID unique identifier of the scope + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public RelatedElementListResponse getAssignedActors(String serverName, + String userId, + String scopeGUID, + int startFrom, + int pageSize) + { + final String methodName = "getAssignedActors"; + final String guidPropertyName = "scopeGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + RelatedElementListResponse response = new RelatedElementListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ReferenceableHandler handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); + + handler.getAssignedActors(userId, + scopeGUID, + guidPropertyName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + startFrom, + pageSize, + false, + false, + new Date(), + methodName); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Create a "ResourceList" relationship between a consuming element and an element that represents resources. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param resourceGUID unique identifier of the resource + * @param requestBody relationship properties + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse setupResource(String serverName, + String userId, + String elementGUID, + String resourceGUID, + RelationshipRequestBody requestBody) + { + final String methodName = "setupResource"; + final String elementGUIDParameterName = "elementGUID"; + final String resourceGUIDParameterName = "resourceGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ReferenceableHandler handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof ResourceListProperties) + { + ResourceListProperties properties = (ResourceListProperties) requestBody.getProperties(); + + handler.saveResourceListMember(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + elementGUID, + elementGUIDParameterName, + resourceGUID, + resourceGUIDParameterName, + properties.getResourceUse(), + properties.getWatchResource(), + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + false, + false, + new Date(), + methodName); + } + else if (requestBody.getProperties() == null) + { + handler.saveResourceListMember(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + elementGUID, + elementGUIDParameterName, + resourceGUID, + resourceGUIDParameterName, + null, + false, + null, + null, + false, + false, + new Date(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(ResourceListProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Remove a "ResourceList" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param resourceGUID unique identifier of the resource + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse clearResource(String serverName, + String userId, + String elementGUID, + String resourceGUID, + ExternalSourceRequestBody requestBody) + { + final String methodName = "clearResource"; + final String elementGUIDParameterName = "elementGUID"; + final String resourceGUIDParameterName = "resourceGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ReferenceableHandler handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); + + if (requestBody != null) + { + handler.removeResourceListMember(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + elementGUID, + elementGUIDParameterName, + resourceGUID, + resourceGUIDParameterName, + false, + false, + new Date(), + methodName); + } + else + { + handler.removeResourceListMember(userId, + null, + null, + elementGUID, + elementGUIDParameterName, + resourceGUID, + resourceGUIDParameterName, + false, + false, + new Date(), + methodName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Retrieve the list of resources assigned to an element via the "ResourceList" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public RelatedElementListResponse getResourceList(String serverName, + String userId, + String elementGUID, + int startFrom, + int pageSize) + { + final String methodName = "getResourceList"; + final String guidPropertyName = "elementGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + RelatedElementListResponse response = new RelatedElementListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ReferenceableHandler handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); + + handler.getResourceList(userId, + elementGUID, + guidPropertyName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + startFrom, + pageSize, + false, + false, + new Date(), + methodName); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Retrieve the list of elements assigned to a resource via the "ResourceList" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param resourceGUID unique identifier of the resource + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public RelatedElementListResponse getSupportedByResource(String serverName, + String userId, + String resourceGUID, + int startFrom, + int pageSize) + { + final String methodName = "getSupportedByResource"; + final String guidPropertyName = "resourceGUID"; + + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + RelatedElementListResponse response = new RelatedElementListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ReferenceableHandler handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); + + handler.getSupportedByResource(userId, + resourceGUID, + guidPropertyName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + startFrom, + pageSize, + false, + false, + new Date(), + methodName); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } } \ No newline at end of file diff --git a/open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/server/ProjectManagementRegistration.java b/open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/server/ProjectManagementRegistration.java index 0a649427cf5..b5c2eea84e0 100644 --- a/open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/server/ProjectManagementRegistration.java +++ b/open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/server/ProjectManagementRegistration.java @@ -13,7 +13,7 @@ * ProjectManagementRegistration registers the access service with the OMAG Server administration services. * This registration must be driven once at server start up. The OMAG Server administration services * then use this registration information as confirmation that there is an implementation of this - * access service in the server and it can be configured and used. + * access service in the server, and it can be configured and used. */ public class ProjectManagementRegistration { diff --git a/open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/server/ProjectManagementServicesInstance.java b/open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/server/ProjectManagementServicesInstance.java index 519db511bcc..ecd23b0d88a 100644 --- a/open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/server/ProjectManagementServicesInstance.java +++ b/open-metadata-implementation/access-services/project-management/project-management-server/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/server/ProjectManagementServicesInstance.java @@ -2,11 +2,24 @@ /* Copyright Contributors to the ODPi Egeria project. */ package org.odpi.openmetadata.accessservices.projectmanagement.server; +import org.odpi.openmetadata.accessservices.projectmanagement.converters.ActorProfileConverter; +import org.odpi.openmetadata.accessservices.projectmanagement.converters.PersonRoleConverter; +import org.odpi.openmetadata.accessservices.projectmanagement.converters.ProjectConverter; +import org.odpi.openmetadata.accessservices.projectmanagement.converters.RelatedElementConverter; import org.odpi.openmetadata.accessservices.projectmanagement.ffdc.ProjectManagementErrorCode; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.ActorProfileElement; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.PersonRoleElement; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.ProjectElement; +import org.odpi.openmetadata.accessservices.projectmanagement.metadataelements.RelatedElement; import org.odpi.openmetadata.adminservices.configuration.registration.AccessServiceDescription; +import org.odpi.openmetadata.commonservices.generichandlers.ActorProfileHandler; +import org.odpi.openmetadata.commonservices.generichandlers.PersonRoleHandler; +import org.odpi.openmetadata.commonservices.generichandlers.ProjectHandler; +import org.odpi.openmetadata.commonservices.generichandlers.ReferenceableHandler; import org.odpi.openmetadata.commonservices.multitenant.OMASServiceInstance; import org.odpi.openmetadata.commonservices.multitenant.ffdc.exceptions.NewInstanceException; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryConnector; import java.util.List; @@ -17,8 +30,12 @@ */ public class ProjectManagementServicesInstance extends OMASServiceInstance { - private static AccessServiceDescription myDescription = AccessServiceDescription.PROJECT_MANAGEMENT_OMAS; + private final static AccessServiceDescription myDescription = AccessServiceDescription.PROJECT_MANAGEMENT_OMAS; + private final ReferenceableHandler relatedElementHandler; + private final ActorProfileHandler actorProfileHandler; + private final PersonRoleHandler personRoleHandler; + private final ProjectHandler projectHandler; /** * Set up the handlers for this server. @@ -49,7 +66,62 @@ public ProjectManagementServicesInstance(OMRSRepositoryConnector repositoryConne if (repositoryHandler != null) { - /* Add handlers here */ + this.relatedElementHandler = new ReferenceableHandler<>(new RelatedElementConverter<>(repositoryHelper, serviceName, serverName), + RelatedElement.class, + serviceName, + serverName, + invalidParameterHandler, + repositoryHandler, + repositoryHelper, + localServerUserId, + securityVerifier, + supportedZones, + defaultZones, + publishZones, + auditLog); + + + this.actorProfileHandler = new ActorProfileHandler<>(new ActorProfileConverter<>(repositoryHelper, serviceName, serverName), + ActorProfileElement.class, + serviceName, + serverName, + invalidParameterHandler, + repositoryHandler, + repositoryHelper, + localServerUserId, + securityVerifier, + supportedZones, + defaultZones, + publishZones, + auditLog); + + this.personRoleHandler = new PersonRoleHandler<>(new PersonRoleConverter<>(repositoryHelper, serviceName, serverName), + PersonRoleElement.class, + serviceName, + serverName, + invalidParameterHandler, + repositoryHandler, + repositoryHelper, + localServerUserId, + securityVerifier, + supportedZones, + defaultZones, + publishZones, + auditLog); + + this.projectHandler = new ProjectHandler<>(new ProjectConverter<>(repositoryHelper, serviceName, serverName), + ProjectElement.class, + serviceName, + serverName, + invalidParameterHandler, + repositoryHandler, + repositoryHelper, + localServerUserId, + securityVerifier, + supportedZones, + defaultZones, + publishZones, + auditLog); } else { @@ -60,4 +132,67 @@ public ProjectManagementServicesInstance(OMRSRepositoryConnector repositoryConne } } + + /** + * Return the handler for related referenceables. + * + * @return handler object + * @throws PropertyServerException the instance has not been initialized successfully + */ + public ReferenceableHandler getRelatedElementHandler() throws PropertyServerException + { + final String methodName = "getRelatedElementHandler"; + + validateActiveRepository(methodName); + + return relatedElementHandler; + } + + + /** + * Return the handler for organization requests. + * + * @return handler object + * @throws PropertyServerException the instance has not been initialized successfully + */ + public ActorProfileHandler getActorProfileHandler() throws PropertyServerException + { + final String methodName = "getActorProfileHandler"; + + validateActiveRepository(methodName); + + return actorProfileHandler; + } + + + /** + * Return the handler for role requests. + * + * @return handler object + * @throws PropertyServerException the instance has not been initialized successfully + */ + public PersonRoleHandler getPersonRoleHandler() throws PropertyServerException + { + final String methodName = "getPersonRoleHandler"; + + validateActiveRepository(methodName); + + return personRoleHandler; + } + + + /** + * Return the handler for community requests. + * + * @return handler object + * @throws PropertyServerException the instance has not been initialized successfully + */ + public ProjectHandler getProjectHandler() throws PropertyServerException + { + final String methodName = "getCommunityHandler"; + + validateActiveRepository(methodName); + + return projectHandler; + } } diff --git a/open-metadata-implementation/access-services/project-management/project-management-spring/build.gradle b/open-metadata-implementation/access-services/project-management/project-management-spring/build.gradle index 38b575f1187..fb7d2797000 100644 --- a/open-metadata-implementation/access-services/project-management/project-management-spring/build.gradle +++ b/open-metadata-implementation/access-services/project-management/project-management-spring/build.gradle @@ -5,7 +5,9 @@ dependencies { + implementation project(':open-metadata-implementation:access-services:project-management:project-management-api') implementation project(':open-metadata-implementation:access-services:project-management:project-management-server') + implementation project(':open-metadata-implementation:common-services:ffdc-services') implementation 'org.springframework:spring-web' implementation 'io.swagger.core.v3:swagger-annotations' } diff --git a/open-metadata-implementation/access-services/project-management/project-management-spring/pom.xml b/open-metadata-implementation/access-services/project-management/project-management-spring/pom.xml index 7d1c86e9626..e04f793d83b 100644 --- a/open-metadata-implementation/access-services/project-management/project-management-spring/pom.xml +++ b/open-metadata-implementation/access-services/project-management/project-management-spring/pom.xml @@ -45,6 +45,16 @@ swagger-annotations + + org.odpi.egeria + ffdc-services + + + + org.odpi.egeria + project-management-api + + diff --git a/open-metadata-implementation/access-services/project-management/project-management-spring/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/server/spring/ProjectManagementResource.java b/open-metadata-implementation/access-services/project-management/project-management-spring/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/server/spring/ProjectManagementResource.java index 90d190c7327..1900436d939 100644 --- a/open-metadata-implementation/access-services/project-management/project-management-spring/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/server/spring/ProjectManagementResource.java +++ b/open-metadata-implementation/access-services/project-management/project-management-spring/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/server/spring/ProjectManagementResource.java @@ -4,8 +4,26 @@ import io.swagger.v3.oas.annotations.ExternalDocumentation; import io.swagger.v3.oas.annotations.tags.Tag; +import org.odpi.openmetadata.accessservices.projectmanagement.rest.ActorProfileListResponse; +import org.odpi.openmetadata.accessservices.projectmanagement.rest.ExternalSourceRequestBody; +import org.odpi.openmetadata.accessservices.projectmanagement.rest.PersonRoleListResponse; +import org.odpi.openmetadata.accessservices.projectmanagement.rest.ProjectListResponse; +import org.odpi.openmetadata.accessservices.projectmanagement.rest.ProjectResponse; +import org.odpi.openmetadata.accessservices.projectmanagement.rest.ReferenceableRequestBody; +import org.odpi.openmetadata.accessservices.projectmanagement.rest.RelatedElementListResponse; +import org.odpi.openmetadata.accessservices.projectmanagement.rest.RelationshipRequestBody; +import org.odpi.openmetadata.accessservices.projectmanagement.rest.TemplateRequestBody; import org.odpi.openmetadata.accessservices.projectmanagement.server.ProjectManagementRESTServices; +import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDResponse; +import org.odpi.openmetadata.commonservices.ffdc.rest.NameRequestBody; +import org.odpi.openmetadata.commonservices.ffdc.rest.SearchStringRequestBody; +import org.odpi.openmetadata.commonservices.ffdc.rest.VoidResponse; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -16,7 +34,7 @@ @RestController @RequestMapping("/servers/{serverName}/open-metadata/access-services/project-management/users/{userId}") -@Tag(name="Project Managemen OMASt", description="The Project Management OMAS provides APIs and events for tools and applications that support project leaders - particularly those who are leading governance projects." + +@Tag(name="Project Management OMAS", description="The Project Management OMAS provides APIs and events for tools and applications that support project leaders - particularly those who are leading governance projects." + "\n", externalDocs=@ExternalDocumentation(description="Project Management Open Metadata Access Service (OMAS)",url="https://egeria-project.org/services/omas/project-management/overview/")) public class ProjectManagementResource @@ -30,4 +48,774 @@ public ProjectManagementResource() { } + + /** + * Create a new metadata element to represent a project. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param requestBody properties to store + * + * @return unique identifier of the new metadata element or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/projects") + + public GUIDResponse createProject(@PathVariable String serverName, + @PathVariable String userId, + @RequestBody ReferenceableRequestBody requestBody) + { + return restAPI.createProject(serverName, userId, requestBody); + } + + + /** + * Create a new metadata element to represent a project using an existing metadata element as a template. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param templateGUID unique identifier of the metadata element to copy + * @param requestBody properties that override the template + * + * @return unique identifier of the new metadata element or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/projects/from-template/{templateGUID}") + + public GUIDResponse createProjectFromTemplate(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String templateGUID, + @RequestBody TemplateRequestBody requestBody) + { + return restAPI.createProjectFromTemplate(serverName, userId, templateGUID, requestBody); + } + + + /** + * Update the metadata element representing a project. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param projectGUID unique identifier of the metadata element to update + * @param isMergeUpdate should the new properties be merged with the existing properties of overlay them? + * @param requestBody new properties for this element + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/projects/{projectGUID}") + + public VoidResponse updateProject(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String projectGUID, + @RequestParam boolean isMergeUpdate, + @RequestBody ReferenceableRequestBody requestBody) + { + return restAPI.updateProject(serverName, userId, projectGUID, isMergeUpdate, requestBody); + } + + + /** + * Create a membership relationship between a project and a person role to show that anyone appointed to the role is a member of the project. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param projectGUID unique identifier of the project + * @param projectRoleGUID unique identifier of the person role + * @param requestBody external identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/projects/{projectGUID}/project-management-roles/{projectRoleGUID}") + + public VoidResponse setupProjectManagementRole(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String projectGUID, + @PathVariable String projectRoleGUID, + @RequestBody RelationshipRequestBody requestBody) + { + return restAPI.setupProjectManagementRole(serverName, userId, projectGUID, projectRoleGUID, requestBody); + } + + + /** + * Remove a membership relationship between a project and a person role. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param projectGUID unique identifier of the project + * @param projectRoleGUID unique identifier of the person role + * @param requestBody external identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/projects/{projectGUID}/project-management-roles/{projectRoleGUID}/delete") + + public VoidResponse clearProjectManagementRole(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String projectGUID, + @PathVariable String projectRoleGUID, + @RequestBody ExternalSourceRequestBody requestBody) + { + return restAPI.clearProjectManagementRole(serverName, userId, projectGUID, projectRoleGUID, requestBody); + } + + + /** + * Create a project team relationship between a project and a person role to show that anyone appointed to the role is a member of the project. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param projectGUID unique identifier of the project + * @param actorProfileGUID unique identifier of the actor + * @param requestBody external identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/projects/{projectGUID}/project-teams/{actorProfileGUID}") + + public VoidResponse setupProjectTeam(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String projectGUID, + @PathVariable String actorProfileGUID, + @RequestBody RelationshipRequestBody requestBody) + { + return restAPI.setupProjectTeam(serverName, userId, projectGUID, actorProfileGUID, requestBody); + } + + + /** + * Remove a relationship between a project and a person role. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param projectGUID unique identifier of the project + * @param actorProfileGUID unique identifier of the actor + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/projects/{projectGUID}/project-teams/{actorProfileGUID}/delete") + + public VoidResponse clearProjectTeam(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String projectGUID, + @PathVariable String actorProfileGUID, + @RequestBody ExternalSourceRequestBody requestBody) + { + return restAPI.clearProjectTeam(serverName, userId, projectGUID, actorProfileGUID, requestBody); + } + + + /** + * Remove the metadata element representing a project. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param projectGUID unique identifier of the metadata element to remove + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/projects/{projectGUID}/delete") + + public VoidResponse removeProject(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String projectGUID, + @RequestBody ExternalSourceRequestBody requestBody) + { + return restAPI.removeProject(serverName, userId, projectGUID, requestBody); + } + + + /** + * Retrieve the list of project metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param requestBody string to find in the properties + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/projects/by-search-string") + + public ProjectListResponse findProjects(@PathVariable String serverName, + @PathVariable String userId, + @RequestBody SearchStringRequestBody requestBody, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.findProjects(serverName, userId, requestBody, startFrom, pageSize); + } + + + /** + * Retrieve the list of project metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param requestBody name to search for + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/projects/by-name") + + public ProjectListResponse getProjectsByName(@PathVariable String serverName, + @PathVariable String userId, + @RequestBody NameRequestBody requestBody, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getProjectsByName(serverName, userId, requestBody, startFrom, pageSize); + } + + + /** + * Return information about a person role connected to the named project. + * + * @param serverName called server + * @param userId calling user + * @param projectGUID unique identifier for the project + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching person roles + * + * InvalidParameterException name or userId is null + * PropertyServerException problem accessing property server + * UserNotAuthorizedException security access problem + */ + @GetMapping(path = "/project-managers/by-project/{projectGUID}") + + public PersonRoleListResponse getProjectManagementRoles(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String projectGUID, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getProjectManagementRoles(serverName, userId, projectGUID, startFrom, pageSize); + } + + + /** + * Return information about the actors linked to a project. + * + * @param serverName called server + * @param userId calling user + * @param projectGUID unique identifier for the project + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching person roles + * + * InvalidParameterException name or userId is null + * PropertyServerException problem accessing property server + * UserNotAuthorizedException security access problem + */ + @GetMapping(path = "/project-actors/by-project/{projectGUID}") + + public ActorProfileListResponse getProjectActors(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String projectGUID, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getProjectActors(serverName, userId, projectGUID, startFrom, pageSize); + } + + + /** + * Retrieve the list of project metadata elements. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @GetMapping(path = "/projects") + + public ProjectListResponse getProjectsByName(@PathVariable String serverName, + @PathVariable String userId, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getProjects(serverName, userId, startFrom, pageSize); + } + + + /** + * Retrieve the project metadata element with the supplied unique identifier. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param guid unique identifier of the requested metadata element + * + * @return matching metadata element or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @GetMapping(path = "/projects/{guid}") + + public ProjectResponse getProjectByGUID(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String guid) + { + return restAPI.getProjectByGUID(serverName, userId, guid); + } + + + + /** + * Create a "MoreInformation" relationship between an element that is descriptive and one that is providing the detail. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element that is descriptive + * @param detailGUID unique identifier of the element that provides the detail + * @param requestBody relationship properties + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/related-elements/{elementGUID}/more-information/{detailGUID}") + + public VoidResponse setupMoreInformation(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @PathVariable String detailGUID, + @RequestBody RelationshipRequestBody requestBody) + { + return restAPI.setupMoreInformation(serverName, userId, elementGUID, detailGUID, requestBody); + } + + + /** + * Remove a "MoreInformation" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element that is descriptive + * @param detailGUID unique identifier of the element that provides the detail + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/related-elements/{elementGUID}/more-information/{detailGUID}/delete") + + public VoidResponse clearMoreInformation(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @PathVariable String detailGUID, + @RequestBody ExternalSourceRequestBody requestBody) + { + return restAPI.clearMoreInformation(serverName, userId, elementGUID, detailGUID, requestBody); + } + + + /** + * Retrieve the detail elements linked via a "MoreInformation" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element that is descriptive + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @GetMapping(path = "/related-elements/more-information/by-descriptive-element/{elementGUID}") + + public RelatedElementListResponse getMoreInformation(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getMoreInformation(serverName, userId, elementGUID, startFrom, pageSize); + } + + + /** + * Retrieve the descriptive elements linked via a "MoreInformation" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param detailGUID unique identifier of the element that provides the detail + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @GetMapping(path = "/related-elements/more-information/by-detail-element/{detailGUID}") + + public RelatedElementListResponse getDescriptiveElements(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String detailGUID, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getDescriptiveElements(serverName, userId, detailGUID, startFrom, pageSize); + } + + + /** + * Create a "Stakeholder" relationship between an element and its stakeholder. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param stakeholderGUID unique identifier of the stakeholder + * @param requestBody relationship properties + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/related-elements/{elementGUID}/stakeholders/{stakeholderGUID}") + + public VoidResponse setupStakeholder(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @PathVariable String stakeholderGUID, + @RequestBody RelationshipRequestBody requestBody) + { + return restAPI.setupStakeholder(serverName, userId, elementGUID, stakeholderGUID, requestBody); + } + + + /** + * Remove a "Stakeholder" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param stakeholderGUID unique identifier of the stakeholder + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/related-elements/{elementGUID}/stakeholders/{stakeholderGUID}/delete") + + public VoidResponse clearStakeholder(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @PathVariable String stakeholderGUID, + @RequestBody ExternalSourceRequestBody requestBody) + { + return restAPI.clearStakeholder(serverName, userId, elementGUID, stakeholderGUID, requestBody); + } + + + /** + * Retrieve the stakeholder elements linked via the "Stakeholder" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @GetMapping(path = "/related-elements/stakeholders/by-commissioned-element/{elementGUID}") + + public RelatedElementListResponse getStakeholders(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getStakeholders(serverName, userId, elementGUID, startFrom, pageSize); + } + + + /** + * Retrieve the elements commissioned by a stakeholder, linked via the "Stakeholder" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param stakeholderGUID unique identifier of the stakeholder + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @GetMapping(path = "/related-elements/stakeholders/by-stakeholder/{stakeholderGUID}") + + public RelatedElementListResponse getStakeholderCommissionedElements(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String stakeholderGUID, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getStakeholderCommissionedElements(serverName, userId, stakeholderGUID, startFrom, pageSize); + } + + + /** + * Create an "AssignmentScope" relationship between an element and its scope. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param scopeGUID unique identifier of the scope + * @param requestBody relationship properties + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/related-elements/{elementGUID}/assignment-scopes/{scopeGUID}") + + public VoidResponse setupAssignmentScope(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @PathVariable String scopeGUID, + @RequestBody RelationshipRequestBody requestBody) + { + return restAPI.setupAssignmentScope(serverName, userId, elementGUID, scopeGUID, requestBody); + } + + + /** + * Remove an "AssignmentScope" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param scopeGUID unique identifier of the scope + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/related-elements/{elementGUID}/assignment-scopes/{scopeGUID}/delete") + + public VoidResponse clearAssignmentScope(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @PathVariable String scopeGUID, + @RequestBody ExternalSourceRequestBody requestBody) + { + return restAPI.clearAssignmentScope(serverName, userId, elementGUID, scopeGUID, requestBody); + } + + + /** + * Retrieve the assigned scopes linked by the "AssignmentScope" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @GetMapping(path = "/related-elements/assignment-scopes/by-assigned-actor/{elementGUID}") + + public RelatedElementListResponse getAssignedScopes(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getAssignedScopes(serverName, userId, elementGUID, startFrom, pageSize); + } + + + /** + * Retrieve the assigned actors linked by the "AssignmentScope" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param scopeGUID unique identifier of the scope + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @GetMapping(path = "/related-elements/assignment-scopes/by-assigned-scope/{scopeGUID}") + + public RelatedElementListResponse getAssignedActors(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String scopeGUID, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getAssignedActors(serverName, userId, scopeGUID, startFrom, pageSize); + } + + + /** + * Create a "ResourceList" relationship between a consuming element and an element that represents resources. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param resourceGUID unique identifier of the resource + * @param requestBody relationship properties + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/related-elements/{elementGUID}/resource-list/{resourceGUID}") + + public VoidResponse setupResource(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @PathVariable String resourceGUID, + @RequestBody RelationshipRequestBody requestBody) + { + return restAPI.setupResource(serverName, userId, elementGUID, resourceGUID, requestBody); + } + + + /** + * Remove a "ResourceList" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param resourceGUID unique identifier of the resource + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/related-elements/{elementGUID}/resource-list/{resourceGUID}/delete") + + public VoidResponse clearResource(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @PathVariable String resourceGUID, + @RequestBody ExternalSourceRequestBody requestBody) + { + return restAPI.clearResource(serverName, userId, elementGUID, resourceGUID, requestBody); + } + + + /** + * Retrieve the list of resources assigned to an element via the "ResourceList" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @GetMapping(path = "/related-elements/resource-list/by-assignee/{elementGUID}") + + public RelatedElementListResponse getResourceList(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getResourceList(serverName, userId, elementGUID, startFrom, pageSize); + } + + + /** + * Retrieve the list of elements assigned to a resource via the "ResourceList" relationship between two referenceables. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param resourceGUID unique identifier of the resource + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @GetMapping(path = "/related-elements/resource-list/by-resource/{resourceGUID}") + + public RelatedElementListResponse getSupportedByResource(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String resourceGUID, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getSupportedByResource(serverName, userId, resourceGUID, startFrom, pageSize); + } } diff --git a/open-metadata-implementation/adapters/open-connectors/rest-client-connectors/pom.xml b/open-metadata-implementation/adapters/open-connectors/rest-client-connectors/pom.xml index 8fb8e8babd2..c6fb00cf2a0 100644 --- a/open-metadata-implementation/adapters/open-connectors/rest-client-connectors/pom.xml +++ b/open-metadata-implementation/adapters/open-connectors/rest-client-connectors/pom.xml @@ -18,7 +18,7 @@ scm:git:git://github.com/odpi/egeria.git scm:git:ssh://github.com/odpi/egeria.git - http://github.com/odpi/egeria/tree/master + https://github.com/odpi/egeria/tree/master REST Client Connectors diff --git a/open-metadata-resources/open-metadata-archives/content-pack-helpers/src/main/java/org/odpi/openmetadata/samples/archiveutilities/SimpleCatalogArchiveHelper.java b/open-metadata-resources/open-metadata-archives/content-pack-helpers/src/main/java/org/odpi/openmetadata/samples/archiveutilities/SimpleCatalogArchiveHelper.java index bb32645e40c..f63cc556a76 100644 --- a/open-metadata-resources/open-metadata-archives/content-pack-helpers/src/main/java/org/odpi/openmetadata/samples/archiveutilities/SimpleCatalogArchiveHelper.java +++ b/open-metadata-resources/open-metadata-archives/content-pack-helpers/src/main/java/org/odpi/openmetadata/samples/archiveutilities/SimpleCatalogArchiveHelper.java @@ -1403,6 +1403,69 @@ public String addPersonRole(String suppliedTypeName, } + + /** + * Add a new person role. + * + * @param suppliedTypeName type name to use for the person role + * @param qualifiedName qualified name of role + * @param domainIdentifier identifier of governance domain + * @param identifier unique code + * @param name display name + * @param description description (eg job description) + * @param scope scope of role's responsibilities + * @param setHeadCount should the headcount field be set? + * @param headCount number of people that may be appointed to the role (default = 1) + * @param additionalProperties are there any additional properties to add + * @param extendedProperties any additional properties associated with a subtype + * @return unique identifier of the new profile + */ + public String addGovernanceRole(String suppliedTypeName, + String qualifiedName, + int domainIdentifier, + String identifier, + String name, + String description, + String scope, + boolean setHeadCount, + int headCount, + Map additionalProperties, + Map extendedProperties) + { + final String methodName = "addPersonRole"; + + String typeName = suppliedTypeName; + + if (typeName == null) + { + typeName = PERSON_ROLE_TYPE_NAME; + } + + InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, QUALIFIED_NAME_PROPERTY, qualifiedName, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, IDENTIFIER_PROPERTY, identifier, methodName); + properties = archiveHelper.addIntPropertyToInstance(archiveRootName, properties, DOMAIN_IDENTIFIER_PROPERTY, domainIdentifier, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, NAME_PROPERTY, name, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, DESCRIPTION_PROPERTY, description, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, SCOPE_PROPERTY, scope, methodName); + if (setHeadCount) + { + properties = archiveHelper.addIntPropertyToInstance(archiveRootName, properties, HEAD_COUNT_PROPERTY, headCount, methodName); + } + properties = archiveHelper.addStringMapPropertyToInstance(archiveRootName, properties, ADDITIONAL_PROPERTIES_PROPERTY, additionalProperties, methodName); + properties = archiveHelper.addPropertyMapToInstance(archiveRootName, properties, extendedProperties, methodName); + + EntityDetail role = archiveHelper.getEntityDetail(typeName, + idToGUIDMap.getGUID(qualifiedName), + properties, + InstanceStatus.ACTIVE, + null); + + archiveBuilder.addEntity(role); + + return role.getGUID(); + } + + /** * Link a person profile to a person role. * diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/build.gradle b/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/build.gradle index d94159175ea..371b3f0c046 100644 --- a/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/build.gradle +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/build.gradle @@ -35,7 +35,7 @@ dependencies { } -description = 'CommunityProperties Profile OMAS FVT' +description = 'ProjectProperties Profile OMAS FVT' java { withJavadocJar() diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/CommunityProfileOMASFVTSuite.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/CommunityProfileOMASFVTSuite.java index 2040d252633..9a40bd436c9 100644 --- a/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/CommunityProfileOMASFVTSuite.java +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/CommunityProfileOMASFVTSuite.java @@ -15,7 +15,7 @@ /** - * CommunityProfileOMASFVTSuite provides the main program for the CommunityProperties Profile OMAS + * CommunityProfileOMASFVTSuite provides the main program for the ProjectProperties Profile OMAS * Functional Verification Tests (FVTs). It is used when running the test suite standalone * (ie outside the failsafe test framework). */ diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/errorhandling/package-info.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/errorhandling/package-info.java index d23002f9526..f6dc85d4aff 100644 --- a/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/errorhandling/package-info.java +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/errorhandling/package-info.java @@ -2,7 +2,7 @@ /* Copyright Contributors to the ODPi Egeria project. */ /** - * The error handling package of the CommunityProperties Profile OMAS FVT suite is + * The error handling package of the ProjectProperties Profile OMAS FVT suite is * focused on tests that validate error conditions such as invalid parameters. */ package org.odpi.openmetadata.accessservices.communityprofile.fvt.errorhandling; diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/package-info.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/package-info.java index 8df58481cb7..d41eb27ced8 100644 --- a/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/package-info.java +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/package-info.java @@ -2,6 +2,6 @@ /* Copyright Contributors to the ODPi Egeria project. */ /** - * This package provides the controlling classes for the CommunityProperties Profile OMAS focused FVT. + * This package provides the controlling classes for the ProjectProperties Profile OMAS focused FVT. */ package org.odpi.openmetadata.accessservices.communityprofile.fvt; diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/test/script/configureStartServer.groovy b/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/test/script/configureStartServer.groovy index 0cd562ff4e0..9cf9cd9ae93 100755 --- a/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/test/script/configureStartServer.groovy +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/test/script/configureStartServer.groovy @@ -89,7 +89,7 @@ if(postRC1.equals(200)) { } // --- Enable OMAS - any errors here and we exit -System.out.println("=== Enabling CommunityProperties Profile OMAS: " + serverMem + " ==="); +System.out.println("=== Enabling ProjectProperties Profile OMAS: " + serverMem + " ==="); post2 = new URL(baseURL + "/open-metadata/admin-services/users/" + user + "/servers/" + serverMem + "/access-services/community-profile/no-topics" ).openConnection() post2.setRequestMethod("POST") post2.setRequestProperty("Content-Type", "application/json") From 965e95ada8d05a4235166a3d40e0258a42c5a4d1 Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Wed, 17 Aug 2022 09:28:45 +0100 Subject: [PATCH 6/8] Split valid values handler from reference data handler Signed-off-by: Mandy Chessell --- .../server/AssetOwnerInstanceHandler.java | 17 +- .../server/AssetOwnerServicesInstance.java | 62 +- .../server/ValidValuesRESTServices.java | 99 +- .../converters/SecurityGroupConverter.java | 1 + .../server/DataManagerInstanceHandler.java | 17 +- .../server/DataManagerServicesInstance.java | 106 +- .../server/SchemaManagerRESTServices.java | 18 +- ...idValues.java => ManageReferenceData.java} | 4 +- ...Manager.java => ReferenceDataManager.java} | 48 +- .../client/package-info.java | 4 +- .../DigitalArchitectureInstanceHandler.java | 6 +- .../DigitalArchitectureServicesInstance.java | 94 +- ...es.java => ReferenceDataRESTServices.java} | 120 +- ...source.java => ReferenceDataResource.java} | 10 +- .../project-management-server/build.gradle | 1 + .../generichandlers/ReferenceDataHandler.java | 1307 ++++++++++++++++ .../generichandlers/ReferenceableHandler.java | 100 ++ .../generichandlers/ValidValuesHandler.java | 1358 ++--------------- .../ClientConstructorTest.java | 12 +- .../errorhandling/InvalidParameterTest.java | 10 +- .../validvalues/CreateValidValuesSetTest.java | 22 +- 21 files changed, 1764 insertions(+), 1652 deletions(-) rename open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/api/{ManageValidValues.java => ManageReferenceData.java} (99%) rename open-metadata-implementation/access-services/digital-architecture/digital-architecture-client/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/client/{ValidValuesManager.java => ReferenceDataManager.java} (98%) rename open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/{ValidValuesRESTServices.java => ReferenceDataRESTServices.java} (96%) rename open-metadata-implementation/access-services/digital-architecture/digital-architecture-spring/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/spring/{ValidValuesResource.java => ReferenceDataResource.java} (99%) create mode 100644 open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ReferenceDataHandler.java diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/server/AssetOwnerInstanceHandler.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/server/AssetOwnerInstanceHandler.java index 1ea8b16ef4f..35fec95dcbc 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/server/AssetOwnerInstanceHandler.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/server/AssetOwnerInstanceHandler.java @@ -193,18 +193,11 @@ FilesAndFoldersHandler getFilesAn * @throws UserNotAuthorizedException user does not have access to the requested server * @throws PropertyServerException error in the requested server */ - ValidValuesHandler getValidValuesHandler(String userId, - String serverName, - String serviceOperationName) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + ValidValuesHandler getValidValuesHandler(String userId, + String serverName, + String serviceOperationName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { AssetOwnerServicesInstance instance = (AssetOwnerServicesInstance)super.getServerServiceInstance(userId, serverName, diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/server/AssetOwnerServicesInstance.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/server/AssetOwnerServicesInstance.java index 32e8b5759f7..89a563718a5 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/server/AssetOwnerServicesInstance.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/server/AssetOwnerServicesInstance.java @@ -13,8 +13,6 @@ import org.odpi.openmetadata.commonservices.generichandlers.SchemaTypeHandler; import org.odpi.openmetadata.commonservices.generichandlers.FilesAndFoldersHandler; import org.odpi.openmetadata.commonservices.generichandlers.ValidValuesHandler; -import org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIDummyBean; -import org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIDummyBeanConverter; import org.odpi.openmetadata.commonservices.generichandlers.DataFieldHandler; import org.odpi.openmetadata.commonservices.generichandlers.AnnotationHandler; import org.odpi.openmetadata.commonservices.generichandlers.DiscoveryAnalysisReportHandler; @@ -38,34 +36,27 @@ */ public class AssetOwnerServicesInstance extends OMASServiceInstance { - private static AccessServiceDescription myDescription = AccessServiceDescription.ASSET_OWNER_OMAS; + private final static AccessServiceDescription myDescription = AccessServiceDescription.ASSET_OWNER_OMAS; - private AssetHandler assetHandler; - private SchemaAttributeHandler schemaAttributeHandler; - private SchemaTypeHandler schemaTypeHandler; + private final AssetHandler assetHandler; + private final SchemaAttributeHandler schemaAttributeHandler; + private final SchemaTypeHandler schemaTypeHandler; - private ReferenceableHandler referenceableHandler; + private final ReferenceableHandler referenceableHandler; - private FilesAndFoldersHandler filesAndFoldersHandler; + private final FilesAndFoldersHandler filesAndFoldersHandler; - private ValidValuesHandler validValuesHandler; + private final ValidValuesHandler validValuesHandler; - private DataFieldHandler dataFieldHandler; - private AnnotationHandler annotationHandler; - private DiscoveryAnalysisReportHandler discoveryAnalysisReportHandler; + private final DataFieldHandler dataFieldHandler; + private final AnnotationHandler annotationHandler; + private final DiscoveryAnalysisReportHandler discoveryAnalysisReportHandler; - private ConnectionHandler connectionHandler; - private ConnectorTypeHandler connectorTypeHandler; - private EndpointHandler endpointHandler; + private final ConnectionHandler connectionHandler; + private final ConnectorTypeHandler connectorTypeHandler; + private final EndpointHandler endpointHandler; /** * Set up the local repository connector that will service the REST Calls. @@ -183,20 +174,6 @@ public AssetOwnerServicesInstance(OMRSRepositoryConnector repositoryConnector, this.validValuesHandler = new ValidValuesHandler<>(new ValidValueConverter<>(repositoryHelper, serviceName, serverName), ValidValueElement.class, - new OpenMetadataAPIDummyBeanConverter<>(repositoryHelper, serviceName, serverName), - OpenMetadataAPIDummyBean.class, - new OpenMetadataAPIDummyBeanConverter<>(repositoryHelper, serviceName, serverName), - OpenMetadataAPIDummyBean.class, - new OpenMetadataAPIDummyBeanConverter<>(repositoryHelper, serviceName, serverName), - OpenMetadataAPIDummyBean.class, - new OpenMetadataAPIDummyBeanConverter<>(repositoryHelper, serviceName, serverName), - OpenMetadataAPIDummyBean.class, - new OpenMetadataAPIDummyBeanConverter<>(repositoryHelper, serviceName, serverName), - OpenMetadataAPIDummyBean.class, - new OpenMetadataAPIDummyBeanConverter<>(repositoryHelper, serviceName, serverName), - OpenMetadataAPIDummyBean.class, - new OpenMetadataAPIDummyBeanConverter<>(repositoryHelper, serviceName, serverName), - OpenMetadataAPIDummyBean.class, serviceName, serverName, invalidParameterHandler, @@ -381,14 +358,7 @@ FilesAndFoldersHandler getFilesAn * @return handler object * @throws PropertyServerException the instance has not been initialized successfully */ - ValidValuesHandler getValidValuesHandler() throws PropertyServerException + ValidValuesHandler getValidValuesHandler() throws PropertyServerException { final String methodName = "getValidValuesHandler"; diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/server/ValidValuesRESTServices.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/server/ValidValuesRESTServices.java index 6c7fc87cc19..a572165bd01 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/server/ValidValuesRESTServices.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/server/ValidValuesRESTServices.java @@ -79,14 +79,7 @@ public GUIDResponse createValidValueSet(String serverName, if (requestBody != null) { - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); response.setGUID(handler.createValidValueSet(userId, null, @@ -152,14 +145,7 @@ public GUIDResponse createValidValueDefinition(String serverNam if (requestBody != null) { - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); response.setGUID(handler.createValidValueDefinition(userId, null, @@ -230,14 +216,7 @@ public VoidResponse updateValidValue(String serverName, if (requestBody != null) { - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); handler.updateValidValue(userId, null, @@ -306,14 +285,7 @@ public VoidResponse deleteValidValue(String serverName, if (qualifiedName != null) { - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); handler.deleteValidValue(userId, null, @@ -375,14 +347,7 @@ public VoidResponse attachValidValueToSet(String serverName, { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); handler.attachValidValueToSet(userId, null, @@ -439,14 +404,7 @@ public VoidResponse detachValidValueFromSet(String serverName, { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); handler.detachValidValueFromSet(userId, null, @@ -495,14 +453,7 @@ public ValidValueResponse getValidValueByGUID(String serverName, { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); response.setElement(handler.getValidValueByGUID(userId, validValueGUID, @@ -556,14 +507,7 @@ public ValidValuesResponse getValidValueByName(String serverName, if (validValueName != null) { - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); response.setElementList(handler.getValidValueByName(userId, validValueName, @@ -621,14 +565,7 @@ public ValidValuesResponse findValidValues(String serverName, if (searchString != null) { - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); response.setElementList(handler.findValidValues(userId, searchString, @@ -683,14 +620,7 @@ public ValidValuesResponse getValidValueSetMembers(String serverName, { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); response.setElementList(handler.getValidValueSetMembers(userId, validValueSetGUID, @@ -744,14 +674,7 @@ public ValidValuesResponse getSetsForValidValue(String serverName, { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); response.setElementList(handler.getSetsForValidValue(userId, validValueGUID, diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/SecurityGroupConverter.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/SecurityGroupConverter.java index b54e759fc57..98c6a29c5f1 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/SecurityGroupConverter.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/SecurityGroupConverter.java @@ -127,6 +127,7 @@ public B getNewComplexBean(Class beanClass, * @return bean populated with properties from the instances supplied * @throws PropertyServerException there is a problem instantiating the bean */ + @Override public B getNewBean(Class beanClass, EntityDetail entity, Relationship relationship, diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/DataManagerInstanceHandler.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/DataManagerInstanceHandler.java index 907d7a00df2..0598b6fad4c 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/DataManagerInstanceHandler.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/DataManagerInstanceHandler.java @@ -599,18 +599,11 @@ EndpointHandler getEndpointHandler(String userId, * @throws UserNotAuthorizedException user does not have access to the requested server * @throws PropertyServerException error in the requested server */ - ValidValuesHandler getValidValuesHandler(String userId, - String serverName, - String serviceOperationName) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + ValidValuesHandler getValidValuesHandler(String userId, + String serverName, + String serviceOperationName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { DataManagerServicesInstance instance = (DataManagerServicesInstance)super.getServerServiceInstance(userId, serverName, diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/DataManagerServicesInstance.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/DataManagerServicesInstance.java index afc152d9513..0a98825a92e 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/DataManagerServicesInstance.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/DataManagerServicesInstance.java @@ -24,51 +24,44 @@ */ public class DataManagerServicesInstance extends OMASServiceInstance { - private static AccessServiceDescription myDescription = AccessServiceDescription.DATA_MANAGER_OMAS; - - private ElementStubConverter elementStubConverter; - private OpenMetadataAPIGenericHandler genericHandler; - private SoftwareCapabilityHandler dataManagerIntegratorHandler; - private RelationalDataHandler relationalDataHandler; - private FilesAndFoldersHandler filesAndFoldersHandler; - - private AssetHandler topicHandler; - private EventTypeHandler eventTypeHandler; - - private AssetHandler apiHandler; - private APIOperationHandler apiOperationHandler; - private APIParameterListHandler apiParameterListHandler; - - private AssetHandler formHandler; - private AssetHandler reportHandler; - private AssetHandler queryHandler; - private DisplayDataContainerHandler dataContainerHandler; - - - private SchemaTypeHandler schemaTypeHandler; - private SchemaAttributeHandler schemaAttributeHandler; - - private ConnectionHandler connectionHandler; - private ConnectorTypeHandler connectorTypeHandler; - private EndpointHandler endpointHandler; - - private ValidValuesHandler validValuesHandler; + private final static AccessServiceDescription myDescription = AccessServiceDescription.DATA_MANAGER_OMAS; + + private final ElementStubConverter elementStubConverter; + private final OpenMetadataAPIGenericHandler genericHandler; + private final SoftwareCapabilityHandler dataManagerIntegratorHandler; + private final RelationalDataHandler relationalDataHandler; + private final FilesAndFoldersHandler filesAndFoldersHandler; + + private final AssetHandler topicHandler; + private final EventTypeHandler eventTypeHandler; + + private final AssetHandler apiHandler; + private final APIOperationHandler apiOperationHandler; + private final APIParameterListHandler apiParameterListHandler; + + private final AssetHandler formHandler; + private final AssetHandler reportHandler; + private final AssetHandler queryHandler; + private final DisplayDataContainerHandler dataContainerHandler; + + + private final SchemaTypeHandler schemaTypeHandler; + private final SchemaAttributeHandler schemaAttributeHandler; + + private final ConnectionHandler connectionHandler; + private final ConnectorTypeHandler connectorTypeHandler; + private final EndpointHandler endpointHandler; + + private final ValidValuesHandler validValuesHandler; /** @@ -393,20 +386,6 @@ public DataManagerServicesInstance(OMRSRepositoryConnector repositoryConnector, this.validValuesHandler = new ValidValuesHandler<>(new ValidValueSetConverter<>(repositoryHelper, serviceName, serverName), ValidValueSetElement.class, - new OpenMetadataAPIDummyBeanConverter<>(repositoryHelper, serviceName, serverName), - OpenMetadataAPIDummyBean.class, - new OpenMetadataAPIDummyBeanConverter<>(repositoryHelper, serviceName, serverName), - OpenMetadataAPIDummyBean.class, - new OpenMetadataAPIDummyBeanConverter<>(repositoryHelper, serviceName, serverName), - OpenMetadataAPIDummyBean.class, - new OpenMetadataAPIDummyBeanConverter<>(repositoryHelper, serviceName, serverName), - OpenMetadataAPIDummyBean.class, - new OpenMetadataAPIDummyBeanConverter<>(repositoryHelper, serviceName, serverName), - OpenMetadataAPIDummyBean.class, - new OpenMetadataAPIDummyBeanConverter<>(repositoryHelper, serviceName, serverName), - OpenMetadataAPIDummyBean.class, - new OpenMetadataAPIDummyBeanConverter<>(repositoryHelper, serviceName, serverName), - OpenMetadataAPIDummyBean.class, serviceName, serverName, invalidParameterHandler, @@ -728,14 +707,7 @@ EndpointHandler getEndpointHandler() throws PropertyServerExcep * @return handler object * @throws PropertyServerException the instance has not been initialized successfully */ - ValidValuesHandler getValidValuesHandler() throws PropertyServerException + ValidValuesHandler getValidValuesHandler() throws PropertyServerException { final String methodName = "getValidValuesHandler"; diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/SchemaManagerRESTServices.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/SchemaManagerRESTServices.java index 778e7fc5509..b6b2c5642c3 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/SchemaManagerRESTServices.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/SchemaManagerRESTServices.java @@ -339,14 +339,7 @@ public ValidValueSetsResponse getValidValueSetByName(String serverName, if (requestBody != null) { - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); response.setElementList(handler.getValidValueByName(userId, requestBody.getName(), @@ -409,14 +402,7 @@ public ValidValueSetsResponse findValidValueSet(String serverNa if (requestBody != null) { - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); response.setElementList(handler.findValidValues(userId, requestBody.getSearchString(), diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/api/ManageValidValues.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/api/ManageReferenceData.java similarity index 99% rename from open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/api/ManageValidValues.java rename to open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/api/ManageReferenceData.java index 31b88a963c3..b7f750ae6ca 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/api/ManageValidValues.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/api/ManageReferenceData.java @@ -11,14 +11,14 @@ import java.util.Map; /** - * ManageValidValues provides the API operations to create and maintain lists of valid + * ManageReferenceData provides the API operations to create and maintain lists of valid * value definitions grouped into a valid value set. Both valid value definitions and valid value sets have * the same attributes and so inherit from ValidValue where all the attributes are defined. * * A set is just grouping of valid values. Valid value definitions and set can be nested many times in other * valid value sets. */ -public interface ManageValidValues +public interface ManageReferenceData { /** * Create a new valid value set. This just creates the Set itself. Members are added either as they are diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-client/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/client/ValidValuesManager.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-client/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/client/ReferenceDataManager.java similarity index 98% rename from open-metadata-implementation/access-services/digital-architecture/digital-architecture-client/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/client/ValidValuesManager.java rename to open-metadata-implementation/access-services/digital-architecture/digital-architecture-client/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/client/ReferenceDataManager.java index 7c272342f2e..ecd84e5b40f 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-client/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/client/ValidValuesManager.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-client/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/client/ReferenceDataManager.java @@ -2,7 +2,7 @@ /* Copyright Contributors to the ODPi Egeria project. */ package org.odpi.openmetadata.accessservices.digitalarchitecture.client; -import org.odpi.openmetadata.accessservices.digitalarchitecture.api.ManageValidValues; +import org.odpi.openmetadata.accessservices.digitalarchitecture.api.ManageReferenceData; import org.odpi.openmetadata.accessservices.digitalarchitecture.client.rest.DigitalArchitectureRESTClient; import org.odpi.openmetadata.accessservices.digitalarchitecture.metadataelements.*; import org.odpi.openmetadata.accessservices.digitalarchitecture.properties.*; @@ -20,14 +20,14 @@ import java.util.Map; /** - * ValidValuesManager provides the API operations to create and maintain lists of valid + * ReferenceDataManager provides the API operations to create and maintain lists of valid * value definitions grouped into a valid value set. Both valid value definitions and valid value sets have * the same attributes and so inherit from ValidValue where all the attributes are defined. * * A set is just grouping of valid values. Valid value definitions and set can be nested many times in other * valid value sets. */ -public class ValidValuesManager extends DigitalArchitectureClientBase implements ManageValidValues +public class ReferenceDataManager extends DigitalArchitectureClientBase implements ManageReferenceData { /** * Create a new client with no authentication embedded in the HTTP request and an audit log. @@ -38,9 +38,9 @@ public class ValidValuesManager extends DigitalArchitectureClientBase implements * @throws InvalidParameterException there is a problem creating the client-side components to issue any * REST API calls. */ - public ValidValuesManager(String serverName, - String serverPlatformURLRoot, - AuditLog auditLog) throws InvalidParameterException + public ReferenceDataManager(String serverName, + String serverPlatformURLRoot, + AuditLog auditLog) throws InvalidParameterException { super(serverName, serverPlatformURLRoot, auditLog); } @@ -54,8 +54,8 @@ public ValidValuesManager(String serverName, * @throws InvalidParameterException there is a problem creating the client-side components to issue any * REST API calls. */ - public ValidValuesManager(String serverName, - String serverPlatformURLRoot) throws InvalidParameterException + public ReferenceDataManager(String serverName, + String serverPlatformURLRoot) throws InvalidParameterException { super(serverName, serverPlatformURLRoot); } @@ -75,11 +75,11 @@ public ValidValuesManager(String serverName, * @throws InvalidParameterException there is a problem creating the client-side components to issue any * REST API calls. */ - public ValidValuesManager(String serverName, - String serverPlatformURLRoot, - String userId, - String password, - AuditLog auditLog) throws InvalidParameterException + public ReferenceDataManager(String serverName, + String serverPlatformURLRoot, + String userId, + String password, + AuditLog auditLog) throws InvalidParameterException { super(serverName, serverPlatformURLRoot, userId, password, auditLog); } @@ -96,10 +96,10 @@ public ValidValuesManager(String serverName, * @throws InvalidParameterException there is a problem creating the client-side components to issue any * REST API calls. */ - public ValidValuesManager(String serverName, - String serverPlatformURLRoot, - String userId, - String password) throws InvalidParameterException + public ReferenceDataManager(String serverName, + String serverPlatformURLRoot, + String userId, + String password) throws InvalidParameterException { super(serverName, serverPlatformURLRoot, userId, password); } @@ -116,11 +116,11 @@ public ValidValuesManager(String serverName, * @throws InvalidParameterException there is a problem creating the client-side components to issue any * REST API calls. */ - public ValidValuesManager(String serverName, - String serverPlatformURLRoot, - DigitalArchitectureRESTClient restClient, - int maxPageSize, - AuditLog auditLog) throws InvalidParameterException + public ReferenceDataManager(String serverName, + String serverPlatformURLRoot, + DigitalArchitectureRESTClient restClient, + int maxPageSize, + AuditLog auditLog) throws InvalidParameterException { super(serverName, serverPlatformURLRoot, restClient, maxPageSize, auditLog); } @@ -128,7 +128,7 @@ public ValidValuesManager(String serverName, /* * ============================================== - * ManageValidValues + * ManageReferenceData * ============================================== */ @@ -448,7 +448,7 @@ public void detachValidValueFromSet(String userId, /** - * Link a valid value to an asset that provides the implementation. Typically this method is + * Link a valid value to an asset that provides the implementation. Typically, this method is * used to link a valid value set to a code table. * * @param userId calling user. diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-client/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/client/package-info.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-client/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/client/package-info.java index f2f1de4d2f5..543d57bd9e6 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-client/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/client/package-info.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-client/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/client/package-info.java @@ -6,8 +6,8 @@ * the properties for the remote server passed on the constructors, the internal REST client (DigitalArchitectureRESTClient), the audit log and the * maximum page size property. It initializes the InvalidParameterHandler that verifies the parameters passed to the client. * - * Today, the Digital Architecture OMAS has one client for managing valid values and reference data. This client is called ValidValuesManager. - * It implements the ManageValidValues interface. More to follow :) + * Today, the Digital Architecture OMAS has one client for managing valid values and reference data. This client is called ReferenceDataManager. + * It implements the ManageReferenceData interface. More to follow :) */ package org.odpi.openmetadata.accessservices.digitalarchitecture.client; diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/DigitalArchitectureInstanceHandler.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/DigitalArchitectureInstanceHandler.java index 4e833650588..bbbbadec9bb 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/DigitalArchitectureInstanceHandler.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/DigitalArchitectureInstanceHandler.java @@ -194,14 +194,14 @@ LocationHandler getLocationHandler(String userId, * @throws UserNotAuthorizedException user does not have access to the requested server * @throws PropertyServerException error in the requested server */ - ValidValuesHandler getValidValuesHandler(String userId, + ReferenceValueAssignmentItemElement> getReferenceDataHandler(String userId, String serverName, String serviceOperationName) throws InvalidParameterException, UserNotAuthorizedException, @@ -213,7 +213,7 @@ ReferenceValueAssignmentItemElement> getValidValuesHandler(String userId, if (instance != null) { - return instance.getValidValuesHandler(); + return instance.getReferenceDataHandler(); } return null; diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/DigitalArchitectureServicesInstance.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/DigitalArchitectureServicesInstance.java index 477bdde8bc9..8216cc78a81 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/DigitalArchitectureServicesInstance.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/DigitalArchitectureServicesInstance.java @@ -18,31 +18,31 @@ import java.util.List; /** - * DigitalArchitectureServicesInstance caches references to objects for a specific server. + * DigitalArchitectureServicesInstance caches references to the runtime objects for a specific server. * It is also responsible for registering itself in the instance map. */ public class DigitalArchitectureServicesInstance extends OMASServiceInstance { - private static AccessServiceDescription myDescription = AccessServiceDescription.DIGITAL_ARCHITECTURE_OMAS; + private final static AccessServiceDescription myDescription = AccessServiceDescription.DIGITAL_ARCHITECTURE_OMAS; - private ReferenceableHandler referenceableHandler; - private AssetHandler assetHandler; + private final ReferenceableHandler referenceableHandler; + private final AssetHandler assetHandler; - private ConnectionHandler connectionHandler; - private ConnectorTypeHandler connectorTypeHandler; - private EndpointHandler endpointHandler; + private final ConnectionHandler connectionHandler; + private final ConnectorTypeHandler connectorTypeHandler; + private final EndpointHandler endpointHandler; - private LocationHandler locationHandler; + private final LocationHandler locationHandler; - private ValidValuesHandler validValuesHandler; + private final ReferenceDataHandler referenceDataHandler; /** * Set up the handlers for this server. @@ -167,33 +167,33 @@ public DigitalArchitectureServicesInstance(OMRSRepositoryConnector repositoryCon publishZones, auditLog); - this.validValuesHandler = new ValidValuesHandler<>(new ValidValueConverter<>(repositoryHelper, serviceName, serverName), - ValidValueElement.class, - new ValidValueAssignmentConsumerConverter<>(repositoryHelper, serviceName, serverName), - ValidValueAssignmentConsumerElement.class, - new ValidValueAssignmentDefinitionConverter<>(repositoryHelper, serviceName, serverName), - ValidValueAssignmentDefinitionElement.class, - new ValidValueImplAssetConverter<>(repositoryHelper, serviceName, serverName), - ValidValueImplAssetElement.class, - new ValidValueImplDefinitionConverter<>(repositoryHelper, serviceName, serverName), - ValidValueImplDefinitionElement.class, - new ValidValueMappingConverter<>(repositoryHelper, serviceName, serverName), - ValidValueMappingElement.class, - new ReferenceValueAssignmentDefinitionConverter<>(repositoryHelper, serviceName, serverName), - ReferenceValueAssignmentDefinitionElement.class, - new ReferenceValueAssignmentItemConverter<>(repositoryHelper, serviceName, serverName), - ReferenceValueAssignmentItemElement.class, - serviceName, - serverName, - invalidParameterHandler, - repositoryHandler, - repositoryHelper, - localServerUserId, - securityVerifier, - supportedZones, - defaultZones, - publishZones, - auditLog); + this.referenceDataHandler = new ReferenceDataHandler<>(new ValidValueConverter<>(repositoryHelper, serviceName, serverName), + ValidValueElement.class, + new ValidValueAssignmentConsumerConverter<>(repositoryHelper, serviceName, serverName), + ValidValueAssignmentConsumerElement.class, + new ValidValueAssignmentDefinitionConverter<>(repositoryHelper, serviceName, serverName), + ValidValueAssignmentDefinitionElement.class, + new ValidValueImplAssetConverter<>(repositoryHelper, serviceName, serverName), + ValidValueImplAssetElement.class, + new ValidValueImplDefinitionConverter<>(repositoryHelper, serviceName, serverName), + ValidValueImplDefinitionElement.class, + new ValidValueMappingConverter<>(repositoryHelper, serviceName, serverName), + ValidValueMappingElement.class, + new ReferenceValueAssignmentDefinitionConverter<>(repositoryHelper, serviceName, serverName), + ReferenceValueAssignmentDefinitionElement.class, + new ReferenceValueAssignmentItemConverter<>(repositoryHelper, serviceName, serverName), + ReferenceValueAssignmentItemElement.class, + serviceName, + serverName, + invalidParameterHandler, + repositoryHandler, + repositoryHelper, + localServerUserId, + securityVerifier, + supportedZones, + defaultZones, + publishZones, + auditLog); } @@ -299,19 +299,19 @@ LocationHandler getLocationHandler() throws PropertyServerExcep * @return handler object * @throws PropertyServerException the instance has not been initialized successfully */ - ValidValuesHandler getValidValuesHandler() throws PropertyServerException + ReferenceValueAssignmentItemElement> getReferenceDataHandler() throws PropertyServerException { - final String methodName = "getValidValuesHandler"; + final String methodName = "getReferenceDataHandler"; validateActiveRepository(methodName); - return validValuesHandler; + return referenceDataHandler; } } diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/ValidValuesRESTServices.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/ReferenceDataRESTServices.java similarity index 96% rename from open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/ValidValuesRESTServices.java rename to open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/ReferenceDataRESTServices.java index a7a8ea23753..c9028a620d4 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/ValidValuesRESTServices.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/ReferenceDataRESTServices.java @@ -10,7 +10,7 @@ import org.odpi.openmetadata.commonservices.ffdc.RESTExceptionHandler; import org.odpi.openmetadata.commonservices.ffdc.rest.*; import org.odpi.openmetadata.commonservices.generichandlers.AssetHandler; -import org.odpi.openmetadata.commonservices.generichandlers.ValidValuesHandler; +import org.odpi.openmetadata.commonservices.generichandlers.ReferenceDataHandler; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; import org.slf4j.LoggerFactory; @@ -20,32 +20,32 @@ import java.util.Map; /** - * ValidValuesRESTServices provides the API operations to create and maintain lists of valid + * ReferenceDataRESTServices provides the API operations to create and maintain lists of valid * value definitions grouped into a valid value set. Both valid value definitions and valid value sets have * the same attributes and so inherit from ValidValue where all the attributes are defined. * * A set is just grouping of valid values. Valid value definitions and set can be nested many times in other * valid value sets. */ -public class ValidValuesRESTServices +public class ReferenceDataRESTServices { private static final DigitalArchitectureInstanceHandler instanceHandler = new DigitalArchitectureInstanceHandler(); private static final RESTExceptionHandler restExceptionHandler = new RESTExceptionHandler(); - private static final RESTCallLogger restCallLogger = new RESTCallLogger(LoggerFactory.getLogger(ValidValuesRESTServices.class), + private static final RESTCallLogger restCallLogger = new RESTCallLogger(LoggerFactory.getLogger(ReferenceDataRESTServices.class), instanceHandler.getServiceName()); /** * Default constructor */ - public ValidValuesRESTServices() + public ReferenceDataRESTServices() { } /* * ============================================== - * ManageValidValues + * ManageReferenceData * ============================================== */ @@ -79,14 +79,14 @@ public GUIDResponse createValidValueSet(String serverName, if (requestBody != null) { - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ReferenceValueAssignmentItemElement> handler = instanceHandler.getReferenceDataHandler(userId, serverName, methodName); response.setGUID(handler.createValidValueSet(userId, null, @@ -152,14 +152,14 @@ public GUIDResponse createValidValueDefinition(String serverName, if (requestBody != null) { - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ReferenceValueAssignmentItemElement> handler = instanceHandler.getReferenceDataHandler(userId, serverName, methodName); response.setGUID(handler.createValidValueDefinition(userId, null, @@ -230,14 +230,14 @@ public VoidResponse updateValidValue(String serverName, if (requestBody != null) { - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ReferenceValueAssignmentItemElement> handler = instanceHandler.getReferenceDataHandler(userId, serverName, methodName); handler.updateValidValue(userId, null, @@ -306,14 +306,14 @@ public VoidResponse deleteValidValue(String serverName, if (qualifiedName != null) { - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ReferenceValueAssignmentItemElement> handler = instanceHandler.getReferenceDataHandler(userId, serverName, methodName); handler.deleteValidValue(userId, null, @@ -375,14 +375,14 @@ public VoidResponse attachValidValueToSet(String serverName, { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ReferenceValueAssignmentItemElement> handler = instanceHandler.getReferenceDataHandler(userId, serverName, methodName); handler.attachValidValueToSet(userId, null, @@ -439,14 +439,14 @@ public VoidResponse detachValidValueFromSet(String serverName, { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ReferenceValueAssignmentItemElement> handler = instanceHandler.getReferenceDataHandler(userId, serverName, methodName); handler.detachValidValueFromSet(userId, null, @@ -510,14 +510,14 @@ public VoidResponse linkValidValueToImplementation(String se { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ReferenceValueAssignmentItemElement> handler = instanceHandler.getReferenceDataHandler(userId, serverName, methodName); handler.linkValidValueToImplementation(userId, null, @@ -628,14 +628,14 @@ public VoidResponse unlinkValidValueFromImplementation(String serverNa { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ReferenceValueAssignmentItemElement> handler = instanceHandler.getReferenceDataHandler(userId, serverName, methodName); handler.unlinkValidValueFromImplementation(userId, null, @@ -747,14 +747,14 @@ public VoidResponse assignValidValueToConsumer(String { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ReferenceValueAssignmentItemElement> handler = instanceHandler.getReferenceDataHandler(userId, serverName, methodName); handler.assignValidValueToConsumer(userId, null, @@ -811,14 +811,14 @@ public VoidResponse unassignValidValueFromConsumer(String serverName, { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ReferenceValueAssignmentItemElement> handler = instanceHandler.getReferenceDataHandler(userId, serverName, methodName); handler.unassignValidValueFromConsumer(userId, null, @@ -886,14 +886,14 @@ public VoidResponse assignReferenceValueToItem(String { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ReferenceValueAssignmentItemElement> handler = instanceHandler.getReferenceDataHandler(userId, serverName, methodName); handler.assignReferenceValueToItem(userId, null, @@ -954,14 +954,14 @@ public VoidResponse unassignReferenceValueFromItem(String serverName, { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ReferenceValueAssignmentItemElement> handler = instanceHandler.getReferenceDataHandler(userId, serverName, methodName); handler.unassignReferenceValueFromItem(userId, null, @@ -1030,14 +1030,14 @@ public VoidResponse mapValidValues(String serverName, { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ReferenceValueAssignmentItemElement> handler = instanceHandler.getReferenceDataHandler(userId, serverName, methodName); handler.mapValidValues(userId, null, @@ -1099,14 +1099,14 @@ public VoidResponse unmapValidValues(String serverName, { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ReferenceValueAssignmentItemElement> handler = instanceHandler.getReferenceDataHandler(userId, serverName, methodName); handler.unmapValidValues(userId, null, @@ -1155,14 +1155,14 @@ public ValidValueResponse getValidValueByGUID(String serverName, { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ReferenceValueAssignmentItemElement> handler = instanceHandler.getReferenceDataHandler(userId, serverName, methodName); ValidValueElement validValue = handler.getValidValueByGUID(userId, validValueGUID, @@ -1217,14 +1217,14 @@ public ValidValuesResponse getValidValueByName(String serverName, if (requestBody != null) { - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ReferenceValueAssignmentItemElement> handler = instanceHandler.getReferenceDataHandler(userId, serverName, methodName); List validValues = handler.getValidValueByName(userId, requestBody.getName(), @@ -1283,14 +1283,14 @@ public ValidValuesResponse findValidValues(String serverName, if (requestBody != null) { - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ReferenceValueAssignmentItemElement> handler = instanceHandler.getReferenceDataHandler(userId, serverName, methodName); List validValues = handler.findValidValues(userId, requestBody.getSearchString(), @@ -1346,14 +1346,14 @@ public ValidValuesResponse getValidValueSetMembers(String serverName, { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ReferenceValueAssignmentItemElement> handler = instanceHandler.getReferenceDataHandler(userId, serverName, methodName); List validValues = handler.getValidValueSetMembers(userId, validValueSetGUID, @@ -1408,14 +1408,14 @@ public ValidValuesResponse getSetsForValidValue(String serverName, { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ReferenceValueAssignmentItemElement> handler = instanceHandler.getReferenceDataHandler(userId, serverName, methodName); List validValues = handler.getSetsForValidValue(userId, validValueGUID, @@ -1470,14 +1470,14 @@ public ValidValueAssignmentConsumersResponse getValidValuesAssignmentConsumers(S { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ReferenceValueAssignmentItemElement> handler = instanceHandler.getReferenceDataHandler(userId, serverName, methodName); List validValueConsumers = handler.getValidValuesAssignmentConsumers(userId, validValueGUID, @@ -1537,14 +1537,14 @@ public ValidValueAssignmentDefinitionsResponse getValidValuesAssignmentDefinitio { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ReferenceValueAssignmentItemElement> handler = instanceHandler.getReferenceDataHandler(userId, serverName, methodName); List validValueAssignmentDefinitions = handler.getValidValuesAssignmentDefinition(userId, referenceableGUID, @@ -1600,14 +1600,14 @@ public ValidValuesImplAssetsResponse getValidValuesImplementationAssets(String { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - ValidValuesHandler validValuesHandler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ReferenceValueAssignmentItemElement> validValuesHandler = instanceHandler.getReferenceDataHandler(userId, serverName, methodName); List validValueImplAssetElements = validValuesHandler.getValidValuesImplementationAssets(userId, validValueGUID, @@ -1665,14 +1665,14 @@ public ValidValuesImplDefinitionsResponse getValidValuesImplementationDefinition { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - ValidValuesHandler validValuesHandler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ReferenceValueAssignmentItemElement> validValuesHandler = instanceHandler.getReferenceDataHandler(userId, serverName, methodName); List definitions = validValuesHandler.getValidValuesImplementationDefinitions(userId, @@ -1731,14 +1731,14 @@ public ValidValueMappingsResponse getValidValueMappings(String serverName, { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ReferenceValueAssignmentItemElement> handler = instanceHandler.getReferenceDataHandler(userId, serverName, methodName); List validValuesMappings = handler.getValidValueMappings(userId, validValueGUID, @@ -1797,14 +1797,14 @@ public ValidValuesMappingsResponse getValidValuesMappings(String serverName, { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ReferenceValueAssignmentItemElement> handler = instanceHandler.getReferenceDataHandler(userId, serverName, methodName); ValidValueElement validValueElement = handler.getValidValueByGUID(userId, validValueGUID, @@ -1899,14 +1899,14 @@ public ReferenceValueAssignmentItemsResponse getReferenceValueAssignedItems(Stri { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ReferenceValueAssignmentItemElement> handler = instanceHandler.getReferenceDataHandler(userId, serverName, methodName); List assignedItems = handler.getReferenceValueAssignedItems(userId, validValueGUID, @@ -1966,14 +1966,14 @@ public ReferenceValueAssignmentDefinitionsResponse getReferenceValueAssignments( { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ReferenceValueAssignmentItemElement> handler = instanceHandler.getReferenceDataHandler(userId, serverName, methodName); List referenceValueAssignments = handler.getReferenceValueAssignments(userId, referenceableGUID, diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-spring/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/spring/ValidValuesResource.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-spring/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/spring/ReferenceDataResource.java similarity index 99% rename from open-metadata-implementation/access-services/digital-architecture/digital-architecture-spring/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/spring/ValidValuesResource.java rename to open-metadata-implementation/access-services/digital-architecture/digital-architecture-spring/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/spring/ReferenceDataResource.java index db0b45d46fa..bc0f738e2c6 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-spring/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/spring/ValidValuesResource.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-spring/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/spring/ReferenceDataResource.java @@ -7,13 +7,13 @@ import io.swagger.v3.oas.annotations.tags.Tag; import org.odpi.openmetadata.accessservices.digitalarchitecture.properties.*; import org.odpi.openmetadata.accessservices.digitalarchitecture.rest.*; -import org.odpi.openmetadata.accessservices.digitalarchitecture.server.ValidValuesRESTServices; +import org.odpi.openmetadata.accessservices.digitalarchitecture.server.ReferenceDataRESTServices; import org.odpi.openmetadata.commonservices.ffdc.rest.*; import org.springframework.web.bind.annotation.*; /** - * ValidValuesResource provides the API operations to create and maintain lists of valid + * ReferenceDataResource provides the API operations to create and maintain lists of valid * value definitions grouped into a valid value set. Both valid value definitions and valid value sets have * the same attributes and so inherit from ValidValue where all the attributes are defined. * @@ -28,15 +28,15 @@ externalDocs=@ExternalDocumentation(description="Digital Architecture Open Metadata Access Service (OMAS)", url="https://egeria-project.org/services/omas/digital-architecture/overview/")) -public class ValidValuesResource +public class ReferenceDataResource { - private ValidValuesRESTServices restAPI = new ValidValuesRESTServices(); + private ReferenceDataRESTServices restAPI = new ReferenceDataRESTServices(); /** * Default constructor */ - public ValidValuesResource() + public ReferenceDataResource() { } diff --git a/open-metadata-implementation/access-services/project-management/project-management-server/build.gradle b/open-metadata-implementation/access-services/project-management/project-management-server/build.gradle index cbd7d6ae124..3b993d65e1d 100644 --- a/open-metadata-implementation/access-services/project-management/project-management-server/build.gradle +++ b/open-metadata-implementation/access-services/project-management/project-management-server/build.gradle @@ -16,6 +16,7 @@ dependencies { implementation project(':open-metadata-implementation:common-services:multi-tenant') implementation project(':open-metadata-implementation:common-services:ffdc-services') implementation project(':open-metadata-implementation:common-services:repository-handler') + implementation project(':open-metadata-implementation:common-services:metadata-security:metadata-security-server') compileOnly 'com.fasterxml.jackson.core:jackson-annotations' } diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ReferenceDataHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ReferenceDataHandler.java new file mode 100644 index 00000000000..1bd692c4b14 --- /dev/null +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ReferenceDataHandler.java @@ -0,0 +1,1307 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.commonservices.generichandlers; + +import org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler; +import org.odpi.openmetadata.commonservices.repositoryhandler.RepositoryHandler; +import org.odpi.openmetadata.frameworks.auditlog.AuditLog; +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; +import org.odpi.openmetadata.metadatasecurity.server.OpenMetadataServerSecurityVerifier; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityProxy; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * ValidValuesHandler provides the methods to create and maintain lists of valid + * value definitions grouped into a valid value set. Both valid value definitions and valid value sets have + * the same attributes and so inherit from ValidValue where all the attributes are defined. + *

          + * A set is just grouping of valid values. Valid value definitions and set can be nested many times in other + * valid value sets. + */ +public class ReferenceDataHandler extends ValidValuesHandler +{ + private final OpenMetadataAPIGenericConverter validValueAssignmentConverter; + private final Class validValueAssignmentClass; + private final OpenMetadataAPIGenericConverter validValueAssignmentDefConverter; + private final Class validValueAssignmentDefClass; + private final OpenMetadataAPIGenericConverter validValueImplementationConverter; + private final Class validValueImplementationClass; + private final OpenMetadataAPIGenericConverter validValueImplementationDefConverter; + private final Class validValueImplementationDefClass; + private final OpenMetadataAPIGenericConverter validValueMappingConverter; + private final Class validValueMappingClass; + private final OpenMetadataAPIGenericConverter referenceValueAssignmentConverter; + private final Class referenceValueAssignmentClass; + private final OpenMetadataAPIGenericConverter referenceValueAssignedItemConverter; + private final Class referenceValueAssignedItemClass; + + /** + * Construct the handler information needed to interact with the repository services + * + * @param converter specific converter for the VALID_VALUE bean class + * @param beanClass name of bean class that is represented by the generic class VALID_VALUE + * @param validValueAssignmentConverter specific converter for the VALID_VALUE_ASSIGNMENT bean class + * @param validValueAssignmentClass name of bean class that is represented by the generic class VALID_VALUE_ASSIGNMENT + * @param validValueAssignmentDefConverter specific converter for the VALID_VALUE_ASSIGNMENT_DEF bean class + * @param validValueAssignmentDefClass name of bean class that is represented by the generic class VALID_VALUE_ASSIGNMENT_DEF + * @param validValueImplementationConverter specific converter for the VALID_VALUE_IMPLEMENTATION bean class + * @param validValueImplementationClass name of bean class that is represented by the generic class VALID_VALUE_IMPLEMENTATION + * @param validValueImplementationDefConverter specific converter for the VALID_VALUE_IMPLEMENTATION_DEF bean class + * @param validValueImplementationDefClass name of bean class that is represented by the generic class VALID_VALUE_IMPLEMENTATION_DEF + * @param validValueMappingConverter specific converter for the VALID_VALUE_MAPPING bean class + * @param validValueMappingClass name of bean class that is represented by the generic class VALID_VALUE_MAPPING + * @param referenceValueAssignmentConverter specific converter for the REFERENCE_VALUE_ASSIGNMENT bean class + * @param referenceValueAssignmentClass name of bean class that is represented by the generic class REFERENCE_VALUE_ASSIGNMENT + * @param referenceValueAssignedItemConverter specific converter for the REFERENCE_VALUE_ASSIGNED_ITEM bean class + * @param referenceValueAssignedItemClass name of bean class that is represented by the generic class REFERENCE_VALUE_ASSIGNED_ITEM + * @param serviceName name of this service + * @param serverName name of the local server + * @param invalidParameterHandler handler for managing parameter errors + * @param repositoryHandler manages calls to the repository services + * @param repositoryHelper provides utilities for manipulating the repository services objects + * @param localServerUserId userId for this server + * @param securityVerifier open metadata security services verifier + * @param supportedZones list of zones that the access service is allowed to serve Asset instances from. + * @param defaultZones list of zones that the access service should set in all new Asset instances. + * @param publishZones list of zones that the access service sets up in published Asset instances. + * @param auditLog destination for audit log events. + */ + public ReferenceDataHandler(OpenMetadataAPIGenericConverter converter, + Class beanClass, + OpenMetadataAPIGenericConverter validValueAssignmentConverter, + Class validValueAssignmentClass, + OpenMetadataAPIGenericConverter validValueAssignmentDefConverter, + Class validValueAssignmentDefClass, + OpenMetadataAPIGenericConverter validValueImplementationConverter, + Class validValueImplementationClass, + OpenMetadataAPIGenericConverter validValueImplementationDefConverter, + Class validValueImplementationDefClass, + OpenMetadataAPIGenericConverter validValueMappingConverter, + Class validValueMappingClass, + OpenMetadataAPIGenericConverter referenceValueAssignmentConverter, + Class referenceValueAssignmentClass, + OpenMetadataAPIGenericConverter referenceValueAssignedItemConverter, + Class referenceValueAssignedItemClass, + String serviceName, + String serverName, + InvalidParameterHandler invalidParameterHandler, + RepositoryHandler repositoryHandler, + OMRSRepositoryHelper repositoryHelper, + String localServerUserId, + OpenMetadataServerSecurityVerifier securityVerifier, + List supportedZones, + List defaultZones, + List publishZones, + AuditLog auditLog) + + { + super(converter, + beanClass, + serviceName, + serverName, + invalidParameterHandler, + repositoryHandler, + repositoryHelper, + localServerUserId, + securityVerifier, + supportedZones, + defaultZones, + publishZones, + auditLog); + + this.validValueAssignmentConverter = validValueAssignmentConverter; + this.validValueAssignmentClass = validValueAssignmentClass; + this.validValueAssignmentDefConverter = validValueAssignmentDefConverter; + this.validValueAssignmentDefClass = validValueAssignmentDefClass; + this.validValueImplementationConverter = validValueImplementationConverter; + this.validValueImplementationClass = validValueImplementationClass; + this.validValueImplementationDefConverter = validValueImplementationDefConverter; + this.validValueImplementationDefClass = validValueImplementationDefClass; + this.validValueMappingConverter = validValueMappingConverter; + this.validValueMappingClass = validValueMappingClass; + this.referenceValueAssignmentConverter = referenceValueAssignmentConverter; + this.referenceValueAssignmentClass = referenceValueAssignmentClass; + this.referenceValueAssignedItemConverter = referenceValueAssignedItemConverter; + this.referenceValueAssignedItemClass = referenceValueAssignedItemClass; + } + + + /** + * Link a valid value to an asset that provides the implementation. Typically, this method is + * used to link a valid value set to a code table. + * + * @param userId calling user. + * @param externalSourceGUID guid of the software capability entity that represented the external source - null for local + * @param externalSourceName name of the software capability entity that represented the external source + * @param validValueGUID unique identifier of the valid value. + * @param assetGUID unique identifier of the asset that implements the valid value. + * @param symbolicName lookup name for valid value + * @param implementationValue value used in implementation + * @param additionalValues additional values stored under the symbolic name + * @param effectiveFrom starting time for this relationship (null for all time) + * @param effectiveTo ending time for this relationship (null for all time) + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException the repository is not available or not working properly. + */ + public void linkValidValueToImplementation(String userId, + String externalSourceGUID, + String externalSourceName, + String validValueGUID, + String assetGUID, + String symbolicName, + String implementationValue, + Map additionalValues, + Date effectiveFrom, + Date effectiveTo, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String validValueGUIDParameter = "validValueGUID"; + final String assetGUIDParameter = "assetGUID"; + + InstanceProperties properties = null; + + if (symbolicName != null) + { + properties = repositoryHelper.addStringPropertyToInstance(serviceName, + null, + OpenMetadataAPIMapper.SYMBOLIC_NAME_PROPERTY_NAME, + symbolicName, + methodName); + } + + if (implementationValue != null) + { + properties = repositoryHelper.addStringPropertyToInstance(serviceName, + properties, + OpenMetadataAPIMapper.IMPLEMENTATION_VALUE_PROPERTY_NAME, + implementationValue, + methodName); + } + + if ((additionalValues != null) && (!additionalValues.isEmpty())) + { + properties = repositoryHelper.addStringMapPropertyToInstance(serviceName, + properties, + OpenMetadataAPIMapper.ADDITIONAL_VALUES_PROPERTY_NAME, + additionalValues, + methodName); + } + + this.linkElementToElement(userId, + externalSourceGUID, + externalSourceName, + validValueGUID, + validValueGUIDParameter, + OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, + assetGUID, + assetGUIDParameter, + OpenMetadataAPIMapper.ASSET_TYPE_NAME, + forLineage, + forDuplicateProcessing, + supportedZones, + OpenMetadataAPIMapper.VALID_VALUES_IMPL_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.VALID_VALUES_IMPL_RELATIONSHIP_TYPE_NAME, + setUpEffectiveDates(properties, effectiveFrom, effectiveTo), + effectiveFrom, + effectiveTo, + effectiveTime, + methodName); + } + + + /** + * Remove the link between a valid value and an implementing asset. + * + * @param userId calling user. + * @param externalSourceGUID guid of the software capability entity that represented the external source - null for local + * @param externalSourceName name of the software capability entity that represented the external source + * @param validValueGUID unique identifier of the valid value. + * @param assetGUID unique identifier of the asset that used to implement the valid value. + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException the repository is not available or not working properly. + */ + public void unlinkValidValueFromImplementation(String userId, + String externalSourceGUID, + String externalSourceName, + String validValueGUID, + String assetGUID, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String validValueGUIDParameter = "validValueGUID"; + final String assetGUIDParameter = "assetGUID"; + + this.unlinkElementFromElement(userId, + false, + externalSourceGUID, + externalSourceName, + validValueGUID, + validValueGUIDParameter, + OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, + assetGUID, + assetGUIDParameter, + OpenMetadataAPIMapper.ASSET_TYPE_GUID, + OpenMetadataAPIMapper.ASSET_TYPE_NAME, + forLineage, + forDuplicateProcessing, + OpenMetadataAPIMapper.VALID_VALUES_IMPL_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.VALID_VALUES_IMPL_RELATIONSHIP_TYPE_NAME, + effectiveTime, + methodName); + } + + + /** + * Link together 2 valid values from different sets that have equivalent values/meanings. + * + * @param userId calling user. + * @param externalSourceGUID guid of the software capability entity that represented the external source - null for local + * @param externalSourceName name of the software capability entity that represented the external source + * @param validValue1GUID unique identifier of the valid value. + * @param validValue2GUID unique identifier of the other valid value to link to. + * @param associationDescription how are the valid values related? + * @param confidence how confident is the steward that this mapping is correct (0-100). + * @param steward identifier of steward + * @param stewardTypeName type of element that represents steward + * @param stewardPropertyName property name of steward identifier + * @param notes additional notes from the steward + * @param effectiveFrom starting time for this relationship (null for all time) + * @param effectiveTo ending time for this relationship (null for all time) + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException the repository is not available or not working properly. + */ + public void mapValidValues(String userId, + String externalSourceGUID, + String externalSourceName, + String validValue1GUID, + String validValue2GUID, + String associationDescription, + int confidence, + String steward, + String stewardTypeName, + String stewardPropertyName, + String notes, + Date effectiveFrom, + Date effectiveTo, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String validValue1GUIDParameter = "validValue1GUID"; + final String validValue2GUIDParameter = "validValue2GUID"; + + InstanceProperties relationshipProperties = repositoryHelper.addIntPropertyToInstance(serviceName, + null, + OpenMetadataAPIMapper.CONFIDENCE_PROPERTY_NAME, + confidence, + methodName); + + relationshipProperties = repositoryHelper.addStringPropertyToInstance(serviceName, + relationshipProperties, + OpenMetadataAPIMapper.ASSOCIATION_DESCRIPTION_PROPERTY_NAME, + associationDescription, + methodName); + + relationshipProperties = repositoryHelper.addStringPropertyToInstance(serviceName, + relationshipProperties, + OpenMetadataAPIMapper.STEWARD_PROPERTY_NAME, + steward, + methodName); + relationshipProperties = repositoryHelper.addStringPropertyToInstance(serviceName, + relationshipProperties, + OpenMetadataAPIMapper.STEWARD_TYPE_NAME_PROPERTY_NAME, + stewardTypeName, + methodName); + + relationshipProperties = repositoryHelper.addStringPropertyToInstance(serviceName, + relationshipProperties, + OpenMetadataAPIMapper.STEWARD_PROPERTY_NAME_PROPERTY_NAME, + stewardPropertyName, + methodName); + + relationshipProperties = repositoryHelper.addStringPropertyToInstance(serviceName, + relationshipProperties, + OpenMetadataAPIMapper.NOTES_PROPERTY_NAME, + notes, + methodName); + + this.linkElementToElement(userId, + externalSourceGUID, + externalSourceName, + validValue2GUID, + validValue2GUIDParameter, + OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, + validValue1GUID, + validValue1GUIDParameter, + OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, + forLineage, + forDuplicateProcessing, + supportedZones, + OpenMetadataAPIMapper.VALID_VALUES_MAP_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.VALID_VALUES_MAP_RELATIONSHIP_TYPE_GUID, + this.setUpEffectiveDates(relationshipProperties, effectiveFrom, effectiveTo), + effectiveFrom, + effectiveTo, + effectiveTime, + methodName); + } + + + /** + * Remove the reference value link between a valid value and a referenceable (item). + * + * @param userId calling user. + * @param externalSourceGUID guid of the software capability entity that represented the external source - null for local + * @param externalSourceName name of the software capability entity that represented the external source + * @param validValue1GUID unique identifier of the valid value. + * @param validValue2GUID unique identifier of the other valid value element to remove the link from. + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException the repository is not available or not working properly. + */ + public void unmapValidValues(String userId, + String externalSourceGUID, + String externalSourceName, + String validValue1GUID, + String validValue2GUID, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String validValue1GUIDParameter = "validValue1GUID"; + final String validValue2GUIDParameter = "validValue2GUID"; + + this.unlinkElementFromElement(userId, + false, + externalSourceGUID, + externalSourceName, + validValue2GUID, + validValue2GUIDParameter, + OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, + validValue1GUID, + validValue1GUIDParameter, + OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_GUID, + OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, + forLineage, + forDuplicateProcessing, + OpenMetadataAPIMapper.VALID_VALUES_MAP_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.VALID_VALUES_MAP_RELATIONSHIP_TYPE_GUID, + effectiveTime, + methodName); + + } + + + + /** + * Page through the list of consumers for a valid value. + * + * @param userId calling user + * @param validValueGUID unique identifier of valid value to query + * @param validValueGUIDParameter parameter name for validValueGUID + * @param serviceSupportedZones list of zones that define which assets can be retrieved. + * @param startFrom paging starting point + * @param pageSize maximum number of return values. + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * @return list of valid value consumer beans + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException the repository is not available or not working properly. + */ + public List getValidValuesAssignmentConsumers(String userId, + String validValueGUID, + String validValueGUIDParameter, + List serviceSupportedZones, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String guidParameterName = "relationship.end1.guid"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(validValueGUID, validValueGUIDParameter, methodName); + + /* + * Validates the parameters and retrieves the links to attached keywords that are visible to this user. + * Relationships are returned so that the isPublic property from the relationship can be retrieved. + */ + List relationships = this.getAttachmentLinks(userId, + validValueGUID, + validValueGUIDParameter, + OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, + OpenMetadataAPIMapper.VALID_VALUES_ASSIGNMENT_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.VALID_VALUES_ASSIGNMENT_RELATIONSHIP_TYPE_NAME, + null, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + 1, + forLineage, + forDuplicateProcessing, + serviceSupportedZones, + startFrom, + pageSize, + effectiveTime, + methodName); + + if ((relationships == null) || (relationships.isEmpty())) + { + return null; + } + + List results = new ArrayList<>(); + + for (Relationship relationship : relationships) + { + if (relationship != null) + { + EntityProxy end1 = relationship.getEntityOneProxy(); + if (end1 != null) + { + try + { + EntityDetail consumerEntity = repositoryHandler.getEntityByGUID(userId, + end1.getGUID(), + guidParameterName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + + this.validateAnchorEntity(userId, + end1.getGUID(), + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + consumerEntity, + guidParameterName, + false, + forLineage, + forDuplicateProcessing, + serviceSupportedZones, + effectiveTime, + methodName); + + VALID_VALUE_ASSIGNMENT bean = validValueAssignmentConverter.getNewBean(validValueAssignmentClass, + consumerEntity, + relationship, + methodName); + if (bean != null) + { + results.add(bean); + } + } + catch (InvalidParameterException | UserNotAuthorizedException error) + { + /* ignore this entity and invisible to this user */ + } + } + } + } + + if (results.isEmpty()) + { + return null; + } + else + { + return results; + } + } + + + /** + * Page through the list of valid values assigned to referenceable element. + * + * @param userId calling user + * @param referenceableGUID unique identifier of anchoring referenceable + * @param referenceableGUIDParameter name of parameter for referenceableGUID + * @param startFrom paging starting point + * @param pageSize maximum number of return values. + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * @return list of valid value consumer beans + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException the repository is not available or not working properly. + */ + public List getValidValuesAssignmentDefinition(String userId, + String referenceableGUID, + String referenceableGUIDParameter, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String guidParameterName = "relationship.end2.guid"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(referenceableGUID, referenceableGUIDParameter, methodName); + + + /* + * Validates the parameters and retrieves the links to attached keywords that are visible to this user. + * Relationships are returned so that the isPublic property from the relationship can be retrieved. + */ + List relationships = this.getAttachmentLinks(userId, + referenceableGUID, + referenceableGUIDParameter, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + OpenMetadataAPIMapper.VALID_VALUES_ASSIGNMENT_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.VALID_VALUES_ASSIGNMENT_RELATIONSHIP_TYPE_NAME, + null, + OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, + 2, + forLineage, + forDuplicateProcessing, + supportedZones, + startFrom, + pageSize, + effectiveTime, + methodName); + + if ((relationships == null) || (relationships.isEmpty())) + { + return null; + } + + List results = new ArrayList<>(); + + for (Relationship relationship : relationships) + { + if (relationship != null) + { + EntityProxy end2 = relationship.getEntityTwoProxy(); + if (end2 != null) + { + try + { + EntityDetail consumerEntity = repositoryHandler.getEntityByGUID(userId, + end2.getGUID(), + guidParameterName, + OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + + this.validateAnchorEntity(userId, + end2.getGUID(), + OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, + consumerEntity, + guidParameterName, + false, + forLineage, + forDuplicateProcessing, + supportedZones, + effectiveTime, + methodName); + + VALID_VALUE_ASSIGNMENT_DEF bean = validValueAssignmentDefConverter.getNewBean(validValueAssignmentDefClass, + consumerEntity, + relationship, + methodName); + if (bean != null) + { + results.add(bean); + } + } + catch (InvalidParameterException | UserNotAuthorizedException error) + { + /* ignore this entity and invisible to this user */ + } + } + } + } + + if (results.isEmpty()) + { + return null; + } + else + { + return results; + } + } + + + /** + * Page through the list of implementations for a valid value. + * + * @param userId calling user + * @param validValueGUID unique identifier of valid value to query + * @param validValueGUIDParameter parameter supplying the validValueGUID value + * @param serviceSupportedZones list of zones that define which assets can be retrieved. + * @param startFrom paging starting point + * @param pageSize maximum number of return values. + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * @return list of valid value beans + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException the repository is not available or not working properly. + */ + public List getValidValuesImplementationAssets(String userId, + String validValueGUID, + String validValueGUIDParameter, + List serviceSupportedZones, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String guidParameterName = "relationship.end1.guid"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(validValueGUID, validValueGUIDParameter, methodName); + + /* + * Validates the parameters and retrieves the links to attached keywords that are visible to this user. + * Relationships are returned so that the isPublic property from the relationship can be retrieved. + */ + List relationships = this.getAttachmentLinks(userId, + validValueGUID, + validValueGUIDParameter, + OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, + OpenMetadataAPIMapper.VALID_VALUES_IMPL_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.VALID_VALUES_IMPL_RELATIONSHIP_TYPE_NAME, + null, + OpenMetadataAPIMapper.ASSET_TYPE_NAME, + 2, + forLineage, + forDuplicateProcessing, + serviceSupportedZones, + startFrom, + pageSize, + effectiveTime, + methodName); + + if ((relationships == null) || (relationships.isEmpty())) + { + return null; + } + + List results = new ArrayList<>(); + + for (Relationship relationship : relationships) + { + if (relationship != null) + { + EntityProxy end2 = relationship.getEntityTwoProxy(); + if (end2 != null) + { + try + { + EntityDetail consumerEntity = repositoryHandler.getEntityByGUID(userId, + end2.getGUID(), + guidParameterName, + OpenMetadataAPIMapper.ASSET_TYPE_NAME, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + + this.validateAnchorEntity(userId, + end2.getGUID(), + OpenMetadataAPIMapper.ASSET_TYPE_NAME, + consumerEntity, + guidParameterName, + false, + forLineage, + forDuplicateProcessing, + serviceSupportedZones, + effectiveTime, + methodName); + + VALID_VALUE_IMPLEMENTATION bean = validValueImplementationConverter.getNewBean(validValueImplementationClass, + consumerEntity, + relationship, + methodName); + if (bean != null) + { + results.add(bean); + } + } + catch (InvalidParameterException | UserNotAuthorizedException error) + { + /* ignore this entity and invisible to this user */ + } + } + } + } + + if (results.isEmpty()) + { + return null; + } + else + { + return results; + } + } + + + /** + * Page through the list of valid values defining the content of a reference data asset. + * This is always called from the assetHandler after it has checked that the asset is in the right zone. + * + * @param userId calling user + * @param assetGUID unique identifier of asset to query + * @param assetGUIDParameter parameter providing the assetGUID value + * @param startFrom paging starting point + * @param pageSize maximum number of return values. + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * @return list of valid value beans + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException the repository is not available or not working properly. + */ + public List getValidValuesImplementationDefinitions(String userId, + String assetGUID, + String assetGUIDParameter, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String guidParameterName = "relationship.end2.guid"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameter, methodName); + + /* + * Validates the parameters and retrieves the links to attached keywords that are visible to this user. + * Relationships are returned so that the isPublic property from the relationship can be retrieved. + */ + List relationships = this.getAttachmentLinks(userId, + assetGUID, + assetGUIDParameter, + OpenMetadataAPIMapper.ASSET_TYPE_NAME, + OpenMetadataAPIMapper.VALID_VALUES_IMPL_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.VALID_VALUES_IMPL_RELATIONSHIP_TYPE_NAME, + null, + OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, + 1, + forLineage, + forDuplicateProcessing, + supportedZones, + startFrom, + pageSize, + effectiveTime, + methodName); + + if ((relationships == null) || (relationships.isEmpty())) + { + return null; + } + + List results = new ArrayList<>(); + + for (Relationship relationship : relationships) + { + if (relationship != null) + { + EntityProxy end1 = relationship.getEntityOneProxy(); + if (end1 != null) + { + try + { + EntityDetail consumerEntity = repositoryHandler.getEntityByGUID(userId, + end1.getGUID(), + guidParameterName, + OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + + this.validateAnchorEntity(userId, + end1.getGUID(), + OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, + consumerEntity, + guidParameterName, + false, + forLineage, + forDuplicateProcessing, + supportedZones, + effectiveTime, + methodName); + + VALID_VALUE_IMPLEMENTATION_DEF bean = validValueImplementationDefConverter.getNewBean(validValueImplementationDefClass, + consumerEntity, + relationship, + methodName); + if (bean != null) + { + results.add(bean); + } + } + catch (InvalidParameterException | UserNotAuthorizedException error) + { + /* ignore this entity and invisible to this user */ + } + } + } + } + + if (results.isEmpty()) + { + return null; + } + else + { + return results; + } + } + + + /** + * Page through the list of mappings for a valid value. These are other valid values from different valid value sets that are equivalent + * in some way. The association description covers the type of association. + * + * @param userId calling user + * @param validValueGUID unique identifier of valid value to query + * @param validValueGUIDParameter name of parameter supplying the validValueGUID + * @param startFrom paging starting point + * @param pageSize maximum number of return values. + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * @return list of mappings to other valid value beans + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException the repository is not available or not working properly. + */ + public List getValidValueMappings(String userId, + String validValueGUID, + String validValueGUIDParameter, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String guidParameterName = "relationship.end1.guid"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(validValueGUID, validValueGUIDParameter, methodName); + + EntityDetail startingEntity = repositoryHandler.getEntityByGUID(userId, + validValueGUID, + validValueGUIDParameter, + OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + + /* + * Validates the parameters and retrieves the links to attached keywords that are visible to this user. + * Relationships are returned so that the isPublic property from the relationship can be retrieved. + */ + List relationships = this.getAttachmentLinks(userId, + startingEntity, + validValueGUIDParameter, + OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, + OpenMetadataAPIMapper.VALID_VALUES_MAP_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.VALID_VALUES_MAP_RELATIONSHIP_TYPE_NAME, + null, + OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, + 0, + forLineage, + forDuplicateProcessing, + supportedZones, + startFrom, + pageSize, + effectiveTime, + methodName); + + if ((relationships == null) || (relationships.isEmpty())) + { + return null; + } + + List results = new ArrayList<>(); + + for (Relationship relationship : relationships) + { + if (relationship != null) + { + EntityProxy proxy = repositoryHandler.getOtherEnd(startingEntity.getGUID(), + OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, + relationship, + 0, + methodName); + if (proxy != null) + { + try + { + EntityDetail consumerEntity = repositoryHandler.getEntityByGUID(userId, + proxy.getGUID(), + guidParameterName, + OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + + this.validateAnchorEntity(userId, + proxy.getGUID(), + OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, + consumerEntity, + guidParameterName, + false, + forLineage, + forDuplicateProcessing, + supportedZones, + effectiveTime, + methodName); + + VALID_VALUE_MAPPING bean = validValueMappingConverter.getNewBean(validValueMappingClass, + consumerEntity, + relationship, + methodName); + if (bean != null) + { + results.add(bean); + } + } + catch (InvalidParameterException | UserNotAuthorizedException error) + { + /* ignore this entity and invisible to this user */ + } + } + } + } + + if (results.isEmpty()) + { + return null; + } + else + { + return results; + } + } + + + /** + * Page through the list of referenceables that have this valid value as a reference value. + * + * @param userId calling user + * @param validValueGUID unique identifier of valid value to query + * @param validValueGUIDParameter name of parameter that provides the validValueGUID value + * @param serviceSupportedZones list of zones that define which assets can be retrieved + * @param startFrom paging starting point + * @param pageSize maximum number of return values + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * @return list of referenceable beans + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to make this request + * @throws PropertyServerException the repository is not available or not working properly + */ + public List getReferenceValueAssignedItems(String userId, + String validValueGUID, + String validValueGUIDParameter, + List serviceSupportedZones, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String guidParameterName = "relationship.end1.guid"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(validValueGUID, validValueGUIDParameter, methodName); + + /* + * Validates the parameters and retrieves the links to attached keywords that are visible to this user. + * Relationships are returned so that the isPublic property from the relationship can be retrieved. + */ + List relationships = this.getAttachmentLinks(userId, + validValueGUID, + validValueGUIDParameter, + OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, + OpenMetadataAPIMapper.REFERENCE_VALUE_ASSIGNMENT_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.REFERENCE_VALUE_ASSIGNMENT_RELATIONSHIP_TYPE_NAME, + null, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + 1, + forLineage, + forDuplicateProcessing, + serviceSupportedZones, + startFrom, + pageSize, + effectiveTime, + methodName); + + if ((relationships == null) || (relationships.isEmpty())) + { + return null; + } + + List results = new ArrayList<>(); + + for (Relationship relationship : relationships) + { + if (relationship != null) + { + EntityProxy end1 = relationship.getEntityOneProxy(); + if (end1 != null) + { + try + { + EntityDetail consumerEntity = repositoryHandler.getEntityByGUID(userId, + end1.getGUID(), + guidParameterName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + false, + false, + effectiveTime, + methodName); + + this.validateAnchorEntity(userId, + end1.getGUID(), + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + consumerEntity, + guidParameterName, + false, + forLineage, + forDuplicateProcessing, + serviceSupportedZones, + effectiveTime, + methodName); + + REFERENCE_VALUE_ASSIGNED_ITEM bean = referenceValueAssignedItemConverter.getNewBean(referenceValueAssignedItemClass, + consumerEntity, + relationship, + methodName); + if (bean != null) + { + results.add(bean); + } + } + catch (InvalidParameterException | UserNotAuthorizedException error) + { + /* ignore this entity and invisible to this user */ + } + } + } + } + + if (results.isEmpty()) + { + return null; + } + else + { + return results; + } + } + + + /** + * Page through the list of assigned reference values for a referenceable. + * + * @param userId calling user + * @param referenceableGUID unique identifier of assigned item + * @param referenceableGUIDParameterName name of parameter for referenceableGUID + * @param startFrom paging starting point + * @param pageSize maximum number of return values. + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * @return list of valid value beans + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException the repository is not available or not working properly. + */ + public List getReferenceValueAssignments(String userId, + String referenceableGUID, + String referenceableGUIDParameterName, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String guidParameterName = "relationship.end2.guid"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(referenceableGUID, referenceableGUIDParameterName, methodName); + + /* + * Validates the parameters and retrieves the links to attached keywords that are visible to this user. + * Relationships are returned so that the isPublic property from the relationship can be retrieved. + */ + List relationships = this.getAttachmentLinks(userId, + referenceableGUID, + referenceableGUIDParameterName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + OpenMetadataAPIMapper.REFERENCE_VALUE_ASSIGNMENT_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.REFERENCE_VALUE_ASSIGNMENT_RELATIONSHIP_TYPE_NAME, + null, + OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, + 2, + forLineage, + forDuplicateProcessing, + supportedZones, + startFrom, + pageSize, + effectiveTime, + methodName); + + if ((relationships == null) || (relationships.isEmpty())) + { + return null; + } + + List results = new ArrayList<>(); + + for (Relationship relationship : relationships) + { + if (relationship != null) + { + EntityProxy end2 = relationship.getEntityTwoProxy(); + if (end2 != null) + { + try + { + EntityDetail consumerEntity = repositoryHandler.getEntityByGUID(userId, + end2.getGUID(), + guidParameterName, + OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + + this.validateAnchorEntity(userId, + end2.getGUID(), + OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, + consumerEntity, + guidParameterName, + false, + forLineage, + forDuplicateProcessing, + supportedZones, + effectiveTime, + methodName); + + REFERENCE_VALUE_ASSIGNMENT bean = referenceValueAssignmentConverter.getNewBean(referenceValueAssignmentClass, + consumerEntity, + relationship, + methodName); + if (bean != null) + { + results.add(bean); + } + } + catch (InvalidParameterException | UserNotAuthorizedException error) + { + /* ignore this entity and invisible to this user */ + } + } + } + } + + if (results.isEmpty()) + { + return null; + } + else + { + return results; + } + } +} diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ReferenceableHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ReferenceableHandler.java index 9e86f50f5e7..dcaeb19d021 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ReferenceableHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ReferenceableHandler.java @@ -1204,6 +1204,106 @@ public void removeTemplateClassification(String userId, } + + + /** + * Page through the list of consumers for a valid value. + * + * @param userId calling user + * @param validValueGUID unique identifier of valid value to query + * @param validValueGUIDParameter parameter name for validValueGUID + * @param startFrom paging starting point + * @param pageSize maximum number of return values. + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * @return list of valid value consumer beans + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException the repository is not available or not working properly. + */ + public List getValidValueConsumers(String userId, + String validValueGUID, + String validValueGUIDParameter, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return this.getAttachedElements(userId, + validValueGUID, + validValueGUIDParameter, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + OpenMetadataAPIMapper.VALID_VALUES_ASSIGNMENT_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.VALID_VALUES_ASSIGNMENT_RELATIONSHIP_TYPE_NAME, + OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, + null, + null, + 1, + forLineage, + forDuplicateProcessing, + startFrom, + pageSize, + effectiveTime, + methodName); + } + + + + + /** + * Page through the list of referenceables that have this valid value as a reference value. + * + * @param userId calling user + * @param validValueGUID unique identifier of valid value to query + * @param validValueGUIDParameter name of parameter that provides the validValueGUID value + * @param startFrom paging starting point + * @param pageSize maximum number of return values + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * @return list of referenceable beans + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to make this request + * @throws PropertyServerException the repository is not available or not working properly + */ + public List getReferenceValueAssignees(String userId, + String validValueGUID, + String validValueGUIDParameter, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return this.getAttachedElements(userId, + validValueGUID, + validValueGUIDParameter, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + OpenMetadataAPIMapper.REFERENCE_VALUE_ASSIGNMENT_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.REFERENCE_VALUE_ASSIGNMENT_RELATIONSHIP_TYPE_NAME, + OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, + null, + null, + 1, + forLineage, + forDuplicateProcessing, + startFrom, + pageSize, + effectiveTime, + methodName); + } + + /** * Add a more information to element. * diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ValidValuesHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ValidValuesHandler.java index 51a4bbcd82d..48305b4ce8d 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ValidValuesHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ValidValuesHandler.java @@ -10,10 +10,7 @@ import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; import org.odpi.openmetadata.metadatasecurity.server.OpenMetadataServerSecurityVerifier; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; -import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail; -import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityProxy; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties; -import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper; import java.util.ArrayList; @@ -29,49 +26,13 @@ * A set is just grouping of valid values. Valid value definitions and set can be nested many times in other * valid value sets. */ -public class ValidValuesHandler extends ReferenceableHandler +public class ValidValuesHandler extends ReferenceableHandler { - private final OpenMetadataAPIGenericConverter validValueAssignmentConverter; - private final Class validValueAssignmentClass; - private final OpenMetadataAPIGenericConverter validValueAssignmentDefConverter; - private final Class validValueAssignmentDefClass; - private final OpenMetadataAPIGenericConverter validValueImplementationConverter; - private final Class validValueImplementationClass; - private final OpenMetadataAPIGenericConverter validValueImplementationDefConverter; - private final Class validValueImplementationDefClass; - private final OpenMetadataAPIGenericConverter validValueMappingConverter; - private final Class validValueMappingClass; - private final OpenMetadataAPIGenericConverter referenceValueAssignmentConverter; - private final Class referenceValueAssignmentClass; - private final OpenMetadataAPIGenericConverter referenceValueAssignedItemConverter; - private final Class referenceValueAssignedItemClass; - /** * Construct the handler information needed to interact with the repository services * - * @param converter specific converter for the VALID_VALUE bean class - * @param beanClass name of bean class that is represented by the generic class VALID_VALUE - * @param validValueAssignmentConverter specific converter for the VALID_VALUE_ASSIGNMENT bean class - * @param validValueAssignmentClass name of bean class that is represented by the generic class VALID_VALUE_ASSIGNMENT - * @param validValueAssignmentDefConverter specific converter for the VALID_VALUE_ASSIGNMENT_DEF bean class - * @param validValueAssignmentDefClass name of bean class that is represented by the generic class VALID_VALUE_ASSIGNMENT_DEF - * @param validValueImplementationConverter specific converter for the VALID_VALUE_IMPLEMENTATION bean class - * @param validValueImplementationClass name of bean class that is represented by the generic class VALID_VALUE_IMPLEMENTATION - * @param validValueImplementationDefConverter specific converter for the VALID_VALUE_IMPLEMENTATION_DEF bean class - * @param validValueImplementationDefClass name of bean class that is represented by the generic class VALID_VALUE_IMPLEMENTATION_DEF - * @param validValueMappingConverter specific converter for the VALID_VALUE_MAPPING bean class - * @param validValueMappingClass name of bean class that is represented by the generic class VALID_VALUE_MAPPING - * @param referenceValueAssignmentConverter specific converter for the REFERENCE_VALUE_ASSIGNMENT bean class - * @param referenceValueAssignmentClass name of bean class that is represented by the generic class REFERENCE_VALUE_ASSIGNMENT - * @param referenceValueAssignedItemConverter specific converter for the REFERENCE_VALUE_ASSIGNED_ITEM bean class - * @param referenceValueAssignedItemClass name of bean class that is represented by the generic class REFERENCE_VALUE_ASSIGNED_ITEM + * @param converter specific converter for the B bean class + * @param beanClass name of bean class that is represented by the generic class B * @param serviceName name of this service * @param serverName name of the local server * @param invalidParameterHandler handler for managing parameter errors @@ -84,33 +45,19 @@ public class ValidValuesHandler converter, - Class beanClass, - OpenMetadataAPIGenericConverter validValueAssignmentConverter, - Class validValueAssignmentClass, - OpenMetadataAPIGenericConverter validValueAssignmentDefConverter, - Class validValueAssignmentDefClass, - OpenMetadataAPIGenericConverter validValueImplementationConverter, - Class validValueImplementationClass, - OpenMetadataAPIGenericConverter validValueImplementationDefConverter, - Class validValueImplementationDefClass, - OpenMetadataAPIGenericConverter validValueMappingConverter, - Class validValueMappingClass, - OpenMetadataAPIGenericConverter referenceValueAssignmentConverter, - Class referenceValueAssignmentClass, - OpenMetadataAPIGenericConverter referenceValueAssignedItemConverter, - Class referenceValueAssignedItemClass, - String serviceName, - String serverName, - InvalidParameterHandler invalidParameterHandler, - RepositoryHandler repositoryHandler, - OMRSRepositoryHelper repositoryHelper, - String localServerUserId, - OpenMetadataServerSecurityVerifier securityVerifier, - List supportedZones, - List defaultZones, - List publishZones, - AuditLog auditLog) + public ValidValuesHandler(OpenMetadataAPIGenericConverter converter, + Class beanClass, + String serviceName, + String serverName, + InvalidParameterHandler invalidParameterHandler, + RepositoryHandler repositoryHandler, + OMRSRepositoryHelper repositoryHelper, + String localServerUserId, + OpenMetadataServerSecurityVerifier securityVerifier, + List supportedZones, + List defaultZones, + List publishZones, + AuditLog auditLog) { super(converter, @@ -126,21 +73,6 @@ public ValidValuesHandler(OpenMetadataAPIGenericConverter defaultZones, publishZones, auditLog); - - this.validValueAssignmentConverter = validValueAssignmentConverter; - this.validValueAssignmentClass = validValueAssignmentClass; - this.validValueAssignmentDefConverter = validValueAssignmentDefConverter; - this.validValueAssignmentDefClass = validValueAssignmentDefClass; - this.validValueImplementationConverter = validValueImplementationConverter; - this.validValueImplementationClass = validValueImplementationClass; - this.validValueImplementationDefConverter = validValueImplementationDefConverter; - this.validValueImplementationDefClass = validValueImplementationDefClass; - this.validValueMappingConverter = validValueMappingConverter; - this.validValueMappingClass = validValueMappingClass; - this.referenceValueAssignmentConverter = referenceValueAssignmentConverter; - this.referenceValueAssignmentClass = referenceValueAssignmentClass; - this.referenceValueAssignedItemConverter = referenceValueAssignedItemConverter; - this.referenceValueAssignedItemClass = referenceValueAssignedItemClass; } @@ -584,150 +516,6 @@ public void detachValidValueFromSet(String userId, } - /** - * Link a valid value to an asset that provides the implementation. Typically, this method is - * used to link a valid value set to a code table. - * - * @param userId calling user. - * @param externalSourceGUID guid of the software capability entity that represented the external source - null for local - * @param externalSourceName name of the software capability entity that represented the external source - * @param validValueGUID unique identifier of the valid value. - * @param assetGUID unique identifier of the asset that implements the valid value. - * @param symbolicName lookup name for valid value - * @param implementationValue value used in implementation - * @param additionalValues additional values stored under the symbolic name - * @param effectiveFrom starting time for this relationship (null for all time) - * @param effectiveTo ending time for this relationship (null for all time) - * @param forLineage return elements marked with the Memento classification? - * @param forDuplicateProcessing do not merge elements marked as duplicates? - * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) - * @param methodName calling method - * @throws InvalidParameterException one of the parameters is invalid. - * @throws UserNotAuthorizedException the user is not authorized to make this request. - * @throws PropertyServerException the repository is not available or not working properly. - */ - public void linkValidValueToImplementation(String userId, - String externalSourceGUID, - String externalSourceName, - String validValueGUID, - String assetGUID, - String symbolicName, - String implementationValue, - Map additionalValues, - Date effectiveFrom, - Date effectiveTo, - boolean forLineage, - boolean forDuplicateProcessing, - Date effectiveTime, - String methodName) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException - { - final String validValueGUIDParameter = "validValueGUID"; - final String assetGUIDParameter = "assetGUID"; - - InstanceProperties properties = null; - - if (symbolicName != null) - { - properties = repositoryHelper.addStringPropertyToInstance(serviceName, - null, - OpenMetadataAPIMapper.SYMBOLIC_NAME_PROPERTY_NAME, - symbolicName, - methodName); - } - - if (implementationValue != null) - { - properties = repositoryHelper.addStringPropertyToInstance(serviceName, - properties, - OpenMetadataAPIMapper.IMPLEMENTATION_VALUE_PROPERTY_NAME, - implementationValue, - methodName); - } - - if ((additionalValues != null) && (!additionalValues.isEmpty())) - { - properties = repositoryHelper.addStringMapPropertyToInstance(serviceName, - properties, - OpenMetadataAPIMapper.ADDITIONAL_VALUES_PROPERTY_NAME, - additionalValues, - methodName); - } - - this.linkElementToElement(userId, - externalSourceGUID, - externalSourceName, - validValueGUID, - validValueGUIDParameter, - OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, - assetGUID, - assetGUIDParameter, - OpenMetadataAPIMapper.ASSET_TYPE_NAME, - forLineage, - forDuplicateProcessing, - supportedZones, - OpenMetadataAPIMapper.VALID_VALUES_IMPL_RELATIONSHIP_TYPE_GUID, - OpenMetadataAPIMapper.VALID_VALUES_IMPL_RELATIONSHIP_TYPE_NAME, - setUpEffectiveDates(properties, effectiveFrom, effectiveTo), - effectiveFrom, - effectiveTo, - effectiveTime, - methodName); - } - - - /** - * Remove the link between a valid value and an implementing asset. - * - * @param userId calling user. - * @param externalSourceGUID guid of the software capability entity that represented the external source - null for local - * @param externalSourceName name of the software capability entity that represented the external source - * @param validValueGUID unique identifier of the valid value. - * @param assetGUID unique identifier of the asset that used to implement the valid value. - * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned - * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate - * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) - * @param methodName calling method - * @throws InvalidParameterException one of the parameters is invalid. - * @throws UserNotAuthorizedException the user is not authorized to make this request. - * @throws PropertyServerException the repository is not available or not working properly. - */ - public void unlinkValidValueFromImplementation(String userId, - String externalSourceGUID, - String externalSourceName, - String validValueGUID, - String assetGUID, - boolean forLineage, - boolean forDuplicateProcessing, - Date effectiveTime, - String methodName) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException - { - final String validValueGUIDParameter = "validValueGUID"; - final String assetGUIDParameter = "assetGUID"; - - this.unlinkElementFromElement(userId, - false, - externalSourceGUID, - externalSourceName, - validValueGUID, - validValueGUIDParameter, - OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, - assetGUID, - assetGUIDParameter, - OpenMetadataAPIMapper.ASSET_TYPE_GUID, - OpenMetadataAPIMapper.ASSET_TYPE_NAME, - forLineage, - forDuplicateProcessing, - OpenMetadataAPIMapper.VALID_VALUES_IMPL_RELATIONSHIP_TYPE_GUID, - OpenMetadataAPIMapper.VALID_VALUES_IMPL_RELATIONSHIP_TYPE_NAME, - effectiveTime, - methodName); - } - - /** * Link a valid value typically to a schema element or glossary term to show that it uses * the valid values. @@ -999,162 +787,6 @@ public void unassignReferenceValueFromItem(String userId, } - /** - * Link together 2 valid values from different sets that have equivalent values/meanings. - * - * @param userId calling user. - * @param externalSourceGUID guid of the software capability entity that represented the external source - null for local - * @param externalSourceName name of the software capability entity that represented the external source - * @param validValue1GUID unique identifier of the valid value. - * @param validValue2GUID unique identifier of the other valid value to link to. - * @param associationDescription how are the valid values related? - * @param confidence how confident is the steward that this mapping is correct (0-100). - * @param steward identifier of steward - * @param stewardTypeName type of element that represents steward - * @param stewardPropertyName property name of steward identifier - * @param notes additional notes from the steward - * @param effectiveFrom starting time for this relationship (null for all time) - * @param effectiveTo ending time for this relationship (null for all time) - * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned - * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate - * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) - * @param methodName calling method - * @throws InvalidParameterException one of the parameters is invalid. - * @throws UserNotAuthorizedException the user is not authorized to make this request. - * @throws PropertyServerException the repository is not available or not working properly. - */ - public void mapValidValues(String userId, - String externalSourceGUID, - String externalSourceName, - String validValue1GUID, - String validValue2GUID, - String associationDescription, - int confidence, - String steward, - String stewardTypeName, - String stewardPropertyName, - String notes, - Date effectiveFrom, - Date effectiveTo, - boolean forLineage, - boolean forDuplicateProcessing, - Date effectiveTime, - String methodName) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException - { - final String validValue1GUIDParameter = "validValue1GUID"; - final String validValue2GUIDParameter = "validValue2GUID"; - - InstanceProperties relationshipProperties = repositoryHelper.addIntPropertyToInstance(serviceName, - null, - OpenMetadataAPIMapper.CONFIDENCE_PROPERTY_NAME, - confidence, - methodName); - - relationshipProperties = repositoryHelper.addStringPropertyToInstance(serviceName, - relationshipProperties, - OpenMetadataAPIMapper.ASSOCIATION_DESCRIPTION_PROPERTY_NAME, - associationDescription, - methodName); - - relationshipProperties = repositoryHelper.addStringPropertyToInstance(serviceName, - relationshipProperties, - OpenMetadataAPIMapper.STEWARD_PROPERTY_NAME, - steward, - methodName); - relationshipProperties = repositoryHelper.addStringPropertyToInstance(serviceName, - relationshipProperties, - OpenMetadataAPIMapper.STEWARD_TYPE_NAME_PROPERTY_NAME, - stewardTypeName, - methodName); - - relationshipProperties = repositoryHelper.addStringPropertyToInstance(serviceName, - relationshipProperties, - OpenMetadataAPIMapper.STEWARD_PROPERTY_NAME_PROPERTY_NAME, - stewardPropertyName, - methodName); - - relationshipProperties = repositoryHelper.addStringPropertyToInstance(serviceName, - relationshipProperties, - OpenMetadataAPIMapper.NOTES_PROPERTY_NAME, - notes, - methodName); - - this.linkElementToElement(userId, - externalSourceGUID, - externalSourceName, - validValue2GUID, - validValue2GUIDParameter, - OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, - validValue1GUID, - validValue1GUIDParameter, - OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, - forLineage, - forDuplicateProcessing, - supportedZones, - OpenMetadataAPIMapper.VALID_VALUES_MAP_RELATIONSHIP_TYPE_GUID, - OpenMetadataAPIMapper.VALID_VALUES_MAP_RELATIONSHIP_TYPE_GUID, - this.setUpEffectiveDates(relationshipProperties, effectiveFrom, effectiveTo), - effectiveFrom, - effectiveTo, - effectiveTime, - methodName); - } - - - /** - * Remove the reference value link between a valid value and a referenceable (item). - * - * @param userId calling user. - * @param externalSourceGUID guid of the software capability entity that represented the external source - null for local - * @param externalSourceName name of the software capability entity that represented the external source - * @param validValue1GUID unique identifier of the valid value. - * @param validValue2GUID unique identifier of the other valid value element to remove the link from. - * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned - * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate - * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) - * @param methodName calling method - * @throws InvalidParameterException one of the parameters is invalid. - * @throws UserNotAuthorizedException the user is not authorized to make this request. - * @throws PropertyServerException the repository is not available or not working properly. - */ - public void unmapValidValues(String userId, - String externalSourceGUID, - String externalSourceName, - String validValue1GUID, - String validValue2GUID, - boolean forLineage, - boolean forDuplicateProcessing, - Date effectiveTime, - String methodName) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException - { - final String validValue1GUIDParameter = "validValue1GUID"; - final String validValue2GUIDParameter = "validValue2GUID"; - - this.unlinkElementFromElement(userId, - false, - externalSourceGUID, - externalSourceName, - validValue2GUID, - validValue2GUIDParameter, - OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, - validValue1GUID, - validValue1GUIDParameter, - OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_GUID, - OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, - forLineage, - forDuplicateProcessing, - OpenMetadataAPIMapper.VALID_VALUES_MAP_RELATIONSHIP_TYPE_GUID, - OpenMetadataAPIMapper.VALID_VALUES_MAP_RELATIONSHIP_TYPE_GUID, - effectiveTime, - methodName); - - } - - /** * Retrieve a specific valid value from the repository. * @@ -1169,12 +801,12 @@ public void unmapValidValues(String userId, * @throws UserNotAuthorizedException the user is not authorized to make this request. * @throws PropertyServerException the repository is not available or not working properly. */ - public VALID_VALUE getValidValueByGUID(String userId, - String validValueGUID, - boolean forLineage, - boolean forDuplicateProcessing, - Date effectiveTime, - String methodName) throws InvalidParameterException, + public B getValidValueByGUID(String userId, + String validValueGUID, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException { @@ -1213,15 +845,15 @@ public VALID_VALUE getValidValueByGUID(String userId, * @throws UserNotAuthorizedException the user is not authorized to make this request. * @throws PropertyServerException the repository is not available or not working properly. */ - public List getValidValueByName(String userId, - String name, - String nameParameterName, - int startFrom, - int pageSize, - boolean forLineage, - boolean forDuplicateProcessing, - Date effectiveTime, - String methodName) throws InvalidParameterException, + public List getValidValueByName(String userId, + String name, + String nameParameterName, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException { @@ -1268,15 +900,15 @@ public List getValidValueByName(String userId, * @throws UserNotAuthorizedException the user is not authorized to make this request. * @throws PropertyServerException the repository is not available or not working properly. */ - public List findValidValues(String userId, - String searchString, - String searchStringParameterName, - int startFrom, - int pageSize, - boolean forLineage, - boolean forDuplicateProcessing, - Date effectiveTime, - String methodName) throws InvalidParameterException, + public List findValidValues(String userId, + String searchString, + String searchStringParameterName, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException { @@ -1313,15 +945,15 @@ public List findValidValues(String userId, * @throws UserNotAuthorizedException the user is not authorized to make this request. * @throws PropertyServerException the repository is not available or not working properly. */ - public List getValidValueSetMembers(String userId, - String validValueSetGUID, - String validValueSetGUIDParameter, - int startFrom, - int pageSize, - boolean forLineage, - boolean forDuplicateProcessing, - Date effectiveTime, - String methodName) throws InvalidParameterException, + public List getValidValueSetMembers(String userId, + String validValueSetGUID, + String validValueSetGUIDParameter, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException { @@ -1364,15 +996,15 @@ public List getValidValueSetMembers(String userId, * @throws UserNotAuthorizedException the user is not authorized to make this request. * @throws PropertyServerException the repository is not available or not working properly. */ - public List getSetsForValidValue(String userId, - String validValueGUID, - String validValueGUIDParameter, - int startFrom, - int pageSize, - boolean forLineage, - boolean forDuplicateProcessing, - Date effectiveTime, - String methodName) throws InvalidParameterException, + public List getSetsForValidValue(String userId, + String validValueGUID, + String validValueGUIDParameter, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException { @@ -1398,128 +1030,6 @@ public List getSetsForValidValue(String userId, } - /** - * Page through the list of consumers for a valid value. - * - * @param userId calling user - * @param validValueGUID unique identifier of valid value to query - * @param validValueGUIDParameter parameter name for validValueGUID - * @param serviceSupportedZones list of zones that define which assets can be retrieved. - * @param startFrom paging starting point - * @param pageSize maximum number of return values. - * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned - * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate - * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) - * @param methodName calling method - * @return list of valid value consumer beans - * @throws InvalidParameterException one of the parameters is invalid. - * @throws UserNotAuthorizedException the user is not authorized to make this request. - * @throws PropertyServerException the repository is not available or not working properly. - */ - public List getValidValuesAssignmentConsumers(String userId, - String validValueGUID, - String validValueGUIDParameter, - List serviceSupportedZones, - int startFrom, - int pageSize, - boolean forLineage, - boolean forDuplicateProcessing, - Date effectiveTime, - String methodName) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException - { - final String guidParameterName = "relationship.end1.guid"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(validValueGUID, validValueGUIDParameter, methodName); - - /* - * Validates the parameters and retrieves the links to attached keywords that are visible to this user. - * Relationships are returned so that the isPublic property from the relationship can be retrieved. - */ - List relationships = this.getAttachmentLinks(userId, - validValueGUID, - validValueGUIDParameter, - OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, - OpenMetadataAPIMapper.VALID_VALUES_ASSIGNMENT_RELATIONSHIP_TYPE_GUID, - OpenMetadataAPIMapper.VALID_VALUES_ASSIGNMENT_RELATIONSHIP_TYPE_NAME, - null, - OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, - 1, - forLineage, - forDuplicateProcessing, - serviceSupportedZones, - startFrom, - pageSize, - effectiveTime, - methodName); - - if ((relationships == null) || (relationships.isEmpty())) - { - return null; - } - - List results = new ArrayList<>(); - - for (Relationship relationship : relationships) - { - if (relationship != null) - { - EntityProxy end1 = relationship.getEntityOneProxy(); - if (end1 != null) - { - try - { - EntityDetail consumerEntity = repositoryHandler.getEntityByGUID(userId, - end1.getGUID(), - guidParameterName, - OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, - forLineage, - forDuplicateProcessing, - effectiveTime, - methodName); - - this.validateAnchorEntity(userId, - end1.getGUID(), - OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, - consumerEntity, - guidParameterName, - false, - forLineage, - forDuplicateProcessing, - serviceSupportedZones, - effectiveTime, - methodName); - - VALID_VALUE_ASSIGNMENT bean = validValueAssignmentConverter.getNewBean(validValueAssignmentClass, - consumerEntity, - relationship, - methodName); - if (bean != null) - { - results.add(bean); - } - } - catch (InvalidParameterException | UserNotAuthorizedException error) - { - /* ignore this entity and invisible to this user */ - } - } - } - } - - if (results.isEmpty()) - { - return null; - } - else - { - return results; - } - } - - /** * Page through the list of valid values assigned to referenceable element. * @@ -1537,606 +1047,34 @@ public List getValidValuesAssignmentConsumers(String * @throws UserNotAuthorizedException the user is not authorized to make this request. * @throws PropertyServerException the repository is not available or not working properly. */ - public List getValidValuesAssignmentDefinition(String userId, - String referenceableGUID, - String referenceableGUIDParameter, - int startFrom, - int pageSize, - boolean forLineage, - boolean forDuplicateProcessing, - Date effectiveTime, - String methodName) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException - { - final String guidParameterName = "relationship.end2.guid"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(referenceableGUID, referenceableGUIDParameter, methodName); - - - /* - * Validates the parameters and retrieves the links to attached keywords that are visible to this user. - * Relationships are returned so that the isPublic property from the relationship can be retrieved. - */ - List relationships = this.getAttachmentLinks(userId, - referenceableGUID, - referenceableGUIDParameter, - OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, - OpenMetadataAPIMapper.VALID_VALUES_ASSIGNMENT_RELATIONSHIP_TYPE_GUID, - OpenMetadataAPIMapper.VALID_VALUES_ASSIGNMENT_RELATIONSHIP_TYPE_NAME, - null, - OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, - 2, - forLineage, - forDuplicateProcessing, - supportedZones, - startFrom, - pageSize, - effectiveTime, - methodName); - - if ((relationships == null) || (relationships.isEmpty())) - { - return null; - } - - List results = new ArrayList<>(); - - for (Relationship relationship : relationships) - { - if (relationship != null) - { - EntityProxy end2 = relationship.getEntityTwoProxy(); - if (end2 != null) - { - try - { - EntityDetail consumerEntity = repositoryHandler.getEntityByGUID(userId, - end2.getGUID(), - guidParameterName, - OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, - forLineage, - forDuplicateProcessing, - effectiveTime, - methodName); - - this.validateAnchorEntity(userId, - end2.getGUID(), - OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, - consumerEntity, - guidParameterName, - false, - forLineage, - forDuplicateProcessing, - supportedZones, - effectiveTime, - methodName); - - VALID_VALUE_ASSIGNMENT_DEF bean = validValueAssignmentDefConverter.getNewBean(validValueAssignmentDefClass, - consumerEntity, - relationship, - methodName); - if (bean != null) - { - results.add(bean); - } - } - catch (InvalidParameterException | UserNotAuthorizedException error) - { - /* ignore this entity and invisible to this user */ - } - } - } - } - - if (results.isEmpty()) - { - return null; - } - else - { - return results; - } - } - - - /** - * Page through the list of implementations for a valid value. - * - * @param userId calling user - * @param validValueGUID unique identifier of valid value to query - * @param validValueGUIDParameter parameter supplying the validValueGUID value - * @param serviceSupportedZones list of zones that define which assets can be retrieved. - * @param startFrom paging starting point - * @param pageSize maximum number of return values. - * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned - * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate - * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) - * @param methodName calling method - * @return list of valid value beans - * @throws InvalidParameterException one of the parameters is invalid. - * @throws UserNotAuthorizedException the user is not authorized to make this request. - * @throws PropertyServerException the repository is not available or not working properly. - */ - public List getValidValuesImplementationAssets(String userId, - String validValueGUID, - String validValueGUIDParameter, - List serviceSupportedZones, - int startFrom, - int pageSize, - boolean forLineage, - boolean forDuplicateProcessing, - Date effectiveTime, - String methodName) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException - { - final String guidParameterName = "relationship.end1.guid"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(validValueGUID, validValueGUIDParameter, methodName); - - /* - * Validates the parameters and retrieves the links to attached keywords that are visible to this user. - * Relationships are returned so that the isPublic property from the relationship can be retrieved. - */ - List relationships = this.getAttachmentLinks(userId, - validValueGUID, - validValueGUIDParameter, - OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, - OpenMetadataAPIMapper.VALID_VALUES_IMPL_RELATIONSHIP_TYPE_GUID, - OpenMetadataAPIMapper.VALID_VALUES_IMPL_RELATIONSHIP_TYPE_NAME, - null, - OpenMetadataAPIMapper.ASSET_TYPE_NAME, - 2, - forLineage, - forDuplicateProcessing, - serviceSupportedZones, - startFrom, - pageSize, - effectiveTime, - methodName); - - if ((relationships == null) || (relationships.isEmpty())) - { - return null; - } - - List results = new ArrayList<>(); - - for (Relationship relationship : relationships) - { - if (relationship != null) - { - EntityProxy end2 = relationship.getEntityTwoProxy(); - if (end2 != null) - { - try - { - EntityDetail consumerEntity = repositoryHandler.getEntityByGUID(userId, - end2.getGUID(), - guidParameterName, - OpenMetadataAPIMapper.ASSET_TYPE_NAME, - forLineage, - forDuplicateProcessing, - effectiveTime, - methodName); - - this.validateAnchorEntity(userId, - end2.getGUID(), - OpenMetadataAPIMapper.ASSET_TYPE_NAME, - consumerEntity, - guidParameterName, - false, - forLineage, - forDuplicateProcessing, - serviceSupportedZones, - effectiveTime, - methodName); - - VALID_VALUE_IMPLEMENTATION bean = validValueImplementationConverter.getNewBean(validValueImplementationClass, - consumerEntity, - relationship, - methodName); - if (bean != null) - { - results.add(bean); - } - } - catch (InvalidParameterException | UserNotAuthorizedException error) - { - /* ignore this entity and invisible to this user */ - } - } - } - } - - if (results.isEmpty()) - { - return null; - } - else - { - return results; - } - } - - - /** - * Page through the list of valid values defining the content of a reference data asset. - * This is always called from the assetHandler after it has checked that the asset is in the right zone. - * - * @param userId calling user - * @param assetGUID unique identifier of asset to query - * @param assetGUIDParameter parameter providing the assetGUID value - * @param startFrom paging starting point - * @param pageSize maximum number of return values. - * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned - * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate - * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) - * @param methodName calling method - * @return list of valid value beans - * @throws InvalidParameterException one of the parameters is invalid. - * @throws UserNotAuthorizedException the user is not authorized to make this request. - * @throws PropertyServerException the repository is not available or not working properly. - */ - public List getValidValuesImplementationDefinitions(String userId, - String assetGUID, - String assetGUIDParameter, - int startFrom, - int pageSize, - boolean forLineage, - boolean forDuplicateProcessing, - Date effectiveTime, - String methodName) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException - { - final String guidParameterName = "relationship.end2.guid"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameter, methodName); - - /* - * Validates the parameters and retrieves the links to attached keywords that are visible to this user. - * Relationships are returned so that the isPublic property from the relationship can be retrieved. - */ - List relationships = this.getAttachmentLinks(userId, - assetGUID, - assetGUIDParameter, - OpenMetadataAPIMapper.ASSET_TYPE_NAME, - OpenMetadataAPIMapper.VALID_VALUES_IMPL_RELATIONSHIP_TYPE_GUID, - OpenMetadataAPIMapper.VALID_VALUES_IMPL_RELATIONSHIP_TYPE_NAME, - null, - OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, - 1, - forLineage, - forDuplicateProcessing, - supportedZones, - startFrom, - pageSize, - effectiveTime, - methodName); - - if ((relationships == null) || (relationships.isEmpty())) - { - return null; - } - - List results = new ArrayList<>(); - - for (Relationship relationship : relationships) - { - if (relationship != null) - { - EntityProxy end1 = relationship.getEntityOneProxy(); - if (end1 != null) - { - try - { - EntityDetail consumerEntity = repositoryHandler.getEntityByGUID(userId, - end1.getGUID(), - guidParameterName, - OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, - forLineage, - forDuplicateProcessing, - effectiveTime, - methodName); - - this.validateAnchorEntity(userId, - end1.getGUID(), - OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, - consumerEntity, - guidParameterName, - false, - forLineage, - forDuplicateProcessing, - supportedZones, - effectiveTime, - methodName); - - VALID_VALUE_IMPLEMENTATION_DEF bean = validValueImplementationDefConverter.getNewBean(validValueImplementationDefClass, - consumerEntity, - relationship, - methodName); - if (bean != null) - { - results.add(bean); - } - } - catch (InvalidParameterException | UserNotAuthorizedException error) - { - /* ignore this entity and invisible to this user */ - } - } - } - } - - if (results.isEmpty()) - { - return null; - } - else - { - return results; - } - } - - - /** - * Page through the list of mappings for a valid value. These are other valid values from different valid value sets that are equivalent - * in some way. The association description covers the type of association. - * - * @param userId calling user - * @param validValueGUID unique identifier of valid value to query - * @param validValueGUIDParameter name of parameter supplying the validValueGUID - * @param startFrom paging starting point - * @param pageSize maximum number of return values. - * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned - * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate - * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) - * @param methodName calling method - * @return list of mappings to other valid value beans - * @throws InvalidParameterException one of the parameters is invalid. - * @throws UserNotAuthorizedException the user is not authorized to make this request. - * @throws PropertyServerException the repository is not available or not working properly. - */ - public List getValidValueMappings(String userId, - String validValueGUID, - String validValueGUIDParameter, - int startFrom, - int pageSize, - boolean forLineage, - boolean forDuplicateProcessing, - Date effectiveTime, - String methodName) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + public List getValidValues(String userId, + String referenceableGUID, + String referenceableGUIDParameter, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { - final String guidParameterName = "relationship.end1.guid"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(validValueGUID, validValueGUIDParameter, methodName); - - EntityDetail startingEntity = repositoryHandler.getEntityByGUID(userId, - validValueGUID, - validValueGUIDParameter, - OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, - forLineage, - forDuplicateProcessing, - effectiveTime, - methodName); - - /* - * Validates the parameters and retrieves the links to attached keywords that are visible to this user. - * Relationships are returned so that the isPublic property from the relationship can be retrieved. - */ - List relationships = this.getAttachmentLinks(userId, - startingEntity, - validValueGUIDParameter, - OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, - OpenMetadataAPIMapper.VALID_VALUES_MAP_RELATIONSHIP_TYPE_GUID, - OpenMetadataAPIMapper.VALID_VALUES_MAP_RELATIONSHIP_TYPE_NAME, - null, - OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, - 0, - forLineage, - forDuplicateProcessing, - supportedZones, - startFrom, - pageSize, - effectiveTime, - methodName); - - if ((relationships == null) || (relationships.isEmpty())) - { - return null; - } - - List results = new ArrayList<>(); - - for (Relationship relationship : relationships) - { - if (relationship != null) - { - EntityProxy proxy = repositoryHandler.getOtherEnd(startingEntity.getGUID(), - OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, - relationship, - 0, - methodName); - if (proxy != null) - { - try - { - EntityDetail consumerEntity = repositoryHandler.getEntityByGUID(userId, - proxy.getGUID(), - guidParameterName, - OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, - forLineage, - forDuplicateProcessing, - effectiveTime, - methodName); - - this.validateAnchorEntity(userId, - proxy.getGUID(), - OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, - consumerEntity, - guidParameterName, - false, - forLineage, - forDuplicateProcessing, - supportedZones, - effectiveTime, - methodName); - - VALID_VALUE_MAPPING bean = validValueMappingConverter.getNewBean(validValueMappingClass, - consumerEntity, - relationship, - methodName); - if (bean != null) - { - results.add(bean); - } - } - catch (InvalidParameterException | UserNotAuthorizedException error) - { - /* ignore this entity and invisible to this user */ - } - } - } - } - - if (results.isEmpty()) - { - return null; - } - else - { - return results; - } - } - - - /** - * Page through the list of referenceables that have this valid value as a reference value. - * - * @param userId calling user - * @param validValueGUID unique identifier of valid value to query - * @param validValueGUIDParameter name of parameter that provides the validValueGUID value - * @param serviceSupportedZones list of zones that define which assets can be retrieved - * @param startFrom paging starting point - * @param pageSize maximum number of return values - * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned - * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate - * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) - * @param methodName calling method - * @return list of referenceable beans - * @throws InvalidParameterException one of the parameters is invalid - * @throws UserNotAuthorizedException the user is not authorized to make this request - * @throws PropertyServerException the repository is not available or not working properly - */ - public List getReferenceValueAssignedItems(String userId, - String validValueGUID, - String validValueGUIDParameter, - List serviceSupportedZones, - int startFrom, - int pageSize, - boolean forLineage, - boolean forDuplicateProcessing, - Date effectiveTime, - String methodName) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException - { - final String guidParameterName = "relationship.end1.guid"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(validValueGUID, validValueGUIDParameter, methodName); - - /* - * Validates the parameters and retrieves the links to attached keywords that are visible to this user. - * Relationships are returned so that the isPublic property from the relationship can be retrieved. - */ - List relationships = this.getAttachmentLinks(userId, - validValueGUID, - validValueGUIDParameter, - OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, - OpenMetadataAPIMapper.REFERENCE_VALUE_ASSIGNMENT_RELATIONSHIP_TYPE_GUID, - OpenMetadataAPIMapper.REFERENCE_VALUE_ASSIGNMENT_RELATIONSHIP_TYPE_NAME, - null, - OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, - 1, - forLineage, - forDuplicateProcessing, - serviceSupportedZones, - startFrom, - pageSize, - effectiveTime, - methodName); - - if ((relationships == null) || (relationships.isEmpty())) - { - return null; - } - - List results = new ArrayList<>(); - - for (Relationship relationship : relationships) - { - if (relationship != null) - { - EntityProxy end1 = relationship.getEntityOneProxy(); - if (end1 != null) - { - try - { - EntityDetail consumerEntity = repositoryHandler.getEntityByGUID(userId, - end1.getGUID(), - guidParameterName, - OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, - false, - false, - effectiveTime, - methodName); - - this.validateAnchorEntity(userId, - end1.getGUID(), - OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, - consumerEntity, - guidParameterName, - false, - forLineage, - forDuplicateProcessing, - serviceSupportedZones, - effectiveTime, - methodName); - - REFERENCE_VALUE_ASSIGNED_ITEM bean = referenceValueAssignedItemConverter.getNewBean(referenceValueAssignedItemClass, - consumerEntity, - relationship, - methodName); - if (bean != null) - { - results.add(bean); - } - } - catch (InvalidParameterException | UserNotAuthorizedException error) - { - /* ignore this entity and invisible to this user */ - } - } - } - } - - if (results.isEmpty()) - { - return null; - } - else - { - return results; - } + return this.getAttachedElements(userId, + referenceableGUID, + referenceableGUIDParameter, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + OpenMetadataAPIMapper.VALID_VALUES_ASSIGNMENT_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.VALID_VALUES_ASSIGNMENT_RELATIONSHIP_TYPE_NAME, + OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, + null, + null, + 2, + forLineage, + forDuplicateProcessing, + startFrom, + pageSize, + effectiveTime, + methodName); } @@ -2157,105 +1095,33 @@ public List getReferenceValueAssignedItems(String * @throws UserNotAuthorizedException the user is not authorized to make this request. * @throws PropertyServerException the repository is not available or not working properly. */ - public List getReferenceValueAssignments(String userId, - String referenceableGUID, - String referenceableGUIDParameterName, - int startFrom, - int pageSize, - boolean forLineage, - boolean forDuplicateProcessing, - Date effectiveTime, - String methodName) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + public List getReferenceValues(String userId, + String referenceableGUID, + String referenceableGUIDParameterName, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { - final String guidParameterName = "relationship.end2.guid"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(referenceableGUID, referenceableGUIDParameterName, methodName); - - /* - * Validates the parameters and retrieves the links to attached keywords that are visible to this user. - * Relationships are returned so that the isPublic property from the relationship can be retrieved. - */ - List relationships = this.getAttachmentLinks(userId, - referenceableGUID, - referenceableGUIDParameterName, - OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, - OpenMetadataAPIMapper.REFERENCE_VALUE_ASSIGNMENT_RELATIONSHIP_TYPE_GUID, - OpenMetadataAPIMapper.REFERENCE_VALUE_ASSIGNMENT_RELATIONSHIP_TYPE_NAME, - null, - OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, - 2, - forLineage, - forDuplicateProcessing, - supportedZones, - startFrom, - pageSize, - effectiveTime, - methodName); - - if ((relationships == null) || (relationships.isEmpty())) - { - return null; - } - - List results = new ArrayList<>(); - - for (Relationship relationship : relationships) - { - if (relationship != null) - { - EntityProxy end2 = relationship.getEntityTwoProxy(); - if (end2 != null) - { - try - { - EntityDetail consumerEntity = repositoryHandler.getEntityByGUID(userId, - end2.getGUID(), - guidParameterName, - OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, - forLineage, - forDuplicateProcessing, - effectiveTime, - methodName); - - this.validateAnchorEntity(userId, - end2.getGUID(), - OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, - consumerEntity, - guidParameterName, - false, - forLineage, - forDuplicateProcessing, - supportedZones, - effectiveTime, - methodName); - - REFERENCE_VALUE_ASSIGNMENT bean = referenceValueAssignmentConverter.getNewBean(referenceValueAssignmentClass, - consumerEntity, - relationship, - methodName); - if (bean != null) - { - results.add(bean); - } - } - catch (InvalidParameterException | UserNotAuthorizedException error) - { - /* ignore this entity and invisible to this user */ - } - } - } - } - - if (results.isEmpty()) - { - return null; - } - else - { - return results; - } + return this.getAttachedElements(userId, + referenceableGUID, + referenceableGUIDParameterName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + OpenMetadataAPIMapper.REFERENCE_VALUE_ASSIGNMENT_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.REFERENCE_VALUE_ASSIGNMENT_RELATIONSHIP_TYPE_NAME, + OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, + null, + null, + 2, + forLineage, + forDuplicateProcessing, + startFrom, + pageSize, + effectiveTime, + methodName); } } diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/digital-architecture-fvt/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/fvt/clientconstructors/ClientConstructorTest.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/digital-architecture-fvt/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/fvt/clientconstructors/ClientConstructorTest.java index 0acf60f174f..640f280b0cf 100644 --- a/open-metadata-test/open-metadata-fvt/access-services-fvt/digital-architecture-fvt/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/fvt/clientconstructors/ClientConstructorTest.java +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/digital-architecture-fvt/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/fvt/clientconstructors/ClientConstructorTest.java @@ -3,7 +3,7 @@ package org.odpi.openmetadata.accessservices.digitalarchitecture.fvt.clientconstructors; -import org.odpi.openmetadata.accessservices.digitalarchitecture.client.ValidValuesManager; +import org.odpi.openmetadata.accessservices.digitalarchitecture.client.ReferenceDataManager; import org.odpi.openmetadata.accessservices.digitalarchitecture.client.rest.DigitalArchitectureRESTClient; import org.odpi.openmetadata.adminservices.configuration.registration.AccessServiceDescription; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; @@ -89,13 +89,13 @@ private void testValidValuesManagerClient(String serverName, String serverPlatformRootURL, AuditLog auditLog) throws InvalidParameterException { - new ValidValuesManager(serverName, serverPlatformRootURL, auditLog); - new ValidValuesManager(serverName, serverPlatformRootURL); - new ValidValuesManager(serverName, serverPlatformRootURL, serverUserId, serverPassword, auditLog); - new ValidValuesManager(serverName, serverPlatformRootURL, serverUserId, serverPassword); + new ReferenceDataManager(serverName, serverPlatformRootURL, auditLog); + new ReferenceDataManager(serverName, serverPlatformRootURL); + new ReferenceDataManager(serverName, serverPlatformRootURL, serverUserId, serverPassword, auditLog); + new ReferenceDataManager(serverName, serverPlatformRootURL, serverUserId, serverPassword); DigitalArchitectureRESTClient restClient = new DigitalArchitectureRESTClient(serverName, serverPlatformRootURL); - new ValidValuesManager(serverName, serverPlatformRootURL, restClient, maxPageSize, auditLog); + new ReferenceDataManager(serverName, serverPlatformRootURL, restClient, maxPageSize, auditLog); } } diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/digital-architecture-fvt/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/fvt/errorhandling/InvalidParameterTest.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/digital-architecture-fvt/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/fvt/errorhandling/InvalidParameterTest.java index 0719306333a..65a650b65a1 100644 --- a/open-metadata-test/open-metadata-fvt/access-services-fvt/digital-architecture-fvt/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/fvt/errorhandling/InvalidParameterTest.java +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/digital-architecture-fvt/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/fvt/errorhandling/InvalidParameterTest.java @@ -3,7 +3,7 @@ package org.odpi.openmetadata.accessservices.digitalarchitecture.fvt.errorhandling; -import org.odpi.openmetadata.accessservices.digitalarchitecture.client.ValidValuesManager; +import org.odpi.openmetadata.accessservices.digitalarchitecture.client.ReferenceDataManager; import org.odpi.openmetadata.accessservices.digitalarchitecture.client.rest.DigitalArchitectureRESTClient; import org.odpi.openmetadata.adminservices.configuration.registration.AccessServiceDescription; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; @@ -99,7 +99,7 @@ private void testValidValuesManagerClient(String serverName, try { DigitalArchitectureRESTClient restClient = new DigitalArchitectureRESTClient(serverName, serverPlatformRootURL); - ValidValuesManager client = new ValidValuesManager(serverName, serverPlatformRootURL, restClient, maxPageSize, auditLog); + ReferenceDataManager client = new ReferenceDataManager(serverName, serverPlatformRootURL, restClient, maxPageSize, auditLog); testCreateValidValuesSet(userId, client); } @@ -122,7 +122,7 @@ private void testValidValuesManagerClient(String serverName, * @throws FVTUnexpectedCondition the test case failed */ private void testCreateValidValuesSet(String userId, - ValidValuesManager client) throws FVTUnexpectedCondition + ReferenceDataManager client) throws FVTUnexpectedCondition { final String activityName = "testCreateValidValuesSet"; @@ -144,7 +144,7 @@ private void testCreateValidValuesSet(String userId, * @param client client to call * @throws FVTUnexpectedCondition the test case failed */ - private void testCreateValidValuesSetNoUserId(ValidValuesManager client) throws FVTUnexpectedCondition + private void testCreateValidValuesSetNoUserId(ReferenceDataManager client) throws FVTUnexpectedCondition { final String activityName = "testCreateValidValuesSetNoUserId"; @@ -171,7 +171,7 @@ private void testCreateValidValuesSetNoUserId(ValidValuesManager client) throws * @param userId calling user * @throws FVTUnexpectedCondition the test case failed */ - private void testCreateValidValuesSetNoProperties(ValidValuesManager client, + private void testCreateValidValuesSetNoProperties(ReferenceDataManager client, String userId) throws FVTUnexpectedCondition { final String activityName = "testCreateFileSystemNoProperties"; diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/digital-architecture-fvt/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/fvt/validvalues/CreateValidValuesSetTest.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/digital-architecture-fvt/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/fvt/validvalues/CreateValidValuesSetTest.java index 013534ed940..0359493e240 100644 --- a/open-metadata-test/open-metadata-fvt/access-services-fvt/digital-architecture-fvt/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/fvt/validvalues/CreateValidValuesSetTest.java +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/digital-architecture-fvt/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/fvt/validvalues/CreateValidValuesSetTest.java @@ -4,8 +4,8 @@ package org.odpi.openmetadata.accessservices.digitalarchitecture.fvt.validvalues; +import org.odpi.openmetadata.accessservices.digitalarchitecture.client.ReferenceDataManager; import org.odpi.openmetadata.accessservices.digitalarchitecture.metadataelements.ValidValueElement; -import org.odpi.openmetadata.accessservices.digitalarchitecture.client.ValidValuesManager; import org.odpi.openmetadata.accessservices.digitalarchitecture.client.rest.DigitalArchitectureRESTClient; import org.odpi.openmetadata.accessservices.digitalarchitecture.properties.ValidValueProperties; import org.odpi.openmetadata.adminservices.configuration.registration.AccessServiceDescription; @@ -21,7 +21,7 @@ /** - * CreateValidValuesSetTest calls the ValidValuesManager to create a valid values set with nested definitions + * CreateValidValuesSetTest calls the ReferenceDataManager to create a valid values set with nested definitions * and then retrieve the results. */ public class CreateValidValuesSetTest @@ -113,8 +113,8 @@ private static void runIt(String serverPlatformRootURL, AccessServiceDescription.DATA_MANAGER_OMAS.getAccessServiceDescription(), AccessServiceDescription.DATA_MANAGER_OMAS.getAccessServiceWiki()); - ValidValuesManager client = thisTest.getValidValuesManagerClient(serverName, serverPlatformRootURL, auditLog); - String validValuesSet = thisTest.createValidValueSet(client, userId); + ReferenceDataManager client = thisTest.getValidValuesManagerClient(serverName, serverPlatformRootURL, auditLog); + String validValuesSet = thisTest.createValidValueSet(client, userId); thisTest.createValidValueDefinitions(client, validValuesSet, userId); @@ -131,9 +131,9 @@ private static void runIt(String serverPlatformRootURL, * @return client * @throws FVTUnexpectedCondition the test case failed */ - private ValidValuesManager getValidValuesManagerClient(String serverName, - String serverPlatformRootURL, - AuditLog auditLog) throws FVTUnexpectedCondition + private ReferenceDataManager getValidValuesManagerClient(String serverName, + String serverPlatformRootURL, + AuditLog auditLog) throws FVTUnexpectedCondition { final String activityName = "getValidValuesManagerClient"; @@ -141,7 +141,7 @@ private ValidValuesManager getValidValuesManagerClient(String serverName, { DigitalArchitectureRESTClient restClient = new DigitalArchitectureRESTClient(serverName, serverPlatformRootURL); - return new ValidValuesManager(serverName, serverPlatformRootURL, restClient, maxPageSize, auditLog); + return new ReferenceDataManager(serverName, serverPlatformRootURL, restClient, maxPageSize, auditLog); } catch (Exception unexpectedError) { @@ -158,7 +158,7 @@ private ValidValuesManager getValidValuesManagerClient(String serverName, * @return guid of set * @throws FVTUnexpectedCondition the test case failed */ - private String createValidValueSet(ValidValuesManager client, + private String createValidValueSet(ReferenceDataManager client, String userId) throws FVTUnexpectedCondition { final String activityName = "createValidValueSet"; @@ -279,7 +279,7 @@ else if (validValueList.size() != 1) * @param userId calling user * @throws FVTUnexpectedCondition the test case failed */ - private void createValidValueDefinitions(ValidValuesManager client, + private void createValidValueDefinitions(ReferenceDataManager client, String validValueSetGUID, String userId) throws FVTUnexpectedCondition { @@ -895,7 +895,7 @@ else if (validValueList.size() != 2) * @param userId calling user * @throws FVTUnexpectedCondition the test case failed */ - private void deleteValidValuesSet(ValidValuesManager client, + private void deleteValidValuesSet(ReferenceDataManager client, String validValueSetGUID, String userId) throws FVTUnexpectedCondition { From 27f0ddce153bf938c0ba09f86c7e8970979ce3c8 Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Wed, 17 Aug 2022 09:29:59 +0100 Subject: [PATCH 7/8] Add secure http url Signed-off-by: Mandy Chessell --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 765fbd46771..cc6a3a02777 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ scm:git:git://github.com/odpi/egeria.git scm:git:ssh://github.com/odpi/egeria.git - http://github.com/odpi/egeria/tree/master + https://github.com/odpi/egeria/tree/master Egeria From 837f445e1b7bfee0dd01777f93fd9559a2849a0e Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Thu, 18 Aug 2022 19:38:35 +0100 Subject: [PATCH 8/8] Add valid value support to Community Profile and Data Manager Signed-off-by: Mandy Chessell --- .../server/ValidValuesRESTServices.java | 4 +- .../api/ValidValueManagementInterface.java | 439 ++++++ .../metadataelements/ValidValueElement.java | 177 +++ .../ReferenceValueAssignmentProperties.java | 232 +++ .../properties/ReferenceableProperties.java | 1 + .../ValidValueAssignmentProperties.java | 117 ++ .../ValidValueMembershipProperties.java | 128 ++ .../properties/ValidValueProperties.java | 261 ++++ .../rest/RelatedElementListResponse.java | 22 +- .../rest/ValidValueListResponse.java | 148 ++ .../rest/ValidValueResponse.java | 136 ++ .../client/CommunityManagement.java | 8 +- .../client/CommunityProfileBaseClient.java | 2 +- .../client/ValidValueManagement.java | 860 ++++++++++ .../rest/CommunityProfileRESTClient.java | 78 + .../converters/CommunityConverter.java | 7 +- .../converters/ValidValueConverter.java | 143 ++ .../CommunityProfileInstanceHandler.java | 30 + .../CommunityProfileServicesInstance.java | 56 +- .../server/ValidValuesRESTServices.java | 1386 +++++++++++++++++ .../CommunityProfileValidValuesResource.java | 539 +++++++ .../api/ValidValueManagementInterface.java | 438 ++++++ .../metadataelements/RelatedElement.java | 173 ++ .../metadataelements/RelationshipElement.java | 199 +++ .../metadataelements/ValidValueElement.java | 177 +++ .../properties/ClassificationProperties.java | 190 +++ .../ReferenceValueAssignmentProperties.java | 231 +++ .../properties/ReferenceableProperties.java | 78 +- .../properties/RelationshipProperties.java | 190 +++ .../ValidValueAssignmentProperties.java | 117 ++ .../ValidValueMembershipProperties.java | 128 ++ .../properties/ValidValueProperties.java | 261 ++++ .../rest/ClassificationRequestBody.java | 129 ++ .../rest/ExternalSourceRequestBody.java | 145 ++ .../rest/ReferenceableRequestBody.java | 129 ++ .../rest/RelatedElementListResponse.java | 148 ++ .../rest/RelationshipElementResponse.java | 139 ++ .../rest/RelationshipElementsResponse.java | 150 ++ .../rest/RelationshipRequestBody.java | 129 ++ .../rest/ValidValueListResponse.java | 148 ++ .../datamanager/rest/ValidValueResponse.java | 136 ++ .../client/DataManagerBaseClient.java | 607 ++++++++ .../client/ValidValueManagement.java | 860 ++++++++++ .../client/rest/DataManagerRESTClient.java | 105 ++ .../converters/DataManagerOMASConverter.java | 54 + .../converters/RelatedElementConverter.java | 60 + .../converters/ValidValueConverter.java | 142 ++ .../server/DataManagerInstanceHandler.java | 68 +- .../server/DataManagerServicesInstance.java | 71 +- .../server/SchemaManagerRESTServices.java | 4 +- .../server/ValidValuesRESTServices.java | 1386 +++++++++++++++++ .../DataManagerValidValuesResource.java | 541 +++++++ .../api/ManageReferenceData.java | 2 + .../client/ReferenceDataManager.java | 7 +- .../server/ReferenceDataRESTServices.java | 5 +- .../server/spring/ReferenceDataResource.java | 5 +- .../generichandlers/CommunityHandler.java | 3 +- .../generichandlers/ValidValuesHandler.java | 180 ++- .../opentypes/OpenMetadataTypesArchive.java | 130 ++ .../errorhandling/InvalidParameterTest.java | 2 +- .../fvt/CommunityProfileOMASFVTSuite.java | 7 + .../fvt/profiles/CreateProfileTest.java | 2 +- .../validvalues/CreateValidValuesSetTest.java | 932 +++++++++++ .../fvt/validvalues/package-info.java | 7 + ...mmunityProfileOMASCreateValidValuesIT.java | 36 + .../fvt/DataManagerOMASFVTSuite.java | 8 + .../validvalues/CreateValidValuesSetTest.java | 931 +++++++++++ .../fvt/validvalues/package-info.java | 7 + .../DataManagerOMASCreateValidValuesIT.java | 36 + .../validvalues/CreateValidValuesSetTest.java | 23 +- 70 files changed, 14332 insertions(+), 98 deletions(-) create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/ValidValueManagementInterface.java create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/ValidValueElement.java create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ReferenceValueAssignmentProperties.java create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ValidValueAssignmentProperties.java create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ValidValueMembershipProperties.java create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ValidValueProperties.java create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ValidValueListResponse.java create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ValidValueResponse.java create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/ValidValueManagement.java create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/ValidValueConverter.java create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/ValidValuesRESTServices.java create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/CommunityProfileValidValuesResource.java create mode 100644 open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/api/ValidValueManagementInterface.java create mode 100644 open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/metadataelements/RelatedElement.java create mode 100644 open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/metadataelements/RelationshipElement.java create mode 100644 open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/metadataelements/ValidValueElement.java create mode 100644 open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/ClassificationProperties.java create mode 100644 open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/ReferenceValueAssignmentProperties.java create mode 100644 open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/RelationshipProperties.java create mode 100644 open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/ValidValueAssignmentProperties.java create mode 100644 open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/ValidValueMembershipProperties.java create mode 100644 open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/ValidValueProperties.java create mode 100644 open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/ClassificationRequestBody.java create mode 100644 open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/ExternalSourceRequestBody.java create mode 100644 open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/ReferenceableRequestBody.java create mode 100644 open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/RelatedElementListResponse.java create mode 100644 open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/RelationshipElementResponse.java create mode 100644 open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/RelationshipElementsResponse.java create mode 100644 open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/RelationshipRequestBody.java create mode 100644 open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/ValidValueListResponse.java create mode 100644 open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/ValidValueResponse.java create mode 100644 open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/DataManagerBaseClient.java create mode 100644 open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/ValidValueManagement.java create mode 100644 open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/RelatedElementConverter.java create mode 100644 open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/ValidValueConverter.java create mode 100644 open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/ValidValuesRESTServices.java create mode 100644 open-metadata-implementation/access-services/data-manager/data-manager-spring/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/spring/DataManagerValidValuesResource.java create mode 100644 open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/validvalues/CreateValidValuesSetTest.java create mode 100644 open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/validvalues/package-info.java create mode 100644 open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/test/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/execution/CommunityProfileOMASCreateValidValuesIT.java create mode 100644 open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/datamanager/fvt/validvalues/CreateValidValuesSetTest.java create mode 100644 open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/datamanager/fvt/validvalues/package-info.java create mode 100644 open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/test/java/org/odpi/openmetadata/accessservices/datamanager/fvt/execution/DataManagerOMASCreateValidValuesIT.java diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/server/ValidValuesRESTServices.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/server/ValidValuesRESTServices.java index a572165bd01..4ca531c4afe 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/server/ValidValuesRESTServices.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/server/ValidValuesRESTServices.java @@ -12,7 +12,6 @@ import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDResponse; import org.odpi.openmetadata.commonservices.ffdc.rest.NullRequestBody; import org.odpi.openmetadata.commonservices.ffdc.rest.VoidResponse; -import org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIDummyBean; import org.odpi.openmetadata.commonservices.generichandlers.ValidValuesHandler; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; import org.slf4j.LoggerFactory; @@ -227,12 +226,13 @@ public VoidResponse updateValidValue(String serverName, requestBody.getDescription(), requestBody.getUsage(), requestBody.getScope(), - requestBody.getPreferredValue(), false, + requestBody.getPreferredValue(), requestBody.getAdditionalProperties(), requestBody.getExtendedProperties(), null, null, + true, false, false, new Date(), diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/ValidValueManagementInterface.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/ValidValueManagementInterface.java new file mode 100644 index 00000000000..d16ca655ad2 --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/ValidValueManagementInterface.java @@ -0,0 +1,439 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.communityprofile.api; + +import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.ValidValueElement; +import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.RelatedElement; +import org.odpi.openmetadata.accessservices.communityprofile.properties.ReferenceValueAssignmentProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.ValidValueAssignmentProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.ValidValueMembershipProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.ValidValueProperties; +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; + +import java.util.Date; +import java.util.List; + +/** + * The ValidValueManagementInterface provides methods for managing valid values. + */ +public interface ValidValueManagementInterface +{ + + /** + * Create a new metadata element to represent the validValue. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param validValueProperties properties to store + * + * @return unique identifier of the new metadata element + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + String createValidValue(String userId, + String externalSourceGUID, + String externalSourceName, + ValidValueProperties validValueProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Update the metadata element representing a validValue. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param validValueGUID unique identifier of the metadata element to update + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param validValueProperties new properties for this element + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void updateValidValue(String userId, + String externalSourceGUID, + String externalSourceName, + String validValueGUID, + boolean isMergeUpdate, + ValidValueProperties validValueProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Create a membership relationship between a validValue and a validValueSet that it belongs to. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param validValueSetGUID unique identifier of the valid value set + * @param properties describes the properties of the membership + * @param validValueMemberGUID unique identifier of the member + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void setupValidValueMember(String userId, + String externalSourceGUID, + String externalSourceName, + String validValueSetGUID, + ValidValueMembershipProperties properties, + String validValueMemberGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove a membership relationship between a validValue and a validValueSet that it belongs to. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param validValueSetGUID unique identifier of the valid value set + * @param validValueMemberGUID unique identifier of the role + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void clearValidValueMember(String userId, + String externalSourceGUID, + String externalSourceName, + String validValueSetGUID, + String validValueMemberGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Create a valid value assignment relationship between an element and a valid value (typically, a valid value set) to show that + * the valid value defines the values that can be stored in the data item that the element represents. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param properties describes the permissions that the role has in the validValue + * @param validValueGUID unique identifier of the valid value + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void setupValidValues(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + ValidValueAssignmentProperties properties, + String validValueGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove a valid value assignment relationship between an element and a valid value. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param validValueGUID unique identifier of the valid value + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void clearValidValues(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String validValueGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Create a reference value assignment relationship between an element and a valid value to show that + * the valid value is a semiformal tag/classification. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param properties describes the quality of the assignment + * @param validValueGUID unique identifier of the valid value + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void setupReferenceValueTag(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + ReferenceValueAssignmentProperties properties, + String validValueGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove a reference value assignment relationship between an element and a valid value. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param validValueGUID unique identifier of the valid value + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void clearReferenceValueTag(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String validValueGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the metadata element representing a validValue. This will delete all anchored + * elements such as comments. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param validValueGUID unique identifier of the metadata element to remove + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void removeValidValue(String userId, + String externalSourceGUID, + String externalSourceName, + String validValueGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param userId calling user + * @param searchString string to find in the properties + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + List findValidValues(String userId, + String searchString, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param userId calling user + * @param name name to search for + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + List getValidValuesByName(String userId, + String name, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of valid values. + * + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + List getAllValidValues(String userId, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Page through the members of a valid value set. + * + * @param userId calling user + * @param validValueSetGUID unique identifier of the valid value set + * @param startFrom paging starting point + * @param pageSize maximum number of return values. + * @return list of valid value beans + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException the repository is not available or not working properly. + */ + List getValidValueSetMembers(String userId, + String validValueSetGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + + /** + * Page through the list of valid value sets that a valid value definition/set belongs to. + * + * @param userId calling user + * @param validValueGUID unique identifier of valid value to query + * @param startFrom paging starting point + * @param pageSize maximum number of return values. + * @return list of valid value beans + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException the repository is not available or not working properly. + */ + List getSetsForValidValue(String userId, + String validValueGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Return information about the valid value set linked to an element as its + * set of valid values. + * + * @param userId calling user + * @param elementGUID unique identifier for the element using the valid value + * + * @return list of matching actor profiles (hopefully only one) + * + * @throws InvalidParameterException name or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + ValidValueElement getValidValuesForConsumer(String userId, + String elementGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Return information about the consumers linked to a valid value. + * + * @param userId calling user + * @param validValueGUID unique identifier for the validValue + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching actor profiles (hopefully only one) + * + * @throws InvalidParameterException name or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + List getConsumersOfValidValue(String userId, + String validValueGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Return information about the valid values linked as reference value tags to an element.. + * + * @param userId calling user + * @param elementGUID unique identifier for the element + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of valid values + * + * @throws InvalidParameterException name or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + List getReferenceValues(String userId, + String elementGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + + /** + * Return information about the person roles linked to a validValue. + * + * @param userId calling user + * @param validValueGUID unique identifier for the validValue + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching actor profiles (hopefully only one) + * + * @throws InvalidParameterException name or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + List getAssigneesOfReferenceValue(String userId, + String validValueGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + /** + * Retrieve the validValue metadata element with the supplied unique identifier. + * + * @param userId calling user + * @param validValueGUID unique identifier of the requested metadata element + * + * @return matching metadata element + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + ValidValueElement getValidValueByGUID(String userId, + String validValueGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; +} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/ValidValueElement.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/ValidValueElement.java new file mode 100644 index 00000000000..78b0ac6938d --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/ValidValueElement.java @@ -0,0 +1,177 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.communityprofile.metadataelements; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.communityprofile.properties.ValidValueProperties; + +import java.io.Serializable; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ValidValueElement contains the properties and header for a valid value definition or set entity retrieved from the metadata repository. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ValidValueElement implements MetadataElement, Serializable +{ + private static final long serialVersionUID = 1L; + + private ElementHeader elementHeader = null; + private ValidValueProperties validValueProperties = null; + private RelatedElement relatedElement = null; + + + /** + * Default constructor + */ + public ValidValueElement() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ValidValueElement(ValidValueElement template) + { + if (template != null) + { + elementHeader = template.getElementHeader(); + validValueProperties = template.getValidValueProperties(); + relatedElement = getRelatedElement(); + } + } + + + /** + * Return the element header associated with the properties. + * + * @return element header object + */ + @Override + public ElementHeader getElementHeader() + { + return elementHeader; + } + + + /** + * Set up the element header associated with the properties. + * + * @param elementHeader element header object + */ + @Override + public void setElementHeader(ElementHeader elementHeader) + { + this.elementHeader = elementHeader; + } + + + /** + * Return the properties for the valid value definition or set. + * + * @return properties bean + */ + public ValidValueProperties getValidValueProperties() + { + return validValueProperties; + } + + + /** + * Set up the properties for the valid value definition or set. + * + * @param validValueProperties properties bean + */ + public void setValidValueProperties(ValidValueProperties validValueProperties) + { + this.validValueProperties = validValueProperties; + } + + + /** + * Return information about the related element and relationship (if any) that was + * used to retrieve the valid value. + * + * @return related element + */ + public RelatedElement getRelatedElement() + { + return relatedElement; + } + + + /** + * Set up information about the related element and relationship (if any) that was + * used to retrieve the valid value. + * + * @param relatedElement related element + */ + public void setRelatedElement(RelatedElement relatedElement) + { + this.relatedElement = relatedElement; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ValidValueElement{" + + "elementHeader=" + elementHeader + + ", validValueProperties=" + validValueProperties + + ", relatedElement=" + relatedElement + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + ValidValueElement that = (ValidValueElement) objectToCompare; + return Objects.equals(elementHeader, that.elementHeader) && Objects.equals(validValueProperties, + that.validValueProperties) && Objects.equals( + relatedElement, that.relatedElement); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), elementHeader, validValueProperties, relatedElement); + } +} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ReferenceValueAssignmentProperties.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ReferenceValueAssignmentProperties.java new file mode 100644 index 00000000000..35ae3fdec83 --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ReferenceValueAssignmentProperties.java @@ -0,0 +1,232 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.communityprofile.properties; + + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.io.Serializable; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ReferenceValueAssignmentProperties is a java bean used to create a link between a valid value and a referenceable item + * to enable the valid value to be used as a semiformal tag/classifier. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ReferenceValueAssignmentProperties extends RelationshipProperties +{ + private static final long serialVersionUID = 1L; + + private int confidence = 0; + private String steward = null; + private String stewardTypeName = null; + private String stewardPropertyName = null; + private String notes = null; + + + /** + * Default constructor + */ + public ReferenceValueAssignmentProperties() + { + } + + + /** + * Copy/clone constructor. Note, this is a deep copy + * + * @param template object to copy + */ + public ReferenceValueAssignmentProperties(ReferenceValueAssignmentProperties template) + { + super (template); + + if (template != null) + { + confidence = template.getConfidence(); + steward = template.getSteward(); + stewardTypeName = template.getStewardTypeName(); + stewardPropertyName = template.getStewardPropertyName(); + notes = template.getNotes(); + } + } + + + /** + * Return the confidence level (0-100) that the mapping is correct. + * + * @return int + */ + public int getConfidence() + { + return confidence; + } + + + /** + * Set up the confidence level (0-100) that the mapping is correct. + * + * @param confidence int + */ + public void setConfidence(int confidence) + { + this.confidence = confidence; + } + + + /** + * Returns the id of the steward responsible for the mapping. + * + * @return String id + */ + public String getSteward() + { + return steward; + } + + + /** + * Set up the id of the steward responsible for the mapping. + * + * @param steward String id + */ + public void setSteward(String steward) + { + this.steward = steward; + } + + + /** + * Return the type of element that describes the steward. + * + * @return type name + */ + public String getStewardTypeName() + { + return stewardTypeName; + } + + + /** + * Set up the type of element that describes the steward. + * + * @param stewardTypeName type name + */ + public void setStewardTypeName(String stewardTypeName) + { + this.stewardTypeName = stewardTypeName; + } + + + /** + * Return the name of the property that holds the steward's identifier. + * + * @return property name + */ + public String getStewardPropertyName() + { + return stewardPropertyName; + } + + + /** + * Set up the name of the property that holds the steward's identifier. + * + * @param stewardPropertyName property name + */ + public void setStewardPropertyName(String stewardPropertyName) + { + this.stewardPropertyName = stewardPropertyName; + } + + + /** + * Return the additional values associated with the symbolic name. + * + * @return string text + */ + public String getNotes() + { + return notes; + } + + + /** + * Set up the additional values associated with the symbolic name. + * + * @param notes string text + */ + public void setNotes(String notes) + { + this.notes = notes; + } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "ReferenceValueAssignmentProperties{" + + "confidence=" + confidence + + ", steward='" + steward + '\'' + + ", stewardTypeName='" + stewardTypeName + '\'' + + ", stewardPropertyName='" + stewardPropertyName + '\'' + + ", notes='" + notes + '\'' + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", extendedProperties=" + getExtendedProperties() + + '}'; + } + + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (! super.equals(objectToCompare)) + { + return false; + } + ReferenceValueAssignmentProperties that = (ReferenceValueAssignmentProperties) objectToCompare; + return confidence == that.confidence && Objects.equals(steward, that.steward) && Objects.equals(stewardTypeName, + that.stewardTypeName) && Objects.equals( + stewardPropertyName, that.stewardPropertyName) && Objects.equals(notes, that.notes); + } + + + /** + * Return has code based on properties. + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), confidence, steward, stewardTypeName, stewardPropertyName, notes); + } +} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ReferenceableProperties.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ReferenceableProperties.java index ccd67b56971..0b2a8db56c7 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ReferenceableProperties.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ReferenceableProperties.java @@ -37,6 +37,7 @@ @JsonSubTypes.Type(value = ProjectProperties.class, name = "ProjectProperties"), @JsonSubTypes.Type(value = ResourceProperties.class, name = "ResourceProperties"), @JsonSubTypes.Type(value = UserIdentityProperties.class, name = "UserIdentityProperties"), + @JsonSubTypes.Type(value = ValidValueProperties.class, name = "ValidValueProperties"), }) public class ReferenceableProperties implements Serializable { diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ValidValueAssignmentProperties.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ValidValueAssignmentProperties.java new file mode 100644 index 00000000000..c3b13d8af51 --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ValidValueAssignmentProperties.java @@ -0,0 +1,117 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.communityprofile.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ValidValueAssignmentProperties describes the properties between a referenceable and its valid values. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ValidValueAssignmentProperties extends RelationshipProperties +{ + private static final long serialVersionUID = 1L; + + private boolean strictRequirement = true; + + + /** + * Default constructor + */ + public ValidValueAssignmentProperties() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ValidValueAssignmentProperties(ValidValueAssignmentProperties template) + { + super(template); + + if (template != null) + { + strictRequirement = template.getStrictRequirement(); + } + } + + + /** + * Return the strict requirement flag. + * + * @return boolean + */ + public boolean getStrictRequirement() + { + return strictRequirement; + } + + + /** + * Set up the strict requirement flag. + * + * @param strictRequirement string type name + */ + public void setStrictRequirement(boolean strictRequirement) + { + this.strictRequirement = strictRequirement; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ValidValueAssignmentProperties{" + "strictRequirement=" + strictRequirement + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + ValidValueAssignmentProperties that = (ValidValueAssignmentProperties) objectToCompare; + return strictRequirement == that.strictRequirement; + } + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(strictRequirement); + } +} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ValidValueMembershipProperties.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ValidValueMembershipProperties.java new file mode 100644 index 00000000000..9008e7e22fb --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ValidValueMembershipProperties.java @@ -0,0 +1,128 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.communityprofile.properties; + + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ValidValueMembershipProperties provides a flag to indicate if this value is the default value for the set. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ValidValueMembershipProperties extends RelationshipProperties +{ + private static final long serialVersionUID = 1L; + + boolean isDefaultValue = false; + + /** + * Default constructor + */ + public ValidValueMembershipProperties() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ValidValueMembershipProperties(ValidValueMembershipProperties template) + { + super(template); + + if (template != null) + { + this.isDefaultValue = template.getDefaultValue(); + } + } + + + /** + * Return whether it is a default value. + * + * @return flag + */ + public boolean getDefaultValue() + { + return isDefaultValue; + } + + + /** + * Set up whether it is a default value. + * + * @param defaultValue flag + */ + public void setDefaultValue(boolean defaultValue) + { + this.isDefaultValue = defaultValue; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ValidValueMembershipProperties{" + + "effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", extendedProperties=" + getExtendedProperties() + + ", isDefaultValue=" + isDefaultValue + + ", defaultValue=" + getDefaultValue() + + '}'; + } + + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (! super.equals(objectToCompare)) + { + return false; + } + ValidValueMembershipProperties that = (ValidValueMembershipProperties) objectToCompare; + return isDefaultValue == that.isDefaultValue; + } + + + /** + * Return has code based on properties. + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), isDefaultValue); + } +} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ValidValueProperties.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ValidValueProperties.java new file mode 100644 index 00000000000..793c3f8678f --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ValidValueProperties.java @@ -0,0 +1,261 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.communityprofile.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ValidValueProperties provides the common super class for ValidValueSet and ValidValueDefinition. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ValidValueProperties extends ReferenceableProperties +{ + private static final long serialVersionUID = 1L; + + private String displayName = null; + private String description = null; + private String usage = null; + private String scope = null; + private String preferredValue = null; + private boolean isDeprecated = false; + + + /** + * Constructor + */ + public ValidValueProperties() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ValidValueProperties(ValidValueProperties template) + { + super(template); + + if (template != null) + { + displayName = template.getDisplayName(); + description = template.getDescription(); + usage = template.getUsage(); + scope = template.getScope(); + preferredValue = template.getPreferredValue(); + isDeprecated = template.getIsDeprecated(); + } + } + + + /** + * Returns the stored display name property for the valid value. + * If no display name is available then null is returned. + * + * @return String name + */ + public String getDisplayName() + { + return displayName; + } + + + /** + * Set up the stored display name property for the valid value. + * + * @param displayName String name + */ + public void setDisplayName(String displayName) + { + this.displayName = displayName; + } + + + /** + * Returns the stored description property for the valid value. + * If no description is provided then null is returned. + * + * @return description String text + */ + public String getDescription() + { + return description; + } + + + /** + * Set up the stored description property associated with the valid value. + * + * @param description String text + */ + public void setDescription(String description) + { + this.description = description; + } + + + /** + * Return the description of how this valid value should be used. + * + * @return String text + */ + public String getUsage() + { + return usage; + } + + + /** + * Set up the description of how this valid value should be used. + * + * @param usage String text + */ + public void setUsage(String usage) + { + this.usage = usage; + } + + + /** + * Return the scope of values that this valid value covers (normally used with sets) + * + * @return String text + */ + public String getScope() + { + return scope; + } + + + /** + * Set up the scope of values that this valid value covers (normally used with sets) + * + * @param scope String text + */ + public void setScope(String scope) + { + this.scope = scope; + } + + + /** + * Return the preferred values to use in implementations (normally used with definitions) + * + * @return String value + */ + public String getPreferredValue() + { + return preferredValue; + } + + + /** + * Set up the preferred values to use in implementations (normally used with definitions) + * + * @param preferredValue String value + */ + public void setPreferredValue(String preferredValue) + { + this.preferredValue = preferredValue; + } + + + /** + * Is the valid value deprecated? + * + * @return boolean flag + */ + public boolean getIsDeprecated() + { + return isDeprecated; + } + + + /** + * Set whether the valid value is deprecated or not. Default is false. + * + * @param deprecated boolean flag + */ + public void setIsDeprecated(boolean deprecated) + { + isDeprecated = deprecated; + } + + /** + * Generate a string containing the properties. + * + * @return string value + */ + @Override + public String toString() + { + return "ValidValueProperties{" + + "qualifiedName='" + getQualifiedName() + '\'' + + ", additionalProperties=" + getAdditionalProperties() + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", vendorProperties=" + getVendorProperties() + + ", typeName='" + getTypeName() + '\'' + + ", extendedProperties=" + getExtendedProperties() + + ", displayName='" + displayName + '\'' + + ", description='" + description + '\'' + + ", usage='" + usage + '\'' + + ", scope='" + scope + '\'' + + ", preferredValue='" + preferredValue + '\'' + + ", isDeprecated=" + isDeprecated + + '}'; + } + + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + ValidValueProperties that = (ValidValueProperties) objectToCompare; + return Objects.equals(displayName, that.displayName) && + Objects.equals(description, that.description) && + Objects.equals(usage, that.usage) && + Objects.equals(scope, that.scope) && + Objects.equals(isDeprecated, that.isDeprecated) && + Objects.equals(preferredValue, that.preferredValue); + } + + + /** + * Return has code based on properties. + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), displayName, description, usage, scope, preferredValue, isDeprecated); + } +} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/RelatedElementListResponse.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/RelatedElementListResponse.java index d462d90e5ab..c81f2fbc5a7 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/RelatedElementListResponse.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/RelatedElementListResponse.java @@ -25,7 +25,7 @@ public class RelatedElementListResponse extends CommunityProfileOMASAPIResponse { private static final long serialVersionUID = 1L; - private List elements = null; + private List elementList = null; /** @@ -47,7 +47,7 @@ public RelatedElementListResponse(RelatedElementListResponse template) if (template != null) { - elements = template.getElements(); + elementList = template.getElementList(); } } @@ -57,19 +57,19 @@ public RelatedElementListResponse(RelatedElementListResponse template) * * @return result object */ - public List getElements() + public List getElementList() { - if (elements == null) + if (elementList == null) { return null; } - else if (elements.isEmpty()) + else if (elementList.isEmpty()) { return null; } else { - return elements; + return elementList; } } @@ -79,9 +79,9 @@ else if (elements.isEmpty()) * * @param elements result object */ - public void setElements(List elements) + public void setElementList(List elements) { - this.elements = elements; + this.elementList = elements; } @@ -94,7 +94,7 @@ public void setElements(List elements) public String toString() { return "RelatedElementListResponse{" + - "element=" + elements + + "element=" + elementList + ", exceptionClassName='" + getExceptionClassName() + '\'' + ", exceptionCausedBy='" + getExceptionCausedBy() + '\'' + ", actionDescription='" + getActionDescription() + '\'' + @@ -131,7 +131,7 @@ public boolean equals(Object objectToCompare) return false; } RelatedElementListResponse that = (RelatedElementListResponse) objectToCompare; - return Objects.equals(elements, that.elements); + return Objects.equals(elementList, that.elementList); } @@ -143,6 +143,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), elements); + return Objects.hash(super.hashCode(), elementList); } } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ValidValueListResponse.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ValidValueListResponse.java new file mode 100644 index 00000000000..78f863960f8 --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ValidValueListResponse.java @@ -0,0 +1,148 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.communityprofile.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.ValidValueElement; + +import java.util.Arrays; +import java.util.List; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ValidValueListResponse is a response object for passing back a list of valid value objects. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ValidValueListResponse extends CommunityProfileOMASAPIResponse +{ + private static final long serialVersionUID = 1L; + + private List elementList = null; + + + /** + * Default constructor + */ + public ValidValueListResponse() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ValidValueListResponse(ValidValueListResponse template) + { + super(template); + + if (template != null) + { + elementList = template.getElementList(); + } + } + + + /** + * Return the list of metadata elements. + * + * @return result object + */ + public List getElementList() + { + if (elementList == null) + { + return null; + } + else if (elementList.isEmpty()) + { + return null; + } + else + { + return elementList; + } + } + + + /** + * Set up the list of metadata elements to return. + * + * @param elementList result object + */ + public void setElementList(List elementList) + { + this.elementList = elementList; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ValidValueListResponse{" + + "element=" + elementList + + ", exceptionClassName='" + getExceptionClassName() + '\'' + + ", exceptionCausedBy='" + getExceptionCausedBy() + '\'' + + ", actionDescription='" + getActionDescription() + '\'' + + ", relatedHTTPCode=" + getRelatedHTTPCode() + + ", exceptionErrorMessage='" + getExceptionErrorMessage() + '\'' + + ", exceptionErrorMessageId='" + getExceptionErrorMessageId() + '\'' + + ", exceptionErrorMessageParameters=" + Arrays.toString(getExceptionErrorMessageParameters()) + + ", exceptionSystemAction='" + getExceptionSystemAction() + '\'' + + ", exceptionUserAction='" + getExceptionUserAction() + '\'' + + ", exceptionProperties=" + getExceptionProperties() + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + ValidValueListResponse that = (ValidValueListResponse) objectToCompare; + return Objects.equals(elementList, that.elementList); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), elementList); + } +} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ValidValueResponse.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ValidValueResponse.java new file mode 100644 index 00000000000..4ef2ff54bfc --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ValidValueResponse.java @@ -0,0 +1,136 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.communityprofile.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.ValidValueElement; + +import java.util.Arrays; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ValidValueResponse is a response object for passing back a single valid value object. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ValidValueResponse extends CommunityProfileOMASAPIResponse +{ + private static final long serialVersionUID = 1L; + + private ValidValueElement element = null; + + + /** + * Default constructor + */ + public ValidValueResponse() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ValidValueResponse(ValidValueResponse template) + { + super(template); + + if (template != null) + { + element = template.getElement(); + } + } + + + /** + * Return the metadata element. + * + * @return result object + */ + public ValidValueElement getElement() + { + return element; + } + + + /** + * Set up the metadata element to return. + * + * @param element result object + */ + public void setElement(ValidValueElement element) + { + this.element = element; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ValidValueResponse{" + + "element=" + element + + ", exceptionClassName='" + getExceptionClassName() + '\'' + + ", exceptionCausedBy='" + getExceptionCausedBy() + '\'' + + ", actionDescription='" + getActionDescription() + '\'' + + ", relatedHTTPCode=" + getRelatedHTTPCode() + + ", exceptionErrorMessage='" + getExceptionErrorMessage() + '\'' + + ", exceptionErrorMessageId='" + getExceptionErrorMessageId() + '\'' + + ", exceptionErrorMessageParameters=" + Arrays.toString(getExceptionErrorMessageParameters()) + + ", exceptionSystemAction='" + getExceptionSystemAction() + '\'' + + ", exceptionUserAction='" + getExceptionUserAction() + '\'' + + ", exceptionProperties=" + getExceptionProperties() + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + ValidValueResponse that = (ValidValueResponse) objectToCompare; + return Objects.equals(element, that.element); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), element); + } +} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityManagement.java b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityManagement.java index b3419757d89..d386bf2d03c 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityManagement.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityManagement.java @@ -228,9 +228,9 @@ public void updateCommunity(String userId, * @param userId calling user * @param externalSourceGUID unique identifier of software capability representing the caller * @param externalSourceName unique name of software capability representing the caller - * @param communityGUID unique identifier of the community in the external data manager + * @param communityGUID unique identifier of the community * @param membershipProperties describes the permissions that the role has in the community - * @param personRoleGUID unique identifier of the person role in the external data manager + * @param personRoleGUID unique identifier of the person role * * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request @@ -262,8 +262,8 @@ public void setupCommunityRole(String userId, * @param userId calling user * @param externalSourceGUID unique identifier of software capability representing the caller * @param externalSourceName unique name of software capability representing the caller - * @param communityGUID unique identifier of the community in the external data manager - * @param personRoleGUID unique identifier of the person role in the external data manager + * @param communityGUID unique identifier of the community + * @param personRoleGUID unique identifier of the person role * * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityProfileBaseClient.java b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityProfileBaseClient.java index 75a86c83282..7daad49845d 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityProfileBaseClient.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityProfileBaseClient.java @@ -566,7 +566,7 @@ List getRelatedElements(String userId, Integer.toString(startFrom), Integer.toString(pageSize)); - return restResult.getElements(); + return restResult.getElementList(); } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/ValidValueManagement.java b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/ValidValueManagement.java new file mode 100644 index 00000000000..f2797a744fe --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/ValidValueManagement.java @@ -0,0 +1,860 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.communityprofile.client; + +import org.odpi.openmetadata.accessservices.communityprofile.api.ValidValueManagementInterface; +import org.odpi.openmetadata.accessservices.communityprofile.client.rest.CommunityProfileRESTClient; +import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.RelatedElement; +import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.ValidValueElement; +import org.odpi.openmetadata.accessservices.communityprofile.properties.ReferenceValueAssignmentProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.ValidValueAssignmentProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.ValidValueMembershipProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.ValidValueProperties; +import org.odpi.openmetadata.accessservices.communityprofile.rest.RelatedElementListResponse; +import org.odpi.openmetadata.accessservices.communityprofile.rest.ValidValueListResponse; +import org.odpi.openmetadata.accessservices.communityprofile.rest.ValidValueResponse; +import org.odpi.openmetadata.commonservices.ffdc.rest.NameRequestBody; +import org.odpi.openmetadata.commonservices.ffdc.rest.SearchStringRequestBody; +import org.odpi.openmetadata.frameworks.auditlog.AuditLog; +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; + +import java.util.List; + +/** + * ValidValueManagerClient supports the APIs to maintain valid values and their related objects. + */ +public class ValidValueManagement extends CommunityProfileBaseClient implements ValidValueManagementInterface +{ + private static final String validValueURLTemplatePrefix = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/valid-values"; + + + /** + * Create a new client with no authentication embedded in the HTTP request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @param auditLog logging destination + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public ValidValueManagement(String serverName, + String serverPlatformURLRoot, + AuditLog auditLog) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot, auditLog); + } + + + /** + * Create a new client with no authentication embedded in the HTTP request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public ValidValueManagement(String serverName, + String serverPlatformURLRoot) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot); + } + + + /** + * Create a new client that passes userId and password in each HTTP request. This is the + * userId/password of the calling server. The end user's userId is sent on each request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @param userId caller's userId embedded in all HTTP requests + * @param password caller's userId embedded in all HTTP requests + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public ValidValueManagement(String serverName, + String serverPlatformURLRoot, + String userId, + String password) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot, userId, password); + } + + + /** + * Create a new client that passes userId and password in each HTTP request. This is the + * userId/password of the calling server. The end user's userId is sent on each request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @param userId caller's userId embedded in all HTTP requests + * @param password caller's userId embedded in all HTTP requests + * @param auditLog logging destination + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public ValidValueManagement(String serverName, + String serverPlatformURLRoot, + String userId, + String password, + AuditLog auditLog) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot, userId, password, auditLog); + } + + + /** + * Create a new client that is going to be used in an OMAG Server. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @param restClient client that issues the REST API calls + * @param maxPageSize maximum number of results supported by this server + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public ValidValueManagement(String serverName, + String serverPlatformURLRoot, + CommunityProfileRESTClient restClient, + int maxPageSize) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot, restClient, maxPageSize); + } + + + /* ===================================================================================================================== + * A ValidValue is the top level object for working with connectors + */ + + /** + * Create a new metadata element to represent a valid value. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param validValueProperties properties about the valid value to store + * + * @return unique identifier of the new valid value + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public String createValidValue(String userId, + String externalSourceGUID, + String externalSourceName, + ValidValueProperties validValueProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "createValidValue"; + final String propertiesParameterName = "validValueProperties"; + final String urlTemplate = serverPlatformURLRoot + validValueURLTemplatePrefix; + + return super.createReferenceable(userId, externalSourceGUID, externalSourceName, validValueProperties, propertiesParameterName, urlTemplate, methodName); + } + + + /** + * Update the metadata element representing a valid value. It is possible to use the subtype property classes or + * set up specialized properties in extended properties. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param validValueGUID unique identifier of the metadata element to update + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param validValueProperties new properties for the metadata element + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void updateValidValue(String userId, + String externalSourceGUID, + String externalSourceName, + String validValueGUID, + boolean isMergeUpdate, + ValidValueProperties validValueProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "updateValidValue"; + final String elementGUIDParameterName = "validValueGUID"; + final String propertiesParameterName = "validValueProperties"; + final String urlTemplate = serverPlatformURLRoot + validValueURLTemplatePrefix + "/{2}?isMergeUpdate={3}"; + + super.updateReferenceable(userId, externalSourceGUID, externalSourceName, validValueGUID, elementGUIDParameterName, isMergeUpdate, validValueProperties, propertiesParameterName, urlTemplate, methodName); + } + + + /** + * Create a membership relationship between a validValue and a validValueSet that it belongs to. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param validValueSetGUID unique identifier of the valid value set + * @param properties describes the properties of the membership + * @param validValueMemberGUID unique identifier of the member + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void setupValidValueMember(String userId, + String externalSourceGUID, + String externalSourceName, + String validValueSetGUID, + ValidValueMembershipProperties properties, + String validValueMemberGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "setupValidValueMember"; + final String validValueSetGUIDParameterName = "validValueSetGUID"; + final String validValueMemberGUIDParameterName = "validValueMemberGUID"; + final String urlTemplate = serverPlatformURLRoot + validValueURLTemplatePrefix + "/{2}/valid-value-members/{3}"; + + super.setupRelationship(userId, externalSourceGUID, externalSourceName, validValueSetGUID, validValueSetGUIDParameterName, properties, validValueMemberGUID, validValueMemberGUIDParameterName, urlTemplate, methodName); + } + + + /** + * Remove a membership relationship between a validValue and a validValueSet that it belongs to. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param validValueSetGUID unique identifier of the valid value set + * @param validValueMemberGUID unique identifier of the member + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void clearValidValueMember(String userId, + String externalSourceGUID, + String externalSourceName, + String validValueSetGUID, + String validValueMemberGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "clearValidValueMember"; + final String validValueSetGUIDParameterName = "validValueSetGUID"; + final String validValueMemberGUIDParameterName = "validValueMemberGUID"; + final String urlTemplate = serverPlatformURLRoot + validValueURLTemplatePrefix + "/{2}/valid-value-members/{3}/delete"; + + super.clearRelationship(userId, + externalSourceGUID, + externalSourceName, + validValueSetGUID, + validValueSetGUIDParameterName, + validValueMemberGUID, + validValueMemberGUIDParameterName, + urlTemplate, + methodName); + } + + + /** + * Create a valid value assignment relationship between an element and a valid value (typically, a valid value set) to show that + * the valid value defines the values that can be stored in the data item that the element represents. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param properties describes the permissions that the role has in the validValue + * @param validValueGUID unique identifier of the valid value + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void setupValidValues(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + ValidValueAssignmentProperties properties, + String validValueGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "setupValidValues"; + final String elementGUIDParameterName = "elementGUID"; + final String validValueGUIDParameterName = "validValueGUID"; + + final String urlTemplate = serverPlatformURLRoot + validValueURLTemplatePrefix + "/{2}/valid-values/{3}"; + + super.setupRelationship(userId, externalSourceGUID, externalSourceName, elementGUID, elementGUIDParameterName, properties, validValueGUID, validValueGUIDParameterName, urlTemplate, methodName); + } + + + /** + * Remove a valid value assignment relationship between an element and a valid value. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param validValueGUID unique identifier of the valid value + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void clearValidValues(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String validValueGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "clearValidValues"; + final String elementGUIDParameterName = "elementGUID"; + final String validValueGUIDParameterName = "validValueGUID"; + final String urlTemplate = serverPlatformURLRoot + validValueURLTemplatePrefix + "/{2}/valid-values/{3}/delete"; + + super.clearRelationship(userId, + externalSourceGUID, + externalSourceName, + elementGUID, + elementGUIDParameterName, + validValueGUID, + validValueGUIDParameterName, + urlTemplate, + methodName); + } + + + /** + * Create a reference value assignment relationship between an element and a valid value to show that + * the valid value is a semiformal tag/classification. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param properties describes the quality of the assignment + * @param validValueGUID unique identifier of the valid value + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void setupReferenceValueTag(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + ReferenceValueAssignmentProperties properties, + String validValueGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "setupReferenceValueTag"; + final String elementGUIDParameterName = "elementGUID"; + final String validValueGUIDParameterName = "validValueGUID"; + + final String urlTemplate = serverPlatformURLRoot + validValueURLTemplatePrefix + "/{2}/reference-value-tags/{3}"; + + super.setupRelationship(userId, externalSourceGUID, externalSourceName, elementGUID, elementGUIDParameterName, properties, validValueGUID, validValueGUIDParameterName, urlTemplate, methodName); + } + + + /** + * Remove a reference value assignment relationship between an element and a valid value. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param validValueGUID unique identifier of the valid value + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void clearReferenceValueTag(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String validValueGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "clearReferenceValueTag"; + final String elementGUIDParameterName = "elementGUID"; + final String validValueGUIDParameterName = "validValueGUID"; + final String urlTemplate = serverPlatformURLRoot + validValueURLTemplatePrefix + "/{2}/reference-value-tags/{3}/delete"; + + super.clearRelationship(userId, + externalSourceGUID, + externalSourceName, + elementGUID, + elementGUIDParameterName, + validValueGUID, + validValueGUIDParameterName, + urlTemplate, + methodName); + } + + + /** + * Remove the metadata element representing a valid value. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param validValueGUID unique identifier of the metadata element to remove + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void removeValidValue(String userId, + String externalSourceGUID, + String externalSourceName, + String validValueGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "removeValidValue"; + final String elementGUIDParameterName = "validValueGUID"; + final String urlTemplate = serverPlatformURLRoot + validValueURLTemplatePrefix + "/{2}/delete"; + + super.removeReferenceable(userId, externalSourceGUID, externalSourceName, validValueGUID, elementGUIDParameterName, urlTemplate, methodName); + } + + + /** + * Retrieve the list of metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param userId calling user + * @param searchString string to find in the properties + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public List findValidValues(String userId, + String searchString, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "findValidValue"; + final String searchStringParameterName = "searchString"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateSearchString(searchString, searchStringParameterName, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = serverPlatformURLRoot + validValueURLTemplatePrefix + "/by-search-string?startFrom={2}&pageSize={3}"; + + SearchStringRequestBody requestBody = new SearchStringRequestBody(); + + requestBody.setSearchString(searchString); + requestBody.setSearchStringParameterName(searchStringParameterName); + + ValidValueListResponse restResult = restClient.callValidValueListPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + startFrom, + validatedPageSize); + + return restResult.getElementList(); + } + + + /** + * Retrieve the list of metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param userId calling user + * @param name name to search for + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public List getValidValuesByName(String userId, + String name, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getValidValueByName"; + final String nameParameterName = "name"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateName(name, nameParameterName, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = serverPlatformURLRoot + validValueURLTemplatePrefix + "/by-name?startFrom={2}&pageSize={3}"; + + NameRequestBody requestBody = new NameRequestBody(); + + requestBody.setName(name); + requestBody.setNamePropertyName(nameParameterName); + + ValidValueListResponse restResult = restClient.callValidValueListPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + startFrom, + validatedPageSize); + + return restResult.getElementList(); + } + + + /** + * Retrieve the list of valid values. + * + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public List getAllValidValues(String userId, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getValidValues"; + + invalidParameterHandler.validateUserId(userId, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = serverPlatformURLRoot + validValueURLTemplatePrefix + "?startFrom={2}&pageSize={3}"; + + ValidValueListResponse restResult = restClient.callValidValueListGetRESTCall(methodName, + urlTemplate, + serverName, + userId, + startFrom, + validatedPageSize); + + return restResult.getElementList(); + } + + + /** + * Page through the members of a valid value set. + * + * @param userId calling user + * @param validValueSetGUID unique identifier of the valid value set + * @param startFrom paging starting point + * @param pageSize maximum number of return values. + * @return list of valid value beans + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException the repository is not available or not working properly. + */ + @Override + public List getValidValueSetMembers(String userId, + String validValueSetGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getValidValueSetMembers"; + final String guidParameterName = "validValueSetGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(validValueSetGUID, guidParameterName, methodName); + + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = serverPlatformURLRoot + validValueURLTemplatePrefix + "/members/{2}?startFrom={3}&pageSize={4}"; + + ValidValueListResponse restResult = restClient.callValidValueListGetRESTCall(methodName, + urlTemplate, + serverName, + userId, + validValueSetGUID, + startFrom, + validatedPageSize); + + return restResult.getElementList(); + } + + + /** + * Page through the list of valid value sets that a valid value definition/set belongs to. + * + * @param userId calling user + * @param validValueGUID unique identifier of valid value to query + * @param startFrom paging starting point + * @param pageSize maximum number of return values. + * @return list of valid value beans + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException the repository is not available or not working properly. + */ + @Override + public List getSetsForValidValue(String userId, + String validValueGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getValidValueSetMembers"; + final String guidParameterName = "validValueGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(validValueGUID, guidParameterName, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = serverPlatformURLRoot + validValueURLTemplatePrefix + "/sets/{2}?startFrom={3}&pageSize={4}"; + + ValidValueListResponse restResult = restClient.callValidValueListGetRESTCall(methodName, + urlTemplate, + serverName, + userId, + validValueGUID, + startFrom, + validatedPageSize); + + return restResult.getElementList(); + } + + + /** + * Return information about the valid value set linked to an element as its + * set of valid values. + * + * @param userId calling user + * @param elementGUID unique identifier for the element using the valid value set + * + * @return list of matching actor profiles (hopefully only one) + * + * @throws InvalidParameterException name or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public ValidValueElement getValidValuesForConsumer(String userId, + String elementGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getValidValuesForConsumer"; + final String guidParameterName = "elementGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(elementGUID, guidParameterName, methodName); + + final String urlTemplate = serverPlatformURLRoot + validValueURLTemplatePrefix + "/by-consumer/{2}"; + + ValidValueResponse restResult = restClient.callValidValueGetRESTCall(methodName, + urlTemplate, + serverName, + userId, + elementGUID); + + return restResult.getElement(); + } + + + /** + * Return information about the consumers linked to a validValue. + * + * @param userId calling user + * @param validValueGUID unique identifier for the validValue + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching actor profiles (hopefully only one) + * + * @throws InvalidParameterException name or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public List getConsumersOfValidValue(String userId, + String validValueGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getConsumersOfValidValue"; + final String guidPropertyName = "validValueGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(validValueGUID, guidPropertyName, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = serverPlatformURLRoot + validValueURLTemplatePrefix + "/{2}/consumers?startFrom={3}&pageSize={4}"; + + RelatedElementListResponse restResult = restClient.callRelatedElementListGetRESTCall(methodName, + urlTemplate, + serverName, + userId, + validValueGUID, + startFrom, + validatedPageSize); + + return restResult.getElementList(); + } + + + /** + * Return information about the valid values linked as reference value tags to an element. + * + * @param userId calling user + * @param elementGUID unique identifier for the element + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of valid values + * + * @throws InvalidParameterException name or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public List getReferenceValues(String userId, + String elementGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getReferenceValues"; + + invalidParameterHandler.validateUserId(userId, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = serverPlatformURLRoot + validValueURLTemplatePrefix + "/by-reference-value-tags/{2}?startFrom={3}&pageSize={4}"; + + ValidValueListResponse restResult = restClient.callValidValueListGetRESTCall(methodName, + urlTemplate, + serverName, + userId, + startFrom, + validatedPageSize); + + return restResult.getElementList(); + } + + + /** + * Return information about the person roles linked to a validValue. + * + * @param userId calling user + * @param validValueGUID unique identifier for the validValue + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching actor profiles (hopefully only one) + * + * @throws InvalidParameterException name or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public List getAssigneesOfReferenceValue(String userId, + String validValueGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getAssigneesOfReferenceValue"; + final String guidPropertyName = "validValueGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(validValueGUID, guidPropertyName, methodName); + + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = serverPlatformURLRoot + validValueURLTemplatePrefix + "/{2}/by-reference-value-tag-assignees?startFrom={3}&pageSize={4}"; + + RelatedElementListResponse restResult = restClient.callRelatedElementListGetRESTCall(methodName, + urlTemplate, + serverName, + userId, + validValueGUID, + startFrom, + validatedPageSize); + + return restResult.getElementList(); + } + + + /** + * Retrieve the metadata element with the supplied unique identifier. + * + * @param userId calling user + * @param validValueGUID unique identifier of the requested metadata element + * + * @return requested metadata element + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public ValidValueElement getValidValueByGUID(String userId, + String validValueGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getValidValueByGUID"; + final String guidParameterName = "validValueGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(validValueGUID, guidParameterName, methodName); + + final String urlTemplate = serverPlatformURLRoot + validValueURLTemplatePrefix + "/{2}"; + + ValidValueResponse restResult = restClient.callValidValueGetRESTCall(methodName, + urlTemplate, + serverName, + userId, + validValueGUID); + + return restResult.getElement(); + } +} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/rest/CommunityProfileRESTClient.java b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/rest/CommunityProfileRESTClient.java index 68d4a888fc3..2b0494ab58c 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/rest/CommunityProfileRESTClient.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/rest/CommunityProfileRESTClient.java @@ -829,4 +829,82 @@ public LocationListResponse callLocationsPostRESTCall(String methodName, return restResult; } + + + /** + * Issue a GET REST call that returns a ValidValueElement in a response object. + * + * @param methodName name of the method being called. + * @param urlTemplate REST API call URL template with place-holders for the parameters. + * @param params a list of parameters that are slotted into the url template. + * + * @return response object + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException something went wrong with the REST call stack. + */ + public ValidValueResponse callValidValueGetRESTCall(String methodName, + String urlTemplate, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + ValidValueResponse restResult = this.callGetRESTCall(methodName, ValidValueResponse.class, urlTemplate, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + + /** + * Issue a GET REST call that returns a list of ValidValueElements in a response object. + * + * @param methodName name of the method being called + * @param urlTemplate REST API call URL template with place-holders for the parameters + * @param params a list of parameters that are slotted into the url template + * @return response object + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException something went wrong with the REST call stack. + */ + public ValidValueListResponse callValidValueListGetRESTCall(String methodName, + String urlTemplate, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + ValidValueListResponse restResult = this.callGetRESTCall(methodName, ValidValueListResponse.class, urlTemplate, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + + /** + * Issue a GET REST call that returns a list of ValidValueElements in a response object. + * + * @param methodName name of the method being called + * @param urlTemplate REST API call URL template with place-holders for the parameters + * @param requestBody request body for the request + * @param params a list of parameters that are slotted into the url template + * @return response object + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException something went wrong with the REST call stack. + */ + public ValidValueListResponse callValidValueListPostRESTCall(String methodName, + String urlTemplate, + Object requestBody, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + ValidValueListResponse restResult = this.callPostRESTCall(methodName, ValidValueListResponse.class, urlTemplate, requestBody, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/CommunityConverter.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/CommunityConverter.java index e3a6564f42f..bd2345d3b77 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/CommunityConverter.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/CommunityConverter.java @@ -3,7 +3,6 @@ package org.odpi.openmetadata.accessservices.communityprofile.converters; -import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.CollectionElement; import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.CommunityElement; import org.odpi.openmetadata.accessservices.communityprofile.properties.CommunityProperties; import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; @@ -17,7 +16,7 @@ /** - * CommunityConverter generates an CommunityProperties bean from an CommunityProperties entity. + * CommunityConverter generates an CommunityElement bean from an CommunityProperties entity. */ public class CommunityConverter extends CommunityProfileOMASConverter { @@ -128,9 +127,9 @@ public B getNewBean(Class beanClass, { B returnBean = this.getNewBean(beanClass, entity, methodName); - if (returnBean instanceof CollectionElement) + if (returnBean instanceof CommunityElement) { - CollectionElement bean = (CollectionElement) returnBean; + CommunityElement bean = (CommunityElement) returnBean; bean.setRelatedElement(super.getRelatedElement(beanClass, entity, relationship, methodName)); } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/ValidValueConverter.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/ValidValueConverter.java new file mode 100644 index 00000000000..6c6608969eb --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/ValidValueConverter.java @@ -0,0 +1,143 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.communityprofile.converters; + + +import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.CollectionElement; +import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.ValidValueElement; +import org.odpi.openmetadata.accessservices.communityprofile.properties.ValidValueProperties; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefCategory; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper; + +import java.lang.reflect.InvocationTargetException; + + +/** + * ValidValueConverter generates an ValidValueElement bean from an ValidValueProperties entity. + */ +public class ValidValueConverter extends CommunityProfileOMASConverter +{ + /** + * Constructor + * + * @param repositoryHelper helper object to parse entity + * @param serviceName name of this component + * @param serverName local server name + */ + public ValidValueConverter(OMRSRepositoryHelper repositoryHelper, + String serviceName, + String serverName) + { + super(repositoryHelper, serviceName, serverName); + } + + + + /** + * Using the supplied entity, return a new instance of the bean. This is used for most beans that have + * a one to one correspondence with the repository instances. + * + * @param beanClass name of the class to create + * @param entity entity containing the properties + * @param methodName calling method + * @return bean populated with properties from the instances supplied + * @throws PropertyServerException there is a problem instantiating the bean + */ + @Override + public B getNewBean(Class beanClass, + EntityDetail entity, + String methodName) throws PropertyServerException + { + try + { + /* + * This is initial confirmation that the generic converter has been initialized with an appropriate bean class. + */ + B returnBean = beanClass.getDeclaredConstructor().newInstance(); + + if (returnBean instanceof ValidValueElement) + { + ValidValueElement bean = (ValidValueElement) returnBean; + ValidValueProperties validValueProperties = new ValidValueProperties(); + + bean.setElementHeader(super.getMetadataElementHeader(beanClass, entity, methodName)); + + InstanceProperties instanceProperties; + + /* + * The initial set of values come from the entity. + */ + if (entity != null) + { + instanceProperties = new InstanceProperties(entity.getProperties()); + + validValueProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); + validValueProperties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); + validValueProperties.setDisplayName(this.removeName(instanceProperties)); + validValueProperties.setDescription(this.removeDescription(instanceProperties)); + validValueProperties.setUsage(this.removeUsage(instanceProperties)); + validValueProperties.setScope(this.removeScope(instanceProperties)); + validValueProperties.setPreferredValue(this.removePreferredValue(instanceProperties)); + validValueProperties.setIsDeprecated(this.removeIsDeprecated(instanceProperties)); + + validValueProperties.setEffectiveFrom(instanceProperties.getEffectiveFromTime()); + validValueProperties.setEffectiveTo(instanceProperties.getEffectiveToTime()); + + /* + * Any remaining properties are returned in the extended properties. They are + * assumed to be defined in a subtype. + */ + validValueProperties.setTypeName(bean.getElementHeader().getType().getTypeName()); + validValueProperties.setExtendedProperties(this.getRemainingExtendedProperties(instanceProperties)); + } + else + { + handleMissingMetadataInstance(beanClass.getName(), TypeDefCategory.ENTITY_DEF, methodName); + } + + bean.setValidValueProperties(validValueProperties); + } + + return returnBean; + } + catch (IllegalAccessException | InstantiationException | ClassCastException | NoSuchMethodException | InvocationTargetException error) + { + super.handleInvalidBeanClass(beanClass.getName(), error, methodName); + } + + return null; + } + + + /** + * Using the supplied instances, return a new instance of the bean. This is used for beans that + * contain a combination of the properties from an entity and that of a connected relationship. + * + * @param beanClass name of the class to create + * @param entity entity containing the properties + * @param relationship relationship containing the properties + * @param methodName calling method + * @return bean populated with properties from the instances supplied + * @throws PropertyServerException there is a problem instantiating the bean + */ + public B getNewBean(Class beanClass, + EntityDetail entity, + Relationship relationship, + String methodName) throws PropertyServerException + { + B returnBean = this.getNewBean(beanClass, entity, methodName); + + if (returnBean instanceof ValidValueElement) + { + ValidValueElement bean = (ValidValueElement) returnBean; + + bean.setRelatedElement(super.getRelatedElement(beanClass, entity, relationship, methodName)); + } + + return returnBean; + } +} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/CommunityProfileInstanceHandler.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/CommunityProfileInstanceHandler.java index b5a7867b23c..7c297f19bb7 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/CommunityProfileInstanceHandler.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/CommunityProfileInstanceHandler.java @@ -480,4 +480,34 @@ RatingHandler getRatingHandler(String userId, return null; } + + + /** + * Retrieve the specific handler for the access service. + * + * @param userId calling user + * @param serverName name of the server tied to the request + * @param serviceOperationName name of the REST API call (typically the top-level methodName) + * @return handler for use by the requested instance + * @throws InvalidParameterException no available instance for the requested server + * @throws UserNotAuthorizedException user does not have access to the requested server + * @throws PropertyServerException error in the requested server + */ + ValidValuesHandler getValidValueHandler(String userId, + String serverName, + String serviceOperationName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + CommunityProfileServicesInstance instance = (CommunityProfileServicesInstance)super.getServerServiceInstance(userId, + serverName, + serviceOperationName); + + if (instance != null) + { + return instance.getValidValuesHandler(); + } + + return null; + } } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/CommunityProfileServicesInstance.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/CommunityProfileServicesInstance.java index 8c7ed079c93..6958b1175ba 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/CommunityProfileServicesInstance.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/CommunityProfileServicesInstance.java @@ -36,6 +36,7 @@ public class CommunityProfileServicesInstance extends OMASServiceInstance private final ContactDetailsHandler contactDetailsHandler; private final LocationHandler locationHandler; private final GovernanceDefinitionHandler securityGroupHandler; + private final ValidValuesHandler validValuesHandler; private final CommentHandler commentHandler; private final InformalTagHandler informalTagHandler; @@ -201,18 +202,18 @@ public CommunityProfileServicesInstance(OMRSRepositoryConnector repositoryConnec auditLog); this.securityGroupHandler = new GovernanceDefinitionHandler<>(new SecurityGroupConverter<>(repositoryHelper, serviceName, serverName), - SecurityGroupElement.class, - serviceName, - serverName, - invalidParameterHandler, - repositoryHandler, - repositoryHelper, - localServerUserId, - securityVerifier, - supportedZones, - defaultZones, - publishZones, - auditLog); + SecurityGroupElement.class, + serviceName, + serverName, + invalidParameterHandler, + repositoryHandler, + repositoryHelper, + localServerUserId, + securityVerifier, + supportedZones, + defaultZones, + publishZones, + auditLog); this.contactDetailsHandler = new ContactDetailsHandler<>(new ContactMethodConverter<>(repositoryHelper, serviceName, serverName), ContactMethodElement.class, @@ -298,6 +299,20 @@ public CommunityProfileServicesInstance(OMRSRepositoryConnector repositoryConnec defaultZones, publishZones, auditLog); + + this.validValuesHandler = new ValidValuesHandler<>(new ValidValueConverter<>(repositoryHelper, serviceName, serverName), + ValidValueElement.class, + serviceName, + serverName, + invalidParameterHandler, + repositoryHandler, + repositoryHelper, + localServerUserId, + securityVerifier, + supportedZones, + defaultZones, + publishZones, + auditLog); } else { @@ -548,4 +563,21 @@ RatingHandler getRatingHandler() throws PropertyServerException return ratingHandler; } + + + /** + * Return the handler for valid value requests. + * + * @return handler object + * @throws PropertyServerException the instance has not been initialized successfully + */ + public ValidValuesHandler getValidValuesHandler() throws PropertyServerException + { + final String methodName = "getValidValuesHandler"; + + validateActiveRepository(methodName); + + return validValuesHandler; + } + } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/ValidValuesRESTServices.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/ValidValuesRESTServices.java new file mode 100644 index 00000000000..29a69a8deaa --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/ValidValuesRESTServices.java @@ -0,0 +1,1386 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.communityprofile.server; + +import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.RelatedElement; +import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.ValidValueElement; +import org.odpi.openmetadata.accessservices.communityprofile.properties.ReferenceValueAssignmentProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.ValidValueAssignmentProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.ValidValueMembershipProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.ValidValueProperties; +import org.odpi.openmetadata.accessservices.communityprofile.rest.ExternalSourceRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.rest.ReferenceableRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.rest.RelatedElementListResponse; +import org.odpi.openmetadata.accessservices.communityprofile.rest.RelationshipRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.rest.ValidValueListResponse; +import org.odpi.openmetadata.accessservices.communityprofile.rest.ValidValueResponse; +import org.odpi.openmetadata.commonservices.ffdc.RESTCallLogger; +import org.odpi.openmetadata.commonservices.ffdc.RESTCallToken; +import org.odpi.openmetadata.commonservices.ffdc.RESTExceptionHandler; +import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDResponse; +import org.odpi.openmetadata.commonservices.ffdc.rest.NameRequestBody; +import org.odpi.openmetadata.commonservices.ffdc.rest.SearchStringRequestBody; +import org.odpi.openmetadata.commonservices.ffdc.rest.VoidResponse; +import org.odpi.openmetadata.commonservices.generichandlers.ReferenceableHandler; +import org.odpi.openmetadata.commonservices.generichandlers.ValidValuesHandler; +import org.odpi.openmetadata.frameworks.auditlog.AuditLog; +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; +import org.slf4j.LoggerFactory; + +import java.util.Date; +import java.util.List; + +/** + * ValidValuesRESTServices provides the API operations to create and maintain validValues information. + */ +public class ValidValuesRESTServices +{ + private static final CommunityProfileInstanceHandler instanceHandler = new CommunityProfileInstanceHandler(); + private static final RESTExceptionHandler restExceptionHandler = new RESTExceptionHandler(); + private static final RESTCallLogger restCallLogger = new RESTCallLogger(LoggerFactory.getLogger(ValidValuesRESTServices.class), + instanceHandler.getServiceName()); + + + /** + * Default constructor + */ + public ValidValuesRESTServices() + { + } + + + /** + * Create a new metadata element to represent a validValues. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param requestBody properties to store + * + * @return unique identifier of the new metadata element or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public GUIDResponse createValidValue(String serverName, + String userId, + ReferenceableRequestBody requestBody) + { + final String methodName = "createValidValue"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + GUIDResponse response = new GUIDResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ValidValuesHandler handler = instanceHandler.getValidValueHandler(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof ValidValueProperties) + { + ValidValueProperties properties = (ValidValueProperties)requestBody.getProperties(); + + String validValueGUID = handler.createValidValue(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + properties.getQualifiedName(), + properties.getDisplayName(), + properties.getDescription(), + properties.getUsage(), + properties.getScope(), + properties.getIsDeprecated(), + properties.getPreferredValue(), + properties.getAdditionalProperties(), + properties.getTypeName(), + properties.getExtendedProperties(), + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + new Date(), + methodName); + + if (validValueGUID != null) + { + handler.setVendorProperties(userId, + validValueGUID, + properties.getVendorProperties(), + false, + false, + new Date(), + methodName); + } + + response.setGUID(validValueGUID); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(ValidValueProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Update the metadata element representing a validValues. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param validValueGUID unique identifier of the metadata element to update + * @param isMergeUpdate should the new properties be merged with the existing properties of overlay them? + * @param requestBody new properties for this element + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse updateValidValue(String serverName, + String userId, + String validValueGUID, + boolean isMergeUpdate, + ReferenceableRequestBody requestBody) + { + final String methodName = "updateValidValue"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ValidValuesHandler handler = instanceHandler.getValidValueHandler(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof ValidValueProperties) + { + ValidValueProperties properties = (ValidValueProperties) requestBody.getProperties(); + + handler.updateValidValue(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + validValueGUID, + properties.getQualifiedName(), + properties.getDisplayName(), + properties.getDescription(), + properties.getUsage(), + properties.getScope(), + properties.getIsDeprecated(), + properties.getPreferredValue(), + properties.getAdditionalProperties(), + properties.getExtendedProperties(), + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + isMergeUpdate, + false, + false, + new Date(), + methodName); + + if ((! isMergeUpdate) || (properties.getVendorProperties() != null)) + { + handler.setVendorProperties(userId, + validValueGUID, + properties.getVendorProperties(), + false, + false, + new Date(), + methodName); + } + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(ValidValueProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Create a membership relationship between a validValue and a validValueSet that it belongs to. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param validValueSetGUID unique identifier of the valid value set + * @param validValueMemberGUID unique identifier of the member + * @param requestBody relationship properties + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse setupValidValueMember(String serverName, + String userId, + String validValueSetGUID, + String validValueMemberGUID, + RelationshipRequestBody requestBody) + { + final String methodName = "setupValidValueMember"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ValidValuesHandler handler = instanceHandler.getValidValueHandler(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof ValidValueMembershipProperties) + { + ValidValueMembershipProperties properties = (ValidValueMembershipProperties) requestBody.getProperties(); + + handler.attachValidValueToSet(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + validValueSetGUID, + validValueMemberGUID, + properties.getDefaultValue(), + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + false, + false, + new Date(), + methodName); + } + else if (requestBody.getProperties() == null) + { + handler.attachValidValueToSet(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + validValueSetGUID, + validValueMemberGUID, + false, + null, + null, + false, + false, + new Date(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(ValidValueMembershipProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Remove a membership relationship between a validValue and a validValueSet that it belongs to. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param validValueSetGUID unique identifier of the valid value set + * @param validValueMemberGUID unique identifier of the member + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse clearValidValueMember(String serverName, + String userId, + String validValueSetGUID, + String validValueMemberGUID, + ExternalSourceRequestBody requestBody) + { + final String methodName = "clearValidValueMember"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ValidValuesHandler handler = instanceHandler.getValidValueHandler(userId, serverName, methodName); + + if (requestBody != null) + { + handler.detachValidValueFromSet(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + validValueSetGUID, + validValueMemberGUID, + false, + false, + new Date(), + methodName); + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Create a valid value assignment relationship between an element and a valid value (typically, a valid value set) to show that + * the valid value defines the values that can be stored in the data item that the element represents. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param validValueGUID unique identifier of the valid value + * @param requestBody relationship properties + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse setupValidValues(String serverName, + String userId, + String elementGUID, + String validValueGUID, + RelationshipRequestBody requestBody) + { + final String methodName = "setupValidValues"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ValidValuesHandler handler = instanceHandler.getValidValueHandler(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof ValidValueAssignmentProperties) + { + ValidValueAssignmentProperties properties = (ValidValueAssignmentProperties) requestBody.getProperties(); + + handler.assignValidValueToConsumer(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + validValueGUID, + elementGUID, + properties.getStrictRequirement(), + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + false, + false, + new Date(), + methodName); + } + else if (requestBody.getProperties() == null) + { + handler.assignValidValueToConsumer(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + validValueGUID, + elementGUID, + false, + null, + null, + false, + false, + new Date(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(ValidValueAssignmentProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Remove a valid value assignment relationship between an element and a valid value. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param validValueGUID unique identifier of the valid value + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse clearValidValues(String serverName, + String userId, + String elementGUID, + String validValueGUID, + ExternalSourceRequestBody requestBody) + { + final String methodName = "clearValidValues"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ValidValuesHandler handler = instanceHandler.getValidValueHandler(userId, serverName, methodName); + + if (requestBody != null) + { + handler.unassignValidValueFromConsumer(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + validValueGUID, + elementGUID, + false, + false, + new Date(), + methodName); + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Create a reference value assignment relationship between an element and a valid value to show that + * the valid value is a semiformal tag/classification. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param validValueGUID unique identifier of the valid value + * @param requestBody relationship properties + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse setupReferenceValueTag(String serverName, + String userId, + String elementGUID, + String validValueGUID, + RelationshipRequestBody requestBody) + { + final String methodName = "setupReferenceValueTag"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ValidValuesHandler handler = instanceHandler.getValidValueHandler(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof ReferenceValueAssignmentProperties) + { + ReferenceValueAssignmentProperties properties = (ReferenceValueAssignmentProperties) requestBody.getProperties(); + + handler.assignReferenceValueToItem(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + validValueGUID, + elementGUID, + properties.getConfidence(), + properties.getSteward(), + properties.getStewardTypeName(), + properties.getStewardPropertyName(), + properties.getNotes(), + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + false, + false, + new Date(), + methodName); + } + else if (requestBody.getProperties() == null) + { + handler.assignReferenceValueToItem(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + validValueGUID, + elementGUID, + 100, + null, + null, + null, + null, + null, + null, + false, + false, + new Date(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(ReferenceValueAssignmentProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Remove a reference value assignment relationship between an element and a valid value. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param validValueGUID unique identifier of the valid value + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse clearReferenceValueTag(String serverName, + String userId, + String elementGUID, + String validValueGUID, + ExternalSourceRequestBody requestBody) + { + final String methodName = "clearReferenceValueTag"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ValidValuesHandler handler = instanceHandler.getValidValueHandler(userId, serverName, methodName); + + if (requestBody != null) + { + handler.unassignValidValueFromConsumer(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + validValueGUID, + elementGUID, + false, + false, + new Date(), + methodName); + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Remove the metadata element representing a validValue. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param validValueGUID unique identifier of the metadata element to remove + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse removeValidValue(String serverName, + String userId, + String validValueGUID, + ExternalSourceRequestBody requestBody) + { + final String methodName = "removeValidValue"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + if (requestBody != null) + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ValidValuesHandler handler = instanceHandler.getValidValueHandler(userId, serverName, methodName); + + handler.deleteValidValue(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + validValueGUID, + null, + false, + false, + new Date(), + methodName); + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Retrieve the list of validValue metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param requestBody string to find in the properties + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public ValidValueListResponse findValidValues(String serverName, + String userId, + SearchStringRequestBody requestBody, + int startFrom, + int pageSize) + { + final String methodName = "findValidValues"; + final String searchStringParameterName = "searchString"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + ValidValueListResponse response = new ValidValueListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + if (requestBody != null) + { + ValidValuesHandler handler = instanceHandler.getValidValueHandler(userId, serverName, methodName); + + List validValues = handler.findValidValues(userId, + requestBody.getSearchString(), + searchStringParameterName, + startFrom, + pageSize, + false, + false, + new Date(), + methodName); + + response.setElementList(setUpVendorProperties(userId, validValues, handler, methodName)); + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Retrieve the list of validValue metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param requestBody name to search for + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public ValidValueListResponse getValidValuesByName(String serverName, + String userId, + NameRequestBody requestBody, + int startFrom, + int pageSize) + { + final String methodName = "getValidValuesByName"; + final String nameParameterName = "name"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + ValidValueListResponse response = new ValidValueListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + if (requestBody != null) + { + ValidValuesHandler handler = instanceHandler.getValidValueHandler(userId, serverName, methodName); + + List validValues = handler.getValidValueByName(userId, + requestBody.getName(), + nameParameterName, + startFrom, + pageSize, + false, + false, + new Date(), + methodName); + + response.setElementList(setUpVendorProperties(userId, validValues, handler, methodName)); + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Page through the members of a valid value set. + * + * @param serverName called server + * @param userId calling user + * @param validValueSetGUID unique identifier of the valid value set + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of valid value beans + * + * InvalidParameterException name or userId is null + * PropertyServerException problem accessing property server + * UserNotAuthorizedException security access problem + */ + public ValidValueListResponse getValidValueSetMembers(String serverName, + String userId, + String validValueSetGUID, + int startFrom, + int pageSize) + { + final String methodName = "getValidValueSetMembers"; + final String guidParameterName = "validValueSetGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + ValidValueListResponse response = new ValidValueListResponse(); + AuditLog auditLog = null; + + try + { + ValidValuesHandler handler = instanceHandler.getValidValueHandler(userId, serverName, methodName); + + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + response.setElementList(handler.getValidValueSetMembers(userId, + validValueSetGUID, + guidParameterName, + startFrom, + pageSize, + false, + false, + new Date(), + methodName)); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Page through the list of valid value sets that a valid value definition/set belongs to. + * + * @param serverName called server + * @param userId calling user + * @param validValueGUID unique identifier of the valid value + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of valid value beans + * + * InvalidParameterException name or userId is null + * PropertyServerException problem accessing property server + * UserNotAuthorizedException security access problem + */ + public ValidValueListResponse getSetsForValidValue(String serverName, + String userId, + String validValueGUID, + int startFrom, + int pageSize) + { + final String methodName = "getSetsForValidValue"; + final String guidParameterName = "validValueGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + ValidValueListResponse response = new ValidValueListResponse(); + AuditLog auditLog = null; + + try + { + ValidValuesHandler handler = instanceHandler.getValidValueHandler(userId, serverName, methodName); + + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + response.setElementList(handler.getSetsForValidValue(userId, + validValueGUID, + guidParameterName, + startFrom, + pageSize, + false, + false, + new Date(), + methodName)); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Return information about the valid value set linked to an element as its + * set of valid values. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier for the element using the valid value set + * + * @return matching metadata element or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public ValidValueResponse getValidValuesForConsumer(String serverName, + String userId, + String elementGUID) + { + final String methodName = "getValidValuesForConsumer"; + final String guidParameterName = "elementGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + ValidValueResponse response = new ValidValueResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ValidValuesHandler handler = instanceHandler.getValidValueHandler(userId, serverName, methodName); + + ValidValueElement validValue = handler.getAssignedValidValues(userId, + elementGUID, + guidParameterName, + false, + false, + new Date(), + methodName); + + response.setElement(setUpVendorProperties(userId, validValue, handler, methodName)); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Return information about the consumers linked to a valid value. + * + * @param serverName called server + * @param userId calling user + * @param validValueGUID unique identifier for the validValue + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching person roles + * + * InvalidParameterException name or userId is null + * PropertyServerException problem accessing property server + * UserNotAuthorizedException security access problem + */ + public RelatedElementListResponse getConsumersOfValidValue(String serverName, + String userId, + String validValueGUID, + int startFrom, + int pageSize) + { + final String methodName = "getConsumersOfValidValue"; + final String guidParameterName = "validValueGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + RelatedElementListResponse response = new RelatedElementListResponse(); + AuditLog auditLog = null; + + try + { + ReferenceableHandler handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); + + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + response.setElementList(handler.getValidValueConsumers(userId, + validValueGUID, + guidParameterName, + startFrom, + pageSize, + false, + false, + new Date(), + methodName)); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Return information about the valid values linked as reference value tags to an element. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier for the element using the valid value set + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public ValidValueListResponse getReferenceValues(String serverName, + String userId, + String elementGUID, + int startFrom, + int pageSize) + { + final String methodName = "getReferenceValues"; + final String guidParameterName = "elementGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + ValidValueListResponse response = new ValidValueListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ValidValuesHandler handler = instanceHandler.getValidValueHandler(userId, serverName, methodName); + + List validValue = handler.getReferenceValues(userId, + elementGUID, + guidParameterName, + startFrom, + pageSize, + false, + false, + new Date(), + methodName); + + response.setElementList(setUpVendorProperties(userId, validValue, handler, methodName)); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Return information about the consumers linked to a valid value. + * + * @param serverName called server + * @param userId calling user + * @param validValueGUID unique identifier for the validValue + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching person roles + * + * InvalidParameterException name or userId is null + * PropertyServerException problem accessing property server + * UserNotAuthorizedException security access problem + */ + public RelatedElementListResponse getAssigneesOfReferenceValue(String serverName, + String userId, + String validValueGUID, + int startFrom, + int pageSize) + { + final String methodName = "getAssigneesOfReferenceValue"; + final String guidParameterName = "validValueGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + RelatedElementListResponse response = new RelatedElementListResponse(); + AuditLog auditLog = null; + + try + { + ReferenceableHandler handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); + + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + response.setElementList(handler.getReferenceValueAssignees(userId, + validValueGUID, + guidParameterName, + startFrom, + pageSize, + false, + false, + new Date(), + methodName)); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Retrieve the list of validValue metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public ValidValueListResponse getAllValidValues(String serverName, + String userId, + int startFrom, + int pageSize) + { + final String methodName = "getAllValidValues"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + ValidValueListResponse response = new ValidValueListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ValidValuesHandler handler = instanceHandler.getValidValueHandler(userId, serverName, methodName); + + List validValues = handler.getValidValues(userId, + startFrom, + pageSize, + false, + false, + new Date(), + methodName); + + response.setElementList(setUpVendorProperties(userId, validValues, handler, methodName)); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Retrieve the validValue metadata element with the supplied unique identifier. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param guid unique identifier of the requested metadata element + * + * @return matching metadata element or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public ValidValueResponse getValidValueByGUID(String serverName, + String userId, + String guid) + { + final String methodName = "getValidValueByGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + ValidValueResponse response = new ValidValueResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ValidValuesHandler handler = instanceHandler.getValidValueHandler(userId, serverName, methodName); + + ValidValueElement validValue = handler.getValidValueByGUID(userId, + guid, + false, + false, + new Date(), + methodName); + + response.setElement(setUpVendorProperties(userId, validValue, handler, methodName)); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + + /** + * Set up the vendor properties in the retrieved elements. + * + * @param userId calling user + * @param retrievedResults results from the repositories + * @param handler handler used to retrieve the vendor properties + * @param methodName calling method + * + * @return updated results + * + * @throws InvalidParameterException one of the parameters is null or invalid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + private List setUpVendorProperties(String userId, + List retrievedResults, + ValidValuesHandler handler, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + if (retrievedResults != null) + { + for (ValidValueElement element : retrievedResults) + { + if (element != null) + { + setUpVendorProperties(userId, element, handler, methodName); + } + } + } + + return retrievedResults; + } + + + /** + * Set up the vendor properties in the retrieved element. + * + * @param userId calling user + * @param element results from the repositories + * @param handler handler used to retrieve the vendor properties + * @param methodName calling method + * + * @return updated results + * + * @throws InvalidParameterException one of the parameters is null or invalid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + private ValidValueElement setUpVendorProperties(String userId, + ValidValueElement element, + ValidValuesHandler handler, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String elementGUIDParameterName = "element.getElementHeader().getGUID()"; + + if (element != null) + { + ValidValueProperties properties = element.getValidValueProperties(); + + properties.setVendorProperties(handler.getVendorProperties(userId, + element.getElementHeader().getGUID(), + elementGUIDParameterName, + false, + false, + new Date(), + methodName)); + } + + return element; + } +} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/CommunityProfileValidValuesResource.java b/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/CommunityProfileValidValuesResource.java new file mode 100644 index 00000000000..f35be004e44 --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/CommunityProfileValidValuesResource.java @@ -0,0 +1,539 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.communityprofile.server.spring; + +import io.swagger.v3.oas.annotations.ExternalDocumentation; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.odpi.openmetadata.accessservices.communityprofile.rest.ExternalSourceRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.rest.ReferenceableRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.rest.RelatedElementListResponse; +import org.odpi.openmetadata.accessservices.communityprofile.rest.RelationshipRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.rest.ValidValueListResponse; +import org.odpi.openmetadata.accessservices.communityprofile.rest.ValidValueResponse; +import org.odpi.openmetadata.accessservices.communityprofile.server.ValidValuesRESTServices; +import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDResponse; +import org.odpi.openmetadata.commonservices.ffdc.rest.NameRequestBody; +import org.odpi.openmetadata.commonservices.ffdc.rest.SearchStringRequestBody; +import org.odpi.openmetadata.commonservices.ffdc.rest.VoidResponse; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + + +/** + * The CommunityProfileValidValuesResource provides a Spring based server-side REST API + * that supports the ValidValueManagementInterface. It delegates each request to the + * ValidValueRESTServices. This provides the server-side implementation of the Community Profile Open Metadata + * Assess Service (OMAS) which is used to manage information about people, roles and organizations. + */ +@RestController +@RequestMapping("/servers/{serverName}/open-metadata/access-services/community-profile/users/{userId}") + +@Tag(name="Community Profile OMAS", description="The Community Profile OMAS provides APIs and events for tools and applications that are managing information about people and the way they work together.", + externalDocs=@ExternalDocumentation(description="Community Profile Open Metadata Access Service (OMAS)", + url="https://egeria-project.org/services/omas/community-profile/overview/")) + +public class CommunityProfileValidValuesResource +{ + private final ValidValuesRESTServices restAPI = new ValidValuesRESTServices(); + + + /** + * Default constructor + */ + public CommunityProfileValidValuesResource() + { + } + + + /** + * Create a new metadata element to represent a validValues. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param requestBody properties to store + * + * @return unique identifier of the new metadata element or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/valid-values") + + public GUIDResponse createValidValue(@PathVariable String serverName, + @PathVariable String userId, + @RequestBody ReferenceableRequestBody requestBody) + { + return restAPI.createValidValue(serverName, userId, requestBody); + } + + + /** + * Update the metadata element representing a validValues. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param validValueGUID unique identifier of the metadata element to update + * @param isMergeUpdate should the new properties be merged with the existing properties of overlay them? + * @param requestBody new properties for this element + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/valid-values/{validValueGUID}") + + public VoidResponse updateValidValue(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String validValueGUID, + @RequestParam boolean isMergeUpdate, + @RequestBody ReferenceableRequestBody requestBody) + { + return restAPI.updateValidValue(serverName, userId, validValueGUID, isMergeUpdate, requestBody); + } + + + /** + * Create a membership relationship between a validValue and a validValueSet that it belongs to. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param validValueSetGUID unique identifier of the valid value set + * @param validValueMemberGUID unique identifier of the member + * @param requestBody relationship properties + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/valid-values/{validValueSetGUID}/valid-value-members/{validValueMemberGUID}") + + public VoidResponse setupValidValueMember(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String validValueSetGUID, + @PathVariable String validValueMemberGUID, + @RequestBody RelationshipRequestBody requestBody) + { + return restAPI.setupValidValueMember(serverName, userId, validValueSetGUID, validValueMemberGUID, requestBody); + } + + + /** + * Remove a membership relationship between a validValue and a validValueSet that it belongs to. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param validValueSetGUID unique identifier of the valid value set + * @param validValueMemberGUID unique identifier of the member + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/valid-values/{validValueSetGUID}/valid-value-members/{validValueMemberGUID}/delete") + + public VoidResponse clearValidValueMember(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String validValueSetGUID, + @PathVariable String validValueMemberGUID, + @RequestBody ExternalSourceRequestBody requestBody) + { + return restAPI.clearValidValueMember(serverName, userId, validValueSetGUID, validValueMemberGUID, requestBody); + } + + + /** + * Create a valid value assignment relationship between an element and a valid value (typically, a valid value set) to show that + * the valid value defines the values that can be stored in the data item that the element represents. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param validValueGUID unique identifier of the valid value + * @param requestBody relationship properties + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/valid-values/{elementGUID}/valid-values/{validValueGUID}") + + public VoidResponse setupValidValues(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @PathVariable String validValueGUID, + @RequestBody RelationshipRequestBody requestBody) + { + return restAPI.setupValidValues(serverName, userId, elementGUID, validValueGUID, requestBody); + } + + + /** + * Remove a valid value assignment relationship between an element and a valid value. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param validValueGUID unique identifier of the valid value + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/valid-values/{elementGUID}/valid-values/{validValueGUID}/delete") + + public VoidResponse clearValidValues(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @PathVariable String validValueGUID, + @RequestBody ExternalSourceRequestBody requestBody) + { + return restAPI.clearValidValues(serverName, userId, elementGUID, validValueGUID, requestBody); + } + + + /** + * Create a reference value assignment relationship between an element and a valid value to show that + * the valid value is a semiformal tag/classification. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param validValueGUID unique identifier of the valid value + * @param requestBody relationship properties + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/valid-values/{elementGUID}/reference-value-tags/{validValueGUID}") + + public VoidResponse setupReferenceValueTag(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @PathVariable String validValueGUID, + @RequestBody RelationshipRequestBody requestBody) + { + return restAPI.setupReferenceValueTag(serverName, userId, elementGUID, validValueGUID, requestBody); + } + + + /** + * Remove a reference value assignment relationship between an element and a valid value. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param validValueGUID unique identifier of the valid value + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/valid-values/{elementGUID}/reference-value-tags/{validValueGUID}/delete") + + public VoidResponse clearReferenceValueTag(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @PathVariable String validValueGUID, + @RequestBody ExternalSourceRequestBody requestBody) + { + return restAPI.clearReferenceValueTag(serverName, userId, elementGUID, validValueGUID, requestBody); + } + + + /** + * Remove the metadata element representing a validValue. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param validValueGUID unique identifier of the metadata element to remove + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/valid-values/{validValueGUID}/delete") + + public VoidResponse removeValidValue(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String validValueGUID, + @RequestBody ExternalSourceRequestBody requestBody) + { + return restAPI.removeValidValue(serverName, userId, validValueGUID, requestBody); + } + + + /** + * Retrieve the list of validValue metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param requestBody string to find in the properties + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/valid-values/by-search-string") + + public ValidValueListResponse findValidValues(@PathVariable String serverName, + @PathVariable String userId, + @RequestParam int startFrom, + @RequestParam int pageSize, + @RequestBody SearchStringRequestBody requestBody) + { + return restAPI.findValidValues(serverName, userId, requestBody, startFrom, pageSize); + } + + + /** + * Retrieve the list of validValue metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param requestBody name to search for + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/valid-values/by-name") + + public ValidValueListResponse getValidValuesByName(@PathVariable String serverName, + @PathVariable String userId, + @RequestParam int startFrom, + @RequestParam int pageSize, + @RequestBody NameRequestBody requestBody) + { + return restAPI.getValidValuesByName(serverName, userId, requestBody, startFrom, pageSize); + } + + + /** + * Page through the members of a valid value set. + * + * @param serverName called server + * @param userId calling user + * @param validValueSetGUID unique identifier of the valid value set + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of valid value beans + *

          + * InvalidParameterException name or userId is null + * PropertyServerException problem accessing property server + * UserNotAuthorizedException security access problem + */ + @GetMapping(path = "/valid-values/members/{validValueSetGUID}") + + public ValidValueListResponse getValidValueSetMembers(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String validValueSetGUID, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getValidValueSetMembers(serverName, userId, validValueSetGUID, startFrom, pageSize); + } + + + /** + * Page through the list of valid value sets that a valid value definition/set belongs to. + * + * @param serverName called server + * @param userId calling user + * @param validValueGUID unique identifier of the valid value + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of valid value beans + *

          + * InvalidParameterException name or userId is null + * PropertyServerException problem accessing property server + * UserNotAuthorizedException security access problem + */ + @GetMapping(path = "/valid-values/sets/{validValueGUID}") + + public ValidValueListResponse getSetsForValidValue(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String validValueGUID, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getSetsForValidValue(serverName, userId, validValueGUID, startFrom, pageSize); + } + + + /** + * Return information about the valid value set linked to an element as its + * set of valid values. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier for the element using the valid value set + * + * @return matching metadata element or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @GetMapping(path = "/valid-values/by-consumer/{elementGUID}") + + public ValidValueResponse getValidValuesForConsumer(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID) + { + return restAPI.getValidValuesForConsumer(serverName, userId, elementGUID); + } + + + /** + * Return information about the consumers linked to a valid value. + * + * @param serverName called server + * @param userId calling user + * @param validValueGUID unique identifier for the validValue + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching person roles + *

          + * InvalidParameterException name or userId is null + * PropertyServerException problem accessing property server + * UserNotAuthorizedException security access problem + */ + @GetMapping(path = "/valid-values/{validValueGUID}/consumers") + + public RelatedElementListResponse getConsumersOfValidValue(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String validValueGUID, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getConsumersOfValidValue(serverName, userId, validValueGUID, startFrom, pageSize); + } + + + /** + * Return information about the valid values linked as reference value tags to an element. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier for the element using the valid value set + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @GetMapping(path = "/valid-values/by-reference-value-tags/{elementGUID}") + + public ValidValueListResponse getReferenceValues(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getReferenceValues(serverName, userId, elementGUID, startFrom, pageSize); + } + + + /** + * Return information about the consumers linked to a valid value. + * + * @param serverName called server + * @param userId calling user + * @param validValueGUID unique identifier for the validValue + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching person roles + *

          + * InvalidParameterException name or userId is null + * PropertyServerException problem accessing property server + * UserNotAuthorizedException security access problem + */ + @GetMapping(path = "/valid-values/{validValueGUID}/by-reference-value-tag-assignees") + + public RelatedElementListResponse getAssigneesOfReferenceValue(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String validValueGUID, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getAssigneesOfReferenceValue(serverName, userId, validValueGUID, startFrom, pageSize); + } + + + /** + * Retrieve the list of validValue metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @GetMapping(path = "/valid-values") + + public ValidValueListResponse getAllValidValues(@PathVariable String serverName, + @PathVariable String userId, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getAllValidValues(serverName, userId, startFrom, pageSize); + } + + + /** + * Retrieve the validValue metadata element with the supplied unique identifier. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param guid unique identifier of the requested metadata element + * + * @return matching metadata element or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @GetMapping(path = "/valid-values/{guid}") + + public ValidValueResponse getValidValueByGUID(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String guid) + { + return restAPI.getValidValueByGUID(serverName, userId, guid); + } +} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/api/ValidValueManagementInterface.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/api/ValidValueManagementInterface.java new file mode 100644 index 00000000000..8c629eadfc9 --- /dev/null +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/api/ValidValueManagementInterface.java @@ -0,0 +1,438 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.datamanager.api; + +import org.odpi.openmetadata.accessservices.datamanager.metadataelements.RelatedElement; +import org.odpi.openmetadata.accessservices.datamanager.metadataelements.ValidValueElement; +import org.odpi.openmetadata.accessservices.datamanager.properties.ReferenceValueAssignmentProperties; +import org.odpi.openmetadata.accessservices.datamanager.properties.ValidValueAssignmentProperties; +import org.odpi.openmetadata.accessservices.datamanager.properties.ValidValueMembershipProperties; +import org.odpi.openmetadata.accessservices.datamanager.properties.ValidValueProperties; +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; + +import java.util.List; + +/** + * The ValidValueManagementInterface provides methods for managing valid values. + */ +public interface ValidValueManagementInterface +{ + + /** + * Create a new metadata element to represent the validValue. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param validValueProperties properties to store + * + * @return unique identifier of the new metadata element + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + String createValidValue(String userId, + String externalSourceGUID, + String externalSourceName, + ValidValueProperties validValueProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Update the metadata element representing a validValue. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param validValueGUID unique identifier of the metadata element to update + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param validValueProperties new properties for this element + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void updateValidValue(String userId, + String externalSourceGUID, + String externalSourceName, + String validValueGUID, + boolean isMergeUpdate, + ValidValueProperties validValueProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Create a membership relationship between a validValue and a validValueSet that it belongs to. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param validValueSetGUID unique identifier of the valid value set + * @param properties describes the properties of the membership + * @param validValueMemberGUID unique identifier of the member + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void setupValidValueMember(String userId, + String externalSourceGUID, + String externalSourceName, + String validValueSetGUID, + ValidValueMembershipProperties properties, + String validValueMemberGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove a membership relationship between a validValue and a validValueSet that it belongs to. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param validValueSetGUID unique identifier of the valid value set + * @param validValueMemberGUID unique identifier of the role + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void clearValidValueMember(String userId, + String externalSourceGUID, + String externalSourceName, + String validValueSetGUID, + String validValueMemberGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Create a valid value assignment relationship between an element and a valid value (typically, a valid value set) to show that + * the valid value defines the values that can be stored in the data item that the element represents. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param properties describes the permissions that the role has in the validValue + * @param validValueGUID unique identifier of the valid value + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void setupValidValues(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + ValidValueAssignmentProperties properties, + String validValueGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove a valid value assignment relationship between an element and a valid value. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param validValueGUID unique identifier of the valid value + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void clearValidValues(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String validValueGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Create a reference value assignment relationship between an element and a valid value to show that + * the valid value is a semiformal tag/classification. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param properties describes the quality of the assignment + * @param validValueGUID unique identifier of the valid value + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void setupReferenceValueTag(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + ReferenceValueAssignmentProperties properties, + String validValueGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove a reference value assignment relationship between an element and a valid value. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param validValueGUID unique identifier of the valid value + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void clearReferenceValueTag(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String validValueGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the metadata element representing a validValue. This will delete all anchored + * elements such as comments. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param validValueGUID unique identifier of the metadata element to remove + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void removeValidValue(String userId, + String externalSourceGUID, + String externalSourceName, + String validValueGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param userId calling user + * @param searchString string to find in the properties + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + List findValidValues(String userId, + String searchString, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param userId calling user + * @param name name to search for + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + List getValidValuesByName(String userId, + String name, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of valid values. + * + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + List getAllValidValues(String userId, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Page through the members of a valid value set. + * + * @param userId calling user + * @param validValueSetGUID unique identifier of the valid value set + * @param startFrom paging starting point + * @param pageSize maximum number of return values. + * @return list of valid value beans + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException the repository is not available or not working properly. + */ + List getValidValueSetMembers(String userId, + String validValueSetGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + + /** + * Page through the list of valid value sets that a valid value definition/set belongs to. + * + * @param userId calling user + * @param validValueGUID unique identifier of valid value to query + * @param startFrom paging starting point + * @param pageSize maximum number of return values. + * @return list of valid value beans + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException the repository is not available or not working properly. + */ + List getSetsForValidValue(String userId, + String validValueGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Return information about the valid value set linked to an element as its + * set of valid values. + * + * @param userId calling user + * @param elementGUID unique identifier for the element using the valid value + * + * @return list of matching actor profiles (hopefully only one) + * + * @throws InvalidParameterException name or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + ValidValueElement getValidValuesForConsumer(String userId, + String elementGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Return information about the consumers linked to a valid value. + * + * @param userId calling user + * @param validValueGUID unique identifier for the validValue + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching actor profiles (hopefully only one) + * + * @throws InvalidParameterException name or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + List getConsumersOfValidValue(String userId, + String validValueGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Return information about the valid values linked as reference value tags to an element.. + * + * @param userId calling user + * @param elementGUID unique identifier for the element + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of valid values + * + * @throws InvalidParameterException name or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + List getReferenceValues(String userId, + String elementGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + + /** + * Return information about the person roles linked to a validValue. + * + * @param userId calling user + * @param validValueGUID unique identifier for the validValue + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching actor profiles (hopefully only one) + * + * @throws InvalidParameterException name or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + List getAssigneesOfReferenceValue(String userId, + String validValueGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + /** + * Retrieve the validValue metadata element with the supplied unique identifier. + * + * @param userId calling user + * @param validValueGUID unique identifier of the requested metadata element + * + * @return matching metadata element + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + ValidValueElement getValidValueByGUID(String userId, + String validValueGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; +} diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/metadataelements/RelatedElement.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/metadataelements/RelatedElement.java new file mode 100644 index 00000000000..63a0072cc20 --- /dev/null +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/metadataelements/RelatedElement.java @@ -0,0 +1,173 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.datamanager.metadataelements; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.datamanager.properties.RelationshipProperties; + +import java.io.Serializable; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * RelatedElement contains the properties and header for a relationship retrieved from the metadata repository along with the stub + * of the related element. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class RelatedElement implements Serializable +{ + private static final long serialVersionUID = 1L; + + private ElementHeader relationshipHeader = null; + private RelationshipProperties relationshipProperties = null; + private ElementStub relatedElement = null; + + /** + * Default constructor + */ + public RelatedElement() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public RelatedElement(RelatedElement template) + { + if (template != null) + { + relationshipHeader = template.getRelationshipHeader(); + relationshipProperties = template.getRelationshipProperties(); + relatedElement = template.getRelatedElement(); + } + } + + + /** + * Return the element header associated with the relationship. + * + * @return element header object + */ + public ElementHeader getRelationshipHeader() + { + return relationshipHeader; + } + + + /** + * Set up the element header associated with the relationship. + * + * @param relationshipHeader element header object + */ + public void setRelationshipHeader(ElementHeader relationshipHeader) + { + this.relationshipHeader = relationshipHeader; + } + + + /** + * Return details of the relationship + * + * @return relationship properties + */ + public RelationshipProperties getRelationshipProperties() + { + return relationshipProperties; + } + + + /** + * Set up relationship properties + * + * @param relationshipProperties relationship properties + */ + public void setRelationshipProperties(RelationshipProperties relationshipProperties) + { + this.relationshipProperties = relationshipProperties; + } + + + /** + * Return the element header associated with end 1 of the relationship. + * + * @return element stub object + */ + public ElementStub getRelatedElement() + { + return relatedElement; + } + + + /** + * Set up the element header associated with end 1 of the relationship. + * + * @param relatedElement element stub object + */ + public void setRelatedElement(ElementStub relatedElement) + { + this.relatedElement = relatedElement; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "RelatedElement{" + + "relationshipHeader=" + relationshipHeader + + ", relationshipProperties=" + relationshipProperties + + ", relatedElement=" + relatedElement + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + RelatedElement that = (RelatedElement) objectToCompare; + return Objects.equals(getRelationshipHeader(), that.getRelationshipHeader()) && + Objects.equals(getRelationshipProperties(), that.getRelationshipProperties()) && + Objects.equals(getRelatedElement(), that.getRelatedElement()); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), relationshipHeader, relationshipProperties, relatedElement); + } +} diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/metadataelements/RelationshipElement.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/metadataelements/RelationshipElement.java new file mode 100644 index 00000000000..f09a51841a6 --- /dev/null +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/metadataelements/RelationshipElement.java @@ -0,0 +1,199 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.datamanager.metadataelements; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.datamanager.properties.RelationshipProperties; + +import java.io.Serializable; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * RelationshipElement contains the properties and header for a relationship retrieved from the metadata repository. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class RelationshipElement implements Serializable +{ + private static final long serialVersionUID = 1L; + + private ElementHeader relationshipHeader = null; + private RelationshipProperties relationshipProperties = null; + private ElementHeader end1GUID = null; + private ElementHeader end2GUID = null; + + /** + * Default constructor + */ + public RelationshipElement() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public RelationshipElement(RelationshipElement template) + { + if (template != null) + { + relationshipHeader = template.getRelationshipHeader(); + relationshipProperties = template.getRelationshipProperties(); + end1GUID = template.getEnd1GUID(); + end2GUID = template.getEnd2GUID(); + } + } + + + /** + * Return the element header associated with the relationship. + * + * @return element header object + */ + public ElementHeader getRelationshipHeader() + { + return relationshipHeader; + } + + + /** + * Set up the element header associated with the relationship. + * + * @param relationshipHeader element header object + */ + public void setRelationshipHeader(ElementHeader relationshipHeader) + { + this.relationshipHeader = relationshipHeader; + } + + + /** + * Return details of the relationship + * + * @return relationship properties + */ + public RelationshipProperties getRelationshipProperties() + { + return relationshipProperties; + } + + + /** + * Set up relationship properties + * + * @param relationshipProperties relationship properties + */ + public void setRelationshipProperties(RelationshipProperties relationshipProperties) + { + this.relationshipProperties = relationshipProperties; + } + + + /** + * Return the element header associated with end 1 of the relationship. + * + * @return element header object + */ + public ElementHeader getEnd1GUID() + { + return end1GUID; + } + + + /** + * Set up the element header associated with end 1 of the relationship. + * + * @param end1GUID element header object + */ + public void setEnd1GUID(ElementHeader end1GUID) + { + this.end1GUID = end1GUID; + } + + + + /** + * Return the element header associated with end 2 of the relationship. + * + * @return element header object + */ + public ElementHeader getEnd2GUID() + { + return end2GUID; + } + + + /** + * Set up the element header associated with end 2 of the relationship. + * + * @param end2GUID element header object + */ + public void setEnd2GUID(ElementHeader end2GUID) + { + this.end2GUID = end2GUID; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "RelationshipElement{" + + "relationshipHeader=" + relationshipHeader + + ", relationshipProperties=" + relationshipProperties + + ", end1GUID=" + end1GUID + + ", end2GUID=" + end2GUID + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + RelationshipElement that = (RelationshipElement) objectToCompare; + return Objects.equals(getRelationshipHeader(), that.getRelationshipHeader()) && + Objects.equals(getRelationshipProperties(), that.getRelationshipProperties()) && + Objects.equals(getEnd1GUID(), that.getEnd1GUID()) && + Objects.equals(getEnd2GUID(), that.getEnd2GUID()); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), relationshipHeader, relationshipProperties, end1GUID, end2GUID); + } +} diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/metadataelements/ValidValueElement.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/metadataelements/ValidValueElement.java new file mode 100644 index 00000000000..fd29069acd2 --- /dev/null +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/metadataelements/ValidValueElement.java @@ -0,0 +1,177 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.datamanager.metadataelements; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.datamanager.properties.ValidValueProperties; + +import java.io.Serializable; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ValidValueElement contains the properties and header for a valid value definition or set entity retrieved from the metadata repository. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ValidValueElement implements MetadataElement, Serializable +{ + private static final long serialVersionUID = 1L; + + private ElementHeader elementHeader = null; + private ValidValueProperties validValueProperties = null; + private RelatedElement relatedElement = null; + + + /** + * Default constructor + */ + public ValidValueElement() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ValidValueElement(ValidValueElement template) + { + if (template != null) + { + elementHeader = template.getElementHeader(); + validValueProperties = template.getValidValueProperties(); + relatedElement = getRelatedElement(); + } + } + + + /** + * Return the element header associated with the properties. + * + * @return element header object + */ + @Override + public ElementHeader getElementHeader() + { + return elementHeader; + } + + + /** + * Set up the element header associated with the properties. + * + * @param elementHeader element header object + */ + @Override + public void setElementHeader(ElementHeader elementHeader) + { + this.elementHeader = elementHeader; + } + + + /** + * Return the properties for the valid value definition or set. + * + * @return properties bean + */ + public ValidValueProperties getValidValueProperties() + { + return validValueProperties; + } + + + /** + * Set up the properties for the valid value definition or set. + * + * @param validValueProperties properties bean + */ + public void setValidValueProperties(ValidValueProperties validValueProperties) + { + this.validValueProperties = validValueProperties; + } + + + /** + * Return information about the related element and relationship (if any) that was + * used to retrieve the valid value. + * + * @return related element + */ + public RelatedElement getRelatedElement() + { + return relatedElement; + } + + + /** + * Set up information about the related element and relationship (if any) that was + * used to retrieve the valid value. + * + * @param relatedElement related element + */ + public void setRelatedElement(RelatedElement relatedElement) + { + this.relatedElement = relatedElement; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ValidValueElement{" + + "elementHeader=" + elementHeader + + ", validValueProperties=" + validValueProperties + + ", relatedElement=" + relatedElement + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + ValidValueElement that = (ValidValueElement) objectToCompare; + return Objects.equals(elementHeader, that.elementHeader) && Objects.equals(validValueProperties, + that.validValueProperties) && Objects.equals( + relatedElement, that.relatedElement); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), elementHeader, validValueProperties, relatedElement); + } +} diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/ClassificationProperties.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/ClassificationProperties.java new file mode 100644 index 00000000000..661b8b86e9c --- /dev/null +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/ClassificationProperties.java @@ -0,0 +1,190 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.datamanager.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + + +import java.io.Serializable; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * RelationshipProperties provides the base class for relationships items. This provides extended properties with the ability to + * set effectivity dates. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) + +public class ClassificationProperties implements Serializable +{ + private static final long serialVersionUID = 1L; + + private Date effectiveFrom = null; + private Date effectiveTo = null; + + private Map extendedProperties = null; + + + /** + * Default constructor + */ + public ClassificationProperties() + { + super(); + } + + + /** + * Copy/clone constructor. Retrieve values from the supplied template + * + * @param template element to copy + */ + public ClassificationProperties(ClassificationProperties template) + { + if (template != null) + { + effectiveFrom = template.getEffectiveFrom(); + effectiveTo = template.getEffectiveTo(); + extendedProperties = template.getExtendedProperties(); + } + } + + + /** + * Return the date/time that this element is effective from (null means effective from the epoch). + * + * @return date object + */ + public Date getEffectiveFrom() + { + return effectiveFrom; + } + + + /** + * Set up the date/time that this element is effective from (null means effective from the epoch). + * + * @param effectiveFrom date object + */ + public void setEffectiveFrom(Date effectiveFrom) + { + this.effectiveFrom = effectiveFrom; + } + + + /** + * Return the date/time that element is effective to (null means that it is effective indefinitely into the future). + * + * @return date object + */ + public Date getEffectiveTo() + { + return effectiveTo; + } + + + /** + * Set the date/time that element is effective to (null means that it is effective indefinitely into the future). + * + * @param effectiveTo date object + */ + public void setEffectiveTo(Date effectiveTo) + { + this.effectiveTo = effectiveTo; + } + + + /** + * Return the properties that have been defined for a subtype of this object that are not supported explicitly + * by this bean. + * + * @return property map + */ + public Map getExtendedProperties() + { + if (extendedProperties == null) + { + return null; + } + else if (extendedProperties.isEmpty()) + { + return null; + } + else + { + return new HashMap<>(extendedProperties); + } + } + + + /** + * Set up the properties that have been defined for a subtype of this object that are not supported explicitly + * by this bean. + * + * @param extendedProperties property map + */ + public void setExtendedProperties(Map extendedProperties) + { + this.extendedProperties = extendedProperties; + } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "RelationshipProperties{" + + "effectiveFrom=" + effectiveFrom + + ", effectiveTo=" + effectiveTo + + ", extendedProperties=" + extendedProperties + + '}'; + } + + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + ClassificationProperties that = (ClassificationProperties) objectToCompare; + return Objects.equals(effectiveFrom, that.effectiveFrom) && + Objects.equals(effectiveTo, that.effectiveTo); + } + + + /** + * Return has code based on properties. + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(effectiveFrom, effectiveTo); + } +} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/ReferenceValueAssignmentProperties.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/ReferenceValueAssignmentProperties.java new file mode 100644 index 00000000000..7afad920935 --- /dev/null +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/ReferenceValueAssignmentProperties.java @@ -0,0 +1,231 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.datamanager.properties; + + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ReferenceValueAssignmentProperties is a java bean used to create a link between a valid value and a referenceable item + * to enable the valid value to be used as a semiformal tag/classifier. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ReferenceValueAssignmentProperties extends RelationshipProperties +{ + private static final long serialVersionUID = 1L; + + private int confidence = 0; + private String steward = null; + private String stewardTypeName = null; + private String stewardPropertyName = null; + private String notes = null; + + + /** + * Default constructor + */ + public ReferenceValueAssignmentProperties() + { + } + + + /** + * Copy/clone constructor. Note, this is a deep copy + * + * @param template object to copy + */ + public ReferenceValueAssignmentProperties(ReferenceValueAssignmentProperties template) + { + super (template); + + if (template != null) + { + confidence = template.getConfidence(); + steward = template.getSteward(); + stewardTypeName = template.getStewardTypeName(); + stewardPropertyName = template.getStewardPropertyName(); + notes = template.getNotes(); + } + } + + + /** + * Return the confidence level (0-100) that the mapping is correct. + * + * @return int + */ + public int getConfidence() + { + return confidence; + } + + + /** + * Set up the confidence level (0-100) that the mapping is correct. + * + * @param confidence int + */ + public void setConfidence(int confidence) + { + this.confidence = confidence; + } + + + /** + * Returns the id of the steward responsible for the mapping. + * + * @return String id + */ + public String getSteward() + { + return steward; + } + + + /** + * Set up the id of the steward responsible for the mapping. + * + * @param steward String id + */ + public void setSteward(String steward) + { + this.steward = steward; + } + + + /** + * Return the type of element that describes the steward. + * + * @return type name + */ + public String getStewardTypeName() + { + return stewardTypeName; + } + + + /** + * Set up the type of element that describes the steward. + * + * @param stewardTypeName type name + */ + public void setStewardTypeName(String stewardTypeName) + { + this.stewardTypeName = stewardTypeName; + } + + + /** + * Return the name of the property that holds the steward's identifier. + * + * @return property name + */ + public String getStewardPropertyName() + { + return stewardPropertyName; + } + + + /** + * Set up the name of the property that holds the steward's identifier. + * + * @param stewardPropertyName property name + */ + public void setStewardPropertyName(String stewardPropertyName) + { + this.stewardPropertyName = stewardPropertyName; + } + + + /** + * Return the additional values associated with the symbolic name. + * + * @return string text + */ + public String getNotes() + { + return notes; + } + + + /** + * Set up the additional values associated with the symbolic name. + * + * @param notes string text + */ + public void setNotes(String notes) + { + this.notes = notes; + } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "ReferenceValueAssignmentProperties{" + + "confidence=" + confidence + + ", steward='" + steward + '\'' + + ", stewardTypeName='" + stewardTypeName + '\'' + + ", stewardPropertyName='" + stewardPropertyName + '\'' + + ", notes='" + notes + '\'' + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", extendedProperties=" + getExtendedProperties() + + '}'; + } + + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (! super.equals(objectToCompare)) + { + return false; + } + ReferenceValueAssignmentProperties that = (ReferenceValueAssignmentProperties) objectToCompare; + return confidence == that.confidence && Objects.equals(steward, that.steward) && Objects.equals(stewardTypeName, + that.stewardTypeName) && Objects.equals( + stewardPropertyName, that.stewardPropertyName) && Objects.equals(notes, that.notes); + } + + + /** + * Return has code based on properties. + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), confidence, steward, stewardTypeName, stewardPropertyName, notes); + } +} diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/ReferenceableProperties.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/ReferenceableProperties.java index e9908e5f0d8..fbf2fe75191 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/ReferenceableProperties.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/ReferenceableProperties.java @@ -29,14 +29,19 @@ @JsonSubTypes.Type(value = SchemaElementProperties.class, name = "SchemaElementProperties"), @JsonSubTypes.Type(value = SoftwareCapabilitiesProperties.class, name = "SoftwareCapabilitiesProperties"), @JsonSubTypes.Type(value = ValidValueSetProperties.class, name = "ValidValueSetProperties"), + @JsonSubTypes.Type(value = ValidValueProperties.class, name = "ValidValueProperties"), }) public class ReferenceableProperties implements Serializable { private static final long serialVersionUID = 1L; + private String qualifiedName = null; private Map additionalProperties = null; + private Date effectiveFrom = null; + private Date effectiveTo = null; + private Map vendorProperties = null; private String typeName = null; @@ -63,6 +68,9 @@ public ReferenceableProperties(ReferenceableProperties template) qualifiedName = template.getQualifiedName(); additionalProperties = template.getAdditionalProperties(); + effectiveFrom = template.getEffectiveFrom(); + effectiveTo = template.getEffectiveTo(); + vendorProperties = template.getVendorProperties(); typeName = template.getTypeName(); @@ -127,6 +135,50 @@ else if (additionalProperties.isEmpty()) } + /** + * Return the date/time that this element is effective from (null means effective from the epoch). + * + * @return date object + */ + public Date getEffectiveFrom() + { + return effectiveFrom; + } + + + /** + * Set up the date/time that this element is effective from (null means effective from the epoch). + * + * @param effectiveFrom date object + */ + public void setEffectiveFrom(Date effectiveFrom) + { + this.effectiveFrom = effectiveFrom; + } + + + /** + * Return the date/time that element is effective to (null means that it is effective indefinitely into the future). + * + * @return date object + */ + public Date getEffectiveTo() + { + return effectiveTo; + } + + + /** + * Set the date/time that element is effective to (null means that it is effective indefinitely into the future). + * + * @param effectiveTo date object + */ + public void setEffectiveTo(Date effectiveTo) + { + this.effectiveTo = effectiveTo; + } + + /** * Return specific properties for the data manager vendor. * @@ -226,12 +278,14 @@ public void setExtendedProperties(Map extendedProperties) public String toString() { return "ReferenceableProperties{" + - "qualifiedName='" + qualifiedName + '\'' + - ", additionalProperties=" + additionalProperties + - ", vendorProperties=" + vendorProperties + - ", typeName='" + typeName + '\'' + - ", extendedProperties=" + extendedProperties + - '}'; + "qualifiedName='" + qualifiedName + '\'' + + ", additionalProperties=" + additionalProperties + + ", effectiveFrom=" + effectiveFrom + + ", effectiveTo=" + effectiveTo + + ", vendorProperties=" + vendorProperties + + ", typeName='" + typeName + '\'' + + ", extendedProperties=" + extendedProperties + + '}'; } @@ -254,10 +308,12 @@ public boolean equals(Object objectToCompare) } ReferenceableProperties that = (ReferenceableProperties) objectToCompare; return Objects.equals(qualifiedName, that.qualifiedName) && - Objects.equals(additionalProperties, that.additionalProperties) && - Objects.equals(vendorProperties, that.vendorProperties) && - Objects.equals(typeName, that.typeName) && - Objects.equals(extendedProperties, that.extendedProperties); + Objects.equals(additionalProperties, that.additionalProperties) && + Objects.equals(effectiveFrom, that.effectiveFrom) && + Objects.equals(effectiveTo, that.effectiveTo) && + Objects.equals(vendorProperties, that.vendorProperties) && + Objects.equals(typeName, that.typeName) && + Objects.equals(extendedProperties, that.extendedProperties); } @@ -269,6 +325,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(qualifiedName, additionalProperties, vendorProperties, typeName, extendedProperties); + return Objects.hash(qualifiedName, additionalProperties, effectiveFrom, effectiveTo, vendorProperties, typeName, extendedProperties); } } \ No newline at end of file diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/RelationshipProperties.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/RelationshipProperties.java new file mode 100644 index 00000000000..f076637b6c8 --- /dev/null +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/RelationshipProperties.java @@ -0,0 +1,190 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.datamanager.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + +import java.io.Serializable; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * RelationshipProperties provides the base class for relationships items. This provides extended properties with the ability to + * set effectivity dates. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class RelationshipProperties implements Serializable +{ + private static final long serialVersionUID = 1L; + + private Date effectiveFrom = null; + private Date effectiveTo = null; + + private Map extendedProperties = null; + + + /** + * Default constructor + */ + public RelationshipProperties() + { + super(); + } + + + /** + * Copy/clone constructor. Retrieve values from the supplied template + * + * @param template element to copy + */ + public RelationshipProperties(RelationshipProperties template) + { + if (template != null) + { + effectiveFrom = template.getEffectiveFrom(); + effectiveTo = template.getEffectiveTo(); + extendedProperties = template.getExtendedProperties(); + } + } + + + /** + * Return the date/time that this element is effective from (null means effective from the epoch). + * + * @return date object + */ + public Date getEffectiveFrom() + { + return effectiveFrom; + } + + + /** + * Set up the date/time that this element is effective from (null means effective from the epoch). + * + * @param effectiveFrom date object + */ + public void setEffectiveFrom(Date effectiveFrom) + { + this.effectiveFrom = effectiveFrom; + } + + + /** + * Return the date/time that element is effective to (null means that it is effective indefinitely into the future). + * + * @return date object + */ + public Date getEffectiveTo() + { + return effectiveTo; + } + + + /** + * Set the date/time that element is effective to (null means that it is effective indefinitely into the future). + * + * @param effectiveTo date object + */ + public void setEffectiveTo(Date effectiveTo) + { + this.effectiveTo = effectiveTo; + } + + + /** + * Return the properties that have been defined for a subtype of this object that are not supported explicitly + * by this bean. + * + * @return property map + */ + public Map getExtendedProperties() + { + if (extendedProperties == null) + { + return null; + } + else if (extendedProperties.isEmpty()) + { + return null; + } + else + { + return new HashMap<>(extendedProperties); + } + } + + + /** + * Set up the properties that have been defined for a subtype of this object that are not supported explicitly + * by this bean. + * + * @param extendedProperties property map + */ + public void setExtendedProperties(Map extendedProperties) + { + this.extendedProperties = extendedProperties; + } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "RelationshipProperties{" + + "effectiveFrom=" + effectiveFrom + + ", effectiveTo=" + effectiveTo + + ", extendedProperties=" + extendedProperties + + '}'; + } + + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + RelationshipProperties that = (RelationshipProperties) objectToCompare; + return Objects.equals(effectiveFrom, that.effectiveFrom) && + Objects.equals(effectiveTo, that.effectiveTo); + } + + + /** + * Return has code based on properties. + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(effectiveFrom, effectiveTo); + } +} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/ValidValueAssignmentProperties.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/ValidValueAssignmentProperties.java new file mode 100644 index 00000000000..d010ff3d957 --- /dev/null +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/ValidValueAssignmentProperties.java @@ -0,0 +1,117 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.datamanager.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ValidValueAssignmentProperties describes the properties between a referenceable and its valid values. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ValidValueAssignmentProperties extends RelationshipProperties +{ + private static final long serialVersionUID = 1L; + + private boolean strictRequirement = true; + + + /** + * Default constructor + */ + public ValidValueAssignmentProperties() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ValidValueAssignmentProperties(ValidValueAssignmentProperties template) + { + super(template); + + if (template != null) + { + strictRequirement = template.getStrictRequirement(); + } + } + + + /** + * Return the strict requirement flag. + * + * @return boolean + */ + public boolean getStrictRequirement() + { + return strictRequirement; + } + + + /** + * Set up the strict requirement flag. + * + * @param strictRequirement string type name + */ + public void setStrictRequirement(boolean strictRequirement) + { + this.strictRequirement = strictRequirement; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ValidValueAssignmentProperties{" + "strictRequirement=" + strictRequirement + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + ValidValueAssignmentProperties that = (ValidValueAssignmentProperties) objectToCompare; + return strictRequirement == that.strictRequirement; + } + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(strictRequirement); + } +} diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/ValidValueMembershipProperties.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/ValidValueMembershipProperties.java new file mode 100644 index 00000000000..77af4153694 --- /dev/null +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/ValidValueMembershipProperties.java @@ -0,0 +1,128 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.datamanager.properties; + + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ValidValueMembershipProperties provides a flag to indicate if this value is the default value for the set. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ValidValueMembershipProperties extends RelationshipProperties +{ + private static final long serialVersionUID = 1L; + + boolean isDefaultValue = false; + + /** + * Default constructor + */ + public ValidValueMembershipProperties() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ValidValueMembershipProperties(ValidValueMembershipProperties template) + { + super(template); + + if (template != null) + { + this.isDefaultValue = template.getDefaultValue(); + } + } + + + /** + * Return whether it is a default value. + * + * @return flag + */ + public boolean getDefaultValue() + { + return isDefaultValue; + } + + + /** + * Set up whether it is a default value. + * + * @param defaultValue flag + */ + public void setDefaultValue(boolean defaultValue) + { + this.isDefaultValue = defaultValue; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ValidValueMembershipProperties{" + + "effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", extendedProperties=" + getExtendedProperties() + + ", isDefaultValue=" + isDefaultValue + + ", defaultValue=" + getDefaultValue() + + '}'; + } + + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (! super.equals(objectToCompare)) + { + return false; + } + ValidValueMembershipProperties that = (ValidValueMembershipProperties) objectToCompare; + return isDefaultValue == that.isDefaultValue; + } + + + /** + * Return has code based on properties. + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), isDefaultValue); + } +} diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/ValidValueProperties.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/ValidValueProperties.java new file mode 100644 index 00000000000..f2b67fdf9d9 --- /dev/null +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/ValidValueProperties.java @@ -0,0 +1,261 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.datamanager.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ValidValueProperties provides the common super class for ValidValueSet and ValidValueDefinition. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ValidValueProperties extends ReferenceableProperties +{ + private static final long serialVersionUID = 1L; + + private String displayName = null; + private String description = null; + private String usage = null; + private String scope = null; + private String preferredValue = null; + private boolean isDeprecated = false; + + + /** + * Constructor + */ + public ValidValueProperties() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ValidValueProperties(ValidValueProperties template) + { + super(template); + + if (template != null) + { + displayName = template.getDisplayName(); + description = template.getDescription(); + usage = template.getUsage(); + scope = template.getScope(); + preferredValue = template.getPreferredValue(); + isDeprecated = template.getIsDeprecated(); + } + } + + + /** + * Returns the stored display name property for the valid value. + * If no display name is available then null is returned. + * + * @return String name + */ + public String getDisplayName() + { + return displayName; + } + + + /** + * Set up the stored display name property for the valid value. + * + * @param displayName String name + */ + public void setDisplayName(String displayName) + { + this.displayName = displayName; + } + + + /** + * Returns the stored description property for the valid value. + * If no description is provided then null is returned. + * + * @return description String text + */ + public String getDescription() + { + return description; + } + + + /** + * Set up the stored description property associated with the valid value. + * + * @param description String text + */ + public void setDescription(String description) + { + this.description = description; + } + + + /** + * Return the description of how this valid value should be used. + * + * @return String text + */ + public String getUsage() + { + return usage; + } + + + /** + * Set up the description of how this valid value should be used. + * + * @param usage String text + */ + public void setUsage(String usage) + { + this.usage = usage; + } + + + /** + * Return the scope of values that this valid value covers (normally used with sets) + * + * @return String text + */ + public String getScope() + { + return scope; + } + + + /** + * Set up the scope of values that this valid value covers (normally used with sets) + * + * @param scope String text + */ + public void setScope(String scope) + { + this.scope = scope; + } + + + /** + * Return the preferred values to use in implementations (normally used with definitions) + * + * @return String value + */ + public String getPreferredValue() + { + return preferredValue; + } + + + /** + * Set up the preferred values to use in implementations (normally used with definitions) + * + * @param preferredValue String value + */ + public void setPreferredValue(String preferredValue) + { + this.preferredValue = preferredValue; + } + + + /** + * Is the valid value deprecated? + * + * @return boolean flag + */ + public boolean getIsDeprecated() + { + return isDeprecated; + } + + + /** + * Set whether the valid value is deprecated or not. Default is false. + * + * @param deprecated boolean flag + */ + public void setIsDeprecated(boolean deprecated) + { + isDeprecated = deprecated; + } + + /** + * Generate a string containing the properties. + * + * @return string value + */ + @Override + public String toString() + { + return "ValidValueProperties{" + + "qualifiedName='" + getQualifiedName() + '\'' + + ", additionalProperties=" + getAdditionalProperties() + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", vendorProperties=" + getVendorProperties() + + ", typeName='" + getTypeName() + '\'' + + ", extendedProperties=" + getExtendedProperties() + + ", displayName='" + displayName + '\'' + + ", description='" + description + '\'' + + ", usage='" + usage + '\'' + + ", scope='" + scope + '\'' + + ", preferredValue='" + preferredValue + '\'' + + ", isDeprecated=" + isDeprecated + + '}'; + } + + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + ValidValueProperties that = (ValidValueProperties) objectToCompare; + return Objects.equals(displayName, that.displayName) && + Objects.equals(description, that.description) && + Objects.equals(usage, that.usage) && + Objects.equals(scope, that.scope) && + Objects.equals(isDeprecated, that.isDeprecated) && + Objects.equals(preferredValue, that.preferredValue); + } + + + /** + * Return has code based on properties. + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), displayName, description, usage, scope, preferredValue, isDeprecated); + } +} diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/ClassificationRequestBody.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/ClassificationRequestBody.java new file mode 100644 index 00000000000..552e1d4d67c --- /dev/null +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/ClassificationRequestBody.java @@ -0,0 +1,129 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.datamanager.rest; + + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.datamanager.properties.ClassificationProperties; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + + +/** + * ClassificationRequestBody describes the request body used when attaching classification to elements. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ClassificationRequestBody extends ExternalSourceRequestBody +{ + private static final long serialVersionUID = 1L; + + private ClassificationProperties properties = null; + + + /** + * Default constructor + */ + public ClassificationRequestBody() + { + super(); + } + + + /** + * Copy/clone constructor. + * + * @param template object to copy + */ + public ClassificationRequestBody(ClassificationRequestBody template) + { + super(template); + + if (template != null) + { + properties = template.getProperties(); + } + } + + + /** + * Return the properties for the classification. + * + * @return properties object + */ + public ClassificationProperties getProperties() + { + return properties; + } + + + /** + * Set up the properties for the classification. + * + * @param properties properties object + */ + public void setProperties(ClassificationProperties properties) + { + this.properties = properties; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ClassificationRequestBody{" + + "externalSourceGUID='" + getExternalSourceGUID() + '\'' + + ", externalSourceName='" + getExternalSourceName() + '\'' + + ", properties=" + properties + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + ClassificationRequestBody that = (ClassificationRequestBody) objectToCompare; + return Objects.equals(getProperties(), that.getProperties()); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), properties); + } +} diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/ExternalSourceRequestBody.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/ExternalSourceRequestBody.java new file mode 100644 index 00000000000..9e4ea60585f --- /dev/null +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/ExternalSourceRequestBody.java @@ -0,0 +1,145 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.datamanager.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ExternalSourceRequestBody carries the parameters for marking an asset or schema as external. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ExternalSourceRequestBody extends DataManagerOMASAPIRequestBody +{ + private static final long serialVersionUID = 1L; + + private String externalSourceGUID = null; + private String externalSourceName = null; + + + /** + * Default constructor + */ + public ExternalSourceRequestBody() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ExternalSourceRequestBody(ExternalSourceRequestBody template) + { + super(template); + + if (template != null) + { + externalSourceGUID = template.getExternalSourceGUID(); + externalSourceName = template.getExternalSourceName(); + } + } + + + /** + * Return the unique identifier of the software server capability entity that represented the external source - null for local. + * + * @return string guid + */ + public String getExternalSourceGUID() + { + return externalSourceGUID; + } + + + /** + * Set up the unique identifier of the software server capability entity that represented the external source - null for local. + * + * @param externalSourceGUID string guid + */ + public void setExternalSourceGUID(String externalSourceGUID) + { + this.externalSourceGUID = externalSourceGUID; + } + + + /** + * Return the unique name of the software server capability entity that represented the external source. + * + * @return string name + */ + public String getExternalSourceName() + { + return externalSourceName; + } + + + /** + * Set up the unique name of the software server capability entity that represented the external source. + * + * @param externalSourceName string name + */ + public void setExternalSourceName(String externalSourceName) + { + this.externalSourceName = externalSourceName; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ExternalSourceRequestBody{" + + "externalSourceGUID='" + externalSourceGUID + '\'' + + ", externalSourceName='" + externalSourceName + '\'' + + '}'; + } + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + ExternalSourceRequestBody that = (ExternalSourceRequestBody) objectToCompare; + return Objects.equals(externalSourceGUID, that.externalSourceGUID) && + Objects.equals(externalSourceName, that.externalSourceName); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), externalSourceGUID, externalSourceName); + } +} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/ReferenceableRequestBody.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/ReferenceableRequestBody.java new file mode 100644 index 00000000000..532761403b1 --- /dev/null +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/ReferenceableRequestBody.java @@ -0,0 +1,129 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.datamanager.rest; + + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.datamanager.properties.ReferenceableProperties; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + + +/** + * RelationshipRequestBody describes the request body used when linking elements together. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ReferenceableRequestBody extends ExternalSourceRequestBody +{ + private static final long serialVersionUID = 1L; + + private ReferenceableProperties properties = null; + + + /** + * Default constructor + */ + public ReferenceableRequestBody() + { + super(); + } + + + /** + * Copy/clone constructor. + * + * @param template object to copy + */ + public ReferenceableRequestBody(ReferenceableRequestBody template) + { + super(template); + + if (template != null) + { + properties = template.getProperties(); + } + } + + + /** + * Return the properties for the relationship. + * + * @return properties object + */ + public ReferenceableProperties getProperties() + { + return properties; + } + + + /** + * Set up the properties for the relationship. + * + * @param properties properties object + */ + public void setProperties(ReferenceableProperties properties) + { + this.properties = properties; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ReferenceableRequestBody{" + + "externalSourceGUID='" + getExternalSourceGUID() + '\'' + + ", externalSourceName='" + getExternalSourceName() + '\'' + + ", properties=" + properties + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + ReferenceableRequestBody that = (ReferenceableRequestBody) objectToCompare; + return Objects.equals(getProperties(), that.getProperties()); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), properties); + } +} diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/RelatedElementListResponse.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/RelatedElementListResponse.java new file mode 100644 index 00000000000..47a56f463c2 --- /dev/null +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/RelatedElementListResponse.java @@ -0,0 +1,148 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.datamanager.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.datamanager.metadataelements.RelatedElement; + +import java.util.Arrays; +import java.util.List; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * RelatedElementListResponse is a response object for passing back a list of relatedElement objects. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class RelatedElementListResponse extends DataManagerOMASAPIResponse +{ + private static final long serialVersionUID = 1L; + + private List elementList = null; + + + /** + * Default constructor + */ + public RelatedElementListResponse() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public RelatedElementListResponse(RelatedElementListResponse template) + { + super(template); + + if (template != null) + { + elementList = template.getElementList(); + } + } + + + /** + * Return the list of metadata elements. + * + * @return result object + */ + public List getElementList() + { + if (elementList == null) + { + return null; + } + else if (elementList.isEmpty()) + { + return null; + } + else + { + return elementList; + } + } + + + /** + * Set up the list of metadata elements to return. + * + * @param elements result object + */ + public void setElementList(List elements) + { + this.elementList = elements; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "RelatedElementListResponse{" + + "element=" + elementList + + ", exceptionClassName='" + getExceptionClassName() + '\'' + + ", exceptionCausedBy='" + getExceptionCausedBy() + '\'' + + ", actionDescription='" + getActionDescription() + '\'' + + ", relatedHTTPCode=" + getRelatedHTTPCode() + + ", exceptionErrorMessage='" + getExceptionErrorMessage() + '\'' + + ", exceptionErrorMessageId='" + getExceptionErrorMessageId() + '\'' + + ", exceptionErrorMessageParameters=" + Arrays.toString(getExceptionErrorMessageParameters()) + + ", exceptionSystemAction='" + getExceptionSystemAction() + '\'' + + ", exceptionUserAction='" + getExceptionUserAction() + '\'' + + ", exceptionProperties=" + getExceptionProperties() + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + RelatedElementListResponse that = (RelatedElementListResponse) objectToCompare; + return Objects.equals(elementList, that.elementList); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), elementList); + } +} diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/RelationshipElementResponse.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/RelationshipElementResponse.java new file mode 100644 index 00000000000..32099b687ac --- /dev/null +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/RelationshipElementResponse.java @@ -0,0 +1,139 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.datamanager.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.datamanager.metadataelements.RelationshipElement; + +import java.util.Arrays; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + + +/** + * RelationshipElementResponse is the response structure used on the OMAS REST API calls that return the properties + * for a relationship. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class RelationshipElementResponse extends DataManagerOMASAPIResponse +{ + private static final long serialVersionUID = 1L; + + private RelationshipElement element = null; + + + /** + * Default constructor + */ + public RelationshipElementResponse() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public RelationshipElementResponse(RelationshipElementResponse template) + { + super(template); + + if (template != null) + { + this.element = template.getElement(); + } + } + + + /** + * Return the element result. + * + * @return bean + */ + public RelationshipElement getElement() + { + return element; + } + + + /** + * Set up the element result. + * + * @param element bean + */ + public void setElement(RelationshipElement element) + { + this.element = element; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "RelationshipElementResponse{" + + "element=" + element + + ", exceptionClassName='" + getExceptionClassName() + '\'' + + ", exceptionCausedBy='" + getExceptionCausedBy() + '\'' + + ", actionDescription='" + getActionDescription() + '\'' + + ", relatedHTTPCode=" + getRelatedHTTPCode() + + ", exceptionErrorMessage='" + getExceptionErrorMessage() + '\'' + + ", exceptionErrorMessageId='" + getExceptionErrorMessageId() + '\'' + + ", exceptionErrorMessageParameters=" + Arrays.toString(getExceptionErrorMessageParameters()) + + ", exceptionSystemAction='" + getExceptionSystemAction() + '\'' + + ", exceptionUserAction='" + getExceptionUserAction() + '\'' + + ", exceptionProperties=" + getExceptionProperties() + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (!(objectToCompare instanceof RelationshipElementResponse)) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + RelationshipElementResponse that = (RelationshipElementResponse) objectToCompare; + return Objects.equals(element, that.element); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(element); + } +} diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/RelationshipElementsResponse.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/RelationshipElementsResponse.java new file mode 100644 index 00000000000..22e721f7289 --- /dev/null +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/RelationshipElementsResponse.java @@ -0,0 +1,150 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.datamanager.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.datamanager.metadataelements.RelationshipElement; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * RelationshipElementsResponse is a response object for passing back a list of relationships + * or an exception if the request failed. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class RelationshipElementsResponse extends DataManagerOMASAPIResponse +{ + private static final long serialVersionUID = 1L; + + private List elementList = null; + + + /** + * Default constructor + */ + public RelationshipElementsResponse() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public RelationshipElementsResponse(RelationshipElementsResponse template) + { + super(template); + + if (template != null) + { + elementList = template.getElementList(); + } + } + + + /** + * Return the list of metadata elements. + * + * @return result object + */ + public List getElementList() + { + if (elementList == null) + { + return null; + } + else if (elementList.isEmpty()) + { + return null; + } + else + { + return new ArrayList<>(elementList); + } + } + + + /** + * Set up the metadata element to return. + * + * @param elementList result object + */ + public void setElementList(List elementList) + { + this.elementList = elementList; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "RelationshipElementsResponse{" + + "elementList=" + elementList + + ", exceptionClassName='" + getExceptionClassName() + '\'' + + ", exceptionCausedBy='" + getExceptionCausedBy() + '\'' + + ", actionDescription='" + getActionDescription() + '\'' + + ", relatedHTTPCode=" + getRelatedHTTPCode() + + ", exceptionErrorMessage='" + getExceptionErrorMessage() + '\'' + + ", exceptionErrorMessageId='" + getExceptionErrorMessageId() + '\'' + + ", exceptionErrorMessageParameters=" + Arrays.toString(getExceptionErrorMessageParameters()) + + ", exceptionSystemAction='" + getExceptionSystemAction() + '\'' + + ", exceptionUserAction='" + getExceptionUserAction() + '\'' + + ", exceptionProperties=" + getExceptionProperties() + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + RelationshipElementsResponse that = (RelationshipElementsResponse) objectToCompare; + return Objects.equals(elementList, that.elementList); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), elementList); + } +} diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/RelationshipRequestBody.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/RelationshipRequestBody.java new file mode 100644 index 00000000000..dea83290eb6 --- /dev/null +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/RelationshipRequestBody.java @@ -0,0 +1,129 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.datamanager.rest; + + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.datamanager.properties.RelationshipProperties; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + + +/** + * RelationshipRequestBody describes the request body used when linking elements together. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class RelationshipRequestBody extends ExternalSourceRequestBody +{ + private static final long serialVersionUID = 1L; + + private RelationshipProperties properties = null; + + + /** + * Default constructor + */ + public RelationshipRequestBody() + { + super(); + } + + + /** + * Copy/clone constructor. + * + * @param template object to copy + */ + public RelationshipRequestBody(RelationshipRequestBody template) + { + super(template); + + if (template != null) + { + properties = template.getProperties(); + } + } + + + /** + * Return the properties for the relationship. + * + * @return properties object + */ + public RelationshipProperties getProperties() + { + return properties; + } + + + /** + * Set up the properties for the relationship. + * + * @param properties properties object + */ + public void setProperties(RelationshipProperties properties) + { + this.properties = properties; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "RelationshipRequestBody{" + + "externalSourceGUID='" + getExternalSourceGUID() + '\'' + + ", externalSourceName='" + getExternalSourceName() + '\'' + + ", properties=" + properties + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + RelationshipRequestBody that = (RelationshipRequestBody) objectToCompare; + return Objects.equals(getProperties(), that.getProperties()); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), properties); + } +} diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/ValidValueListResponse.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/ValidValueListResponse.java new file mode 100644 index 00000000000..aeb209e8cd6 --- /dev/null +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/ValidValueListResponse.java @@ -0,0 +1,148 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.datamanager.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.datamanager.metadataelements.ValidValueElement; + +import java.util.Arrays; +import java.util.List; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ValidValueListResponse is a response object for passing back a list of valid value objects. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ValidValueListResponse extends DataManagerOMASAPIResponse +{ + private static final long serialVersionUID = 1L; + + private List elementList = null; + + + /** + * Default constructor + */ + public ValidValueListResponse() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ValidValueListResponse(ValidValueListResponse template) + { + super(template); + + if (template != null) + { + elementList = template.getElementList(); + } + } + + + /** + * Return the list of metadata elements. + * + * @return result object + */ + public List getElementList() + { + if (elementList == null) + { + return null; + } + else if (elementList.isEmpty()) + { + return null; + } + else + { + return elementList; + } + } + + + /** + * Set up the list of metadata elements to return. + * + * @param elementList result object + */ + public void setElementList(List elementList) + { + this.elementList = elementList; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ValidValueListResponse{" + + "element=" + elementList + + ", exceptionClassName='" + getExceptionClassName() + '\'' + + ", exceptionCausedBy='" + getExceptionCausedBy() + '\'' + + ", actionDescription='" + getActionDescription() + '\'' + + ", relatedHTTPCode=" + getRelatedHTTPCode() + + ", exceptionErrorMessage='" + getExceptionErrorMessage() + '\'' + + ", exceptionErrorMessageId='" + getExceptionErrorMessageId() + '\'' + + ", exceptionErrorMessageParameters=" + Arrays.toString(getExceptionErrorMessageParameters()) + + ", exceptionSystemAction='" + getExceptionSystemAction() + '\'' + + ", exceptionUserAction='" + getExceptionUserAction() + '\'' + + ", exceptionProperties=" + getExceptionProperties() + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + ValidValueListResponse that = (ValidValueListResponse) objectToCompare; + return Objects.equals(elementList, that.elementList); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), elementList); + } +} diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/ValidValueResponse.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/ValidValueResponse.java new file mode 100644 index 00000000000..e96951119de --- /dev/null +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/ValidValueResponse.java @@ -0,0 +1,136 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.datamanager.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.datamanager.metadataelements.ValidValueElement; + +import java.util.Arrays; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ValidValueResponse is a response object for passing back a single valid value object. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ValidValueResponse extends DataManagerOMASAPIResponse +{ + private static final long serialVersionUID = 1L; + + private ValidValueElement element = null; + + + /** + * Default constructor + */ + public ValidValueResponse() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ValidValueResponse(ValidValueResponse template) + { + super(template); + + if (template != null) + { + element = template.getElement(); + } + } + + + /** + * Return the metadata element. + * + * @return result object + */ + public ValidValueElement getElement() + { + return element; + } + + + /** + * Set up the metadata element to return. + * + * @param element result object + */ + public void setElement(ValidValueElement element) + { + this.element = element; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ValidValueResponse{" + + "element=" + element + + ", exceptionClassName='" + getExceptionClassName() + '\'' + + ", exceptionCausedBy='" + getExceptionCausedBy() + '\'' + + ", actionDescription='" + getActionDescription() + '\'' + + ", relatedHTTPCode=" + getRelatedHTTPCode() + + ", exceptionErrorMessage='" + getExceptionErrorMessage() + '\'' + + ", exceptionErrorMessageId='" + getExceptionErrorMessageId() + '\'' + + ", exceptionErrorMessageParameters=" + Arrays.toString(getExceptionErrorMessageParameters()) + + ", exceptionSystemAction='" + getExceptionSystemAction() + '\'' + + ", exceptionUserAction='" + getExceptionUserAction() + '\'' + + ", exceptionProperties=" + getExceptionProperties() + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + ValidValueResponse that = (ValidValueResponse) objectToCompare; + return Objects.equals(element, that.element); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), element); + } +} diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/DataManagerBaseClient.java b/open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/DataManagerBaseClient.java new file mode 100644 index 00000000000..e1ade470e07 --- /dev/null +++ b/open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/DataManagerBaseClient.java @@ -0,0 +1,607 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.datamanager.client; + +import org.odpi.openmetadata.accessservices.datamanager.metadataelements.RelatedElement; +import org.odpi.openmetadata.accessservices.datamanager.properties.ClassificationProperties; +import org.odpi.openmetadata.accessservices.datamanager.properties.ReferenceableProperties; +import org.odpi.openmetadata.accessservices.datamanager.properties.RelationshipProperties; +import org.odpi.openmetadata.accessservices.datamanager.properties.TemplateProperties; +import org.odpi.openmetadata.accessservices.datamanager.rest.ClassificationRequestBody; +import org.odpi.openmetadata.accessservices.datamanager.rest.ExternalSourceRequestBody; +import org.odpi.openmetadata.accessservices.datamanager.rest.ReferenceableRequestBody; +import org.odpi.openmetadata.accessservices.datamanager.rest.RelatedElementListResponse; +import org.odpi.openmetadata.accessservices.datamanager.rest.RelationshipRequestBody; +import org.odpi.openmetadata.accessservices.datamanager.rest.TemplateRequestBody; +import org.odpi.openmetadata.accessservices.datamanager.client.rest.DataManagerRESTClient; +import org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler; +import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDResponse; +import org.odpi.openmetadata.frameworks.auditlog.AuditLog; +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; + +import java.util.List; + +/** + * DataManagerBaseClient supports the common properties and functions for the Data Manager OMAS. + */ +public class DataManagerBaseClient +{ + final String serverName; /* Initialized in constructor */ + final String serverPlatformURLRoot; /* Initialized in constructor */ + + final InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); + final DataManagerRESTClient restClient; /* Initialized in constructor */ + + + /** + * Create a new client with no authentication embedded in the HTTP request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @param auditLog logging destination + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public DataManagerBaseClient(String serverName, + String serverPlatformURLRoot, + AuditLog auditLog) throws InvalidParameterException + { + final String methodName = "Client Constructor"; + + invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); + + this.serverName = serverName; + this.serverPlatformURLRoot = serverPlatformURLRoot; + + this.restClient = new DataManagerRESTClient(serverName, serverPlatformURLRoot, auditLog); + } + + + /** + * Create a new client with no authentication embedded in the HTTP request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public DataManagerBaseClient(String serverName, + String serverPlatformURLRoot) throws InvalidParameterException + { + final String methodName = "Client Constructor"; + + invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); + + this.serverName = serverName; + this.serverPlatformURLRoot = serverPlatformURLRoot; + + this.restClient = new DataManagerRESTClient(serverName, serverPlatformURLRoot); + } + + + /** + * Create a new client that passes userId and password in each HTTP request. This is the + * userId/password of the calling server. The end user's userId is sent on each request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @param userId caller's userId embedded in all HTTP requests + * @param password caller's userId embedded in all HTTP requests + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public DataManagerBaseClient(String serverName, + String serverPlatformURLRoot, + String userId, + String password) throws InvalidParameterException + { + final String methodName = "Client Constructor"; + + invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); + + this.serverName = serverName; + this.serverPlatformURLRoot = serverPlatformURLRoot; + + this.restClient = new DataManagerRESTClient(serverName, serverPlatformURLRoot, userId, password); + } + + + /** + * Create a new client that passes userId and password in each HTTP request. This is the + * userId/password of the calling server. The end user's userId is sent on each request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @param userId caller's userId embedded in all HTTP requests + * @param password caller's userId embedded in all HTTP requests + * @param auditLog logging destination + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public DataManagerBaseClient(String serverName, + String serverPlatformURLRoot, + String userId, + String password, + AuditLog auditLog) throws InvalidParameterException + { + final String methodName = "Client Constructor"; + + invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); + + this.serverName = serverName; + this.serverPlatformURLRoot = serverPlatformURLRoot; + + this.restClient = new DataManagerRESTClient(serverName, serverPlatformURLRoot, userId, password, auditLog); + } + + + /** + * Create a new client that is going to be used in an OMAG Server. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @param restClient client that issues the REST API calls + * @param maxPageSize maximum number of results supported by this server + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public DataManagerBaseClient(String serverName, + String serverPlatformURLRoot, + DataManagerRESTClient restClient, + int maxPageSize) throws InvalidParameterException + { + final String methodName = "Client Constructor"; + + invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); + + this.serverName = serverName; + this.serverPlatformURLRoot = serverPlatformURLRoot; + + invalidParameterHandler.setMaxPagingSize(maxPageSize); + + this.restClient = restClient; + } + + + /* ===================================================================================================================== + * Basic client methods + */ + + + /** + * Create a new metadata element. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param properties properties about the element to store + * @param propertiesParameterName name of parameter passing the properties + * @param urlTemplate URL to call (no expected placeholders) + * @param methodName calling method + * + * @return unique identifier of the new element + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + String createReferenceable(String userId, + String externalSourceGUID, + String externalSourceName, + ReferenceableProperties properties, + String propertiesParameterName, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String qualifiedNameParameterName = "qualifiedName"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateObject(properties, propertiesParameterName, methodName); + invalidParameterHandler.validateName(properties.getQualifiedName(), qualifiedNameParameterName, methodName); + + ReferenceableRequestBody requestBody = new ReferenceableRequestBody(); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + requestBody.setProperties(properties); + + GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId); + + return restResult.getGUID(); + } + + + /** + * Create a new metadata element to represent a community using an existing metadata element as a template. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param templateGUID unique identifier of the metadata element to copy + * @param templateProperties properties that override the template + * @param urlTemplate URL to call (with placeholders) + * @param methodName calling method + * + * @return unique identifier of the new community + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + String createReferenceableFromTemplate(String userId, + String externalSourceGUID, + String externalSourceName, + String templateGUID, + TemplateProperties templateProperties, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String templateGUIDParameterName = "templateGUID"; + final String propertiesParameterName = "templateProperties"; + final String qualifiedNameParameterName = "qualifiedName"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(templateGUID, templateGUIDParameterName, methodName); + invalidParameterHandler.validateObject(templateProperties, propertiesParameterName, methodName); + invalidParameterHandler.validateName(templateProperties.getQualifiedName(), qualifiedNameParameterName, methodName); + + TemplateRequestBody requestBody = new TemplateRequestBody(templateProperties); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + + GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + templateGUID); + + return restResult.getGUID(); + } + + + /** + * Update the metadata element. It is possible to use the subtype property classes or + * set up specialized properties in extended properties. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the metadata element to update + * @param elementGUIDParameterName name of parameter passing the elementGUID + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param properties new properties for the metadata element + * @param propertiesParameterName name of parameter passing the properties + * @param urlTemplate URL to call (no expected placeholders) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void updateReferenceable(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String elementGUIDParameterName, + boolean isMergeUpdate, + ReferenceableProperties properties, + String propertiesParameterName, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String qualifiedNameParameterName = "qualifiedName"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameterName, methodName); + invalidParameterHandler.validateObject(properties, propertiesParameterName, methodName); + + if (! isMergeUpdate) + { + invalidParameterHandler.validateName(properties.getQualifiedName(), qualifiedNameParameterName, methodName); + } + + ReferenceableRequestBody requestBody = new ReferenceableRequestBody(); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + requestBody.setProperties(properties); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + elementGUID, + isMergeUpdate); + } + + + /** + * Add or update classification on referenceable. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the metadata element to classify + * @param elementGUIDParameter parameter name for elementGUID + * @param properties properties of security at the site + * @param urlTemplate URL to call with placeholder for guid + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void setReferenceableClassification(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String elementGUIDParameter, + ClassificationProperties properties, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + + { + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameter, methodName); + + ClassificationRequestBody requestBody = new ClassificationRequestBody(); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + requestBody.setProperties(properties); + + restClient.callVoidPostRESTCall(methodName, + serverPlatformURLRoot + urlTemplate, + requestBody, + serverName, + userId, + elementGUID); + } + + + /** + * Remove classification from the referenceable. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the metadata element to classify + * @param elementGUIDParameter parameter name for elementGUID + * @param urlTemplate URL to call with placeholder for guid + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void removeReferenceableClassification(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String elementGUIDParameter, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + + { + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameter, methodName); + + ExternalSourceRequestBody requestBody = new ExternalSourceRequestBody(); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + + restClient.callVoidPostRESTCall(methodName, + serverPlatformURLRoot + urlTemplate, + requestBody, + serverName, + userId, + elementGUID); + } + + + /** + * Create a relationship between a primary element and a secondary element. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param primaryElementGUID unique identifier of the primary element + * @param primaryElementGUIDParameterName name of parameter passing the primaryElementGUID + * @param properties describes the properties for the relationship + * @param secondaryElementGUID unique identifier of the element to connect it to + * @param secondaryElementGUIDParameterName name of parameter passing the secondaryElementGUID + * @param urlTemplate URL to call (no expected placeholders) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void setupRelationship(String userId, + String externalSourceGUID, + String externalSourceName, + String primaryElementGUID, + String primaryElementGUIDParameterName, + RelationshipProperties properties, + String secondaryElementGUID, + String secondaryElementGUIDParameterName, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(primaryElementGUID, primaryElementGUIDParameterName, methodName); + invalidParameterHandler.validateGUID(secondaryElementGUID, secondaryElementGUIDParameterName, methodName); + + RelationshipRequestBody requestBody = new RelationshipRequestBody(); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + requestBody.setProperties(properties); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + primaryElementGUID, + secondaryElementGUID); + } + + + /** + * Remove a relationship. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param primaryElementGUID unique identifier of the primary element + * @param primaryElementGUIDParameterName name of parameter passing the primaryElementGUID + * @param secondaryElementGUID unique identifier of the element to connect it to + * @param secondaryElementGUIDParameterName name of parameter passing the secondaryElementGUID + * @param urlTemplate URL to call (no expected placeholders) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void clearRelationship(String userId, + String externalSourceGUID, + String externalSourceName, + String primaryElementGUID, + String primaryElementGUIDParameterName, + String secondaryElementGUID, + String secondaryElementGUIDParameterName, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(primaryElementGUID, primaryElementGUIDParameterName, methodName); + invalidParameterHandler.validateGUID(secondaryElementGUID, secondaryElementGUIDParameterName, methodName); + + ExternalSourceRequestBody requestBody = new ExternalSourceRequestBody(); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + primaryElementGUID, + secondaryElementGUID); + } + + + /** + * Retrieve a relationship. + * + * @param userId calling user + * @param startingElementGUID unique identifier of the primary element + * @param startingElementGUIDParameterName name of parameter passing the startingElementGUID + * @param urlTemplate URL to call (no expected placeholders) + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * @param methodName calling method + * + * @return list of related elements + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + List getRelatedElements(String userId, + String startingElementGUID, + String startingElementGUIDParameterName, + String urlTemplate, + int startFrom, + int pageSize, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(startingElementGUID, startingElementGUIDParameterName, methodName); + + RelatedElementListResponse restResult = restClient.callRelatedElementListGetRESTCall(methodName, + urlTemplate, + serverName, + userId, + startingElementGUID, + Integer.toString(startFrom), + Integer.toString(pageSize)); + + return restResult.getElementList(); + } + + + /** + * Remove the metadata element. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the metadata element to remove + * @param elementGUIDParameterName name of parameter passing the elementGUID + * @param urlTemplate URL to call (no expected placeholders) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void removeReferenceable(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String elementGUIDParameterName, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameterName, methodName); + + ExternalSourceRequestBody requestBody = new ExternalSourceRequestBody(); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + elementGUID); + } +} diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/ValidValueManagement.java b/open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/ValidValueManagement.java new file mode 100644 index 00000000000..ffe055beb97 --- /dev/null +++ b/open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/ValidValueManagement.java @@ -0,0 +1,860 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.datamanager.client; + +import org.odpi.openmetadata.accessservices.datamanager.api.ValidValueManagementInterface; +import org.odpi.openmetadata.accessservices.datamanager.client.rest.DataManagerRESTClient; +import org.odpi.openmetadata.accessservices.datamanager.metadataelements.RelatedElement; +import org.odpi.openmetadata.accessservices.datamanager.metadataelements.ValidValueElement; +import org.odpi.openmetadata.accessservices.datamanager.properties.ReferenceValueAssignmentProperties; +import org.odpi.openmetadata.accessservices.datamanager.properties.ValidValueAssignmentProperties; +import org.odpi.openmetadata.accessservices.datamanager.properties.ValidValueMembershipProperties; +import org.odpi.openmetadata.accessservices.datamanager.properties.ValidValueProperties; +import org.odpi.openmetadata.accessservices.datamanager.rest.RelatedElementListResponse; +import org.odpi.openmetadata.accessservices.datamanager.rest.ValidValueListResponse; +import org.odpi.openmetadata.accessservices.datamanager.rest.ValidValueResponse; +import org.odpi.openmetadata.commonservices.ffdc.rest.NameRequestBody; +import org.odpi.openmetadata.commonservices.ffdc.rest.SearchStringRequestBody; +import org.odpi.openmetadata.frameworks.auditlog.AuditLog; +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; + +import java.util.List; + +/** + * ValidValueManagerClient supports the APIs to maintain valid values and their related objects. + */ +public class ValidValueManagement extends DataManagerBaseClient implements ValidValueManagementInterface +{ + private static final String validValueURLTemplatePrefix = "/servers/{0}/open-metadata/access-services/data-manager/users/{1}/valid-values"; + + + /** + * Create a new client with no authentication embedded in the HTTP request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @param auditLog logging destination + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public ValidValueManagement(String serverName, + String serverPlatformURLRoot, + AuditLog auditLog) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot, auditLog); + } + + + /** + * Create a new client with no authentication embedded in the HTTP request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public ValidValueManagement(String serverName, + String serverPlatformURLRoot) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot); + } + + + /** + * Create a new client that passes userId and password in each HTTP request. This is the + * userId/password of the calling server. The end user's userId is sent on each request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @param userId caller's userId embedded in all HTTP requests + * @param password caller's userId embedded in all HTTP requests + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public ValidValueManagement(String serverName, + String serverPlatformURLRoot, + String userId, + String password) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot, userId, password); + } + + + /** + * Create a new client that passes userId and password in each HTTP request. This is the + * userId/password of the calling server. The end user's userId is sent on each request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @param userId caller's userId embedded in all HTTP requests + * @param password caller's userId embedded in all HTTP requests + * @param auditLog logging destination + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public ValidValueManagement(String serverName, + String serverPlatformURLRoot, + String userId, + String password, + AuditLog auditLog) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot, userId, password, auditLog); + } + + + /** + * Create a new client that is going to be used in an OMAG Server. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @param restClient client that issues the REST API calls + * @param maxPageSize maximum number of results supported by this server + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public ValidValueManagement(String serverName, + String serverPlatformURLRoot, + DataManagerRESTClient restClient, + int maxPageSize) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot, restClient, maxPageSize); + } + + + /* ===================================================================================================================== + * A ValidValue is the top level object for working with connectors + */ + + /** + * Create a new metadata element to represent a valid value. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param validValueProperties properties about the valid value to store + * + * @return unique identifier of the new valid value + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public String createValidValue(String userId, + String externalSourceGUID, + String externalSourceName, + ValidValueProperties validValueProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "createValidValue"; + final String propertiesParameterName = "validValueProperties"; + final String urlTemplate = serverPlatformURLRoot + validValueURLTemplatePrefix; + + return super.createReferenceable(userId, externalSourceGUID, externalSourceName, validValueProperties, propertiesParameterName, urlTemplate, methodName); + } + + + /** + * Update the metadata element representing a valid value. It is possible to use the subtype property classes or + * set up specialized properties in extended properties. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param validValueGUID unique identifier of the metadata element to update + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param validValueProperties new properties for the metadata element + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void updateValidValue(String userId, + String externalSourceGUID, + String externalSourceName, + String validValueGUID, + boolean isMergeUpdate, + ValidValueProperties validValueProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "updateValidValue"; + final String elementGUIDParameterName = "validValueGUID"; + final String propertiesParameterName = "validValueProperties"; + final String urlTemplate = serverPlatformURLRoot + validValueURLTemplatePrefix + "/{2}?isMergeUpdate={3}"; + + super.updateReferenceable(userId, externalSourceGUID, externalSourceName, validValueGUID, elementGUIDParameterName, isMergeUpdate, validValueProperties, propertiesParameterName, urlTemplate, methodName); + } + + + /** + * Create a membership relationship between a validValue and a validValueSet that it belongs to. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param validValueSetGUID unique identifier of the valid value set + * @param properties describes the properties of the membership + * @param validValueMemberGUID unique identifier of the member + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void setupValidValueMember(String userId, + String externalSourceGUID, + String externalSourceName, + String validValueSetGUID, + ValidValueMembershipProperties properties, + String validValueMemberGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "setupValidValueMember"; + final String validValueSetGUIDParameterName = "validValueSetGUID"; + final String validValueMemberGUIDParameterName = "validValueMemberGUID"; + final String urlTemplate = serverPlatformURLRoot + validValueURLTemplatePrefix + "/{2}/valid-value-members/{3}"; + + super.setupRelationship(userId, externalSourceGUID, externalSourceName, validValueSetGUID, validValueSetGUIDParameterName, properties, validValueMemberGUID, validValueMemberGUIDParameterName, urlTemplate, methodName); + } + + + /** + * Remove a membership relationship between a validValue and a validValueSet that it belongs to. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param validValueSetGUID unique identifier of the valid value set + * @param validValueMemberGUID unique identifier of the member + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void clearValidValueMember(String userId, + String externalSourceGUID, + String externalSourceName, + String validValueSetGUID, + String validValueMemberGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "clearValidValueMember"; + final String validValueSetGUIDParameterName = "validValueSetGUID"; + final String validValueMemberGUIDParameterName = "validValueMemberGUID"; + final String urlTemplate = serverPlatformURLRoot + validValueURLTemplatePrefix + "/{2}/valid-value-members/{3}/delete"; + + super.clearRelationship(userId, + externalSourceGUID, + externalSourceName, + validValueSetGUID, + validValueSetGUIDParameterName, + validValueMemberGUID, + validValueMemberGUIDParameterName, + urlTemplate, + methodName); + } + + + /** + * Create a valid value assignment relationship between an element and a valid value (typically, a valid value set) to show that + * the valid value defines the values that can be stored in the data item that the element represents. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param properties describes the permissions that the role has in the validValue + * @param validValueGUID unique identifier of the valid value + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void setupValidValues(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + ValidValueAssignmentProperties properties, + String validValueGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "setupValidValues"; + final String elementGUIDParameterName = "elementGUID"; + final String validValueGUIDParameterName = "validValueGUID"; + + final String urlTemplate = serverPlatformURLRoot + validValueURLTemplatePrefix + "/{2}/valid-values/{3}"; + + super.setupRelationship(userId, externalSourceGUID, externalSourceName, elementGUID, elementGUIDParameterName, properties, validValueGUID, validValueGUIDParameterName, urlTemplate, methodName); + } + + + /** + * Remove a valid value assignment relationship between an element and a valid value. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param validValueGUID unique identifier of the valid value + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void clearValidValues(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String validValueGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "clearValidValues"; + final String elementGUIDParameterName = "elementGUID"; + final String validValueGUIDParameterName = "validValueGUID"; + final String urlTemplate = serverPlatformURLRoot + validValueURLTemplatePrefix + "/{2}/valid-values/{3}/delete"; + + super.clearRelationship(userId, + externalSourceGUID, + externalSourceName, + elementGUID, + elementGUIDParameterName, + validValueGUID, + validValueGUIDParameterName, + urlTemplate, + methodName); + } + + + /** + * Create a reference value assignment relationship between an element and a valid value to show that + * the valid value is a semiformal tag/classification. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param properties describes the quality of the assignment + * @param validValueGUID unique identifier of the valid value + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void setupReferenceValueTag(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + ReferenceValueAssignmentProperties properties, + String validValueGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "setupReferenceValueTag"; + final String elementGUIDParameterName = "elementGUID"; + final String validValueGUIDParameterName = "validValueGUID"; + + final String urlTemplate = serverPlatformURLRoot + validValueURLTemplatePrefix + "/{2}/reference-value-tags/{3}"; + + super.setupRelationship(userId, externalSourceGUID, externalSourceName, elementGUID, elementGUIDParameterName, properties, validValueGUID, validValueGUIDParameterName, urlTemplate, methodName); + } + + + /** + * Remove a reference value assignment relationship between an element and a valid value. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param validValueGUID unique identifier of the valid value + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void clearReferenceValueTag(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String validValueGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "clearReferenceValueTag"; + final String elementGUIDParameterName = "elementGUID"; + final String validValueGUIDParameterName = "validValueGUID"; + final String urlTemplate = serverPlatformURLRoot + validValueURLTemplatePrefix + "/{2}/reference-value-tags/{3}/delete"; + + super.clearRelationship(userId, + externalSourceGUID, + externalSourceName, + elementGUID, + elementGUIDParameterName, + validValueGUID, + validValueGUIDParameterName, + urlTemplate, + methodName); + } + + + /** + * Remove the metadata element representing a valid value. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param validValueGUID unique identifier of the metadata element to remove + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public void removeValidValue(String userId, + String externalSourceGUID, + String externalSourceName, + String validValueGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "removeValidValue"; + final String elementGUIDParameterName = "validValueGUID"; + final String urlTemplate = serverPlatformURLRoot + validValueURLTemplatePrefix + "/{2}/delete"; + + super.removeReferenceable(userId, externalSourceGUID, externalSourceName, validValueGUID, elementGUIDParameterName, urlTemplate, methodName); + } + + + /** + * Retrieve the list of metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param userId calling user + * @param searchString string to find in the properties + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public List findValidValues(String userId, + String searchString, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "findValidValue"; + final String searchStringParameterName = "searchString"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateSearchString(searchString, searchStringParameterName, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = serverPlatformURLRoot + validValueURLTemplatePrefix + "/by-search-string?startFrom={2}&pageSize={3}"; + + SearchStringRequestBody requestBody = new SearchStringRequestBody(); + + requestBody.setSearchString(searchString); + requestBody.setSearchStringParameterName(searchStringParameterName); + + ValidValueListResponse restResult = restClient.callValidValueListPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + startFrom, + validatedPageSize); + + return restResult.getElementList(); + } + + + /** + * Retrieve the list of metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param userId calling user + * @param name name to search for + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public List getValidValuesByName(String userId, + String name, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getValidValueByName"; + final String nameParameterName = "name"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateName(name, nameParameterName, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = serverPlatformURLRoot + validValueURLTemplatePrefix + "/by-name?startFrom={2}&pageSize={3}"; + + NameRequestBody requestBody = new NameRequestBody(); + + requestBody.setName(name); + requestBody.setNamePropertyName(nameParameterName); + + ValidValueListResponse restResult = restClient.callValidValueListPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + startFrom, + validatedPageSize); + + return restResult.getElementList(); + } + + + /** + * Retrieve the list of valid values. + * + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public List getAllValidValues(String userId, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getValidValues"; + + invalidParameterHandler.validateUserId(userId, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = serverPlatformURLRoot + validValueURLTemplatePrefix + "?startFrom={2}&pageSize={3}"; + + ValidValueListResponse restResult = restClient.callValidValueListGetRESTCall(methodName, + urlTemplate, + serverName, + userId, + startFrom, + validatedPageSize); + + return restResult.getElementList(); + } + + + /** + * Page through the members of a valid value set. + * + * @param userId calling user + * @param validValueSetGUID unique identifier of the valid value set + * @param startFrom paging starting point + * @param pageSize maximum number of return values. + * @return list of valid value beans + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException the repository is not available or not working properly. + */ + @Override + public List getValidValueSetMembers(String userId, + String validValueSetGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getValidValueSetMembers"; + final String guidParameterName = "validValueSetGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(validValueSetGUID, guidParameterName, methodName); + + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = serverPlatformURLRoot + validValueURLTemplatePrefix + "/members/{2}?startFrom={3}&pageSize={4}"; + + ValidValueListResponse restResult = restClient.callValidValueListGetRESTCall(methodName, + urlTemplate, + serverName, + userId, + validValueSetGUID, + startFrom, + validatedPageSize); + + return restResult.getElementList(); + } + + + /** + * Page through the list of valid value sets that a valid value definition/set belongs to. + * + * @param userId calling user + * @param validValueGUID unique identifier of valid value to query + * @param startFrom paging starting point + * @param pageSize maximum number of return values. + * @return list of valid value beans + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException the repository is not available or not working properly. + */ + @Override + public List getSetsForValidValue(String userId, + String validValueGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getValidValueSetMembers"; + final String guidParameterName = "validValueGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(validValueGUID, guidParameterName, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = serverPlatformURLRoot + validValueURLTemplatePrefix + "/sets/{2}?startFrom={3}&pageSize={4}"; + + ValidValueListResponse restResult = restClient.callValidValueListGetRESTCall(methodName, + urlTemplate, + serverName, + userId, + validValueGUID, + startFrom, + validatedPageSize); + + return restResult.getElementList(); + } + + + /** + * Return information about the valid value set linked to an element as its + * set of valid values. + * + * @param userId calling user + * @param elementGUID unique identifier for the element using the valid value set + * + * @return list of matching actor profiles (hopefully only one) + * + * @throws InvalidParameterException name or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public ValidValueElement getValidValuesForConsumer(String userId, + String elementGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getValidValuesForConsumer"; + final String guidParameterName = "elementGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(elementGUID, guidParameterName, methodName); + + final String urlTemplate = serverPlatformURLRoot + validValueURLTemplatePrefix + "/by-consumer/{2}"; + + ValidValueResponse restResult = restClient.callValidValueGetRESTCall(methodName, + urlTemplate, + serverName, + userId, + elementGUID); + + return restResult.getElement(); + } + + + /** + * Return information about the consumers linked to a validValue. + * + * @param userId calling user + * @param validValueGUID unique identifier for the validValue + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching actor profiles (hopefully only one) + * + * @throws InvalidParameterException name or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public List getConsumersOfValidValue(String userId, + String validValueGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getConsumersOfValidValue"; + final String guidPropertyName = "validValueGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(validValueGUID, guidPropertyName, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = serverPlatformURLRoot + validValueURLTemplatePrefix + "/{2}/consumers?startFrom={3}&pageSize={4}"; + + RelatedElementListResponse restResult = restClient.callRelatedElementListGetRESTCall(methodName, + urlTemplate, + serverName, + userId, + validValueGUID, + startFrom, + validatedPageSize); + + return restResult.getElementList(); + } + + + /** + * Return information about the valid values linked as reference value tags to an element. + * + * @param userId calling user + * @param elementGUID unique identifier for the element + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of valid values + * + * @throws InvalidParameterException name or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public List getReferenceValues(String userId, + String elementGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getReferenceValues"; + + invalidParameterHandler.validateUserId(userId, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = serverPlatformURLRoot + validValueURLTemplatePrefix + "/by-reference-value-tags/{2}?startFrom={3}&pageSize={4}"; + + ValidValueListResponse restResult = restClient.callValidValueListGetRESTCall(methodName, + urlTemplate, + serverName, + userId, + startFrom, + validatedPageSize); + + return restResult.getElementList(); + } + + + /** + * Return information about the person roles linked to a validValue. + * + * @param userId calling user + * @param validValueGUID unique identifier for the validValue + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching actor profiles (hopefully only one) + * + * @throws InvalidParameterException name or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public List getAssigneesOfReferenceValue(String userId, + String validValueGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getAssigneesOfReferenceValue"; + final String guidPropertyName = "validValueGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(validValueGUID, guidPropertyName, methodName); + + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = serverPlatformURLRoot + validValueURLTemplatePrefix + "/{2}/by-reference-value-tag-assignees?startFrom={3}&pageSize={4}"; + + RelatedElementListResponse restResult = restClient.callRelatedElementListGetRESTCall(methodName, + urlTemplate, + serverName, + userId, + validValueGUID, + startFrom, + validatedPageSize); + + return restResult.getElementList(); + } + + + /** + * Retrieve the metadata element with the supplied unique identifier. + * + * @param userId calling user + * @param validValueGUID unique identifier of the requested metadata element + * + * @return requested metadata element + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + @Override + public ValidValueElement getValidValueByGUID(String userId, + String validValueGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getValidValueByGUID"; + final String guidParameterName = "validValueGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(validValueGUID, guidParameterName, methodName); + + final String urlTemplate = serverPlatformURLRoot + validValueURLTemplatePrefix + "/{2}"; + + ValidValueResponse restResult = restClient.callValidValueGetRESTCall(methodName, + urlTemplate, + serverName, + userId, + validValueGUID); + + return restResult.getElement(); + } +} diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/rest/DataManagerRESTClient.java b/open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/rest/DataManagerRESTClient.java index fa6188feacd..1ae844aad16 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/rest/DataManagerRESTClient.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/rest/DataManagerRESTClient.java @@ -1997,4 +1997,109 @@ public ElementStubResponse callElementStubGetRESTCall(String methodName, return restResult; } + + + + /** + * Issue a GET REST call that returns a RelatedElementListResponse object. + * + * @param methodName name of the method being called. + * @param urlTemplate REST API call URL template with place-holders for the parameters. + * @param params a list of parameters that are slotted into the url template. + * + * @return response object + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException the repository is not available or not working properly. + */ + public RelatedElementListResponse callRelatedElementListGetRESTCall(String methodName, + String urlTemplate, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + RelatedElementListResponse restResult = this.callGetRESTCall(methodName, RelatedElementListResponse.class, urlTemplate, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + + /** + * Issue a GET REST call that returns a ValidValueElement in a response object. + * + * @param methodName name of the method being called. + * @param urlTemplate REST API call URL template with place-holders for the parameters. + * @param params a list of parameters that are slotted into the url template. + * + * @return response object + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException something went wrong with the REST call stack. + */ + public ValidValueResponse callValidValueGetRESTCall(String methodName, + String urlTemplate, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + ValidValueResponse restResult = this.callGetRESTCall(methodName, ValidValueResponse.class, urlTemplate, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + + /** + * Issue a GET REST call that returns a list of ValidValueElements in a response object. + * + * @param methodName name of the method being called + * @param urlTemplate REST API call URL template with place-holders for the parameters + * @param params a list of parameters that are slotted into the url template + * @return response object + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException something went wrong with the REST call stack. + */ + public ValidValueListResponse callValidValueListGetRESTCall(String methodName, + String urlTemplate, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + ValidValueListResponse restResult = this.callGetRESTCall(methodName, ValidValueListResponse.class, urlTemplate, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + + /** + * Issue a GET REST call that returns a list of ValidValueElements in a response object. + * + * @param methodName name of the method being called + * @param urlTemplate REST API call URL template with place-holders for the parameters + * @param requestBody request body for the request + * @param params a list of parameters that are slotted into the url template + * @return response object + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException something went wrong with the REST call stack. + */ + public ValidValueListResponse callValidValueListPostRESTCall(String methodName, + String urlTemplate, + Object requestBody, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + ValidValueListResponse restResult = this.callPostRESTCall(methodName, ValidValueListResponse.class, urlTemplate, requestBody, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } } diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/DataManagerOMASConverter.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/DataManagerOMASConverter.java index 78af4786ea3..5027ebe1b1b 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/DataManagerOMASConverter.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/DataManagerOMASConverter.java @@ -730,4 +730,58 @@ else if (schemaTypeProperties instanceof ExternalSchemaTypeProperties) attributeProperties.setExternalTypeGUID(externalSchemaType.getElementHeader().getGUID()); } } + + + /** + * Using the supplied instances, return a new instance of a relatedElement bean. This is used for beans that + * contain a combination of the properties from an entity and that of a connected relationship. + * + * @param beanClass name of the class to create + * @param entity entity containing the properties + * @param relationship relationship containing the properties + * @param methodName calling method + * @return bean populated with properties from the instances supplied + * @throws PropertyServerException there is a problem instantiating the bean + */ + public RelatedElement getRelatedElement(Class beanClass, + EntityDetail entity, + Relationship relationship, + String methodName) throws PropertyServerException + { + RelatedElement relatedElement = new RelatedElement(); + + relatedElement.setRelationshipHeader(this.getMetadataElementHeader(beanClass, relationship, null, methodName)); + + if (relationship != null) + { + InstanceProperties instanceProperties = new InstanceProperties(relationship.getProperties()); + + RelationshipProperties relationshipProperties = new RelationshipProperties(); + + relationshipProperties.setEffectiveFrom(instanceProperties.getEffectiveFromTime()); + relationshipProperties.setEffectiveTo(instanceProperties.getEffectiveToTime()); + relationshipProperties.setExtendedProperties(this.getRemainingExtendedProperties(instanceProperties)); + + relatedElement.setRelationshipProperties(relationshipProperties); + } + else + { + handleMissingMetadataInstance(beanClass.getName(), TypeDefCategory.RELATIONSHIP_DEF, methodName); + } + + + if (entity != null) + { + ElementStub elementStub = this.getElementStub(beanClass, entity, methodName); + + relatedElement.setRelatedElement(elementStub); + } + else + { + handleMissingMetadataInstance(beanClass.getName(), TypeDefCategory.ENTITY_DEF, methodName); + } + + return relatedElement; + } + } diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/RelatedElementConverter.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/RelatedElementConverter.java new file mode 100644 index 00000000000..3b7215220cb --- /dev/null +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/RelatedElementConverter.java @@ -0,0 +1,60 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.datamanager.converters; + + +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper; + + +/** + * RelatedElementConverter generates a RelatedElement from a relationship and attached entity + */ +public class RelatedElementConverter extends DataManagerOMASConverter +{ + /** + * Constructor + * + * @param repositoryHelper helper object to parse entity + * @param serviceName name of this component + * @param serverName local server name + */ + public RelatedElementConverter(OMRSRepositoryHelper repositoryHelper, + String serviceName, + String serverName) + { + super(repositoryHelper, serviceName, serverName); + } + + + /** + * Using the supplied instances, return a new instance of the bean. This is used for beans that + * contain a combination of the properties from an entity and that of a connected relationship. + * + * @param beanClass name of the class to create + * @param entity entity containing the properties + * @param relationship relationship containing the properties + * @param methodName calling method + * @return bean populated with properties from the instances supplied + * @throws PropertyServerException there is a problem instantiating the bean + */ + @Override + public B getNewBean(Class beanClass, + EntityDetail entity, + Relationship relationship, + String methodName) throws PropertyServerException + { + try + { + return (B)this.getRelatedElement(beanClass, entity, relationship, methodName); + } + catch (ClassCastException error) + { + super.handleInvalidBeanClass(beanClass.getName(), error, methodName); + } + + return null; + } +} diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/ValidValueConverter.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/ValidValueConverter.java new file mode 100644 index 00000000000..fd113e00c5c --- /dev/null +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/ValidValueConverter.java @@ -0,0 +1,142 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.datamanager.converters; + + +import org.odpi.openmetadata.accessservices.datamanager.metadataelements.ValidValueElement; +import org.odpi.openmetadata.accessservices.datamanager.properties.ValidValueProperties; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefCategory; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper; + +import java.lang.reflect.InvocationTargetException; + + +/** + * ValidValueConverter generates an ValidValueElement bean from an ValidValueProperties entity. + */ +public class ValidValueConverter extends DataManagerOMASConverter +{ + /** + * Constructor + * + * @param repositoryHelper helper object to parse entity + * @param serviceName name of this component + * @param serverName local server name + */ + public ValidValueConverter(OMRSRepositoryHelper repositoryHelper, + String serviceName, + String serverName) + { + super(repositoryHelper, serviceName, serverName); + } + + + + /** + * Using the supplied entity, return a new instance of the bean. This is used for most beans that have + * a one to one correspondence with the repository instances. + * + * @param beanClass name of the class to create + * @param entity entity containing the properties + * @param methodName calling method + * @return bean populated with properties from the instances supplied + * @throws PropertyServerException there is a problem instantiating the bean + */ + @Override + public B getNewBean(Class beanClass, + EntityDetail entity, + String methodName) throws PropertyServerException + { + try + { + /* + * This is initial confirmation that the generic converter has been initialized with an appropriate bean class. + */ + B returnBean = beanClass.getDeclaredConstructor().newInstance(); + + if (returnBean instanceof ValidValueElement) + { + ValidValueElement bean = (ValidValueElement) returnBean; + ValidValueProperties validValueProperties = new ValidValueProperties(); + + bean.setElementHeader(super.getMetadataElementHeader(beanClass, entity, methodName)); + + InstanceProperties instanceProperties; + + /* + * The initial set of values come from the entity. + */ + if (entity != null) + { + instanceProperties = new InstanceProperties(entity.getProperties()); + + validValueProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); + validValueProperties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); + validValueProperties.setDisplayName(this.removeName(instanceProperties)); + validValueProperties.setDescription(this.removeDescription(instanceProperties)); + validValueProperties.setUsage(this.removeUsage(instanceProperties)); + validValueProperties.setScope(this.removeScope(instanceProperties)); + validValueProperties.setPreferredValue(this.removePreferredValue(instanceProperties)); + validValueProperties.setIsDeprecated(this.removeIsDeprecated(instanceProperties)); + + validValueProperties.setEffectiveFrom(instanceProperties.getEffectiveFromTime()); + validValueProperties.setEffectiveTo(instanceProperties.getEffectiveToTime()); + + /* + * Any remaining properties are returned in the extended properties. They are + * assumed to be defined in a subtype. + */ + validValueProperties.setTypeName(bean.getElementHeader().getType().getTypeName()); + validValueProperties.setExtendedProperties(this.getRemainingExtendedProperties(instanceProperties)); + } + else + { + handleMissingMetadataInstance(beanClass.getName(), TypeDefCategory.ENTITY_DEF, methodName); + } + + bean.setValidValueProperties(validValueProperties); + } + + return returnBean; + } + catch (IllegalAccessException | InstantiationException | ClassCastException | NoSuchMethodException | InvocationTargetException error) + { + super.handleInvalidBeanClass(beanClass.getName(), error, methodName); + } + + return null; + } + + + /** + * Using the supplied instances, return a new instance of the bean. This is used for beans that + * contain a combination of the properties from an entity and that of a connected relationship. + * + * @param beanClass name of the class to create + * @param entity entity containing the properties + * @param relationship relationship containing the properties + * @param methodName calling method + * @return bean populated with properties from the instances supplied + * @throws PropertyServerException there is a problem instantiating the bean + */ + public B getNewBean(Class beanClass, + EntityDetail entity, + Relationship relationship, + String methodName) throws PropertyServerException + { + B returnBean = this.getNewBean(beanClass, entity, methodName); + + if (returnBean instanceof ValidValueElement) + { + ValidValueElement bean = (ValidValueElement) returnBean; + + bean.setRelatedElement(super.getRelatedElement(beanClass, entity, relationship, methodName)); + } + + return returnBean; + } +} diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/DataManagerInstanceHandler.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/DataManagerInstanceHandler.java index 0598b6fad4c..dfed58411fe 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/DataManagerInstanceHandler.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/DataManagerInstanceHandler.java @@ -588,6 +588,68 @@ EndpointHandler getEndpointHandler(String userId, } + + /** + * Retrieve the specific handler for the access service. + * + * @param userId calling user + * @param serverName name of the server tied to the request + * @param serviceOperationName name of the REST API call (typically the top-level methodName) + * @return handler for use by the requested instance + * @throws InvalidParameterException no available instance for the requested server + * @throws UserNotAuthorizedException user does not have access to the requested server + * @throws PropertyServerException error in the requested server + */ + ReferenceableHandler getRelatedElementHandler(String userId, + String serverName, + String serviceOperationName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + + DataManagerServicesInstance instance = (DataManagerServicesInstance) super.getServerServiceInstance(userId, + serverName, + serviceOperationName); + + if (instance != null) + { + return instance.getRelatedElementHandler(); + } + + return null; + } + + + /** + * Retrieve the specific handler for the access service. + * + * @param userId calling user + * @param serverName name of the server tied to the request + * @param serviceOperationName name of the REST API call (typically the top-level methodName) + * @return handler for use by the requested instance + * @throws InvalidParameterException no available instance for the requested server + * @throws UserNotAuthorizedException user does not have access to the requested server + * @throws PropertyServerException error in the requested server + */ + ValidValuesHandler getValidValuesSetHandler(String userId, + String serverName, + String serviceOperationName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + DataManagerServicesInstance instance = (DataManagerServicesInstance)super.getServerServiceInstance(userId, + serverName, + serviceOperationName); + + if (instance != null) + { + return instance.getValidValuesSetHandler(); + } + + return null; + } + + /** * Retrieve the specific handler for the access service. * @@ -599,9 +661,9 @@ EndpointHandler getEndpointHandler(String userId, * @throws UserNotAuthorizedException user does not have access to the requested server * @throws PropertyServerException error in the requested server */ - ValidValuesHandler getValidValuesHandler(String userId, - String serverName, - String serviceOperationName) throws InvalidParameterException, + ValidValuesHandler getValidValueHandler(String userId, + String serverName, + String serviceOperationName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException { diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/DataManagerServicesInstance.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/DataManagerServicesInstance.java index 0a98825a92e..fdeb03c02c6 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/DataManagerServicesInstance.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/DataManagerServicesInstance.java @@ -61,7 +61,9 @@ public class DataManagerServicesInstance extends OMASServiceInstance private final ConnectorTypeHandler connectorTypeHandler; private final EndpointHandler endpointHandler; - private final ValidValuesHandler validValuesHandler; + private final ValidValuesHandler validValuesSetHandler; + private final ReferenceableHandler relatedElementHandler; + private final ValidValuesHandler validValuesHandler; /** @@ -384,8 +386,22 @@ public DataManagerServicesInstance(OMRSRepositoryConnector repositoryConnector, publishZones, auditLog); - this.validValuesHandler = new ValidValuesHandler<>(new ValidValueSetConverter<>(repositoryHelper, serviceName, serverName), - ValidValueSetElement.class, + this.validValuesSetHandler = new ValidValuesHandler<>(new ValidValueSetConverter<>(repositoryHelper, serviceName, serverName), + ValidValueSetElement.class, + serviceName, + serverName, + invalidParameterHandler, + repositoryHandler, + repositoryHelper, + localServerUserId, + securityVerifier, + supportedZones, + defaultZones, + publishZones, + auditLog); + + this.validValuesHandler = new ValidValuesHandler<>(new ValidValueConverter<>(repositoryHelper, serviceName, serverName), + ValidValueElement.class, serviceName, serverName, invalidParameterHandler, @@ -397,6 +413,20 @@ public DataManagerServicesInstance(OMRSRepositoryConnector repositoryConnector, defaultZones, publishZones, auditLog); + + this.relatedElementHandler = new ReferenceableHandler<>(new RelatedElementConverter<>(repositoryHelper, serviceName,serverName), + RelatedElement.class, + serviceName, + serverName, + invalidParameterHandler, + repositoryHandler, + repositoryHelper, + localServerUserId, + securityVerifier, + supportedZones, + defaultZones, + publishZones, + auditLog); } @@ -701,13 +731,29 @@ EndpointHandler getEndpointHandler() throws PropertyServerExcep } + /** + * Return the handler for managing valid values - used by schema. + * + * @return handler object + * @throws PropertyServerException the instance has not been initialized successfully + */ + ValidValuesHandler getValidValuesSetHandler() throws PropertyServerException + { + final String methodName = "getValidValuesSetHandler"; + + validateActiveRepository(methodName); + + return validValuesSetHandler; + } + + /** * Return the handler for managing valid values. * * @return handler object * @throws PropertyServerException the instance has not been initialized successfully */ - ValidValuesHandler getValidValuesHandler() throws PropertyServerException + ValidValuesHandler getValidValuesHandler() throws PropertyServerException { final String methodName = "getValidValuesHandler"; @@ -715,4 +761,21 @@ ValidValuesHandler getValidValuesHandler() throws Property return validValuesHandler; } + + + + /** + * Return the handler for managing valid values. + * + * @return handler object + * @throws PropertyServerException the instance has not been initialized successfully + */ + ReferenceableHandler getRelatedElementHandler() throws PropertyServerException + { + final String methodName = "getRelatedElementHandler"; + + validateActiveRepository(methodName); + + return relatedElementHandler; + } } diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/SchemaManagerRESTServices.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/SchemaManagerRESTServices.java index b6b2c5642c3..4cc517525e8 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/SchemaManagerRESTServices.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/SchemaManagerRESTServices.java @@ -339,7 +339,7 @@ public ValidValueSetsResponse getValidValueSetByName(String serverName, if (requestBody != null) { - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ValidValuesHandler handler = instanceHandler.getValidValuesSetHandler(userId, serverName, methodName); response.setElementList(handler.getValidValueByName(userId, requestBody.getName(), @@ -402,7 +402,7 @@ public ValidValueSetsResponse findValidValueSet(String serverNa if (requestBody != null) { - ValidValuesHandler handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName); + ValidValuesHandler handler = instanceHandler.getValidValuesSetHandler(userId, serverName, methodName); response.setElementList(handler.findValidValues(userId, requestBody.getSearchString(), diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/ValidValuesRESTServices.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/ValidValuesRESTServices.java new file mode 100644 index 00000000000..ef8335bbe9d --- /dev/null +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/ValidValuesRESTServices.java @@ -0,0 +1,1386 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.datamanager.server; + +import org.odpi.openmetadata.accessservices.datamanager.metadataelements.RelatedElement; +import org.odpi.openmetadata.accessservices.datamanager.metadataelements.ValidValueElement; +import org.odpi.openmetadata.accessservices.datamanager.properties.ReferenceValueAssignmentProperties; +import org.odpi.openmetadata.accessservices.datamanager.properties.ValidValueAssignmentProperties; +import org.odpi.openmetadata.accessservices.datamanager.properties.ValidValueMembershipProperties; +import org.odpi.openmetadata.accessservices.datamanager.properties.ValidValueProperties; +import org.odpi.openmetadata.accessservices.datamanager.rest.ExternalSourceRequestBody; +import org.odpi.openmetadata.accessservices.datamanager.rest.ReferenceableRequestBody; +import org.odpi.openmetadata.accessservices.datamanager.rest.RelatedElementListResponse; +import org.odpi.openmetadata.accessservices.datamanager.rest.RelationshipRequestBody; +import org.odpi.openmetadata.accessservices.datamanager.rest.ValidValueListResponse; +import org.odpi.openmetadata.accessservices.datamanager.rest.ValidValueResponse; +import org.odpi.openmetadata.commonservices.ffdc.RESTCallLogger; +import org.odpi.openmetadata.commonservices.ffdc.RESTCallToken; +import org.odpi.openmetadata.commonservices.ffdc.RESTExceptionHandler; +import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDResponse; +import org.odpi.openmetadata.commonservices.ffdc.rest.NameRequestBody; +import org.odpi.openmetadata.commonservices.ffdc.rest.SearchStringRequestBody; +import org.odpi.openmetadata.commonservices.ffdc.rest.VoidResponse; +import org.odpi.openmetadata.commonservices.generichandlers.ReferenceableHandler; +import org.odpi.openmetadata.commonservices.generichandlers.ValidValuesHandler; +import org.odpi.openmetadata.frameworks.auditlog.AuditLog; +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; +import org.slf4j.LoggerFactory; + +import java.util.Date; +import java.util.List; + +/** + * ValidValuesRESTServices provides the API operations to create and maintain validValues information. + */ +public class ValidValuesRESTServices +{ + private static final DataManagerInstanceHandler instanceHandler = new DataManagerInstanceHandler(); + private static final RESTExceptionHandler restExceptionHandler = new RESTExceptionHandler(); + private static final RESTCallLogger restCallLogger = new RESTCallLogger(LoggerFactory.getLogger(ValidValuesRESTServices.class), + instanceHandler.getServiceName()); + + + /** + * Default constructor + */ + public ValidValuesRESTServices() + { + } + + + /** + * Create a new metadata element to represent a validValues. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param requestBody properties to store + * + * @return unique identifier of the new metadata element or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public GUIDResponse createValidValue(String serverName, + String userId, + ReferenceableRequestBody requestBody) + { + final String methodName = "createValidValue"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + GUIDResponse response = new GUIDResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ValidValuesHandler handler = instanceHandler.getValidValueHandler(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof ValidValueProperties) + { + ValidValueProperties properties = (ValidValueProperties)requestBody.getProperties(); + + String validValueGUID = handler.createValidValue(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + properties.getQualifiedName(), + properties.getDisplayName(), + properties.getDescription(), + properties.getUsage(), + properties.getScope(), + properties.getIsDeprecated(), + properties.getPreferredValue(), + properties.getAdditionalProperties(), + properties.getTypeName(), + properties.getExtendedProperties(), + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + new Date(), + methodName); + + if (validValueGUID != null) + { + handler.setVendorProperties(userId, + validValueGUID, + properties.getVendorProperties(), + false, + false, + new Date(), + methodName); + } + + response.setGUID(validValueGUID); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(ValidValueProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Update the metadata element representing a validValues. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param validValueGUID unique identifier of the metadata element to update + * @param isMergeUpdate should the new properties be merged with the existing properties of overlay them? + * @param requestBody new properties for this element + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse updateValidValue(String serverName, + String userId, + String validValueGUID, + boolean isMergeUpdate, + ReferenceableRequestBody requestBody) + { + final String methodName = "updateValidValue"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ValidValuesHandler handler = instanceHandler.getValidValueHandler(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof ValidValueProperties) + { + ValidValueProperties properties = (ValidValueProperties) requestBody.getProperties(); + + handler.updateValidValue(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + validValueGUID, + properties.getQualifiedName(), + properties.getDisplayName(), + properties.getDescription(), + properties.getUsage(), + properties.getScope(), + properties.getIsDeprecated(), + properties.getPreferredValue(), + properties.getAdditionalProperties(), + properties.getExtendedProperties(), + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + isMergeUpdate, + false, + false, + new Date(), + methodName); + + if ((! isMergeUpdate) || (properties.getVendorProperties() != null)) + { + handler.setVendorProperties(userId, + validValueGUID, + properties.getVendorProperties(), + false, + false, + new Date(), + methodName); + } + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(ValidValueProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Create a membership relationship between a validValue and a validValueSet that it belongs to. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param validValueSetGUID unique identifier of the valid value set + * @param validValueMemberGUID unique identifier of the member + * @param requestBody relationship properties + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse setupValidValueMember(String serverName, + String userId, + String validValueSetGUID, + String validValueMemberGUID, + RelationshipRequestBody requestBody) + { + final String methodName = "setupValidValueMember"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ValidValuesHandler handler = instanceHandler.getValidValueHandler(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof ValidValueMembershipProperties) + { + ValidValueMembershipProperties properties = (ValidValueMembershipProperties) requestBody.getProperties(); + + handler.attachValidValueToSet(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + validValueSetGUID, + validValueMemberGUID, + properties.getDefaultValue(), + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + false, + false, + new Date(), + methodName); + } + else if (requestBody.getProperties() == null) + { + handler.attachValidValueToSet(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + validValueSetGUID, + validValueMemberGUID, + false, + null, + null, + false, + false, + new Date(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(ValidValueMembershipProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Remove a membership relationship between a validValue and a validValueSet that it belongs to. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param validValueSetGUID unique identifier of the valid value set + * @param validValueMemberGUID unique identifier of the member + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse clearValidValueMember(String serverName, + String userId, + String validValueSetGUID, + String validValueMemberGUID, + ExternalSourceRequestBody requestBody) + { + final String methodName = "clearValidValueMember"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ValidValuesHandler handler = instanceHandler.getValidValueHandler(userId, serverName, methodName); + + if (requestBody != null) + { + handler.detachValidValueFromSet(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + validValueSetGUID, + validValueMemberGUID, + false, + false, + new Date(), + methodName); + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Create a valid value assignment relationship between an element and a valid value (typically, a valid value set) to show that + * the valid value defines the values that can be stored in the data item that the element represents. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param validValueGUID unique identifier of the valid value + * @param requestBody relationship properties + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse setupValidValues(String serverName, + String userId, + String elementGUID, + String validValueGUID, + RelationshipRequestBody requestBody) + { + final String methodName = "setupValidValues"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ValidValuesHandler handler = instanceHandler.getValidValueHandler(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof ValidValueAssignmentProperties) + { + ValidValueAssignmentProperties properties = (ValidValueAssignmentProperties) requestBody.getProperties(); + + handler.assignValidValueToConsumer(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + validValueGUID, + elementGUID, + properties.getStrictRequirement(), + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + false, + false, + new Date(), + methodName); + } + else if (requestBody.getProperties() == null) + { + handler.assignValidValueToConsumer(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + validValueGUID, + elementGUID, + false, + null, + null, + false, + false, + new Date(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(ValidValueAssignmentProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Remove a valid value assignment relationship between an element and a valid value. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param validValueGUID unique identifier of the valid value + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse clearValidValues(String serverName, + String userId, + String elementGUID, + String validValueGUID, + ExternalSourceRequestBody requestBody) + { + final String methodName = "clearValidValues"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ValidValuesHandler handler = instanceHandler.getValidValueHandler(userId, serverName, methodName); + + if (requestBody != null) + { + handler.unassignValidValueFromConsumer(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + validValueGUID, + elementGUID, + false, + false, + new Date(), + methodName); + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Create a reference value assignment relationship between an element and a valid value to show that + * the valid value is a semiformal tag/classification. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param validValueGUID unique identifier of the valid value + * @param requestBody relationship properties + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse setupReferenceValueTag(String serverName, + String userId, + String elementGUID, + String validValueGUID, + RelationshipRequestBody requestBody) + { + final String methodName = "setupReferenceValueTag"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ValidValuesHandler handler = instanceHandler.getValidValueHandler(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof ReferenceValueAssignmentProperties) + { + ReferenceValueAssignmentProperties properties = (ReferenceValueAssignmentProperties) requestBody.getProperties(); + + handler.assignReferenceValueToItem(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + validValueGUID, + elementGUID, + properties.getConfidence(), + properties.getSteward(), + properties.getStewardTypeName(), + properties.getStewardPropertyName(), + properties.getNotes(), + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + false, + false, + new Date(), + methodName); + } + else if (requestBody.getProperties() == null) + { + handler.assignReferenceValueToItem(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + validValueGUID, + elementGUID, + 100, + null, + null, + null, + null, + null, + null, + false, + false, + new Date(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(ReferenceValueAssignmentProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Remove a reference value assignment relationship between an element and a valid value. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param validValueGUID unique identifier of the valid value + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse clearReferenceValueTag(String serverName, + String userId, + String elementGUID, + String validValueGUID, + ExternalSourceRequestBody requestBody) + { + final String methodName = "clearReferenceValueTag"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ValidValuesHandler handler = instanceHandler.getValidValueHandler(userId, serverName, methodName); + + if (requestBody != null) + { + handler.unassignValidValueFromConsumer(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + validValueGUID, + elementGUID, + false, + false, + new Date(), + methodName); + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Remove the metadata element representing a validValue. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param validValueGUID unique identifier of the metadata element to remove + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse removeValidValue(String serverName, + String userId, + String validValueGUID, + ExternalSourceRequestBody requestBody) + { + final String methodName = "removeValidValue"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + if (requestBody != null) + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ValidValuesHandler handler = instanceHandler.getValidValueHandler(userId, serverName, methodName); + + handler.deleteValidValue(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + validValueGUID, + null, + false, + false, + new Date(), + methodName); + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Retrieve the list of validValue metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param requestBody string to find in the properties + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public ValidValueListResponse findValidValues(String serverName, + String userId, + SearchStringRequestBody requestBody, + int startFrom, + int pageSize) + { + final String methodName = "findValidValues"; + final String searchStringParameterName = "searchString"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + ValidValueListResponse response = new ValidValueListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + if (requestBody != null) + { + ValidValuesHandler handler = instanceHandler.getValidValueHandler(userId, serverName, methodName); + + List validValues = handler.findValidValues(userId, + requestBody.getSearchString(), + searchStringParameterName, + startFrom, + pageSize, + false, + false, + new Date(), + methodName); + + response.setElementList(setUpVendorProperties(userId, validValues, handler, methodName)); + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Retrieve the list of validValue metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param requestBody name to search for + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public ValidValueListResponse getValidValuesByName(String serverName, + String userId, + NameRequestBody requestBody, + int startFrom, + int pageSize) + { + final String methodName = "getValidValuesByName"; + final String nameParameterName = "name"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + ValidValueListResponse response = new ValidValueListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + if (requestBody != null) + { + ValidValuesHandler handler = instanceHandler.getValidValueHandler(userId, serverName, methodName); + + List validValues = handler.getValidValueByName(userId, + requestBody.getName(), + nameParameterName, + startFrom, + pageSize, + false, + false, + new Date(), + methodName); + + response.setElementList(setUpVendorProperties(userId, validValues, handler, methodName)); + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Page through the members of a valid value set. + * + * @param serverName called server + * @param userId calling user + * @param validValueSetGUID unique identifier of the valid value set + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of valid value beans + * + * InvalidParameterException name or userId is null + * PropertyServerException problem accessing property server + * UserNotAuthorizedException security access problem + */ + public ValidValueListResponse getValidValueSetMembers(String serverName, + String userId, + String validValueSetGUID, + int startFrom, + int pageSize) + { + final String methodName = "getValidValueSetMembers"; + final String guidParameterName = "validValueSetGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + ValidValueListResponse response = new ValidValueListResponse(); + AuditLog auditLog = null; + + try + { + ValidValuesHandler handler = instanceHandler.getValidValueHandler(userId, serverName, methodName); + + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + response.setElementList(handler.getValidValueSetMembers(userId, + validValueSetGUID, + guidParameterName, + startFrom, + pageSize, + false, + false, + new Date(), + methodName)); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Page through the list of valid value sets that a valid value definition/set belongs to. + * + * @param serverName called server + * @param userId calling user + * @param validValueGUID unique identifier of the valid value + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of valid value beans + * + * InvalidParameterException name or userId is null + * PropertyServerException problem accessing property server + * UserNotAuthorizedException security access problem + */ + public ValidValueListResponse getSetsForValidValue(String serverName, + String userId, + String validValueGUID, + int startFrom, + int pageSize) + { + final String methodName = "getSetsForValidValue"; + final String guidParameterName = "validValueGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + ValidValueListResponse response = new ValidValueListResponse(); + AuditLog auditLog = null; + + try + { + ValidValuesHandler handler = instanceHandler.getValidValueHandler(userId, serverName, methodName); + + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + response.setElementList(handler.getSetsForValidValue(userId, + validValueGUID, + guidParameterName, + startFrom, + pageSize, + false, + false, + new Date(), + methodName)); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Return information about the valid value set linked to an element as its + * set of valid values. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier for the element using the valid value set + * + * @return matching metadata element or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public ValidValueResponse getValidValuesForConsumer(String serverName, + String userId, + String elementGUID) + { + final String methodName = "getValidValuesForConsumer"; + final String guidParameterName = "elementGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + ValidValueResponse response = new ValidValueResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ValidValuesHandler handler = instanceHandler.getValidValueHandler(userId, serverName, methodName); + + ValidValueElement validValue = handler.getAssignedValidValues(userId, + elementGUID, + guidParameterName, + false, + false, + new Date(), + methodName); + + response.setElement(setUpVendorProperties(userId, validValue, handler, methodName)); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Return information about the consumers linked to a valid value. + * + * @param serverName called server + * @param userId calling user + * @param validValueGUID unique identifier for the validValue + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching person roles + * + * InvalidParameterException name or userId is null + * PropertyServerException problem accessing property server + * UserNotAuthorizedException security access problem + */ + public RelatedElementListResponse getConsumersOfValidValue(String serverName, + String userId, + String validValueGUID, + int startFrom, + int pageSize) + { + final String methodName = "getConsumersOfValidValue"; + final String guidParameterName = "validValueGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + RelatedElementListResponse response = new RelatedElementListResponse(); + AuditLog auditLog = null; + + try + { + ReferenceableHandler handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); + + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + response.setElementList(handler.getValidValueConsumers(userId, + validValueGUID, + guidParameterName, + startFrom, + pageSize, + false, + false, + new Date(), + methodName)); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Return information about the valid values linked as reference value tags to an element. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier for the element using the valid value set + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public ValidValueListResponse getReferenceValues(String serverName, + String userId, + String elementGUID, + int startFrom, + int pageSize) + { + final String methodName = "getReferenceValues"; + final String guidParameterName = "elementGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + ValidValueListResponse response = new ValidValueListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ValidValuesHandler handler = instanceHandler.getValidValueHandler(userId, serverName, methodName); + + List validValue = handler.getReferenceValues(userId, + elementGUID, + guidParameterName, + startFrom, + pageSize, + false, + false, + new Date(), + methodName); + + response.setElementList(setUpVendorProperties(userId, validValue, handler, methodName)); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Return information about the consumers linked to a valid value. + * + * @param serverName called server + * @param userId calling user + * @param validValueGUID unique identifier for the validValue + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching person roles + * + * InvalidParameterException name or userId is null + * PropertyServerException problem accessing property server + * UserNotAuthorizedException security access problem + */ + public RelatedElementListResponse getAssigneesOfReferenceValue(String serverName, + String userId, + String validValueGUID, + int startFrom, + int pageSize) + { + final String methodName = "getAssigneesOfReferenceValue"; + final String guidParameterName = "validValueGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + RelatedElementListResponse response = new RelatedElementListResponse(); + AuditLog auditLog = null; + + try + { + ReferenceableHandler handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); + + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + response.setElementList(handler.getReferenceValueAssignees(userId, + validValueGUID, + guidParameterName, + startFrom, + pageSize, + false, + false, + new Date(), + methodName)); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Retrieve the list of validValue metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public ValidValueListResponse getAllValidValues(String serverName, + String userId, + int startFrom, + int pageSize) + { + final String methodName = "getAllValidValues"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + ValidValueListResponse response = new ValidValueListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ValidValuesHandler handler = instanceHandler.getValidValueHandler(userId, serverName, methodName); + + List validValues = handler.getValidValues(userId, + startFrom, + pageSize, + false, + false, + new Date(), + methodName); + + response.setElementList(setUpVendorProperties(userId, validValues, handler, methodName)); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Retrieve the validValue metadata element with the supplied unique identifier. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param guid unique identifier of the requested metadata element + * + * @return matching metadata element or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public ValidValueResponse getValidValueByGUID(String serverName, + String userId, + String guid) + { + final String methodName = "getValidValueByGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + ValidValueResponse response = new ValidValueResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + ValidValuesHandler handler = instanceHandler.getValidValueHandler(userId, serverName, methodName); + + ValidValueElement validValue = handler.getValidValueByGUID(userId, + guid, + false, + false, + new Date(), + methodName); + + response.setElement(setUpVendorProperties(userId, validValue, handler, methodName)); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + + /** + * Set up the vendor properties in the retrieved elements. + * + * @param userId calling user + * @param retrievedResults results from the repositories + * @param handler handler used to retrieve the vendor properties + * @param methodName calling method + * + * @return updated results + * + * @throws InvalidParameterException one of the parameters is null or invalid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + private List setUpVendorProperties(String userId, + List retrievedResults, + ValidValuesHandler handler, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + if (retrievedResults != null) + { + for (ValidValueElement element : retrievedResults) + { + if (element != null) + { + setUpVendorProperties(userId, element, handler, methodName); + } + } + } + + return retrievedResults; + } + + + /** + * Set up the vendor properties in the retrieved element. + * + * @param userId calling user + * @param element results from the repositories + * @param handler handler used to retrieve the vendor properties + * @param methodName calling method + * + * @return updated results + * + * @throws InvalidParameterException one of the parameters is null or invalid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + private ValidValueElement setUpVendorProperties(String userId, + ValidValueElement element, + ValidValuesHandler handler, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String elementGUIDParameterName = "element.getElementHeader().getGUID()"; + + if (element != null) + { + ValidValueProperties properties = element.getValidValueProperties(); + + properties.setVendorProperties(handler.getVendorProperties(userId, + element.getElementHeader().getGUID(), + elementGUIDParameterName, + false, + false, + new Date(), + methodName)); + } + + return element; + } +} diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-spring/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/spring/DataManagerValidValuesResource.java b/open-metadata-implementation/access-services/data-manager/data-manager-spring/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/spring/DataManagerValidValuesResource.java new file mode 100644 index 00000000000..0ac37634e50 --- /dev/null +++ b/open-metadata-implementation/access-services/data-manager/data-manager-spring/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/spring/DataManagerValidValuesResource.java @@ -0,0 +1,541 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.datamanager.server.spring; + +import io.swagger.v3.oas.annotations.ExternalDocumentation; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.odpi.openmetadata.accessservices.datamanager.rest.ExternalSourceRequestBody; +import org.odpi.openmetadata.accessservices.datamanager.rest.ReferenceableRequestBody; +import org.odpi.openmetadata.accessservices.datamanager.rest.RelatedElementListResponse; +import org.odpi.openmetadata.accessservices.datamanager.rest.RelationshipRequestBody; +import org.odpi.openmetadata.accessservices.datamanager.rest.ValidValueListResponse; +import org.odpi.openmetadata.accessservices.datamanager.rest.ValidValueResponse; +import org.odpi.openmetadata.accessservices.datamanager.server.ValidValuesRESTServices; +import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDResponse; +import org.odpi.openmetadata.commonservices.ffdc.rest.NameRequestBody; +import org.odpi.openmetadata.commonservices.ffdc.rest.SearchStringRequestBody; +import org.odpi.openmetadata.commonservices.ffdc.rest.VoidResponse; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + + +/** + * The DataManagerValidValuesResource provides a Spring based server-side REST API + * that supports the ValidValueManagementInterface. It delegates each request to the + * ValidValueRESTServices. This provides the server-side implementation of the Community Profile Open Metadata + * Assess Service (OMAS) which is used to manage information about people, roles and organizations. + */ +@RestController +@RequestMapping("/servers/{serverName}/open-metadata/access-services/data-manager/users/{userId}") + +@Tag(name="Data Manager OMAS", + description="The Data Manager OMAS provides APIs for tools and applications wishing to manage metadata relating to data managers " + + "such as database servers, event brokers, content managers and file systems.", + externalDocs=@ExternalDocumentation(description="Data Manager Open Metadata Access Service (OMAS)", + url="https://egeria-project.org/services/omas/data-manager/overview/")) + +public class DataManagerValidValuesResource +{ + private final ValidValuesRESTServices restAPI = new ValidValuesRESTServices(); + + + /** + * Default constructor + */ + public DataManagerValidValuesResource() + { + } + + + /** + * Create a new metadata element to represent a validValues. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param requestBody properties to store + * + * @return unique identifier of the new metadata element or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/valid-values") + + public GUIDResponse createValidValue(@PathVariable String serverName, + @PathVariable String userId, + @RequestBody ReferenceableRequestBody requestBody) + { + return restAPI.createValidValue(serverName, userId, requestBody); + } + + + /** + * Update the metadata element representing a validValues. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param validValueGUID unique identifier of the metadata element to update + * @param isMergeUpdate should the new properties be merged with the existing properties of overlay them? + * @param requestBody new properties for this element + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/valid-values/{validValueGUID}") + + public VoidResponse updateValidValue(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String validValueGUID, + @RequestParam boolean isMergeUpdate, + @RequestBody ReferenceableRequestBody requestBody) + { + return restAPI.updateValidValue(serverName, userId, validValueGUID, isMergeUpdate, requestBody); + } + + + /** + * Create a membership relationship between a validValue and a validValueSet that it belongs to. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param validValueSetGUID unique identifier of the valid value set + * @param validValueMemberGUID unique identifier of the member + * @param requestBody relationship properties + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/valid-values/{validValueSetGUID}/valid-value-members/{validValueMemberGUID}") + + public VoidResponse setupValidValueMember(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String validValueSetGUID, + @PathVariable String validValueMemberGUID, + @RequestBody RelationshipRequestBody requestBody) + { + return restAPI.setupValidValueMember(serverName, userId, validValueSetGUID, validValueMemberGUID, requestBody); + } + + + /** + * Remove a membership relationship between a validValue and a validValueSet that it belongs to. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param validValueSetGUID unique identifier of the valid value set + * @param validValueMemberGUID unique identifier of the member + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/valid-values/{validValueSetGUID}/valid-value-members/{validValueMemberGUID}/delete") + + public VoidResponse clearValidValueMember(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String validValueSetGUID, + @PathVariable String validValueMemberGUID, + @RequestBody ExternalSourceRequestBody requestBody) + { + return restAPI.clearValidValueMember(serverName, userId, validValueSetGUID, validValueMemberGUID, requestBody); + } + + + /** + * Create a valid value assignment relationship between an element and a valid value (typically, a valid value set) to show that + * the valid value defines the values that can be stored in the data item that the element represents. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param validValueGUID unique identifier of the valid value + * @param requestBody relationship properties + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/valid-values/{elementGUID}/valid-values/{validValueGUID}") + + public VoidResponse setupValidValues(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @PathVariable String validValueGUID, + @RequestBody RelationshipRequestBody requestBody) + { + return restAPI.setupValidValues(serverName, userId, elementGUID, validValueGUID, requestBody); + } + + + /** + * Remove a valid value assignment relationship between an element and a valid value. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param validValueGUID unique identifier of the valid value + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/valid-values/{elementGUID}/valid-values/{validValueGUID}/delete") + + public VoidResponse clearValidValues(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @PathVariable String validValueGUID, + @RequestBody ExternalSourceRequestBody requestBody) + { + return restAPI.clearValidValues(serverName, userId, elementGUID, validValueGUID, requestBody); + } + + + /** + * Create a reference value assignment relationship between an element and a valid value to show that + * the valid value is a semiformal tag/classification. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param validValueGUID unique identifier of the valid value + * @param requestBody relationship properties + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/valid-values/{elementGUID}/reference-value-tags/{validValueGUID}") + + public VoidResponse setupReferenceValueTag(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @PathVariable String validValueGUID, + @RequestBody RelationshipRequestBody requestBody) + { + return restAPI.setupReferenceValueTag(serverName, userId, elementGUID, validValueGUID, requestBody); + } + + + /** + * Remove a reference value assignment relationship between an element and a valid value. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param validValueGUID unique identifier of the valid value + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/valid-values/{elementGUID}/reference-value-tags/{validValueGUID}/delete") + + public VoidResponse clearReferenceValueTag(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @PathVariable String validValueGUID, + @RequestBody ExternalSourceRequestBody requestBody) + { + return restAPI.clearReferenceValueTag(serverName, userId, elementGUID, validValueGUID, requestBody); + } + + + /** + * Remove the metadata element representing a validValue. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param validValueGUID unique identifier of the metadata element to remove + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/valid-values/{validValueGUID}/delete") + + public VoidResponse removeValidValue(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String validValueGUID, + @RequestBody ExternalSourceRequestBody requestBody) + { + return restAPI.removeValidValue(serverName, userId, validValueGUID, requestBody); + } + + + /** + * Retrieve the list of validValue metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param requestBody string to find in the properties + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/valid-values/by-search-string") + + public ValidValueListResponse findValidValues(@PathVariable String serverName, + @PathVariable String userId, + @RequestParam int startFrom, + @RequestParam int pageSize, + @RequestBody SearchStringRequestBody requestBody) + { + return restAPI.findValidValues(serverName, userId, requestBody, startFrom, pageSize); + } + + + /** + * Retrieve the list of validValue metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param requestBody name to search for + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/valid-values/by-name") + + public ValidValueListResponse getValidValuesByName(@PathVariable String serverName, + @PathVariable String userId, + @RequestParam int startFrom, + @RequestParam int pageSize, + @RequestBody NameRequestBody requestBody) + { + return restAPI.getValidValuesByName(serverName, userId, requestBody, startFrom, pageSize); + } + + + /** + * Page through the members of a valid value set. + * + * @param serverName called server + * @param userId calling user + * @param validValueSetGUID unique identifier of the valid value set + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of valid value beans + *

          + * InvalidParameterException name or userId is null + * PropertyServerException problem accessing property server + * UserNotAuthorizedException security access problem + */ + @GetMapping(path = "/valid-values/members/{validValueSetGUID}") + + public ValidValueListResponse getValidValueSetMembers(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String validValueSetGUID, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getValidValueSetMembers(serverName, userId, validValueSetGUID, startFrom, pageSize); + } + + + /** + * Page through the list of valid value sets that a valid value definition/set belongs to. + * + * @param serverName called server + * @param userId calling user + * @param validValueGUID unique identifier of the valid value + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of valid value beans + *

          + * InvalidParameterException name or userId is null + * PropertyServerException problem accessing property server + * UserNotAuthorizedException security access problem + */ + @GetMapping(path = "/valid-values/sets/{validValueGUID}") + + public ValidValueListResponse getSetsForValidValue(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String validValueGUID, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getSetsForValidValue(serverName, userId, validValueGUID, startFrom, pageSize); + } + + + /** + * Return information about the valid value set linked to an element as its + * set of valid values. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier for the element using the valid value set + * + * @return matching metadata element or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @GetMapping(path = "/valid-values/by-consumer/{elementGUID}") + + public ValidValueResponse getValidValuesForConsumer(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID) + { + return restAPI.getValidValuesForConsumer(serverName, userId, elementGUID); + } + + + /** + * Return information about the consumers linked to a valid value. + * + * @param serverName called server + * @param userId calling user + * @param validValueGUID unique identifier for the validValue + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching person roles + *

          + * InvalidParameterException name or userId is null + * PropertyServerException problem accessing property server + * UserNotAuthorizedException security access problem + */ + @GetMapping(path = "/valid-values/{validValueGUID}/consumers") + + public RelatedElementListResponse getConsumersOfValidValue(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String validValueGUID, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getConsumersOfValidValue(serverName, userId, validValueGUID, startFrom, pageSize); + } + + + /** + * Return information about the valid values linked as reference value tags to an element. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param elementGUID unique identifier for the element using the valid value set + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @GetMapping(path = "/valid-values/by-reference-value-tags/{elementGUID}") + + public ValidValueListResponse getReferenceValues(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getReferenceValues(serverName, userId, elementGUID, startFrom, pageSize); + } + + + /** + * Return information about the consumers linked to a valid value. + * + * @param serverName called server + * @param userId calling user + * @param validValueGUID unique identifier for the validValue + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching person roles + *

          + * InvalidParameterException name or userId is null + * PropertyServerException problem accessing property server + * UserNotAuthorizedException security access problem + */ + @GetMapping(path = "/valid-values/{validValueGUID}/by-reference-value-tag-assignees") + + public RelatedElementListResponse getAssigneesOfReferenceValue(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String validValueGUID, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getAssigneesOfReferenceValue(serverName, userId, validValueGUID, startFrom, pageSize); + } + + + /** + * Retrieve the list of validValue metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @GetMapping(path = "/valid-values") + + public ValidValueListResponse getAllValidValues(@PathVariable String serverName, + @PathVariable String userId, + @RequestParam int startFrom, + @RequestParam int pageSize) + { + return restAPI.getAllValidValues(serverName, userId, startFrom, pageSize); + } + + + /** + * Retrieve the validValue metadata element with the supplied unique identifier. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param guid unique identifier of the requested metadata element + * + * @return matching metadata element or + * InvalidParameterException one of the parameters is invalid or + * UserNotAuthorizedException the user is not authorized to issue this request or + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @GetMapping(path = "/valid-values/{guid}") + + public ValidValueResponse getValidValueByGUID(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String guid) + { + return restAPI.getValidValueByGUID(serverName, userId, guid); + } +} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/api/ManageReferenceData.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/api/ManageReferenceData.java index b7f750ae6ca..e68109404b0 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/api/ManageReferenceData.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/api/ManageReferenceData.java @@ -106,6 +106,7 @@ String createValidValueDefinition(String userId, * @param preferredValue the value that should be used in an implementation if possible. * @param isDeprecated is this value deprecated? * @param additionalProperties additional properties for this valid value. + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? * @param typeName name of subtype of the definition (or null to use the standard open type) * @param extendedProperties properties that need to be populated into a subtype. * @@ -123,6 +124,7 @@ void updateValidValue(String userId, String preferredValue, boolean isDeprecated, Map additionalProperties, + boolean isMergeUpdate, String typeName, Map extendedProperties) throws InvalidParameterException, UserNotAuthorizedException, diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-client/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/client/ReferenceDataManager.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-client/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/client/ReferenceDataManager.java index ecd84e5b40f..c2a04980a92 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-client/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/client/ReferenceDataManager.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-client/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/client/ReferenceDataManager.java @@ -276,6 +276,7 @@ public String createValidValueDefinition(String userId, * @param preferredValue the value that should be used in an implementation if possible. * @param isDeprecated is this value deprecated? * @param additionalProperties additional properties for this valid value. + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? * @param typeName name of subtype of the definition (or null to use the standard open type) * @param extendedProperties properties that need to be populated into a subtype. * @@ -294,6 +295,7 @@ public void updateValidValue(String userId, String preferredValue, boolean isDeprecated, Map additionalProperties, + boolean isMergeUpdate, String typeName, Map extendedProperties) throws InvalidParameterException, UserNotAuthorizedException, @@ -307,7 +309,7 @@ public void updateValidValue(String userId, invalidParameterHandler.validateGUID(validValueGUID, guidParameter, methodName); invalidParameterHandler.validateName(qualifiedName, nameParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/{2}/update"; + final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/{2}/update?isMergeUpdate={3}"; ValidValueProperties requestBody = new ValidValueProperties(); requestBody.setQualifiedName(qualifiedName); @@ -325,7 +327,8 @@ public void updateValidValue(String userId, requestBody, serverName, userId, - validValueGUID); + validValueGUID, + isMergeUpdate); } diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/ReferenceDataRESTServices.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/ReferenceDataRESTServices.java index c9028a620d4..a9b195446e3 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/ReferenceDataRESTServices.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/ReferenceDataRESTServices.java @@ -205,6 +205,7 @@ public GUIDResponse createValidValueDefinition(String serverName, * @param serverName name of calling server * @param userId calling user. * @param validValueGUID unique identifier of the valid value. + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? * @param requestBody parameters to update. * * @return void or @@ -215,6 +216,7 @@ public GUIDResponse createValidValueDefinition(String serverName, public VoidResponse updateValidValue(String serverName, String userId, String validValueGUID, + boolean isMergeUpdate, ValidValueProperties requestBody) { final String methodName = "updateValidValue"; @@ -248,12 +250,13 @@ public VoidResponse updateValidValue(String serverName, requestBody.getDescription(), requestBody.getUsage(), requestBody.getScope(), - requestBody.getPreferredValue(), requestBody.getIsDeprecated(), + requestBody.getPreferredValue(), requestBody.getAdditionalProperties(), requestBody.getExtendedProperties(), null, null, + isMergeUpdate, false, false, new Date(), diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-spring/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/spring/ReferenceDataResource.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-spring/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/spring/ReferenceDataResource.java index bc0f738e2c6..81aa524cf90 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-spring/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/spring/ReferenceDataResource.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-spring/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/spring/ReferenceDataResource.java @@ -100,6 +100,7 @@ public GUIDResponse createValidValueDefinition(@PathVariable String * @param serverName name of calling server * @param userId calling user. * @param validValueGUID unique identifier of the valid value. + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? * @param requestBody parameters to update. * * @return void or @@ -112,9 +113,11 @@ public GUIDResponse createValidValueDefinition(@PathVariable String public VoidResponse updateValidValue(@PathVariable String serverName, @PathVariable String userId, @PathVariable String validValueGUID, + @RequestParam(required = false, defaultValue = "true") + boolean isMergeUpdate, @RequestBody ValidValueProperties requestBody) { - return restAPI.updateValidValue(serverName, userId, validValueGUID, requestBody); + return restAPI.updateValidValue(serverName, userId, validValueGUID, isMergeUpdate, requestBody); } diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/CommunityHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/CommunityHandler.java index cd72d062326..23b74eaacbd 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/CommunityHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/CommunityHandler.java @@ -598,8 +598,7 @@ public List getCommunitiesByName(String userId, /** - * Retrieve the list of community metadata elements with a matching qualified or display name. - * There are no wildcards supported on this request. + * Retrieve the list of community metadata elements. * * @param userId calling user * @param startFrom paging start point diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ValidValuesHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ValidValuesHandler.java index 48305b4ce8d..1728c601a0e 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ValidValuesHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ValidValuesHandler.java @@ -76,6 +76,94 @@ public ValidValuesHandler(OpenMetadataAPIGenericConverter converter, } + + /** + * Create a new valid value set/definition. + * + * @param userId calling user. + * @param externalSourceGUID guid of the software capability entity that represented the external source - null for local + * @param externalSourceName name of the software capability entity that represented the external source + * @param qualifiedName unique name. + * @param displayName displayable descriptive name. + * @param description further information. + * @param usage how/when should this set be used. + * @param scope what is the scope of this set's values. + * @param isDeprecated is the valid value deprecated + * @param preferredValue value to use to represent this option. + * @param additionalProperties additional properties for this set. + * @param suppliedTypeName optional type name (default is ValidValueSet since it is the most flexible) + * @param extendedProperties properties that need to be populated into a subtype. + * @param effectiveFrom starting time for this relationship (null for all time) + * @param effectiveTo ending time for this relationship (null for all time) + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * @return unique identifier for the new set + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException the repository is not available or not working properly. + */ + public String createValidValue(String userId, + String externalSourceGUID, + String externalSourceName, + String qualifiedName, + String displayName, + String description, + String usage, + String scope, + boolean isDeprecated, + String preferredValue, + Map additionalProperties, + String suppliedTypeName, + Map extendedProperties, + Date effectiveFrom, + Date effectiveTo, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String nameParameter = "qualifiedName"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateName(qualifiedName, nameParameter, methodName); + + String typeName = OpenMetadataAPIMapper.VALID_VALUE_SET_TYPE_NAME; + + if (suppliedTypeName != null) + { + typeName = suppliedTypeName; + } + + String typeGUID = invalidParameterHandler.validateTypeName(typeName, OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, serviceName, methodName, repositoryHelper); + + ValidValuesBuilder builder = new ValidValuesBuilder(qualifiedName, + displayName, + description, + usage, + scope, + preferredValue, + isDeprecated, + additionalProperties, + extendedProperties, + repositoryHelper, + serviceName, + serverName); + + builder.setEffectivityDates(effectiveFrom, effectiveTo); + + return this.createBeanInRepository(userId, + externalSourceGUID, + externalSourceName, + typeGUID, + typeName, + qualifiedName, + OpenMetadataAPIMapper.QUALIFIED_NAME_PROPERTY_NAME, + builder, + effectiveTime, + methodName); + } + + /** * Create a new valid value set. This just creates the Set itself. Members are added either as they are * created, or they can be attached to a set after they are created. @@ -123,12 +211,13 @@ public String createValidValueSet(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(qualifiedName, nameParameter, methodName); + ValidValuesBuilder builder = new ValidValuesBuilder(qualifiedName, displayName, description, usage, scope, - null, + null, /* typically, not used in a set*/ isDeprecated, additionalProperties, extendedProperties, @@ -282,6 +371,7 @@ public String createValidValueDefinition(String userId, * @param extendedProperties properties that need to be populated into a subtype. * @param effectiveFrom starting time for this relationship (null for all time) * @param effectiveTo ending time for this relationship (null for all time) + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) @@ -299,12 +389,13 @@ public void updateValidValue(String userId, String description, String usage, String scope, - String preferredValue, boolean isDeprecated, + String preferredValue, Map additionalProperties, Map extendedProperties, Date effectiveFrom, Date effectiveTo, + boolean isMergeUpdate, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, @@ -317,7 +408,11 @@ public void updateValidValue(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(validValueGUID, guidParameter, methodName); - invalidParameterHandler.validateName(qualifiedName, nameParameter, methodName); + + if (! isMergeUpdate) + { + invalidParameterHandler.validateName(qualifiedName, nameParameter, methodName); + } ValidValuesBuilder builder = new ValidValuesBuilder(qualifiedName, displayName, @@ -345,7 +440,7 @@ public void updateValidValue(String userId, forDuplicateProcessing, supportedZones, builder.getInstanceProperties(methodName), - false, + isMergeUpdate, effectiveTime, methodName); } @@ -381,11 +476,9 @@ public void deleteValidValue(String userId, PropertyServerException { final String guidParameter = "validValueGUID"; - final String nameParameter = "qualifiedName"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(validValueGUID, guidParameter, methodName); - invalidParameterHandler.validateName(qualifiedName, nameParameter, methodName); this.deleteBeanInRepository(userId, externalSourceGUID, @@ -954,8 +1047,8 @@ public List getValidValueSetMembers(String userId, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + UserNotAuthorizedException, + PropertyServerException { return this.getAttachedElements(userId, null, @@ -1036,8 +1129,6 @@ public List getSetsForValidValue(String userId, * @param userId calling user * @param referenceableGUID unique identifier of anchoring referenceable * @param referenceableGUIDParameter name of parameter for referenceableGUID - * @param startFrom paging starting point - * @param pageSize maximum number of return values. * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) @@ -1047,32 +1138,27 @@ public List getSetsForValidValue(String userId, * @throws UserNotAuthorizedException the user is not authorized to make this request. * @throws PropertyServerException the repository is not available or not working properly. */ - public List getValidValues(String userId, - String referenceableGUID, - String referenceableGUIDParameter, - int startFrom, - int pageSize, - boolean forLineage, - boolean forDuplicateProcessing, - Date effectiveTime, - String methodName) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + public B getAssignedValidValues(String userId, + String referenceableGUID, + String referenceableGUIDParameter, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { - return this.getAttachedElements(userId, + return this.getAttachedElement(userId, referenceableGUID, referenceableGUIDParameter, OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, OpenMetadataAPIMapper.VALID_VALUES_ASSIGNMENT_RELATIONSHIP_TYPE_GUID, OpenMetadataAPIMapper.VALID_VALUES_ASSIGNMENT_RELATIONSHIP_TYPE_NAME, OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, - null, - null, 2, forLineage, forDuplicateProcessing, - startFrom, - pageSize, + supportedZones, effectiveTime, methodName); } @@ -1124,4 +1210,46 @@ public List getReferenceValues(String userId, effectiveTime, methodName); } + + + /** + * Retrieve the list of valid values metadata elements. + * + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + + * @param methodName calling method + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public List getValidValues(String userId, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return this.getBeansByType(userId, + OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_GUID, + OpenMetadataAPIMapper.VALID_VALUE_DEFINITION_TYPE_NAME, + null, + forLineage, + forDuplicateProcessing, + supportedZones, + startFrom, + pageSize, + effectiveTime, + methodName); + } } diff --git a/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive.java b/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive.java index b8cf1a1b025..3e3affe3750 100644 --- a/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive.java +++ b/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive.java @@ -164,6 +164,7 @@ public void getOriginalTypes() * Calls for new and changed types go here */ update0010BaseModel(); + add0022Translations(); update0025Locations(); update0110ActorProfile(); update0130Projects(); @@ -261,6 +262,135 @@ private TypeDefPatch updateDataContentForDataSet() } + /* + * ------------------------------------------------------------------------------------------------------- + */ + + private void add0022Translations() + { + this.archiveBuilder.addEntityDef(getTranslationDetailEntity()); + this.archiveBuilder.addRelationshipDef(getTranslationLinkRelationship()); + } + + + private RelationshipDef getTranslationLinkRelationship() + { + final String guid = "576228af-33ec-4588-ba4e-6a864a097e10"; + final String name = "TranslationLink"; + final String description = "Links an entity to a collection of translated properties."; + final String descriptionGUID = null; + + final ClassificationPropagationRule classificationPropagationRule = ClassificationPropagationRule.NONE; + + RelationshipDef relationshipDef = archiveHelper.getBasicRelationshipDef(guid, + name, + null, + description, + descriptionGUID, + classificationPropagationRule); + + RelationshipEndDef relationshipEndDef; + + /* + * Set up end 1. + */ + final String end1EntityType = "OpenMetadataRoot"; + final String end1AttributeName = "translates"; + final String end1AttributeDescription = "Entity that is translated."; + final String end1AttributeDescriptionGUID = null; + final RelationshipEndCardinality end1Cardinality = RelationshipEndCardinality.AT_MOST_ONE; + + relationshipEndDef = archiveHelper.getRelationshipEndDef(this.archiveBuilder.getEntityDef(end1EntityType), + end1AttributeName, + end1AttributeDescription, + end1AttributeDescriptionGUID, + end1Cardinality); + relationshipDef.setEndDef1(relationshipEndDef); + + /* + * Set up end 2. + */ + final String end2EntityType = "TranslationDetail"; + final String end2AttributeName = "translation"; + final String end2AttributeDescription = "Translation of entity for a single language."; + final String end2AttributeDescriptionGUID = null; + final RelationshipEndCardinality end2Cardinality = RelationshipEndCardinality.ANY_NUMBER; + + relationshipEndDef = archiveHelper.getRelationshipEndDef(this.archiveBuilder.getEntityDef(end2EntityType), + end2AttributeName, + end2AttributeDescription, + end2AttributeDescriptionGUID, + end2Cardinality); + relationshipDef.setEndDef2(relationshipEndDef); + + return relationshipDef; + } + + + private EntityDef getTranslationDetailEntity() + { + final String guid = "d7df0579-8671-48f0-a8aa-38a487d418c8"; + final String name = "TranslationDetail"; + final String description = "A collection of translated properties."; + final String descriptionGUID = null; + + final String superTypeName = "OpenMetadataRoot"; + + EntityDef entityDef = archiveHelper.getDefaultEntityDef(guid, + name, + this.archiveBuilder.getEntityDef(superTypeName), + description, + descriptionGUID); + + /* + * Build the attributes + */ + List properties = new ArrayList<>(); + TypeDefAttribute property; + + final String attribute1Name = "language"; + final String attribute1Description = "Language for the translation."; + final String attribute1DescriptionGUID = null; + final String attribute2Name = "locale"; + final String attribute2Description = "Locale for the translation."; + final String attribute2DescriptionGUID = null; + final String attribute3Name = "displayName"; + final String attribute3Description = "Translation of the name or displayName property."; + final String attribute3DescriptionGUID = null; + final String attribute4Name = "description"; + final String attribute4Description = "Translation of the description property."; + final String attribute4DescriptionGUID = null; + final String attribute5Name = "additionalTranslations"; + final String attribute5Description = "Translations of other string properties found in the linked entity."; + final String attribute5DescriptionGUID = null; + + property = archiveHelper.getStringTypeDefAttribute(attribute1Name, + attribute1Description, + attribute1DescriptionGUID); + properties.add(property); + property = archiveHelper.getStringTypeDefAttribute(attribute2Name, + attribute2Description, + attribute2DescriptionGUID); + properties.add(property); + property = archiveHelper.getStringTypeDefAttribute(attribute3Name, + attribute3Description, + attribute3DescriptionGUID); + properties.add(property); + property = archiveHelper.getStringTypeDefAttribute(attribute4Name, + attribute4Description, + attribute4DescriptionGUID); + properties.add(property); + property = archiveHelper.getArrayStringTypeDefAttribute(attribute5Name, + attribute5Description, + attribute5DescriptionGUID); + properties.add(property); + + entityDef.setPropertiesDefinition(properties); + + return entityDef; + } + + /* * ------------------------------------------------------------------------------------------------------- */ diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-consumer-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/fvt/errorhandling/InvalidParameterTest.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-consumer-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/fvt/errorhandling/InvalidParameterTest.java index 0a95195466d..5ae09fcd754 100644 --- a/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-consumer-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/fvt/errorhandling/InvalidParameterTest.java +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-consumer-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/fvt/errorhandling/InvalidParameterTest.java @@ -115,7 +115,7 @@ private void testAssetConsumerClient(String serverName, /** - * Test combinations of invalid parameters passed to createValidValueSet. + * Test combinations of invalid parameters passed to getAssetForConnection. * * @param userId calling user * @param client client to call diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/CommunityProfileOMASFVTSuite.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/CommunityProfileOMASFVTSuite.java index 9a40bd436c9..03e2a458bf3 100644 --- a/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/CommunityProfileOMASFVTSuite.java +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/CommunityProfileOMASFVTSuite.java @@ -5,6 +5,7 @@ import org.odpi.openmetadata.accessservices.communityprofile.fvt.clientconstructors.ClientConstructorTest; import org.odpi.openmetadata.accessservices.communityprofile.fvt.profiles.CreateProfileTest; import org.odpi.openmetadata.accessservices.communityprofile.fvt.errorhandling.InvalidParameterTest; +import org.odpi.openmetadata.accessservices.communityprofile.fvt.validvalues.CreateValidValuesSetTest; import org.odpi.openmetadata.fvt.utilities.FVTResults; import org.odpi.openmetadata.fvt.utilities.FVTSuiteBase; import org.odpi.openmetadata.http.HttpHelper; @@ -70,6 +71,12 @@ public int performFVT(String serverName, FVTResults results; + results = CreateValidValuesSetTest.performFVT(serverName, serverPlatformRootURL, userId); + if (! results.isSuccessful()) + { + returnCode --; + } + results.printResults(serverName); results = ClientConstructorTest.performFVT(serverName, serverPlatformRootURL); if (! results.isSuccessful()) { diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/profiles/CreateProfileTest.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/profiles/CreateProfileTest.java index db1f9f612d2..212123ceff3 100644 --- a/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/profiles/CreateProfileTest.java +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/profiles/CreateProfileTest.java @@ -73,7 +73,7 @@ public static FVTResults performFVT(String serverName, /** - * Run all of the tests in this class. + * Run all the tests in this class. * * @param serverPlatformRootURL root url of the server * @param serverName name of the server diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/validvalues/CreateValidValuesSetTest.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/validvalues/CreateValidValuesSetTest.java new file mode 100644 index 00000000000..9279b58abdd --- /dev/null +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/validvalues/CreateValidValuesSetTest.java @@ -0,0 +1,932 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.communityprofile.fvt.validvalues; + + +import org.odpi.openmetadata.accessservices.communityprofile.client.ValidValueManagement; +import org.odpi.openmetadata.accessservices.communityprofile.client.rest.CommunityProfileRESTClient; +import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.ValidValueElement; +import org.odpi.openmetadata.accessservices.communityprofile.properties.ValidValueMembershipProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.ValidValueProperties; +import org.odpi.openmetadata.adminservices.configuration.registration.AccessServiceDescription; +import org.odpi.openmetadata.frameworks.auditlog.AuditLog; +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.fvt.utilities.FVTResults; +import org.odpi.openmetadata.fvt.utilities.auditlog.FVTAuditLogDestination; +import org.odpi.openmetadata.fvt.utilities.exceptions.FVTUnexpectedCondition; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +/** + * CreateValidValuesSetTest calls the ValidValueManagement to create a valid values set with nested definitions + * and then retrieve the results. + */ +public class CreateValidValuesSetTest +{ + private final static String testCaseName = "CreateValidValuesSetTest"; + + private final static int maxPageSize = 100; + + /* + * The values below describe the valid value set that is being built. + */ + private final static String validValuesSetName = "TestValidValuesSet"; + private final static String validValuesSetDisplayName = "TestValidValuesSet displayName"; + private final static String validValuesSetDescription = "TestValidValuesSet description"; + private final static String validValuesSetUsage = "TestValidValuesSet usage"; + private final static String validValuesSetScope = "TestValidValuesSet scope"; + + /* + * These are the two valid value definitions that are part of the set. + */ + private final static String validValue1Name = "TestValidValue1"; + private final static String validValue1DisplayName = "TestValidValue1 displayName"; + private final static String validValue1Description = "TestValidValue1 description"; + private final static String validValue1Usage = "TestValidValue1 usage"; + private final static String validValue1Scope = "TestValidValue1 scope"; + private final static String validValue1PreferredValue = "TestValidValue1 preferredValue"; + private final static String validValue1AdditionalPropertyName = "TestValidValue1 additionalPropertyName"; + private final static String validValue1AdditionalPropertyValue = "TestValidValue1 additionalPropertyValue"; + private final static String validValue2Name = "TestValidValue2"; + private final static String validValue2DisplayName = "TestValidValue2 displayName"; + private final static String validValue2Description = "TestValidValue2 description"; + private final static String validValue2Usage = "TestValidValue2 usage"; + private final static String validValue2Scope = "TestValidValue2 scope"; + private final static String validValue2PreferredValue = "TestValidValue2 preferredValue"; + private final static String validValue2NameUpdate = "TestValidValue2 - updated"; + + private final static String searchString = ".*Test.*"; + + + /** + * Run all the defined tests and capture the results. + * + * @param serverName name of the server to connect to + * @param serverPlatformRootURL the network address of the server running the OMAS REST servers + * @param userId calling user + * @return results of running test + */ + public static FVTResults performFVT(String serverName, + String serverPlatformRootURL, + String userId) + { + FVTResults results = new FVTResults(testCaseName); + + results.incrementNumberOfTests(); + try + { + CreateValidValuesSetTest.runIt(serverPlatformRootURL, serverName, userId, results.getAuditLogDestination()); + results.incrementNumberOfSuccesses(); + } + catch (Exception error) + { + results.addCapturedError(error); + } + + return results; + } + + + /** + * Run all the tests in this class. + * + * @param serverPlatformRootURL root url of the server + * @param serverName name of the server + * @param userId calling user + * @param auditLogDestination logging destination + * @throws FVTUnexpectedCondition the test case failed + */ + private static void runIt(String serverPlatformRootURL, + String serverName, + String userId, + FVTAuditLogDestination auditLogDestination) throws FVTUnexpectedCondition + { + CreateValidValuesSetTest thisTest = new CreateValidValuesSetTest(); + + AuditLog auditLog = new AuditLog(auditLogDestination, + AccessServiceDescription.COMMUNITY_PROFILE_OMAS.getAccessServiceCode(), + AccessServiceDescription.COMMUNITY_PROFILE_OMAS.getAccessServiceDevelopmentStatus(), + AccessServiceDescription.COMMUNITY_PROFILE_OMAS.getAccessServiceName(), + AccessServiceDescription.COMMUNITY_PROFILE_OMAS.getAccessServiceDescription(), + AccessServiceDescription.COMMUNITY_PROFILE_OMAS.getAccessServiceWiki()); + + ValidValueManagement client = thisTest.getValidValuesManagerClient(serverName, serverPlatformRootURL, auditLog); + String validValuesSet = thisTest.createValidValueSet(client, userId); + + thisTest.createValidValueDefinitions(client, validValuesSet, userId); + + thisTest.deleteValidValuesSet(client, validValuesSet, userId); + } + + + /** + * Create and return a valid values' manager client. + * + * @param serverName name of the server to connect to + * @param serverPlatformRootURL the network address of the server running the OMAS REST servers + * @param auditLog logging destination + * @return client + * @throws FVTUnexpectedCondition the test case failed + */ + private ValidValueManagement getValidValuesManagerClient(String serverName, + String serverPlatformRootURL, + AuditLog auditLog) throws FVTUnexpectedCondition + { + final String activityName = "getValidValuesManagerClient"; + + try + { + CommunityProfileRESTClient restClient = new CommunityProfileRESTClient(serverName, serverPlatformRootURL, auditLog); + + return new ValidValueManagement(serverName, serverPlatformRootURL, restClient, maxPageSize); + } + catch (Exception unexpectedError) + { + throw new FVTUnexpectedCondition(testCaseName, activityName, unexpectedError); + } + } + + + /** + * Create a valid value set and return its GUID. + * + * @param client interface to Digital Architecture OMAS + * @param userId calling user + * @return guid of set + * @throws FVTUnexpectedCondition the test case failed + */ + private String createValidValueSet(ValidValueManagement client, + String userId) throws FVTUnexpectedCondition + { + final String activityName = "createValidValueSet"; + + try + { + ValidValueProperties validValueProperties = new ValidValueProperties(); + + validValueProperties.setTypeName("ValidValuesSet"); + validValueProperties.setQualifiedName(validValuesSetName); + validValueProperties.setDisplayName(validValuesSetDisplayName); + validValueProperties.setDescription(validValuesSetDescription); + validValueProperties.setUsage(validValuesSetUsage); + validValueProperties.setScope(validValuesSetScope); + + String validValuesSetGUID = client.createValidValue(userId, null, null, validValueProperties); + + if (validValuesSetGUID == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no GUID for Create)"); + } + + ValidValueElement retrievedElement = client.getValidValueByGUID(userId, validValuesSetGUID); + ValidValueProperties retrievedSet = retrievedElement.getValidValueProperties(); + + if (retrievedSet == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no Valid Values Set from Retrieve)"); + } + + if (! validValuesSetName.equals(retrievedSet.getQualifiedName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad qualifiedName from Retrieve)"); + } + if (! validValuesSetDisplayName.equals(retrievedSet.getDisplayName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad displayName from Retrieve)"); + } + if (! validValuesSetDescription.equals(retrievedSet.getDescription())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad description from Retrieve)"); + } + if (! validValuesSetUsage.equals(retrievedSet.getUsage())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad usage from Retrieve)"); + } + if (! validValuesSetScope.equals(retrievedSet.getScope())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad scope from Retrieve)"); + } + if (retrievedSet.getPreferredValue() != null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad preferredValue from Retrieve)"); + } + + List validValueList = client.getValidValuesByName(userId, validValuesSetName, 0, maxPageSize); + + if (validValueList == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no valid value for RetrieveByName)"); + } + else if (validValueList.isEmpty()) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Empty valid value list for RetrieveByName)"); + } + else if (validValueList.size() != 1) + { + throw new FVTUnexpectedCondition(testCaseName, + activityName + "(Valid value list for RetrieveByName contains" + validValueList.size() + + " elements)"); + } + + retrievedElement = validValueList.get(0); + retrievedSet = retrievedElement.getValidValueProperties(); + + if (! validValuesSetName.equals(retrievedSet.getQualifiedName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad qualifiedName from RetrieveByName)"); + } + if (! validValuesSetDisplayName.equals(retrievedSet.getDisplayName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad displayName from RetrieveByName)"); + } + if (! validValuesSetDescription.equals(retrievedSet.getDescription())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad description from RetrieveByName)"); + } + if (! validValuesSetUsage.equals(retrievedSet.getUsage())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad usage from RetrieveByName)"); + } + if (! validValuesSetScope.equals(retrievedSet.getScope())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad scope from RetrieveByName)"); + } + if (retrievedSet.getPreferredValue() != null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad preferredValue from RetrieveByName)"); + } + + return validValuesSetGUID; + } + catch (FVTUnexpectedCondition testCaseError) + { + throw testCaseError; + } + catch (Exception unexpectedError) + { + throw new FVTUnexpectedCondition(testCaseName, activityName, unexpectedError); + } + } + + + /** + * Two valid value definitions for the set using a variety of mechanisms. + * + * @param client interface to Digital Architecture OMAS + * @param validValueSetGUID unique identifier of the valid value set + * @param userId calling user + * @throws FVTUnexpectedCondition the test case failed + */ + private void createValidValueDefinitions(ValidValueManagement client, + String validValueSetGUID, + String userId) throws FVTUnexpectedCondition + { + final String activityName = "createValidValueDefinitions"; + + try + { + Map additionalProperties = new HashMap<>(); + additionalProperties.put(validValue1AdditionalPropertyName, validValue1AdditionalPropertyValue); + + ValidValueProperties validValueProperties = new ValidValueProperties(); + + validValueProperties.setTypeName("ValidValuesSet"); // Yes this is deliberate + validValueProperties.setQualifiedName(validValue1Name); + validValueProperties.setDisplayName(validValue1DisplayName); + validValueProperties.setDescription( validValue1Description); + validValueProperties.setUsage(validValue1Usage); + validValueProperties.setScope(validValue1Scope); + validValueProperties.setPreferredValue(validValue1PreferredValue); + validValueProperties.setAdditionalProperties(additionalProperties); + + String validValue1GUID = client.createValidValue(userId, null, null, validValueProperties); + + if (validValue1GUID == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no GUID for Create of definition 1)"); + } + + client.setupValidValueMember(userId, null, null, validValueSetGUID, null, validValue1GUID); + + ValidValueElement retrievedElement = client.getValidValueByGUID(userId, validValue1GUID); + ValidValueProperties retrievedDefinition = retrievedElement.getValidValueProperties(); + + if (retrievedDefinition == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no Valid Values definition 1 from Retrieve)"); + } + + if (! validValue1Name.equals(retrievedDefinition.getQualifiedName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad qualifiedName from Retrieve of 1)"); + } + if (! validValue1DisplayName.equals(retrievedDefinition.getDisplayName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad displayName from Retrieve of 1)"); + } + if (! validValue1Description.equals(retrievedDefinition.getDescription())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad description from Retrieve of 1)"); + } + if (! validValue1Usage.equals(retrievedDefinition.getUsage())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad usage from Retrieve of 1)"); + } + if (! validValue1Scope.equals(retrievedDefinition.getScope())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad scope from Retrieve of 1)"); + } + if (! validValue1PreferredValue.equals(retrievedDefinition.getPreferredValue())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad preferredValue from Retrieve of 1)"); + } + if (retrievedDefinition.getAdditionalProperties() == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(null additionalProperties from Retrieve of 1)"); + } + else if (! validValue1AdditionalPropertyValue.equals(retrievedDefinition.getAdditionalProperties().get(validValue1AdditionalPropertyName))) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(bad additionalProperties from Retrieve of 1)"); + } + + List validValueList = client.getValidValuesByName(userId, validValue1Name, 0, maxPageSize); + + if (validValueList == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no valid value for RetrieveByName of 1)"); + } + else if (validValueList.isEmpty()) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Empty valid value list for RetrieveByName of 1)"); + } + else if (validValueList.size() != 1) + { + throw new FVTUnexpectedCondition(testCaseName, + activityName + "(Valid value list for RetrieveByName of 1 contains" + validValueList.size() + + " elements)"); + } + + retrievedElement = validValueList.get(0); + retrievedDefinition = retrievedElement.getValidValueProperties(); + + if (retrievedDefinition == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no Valid Values definition 1 from Retrieve)"); + } + + if (! validValue1Name.equals(retrievedDefinition.getQualifiedName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad qualifiedName from RetrieveByName of 1)"); + } + if (! validValue1DisplayName.equals(retrievedDefinition.getDisplayName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad displayName from RetrieveByName of 1)"); + } + if (! validValue1Description.equals(retrievedDefinition.getDescription())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad description from RetrieveByName of 1)"); + } + if (! validValue1Usage.equals(retrievedDefinition.getUsage())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad usage from RetrieveByName of 1)"); + } + if (! validValue1Scope.equals(retrievedDefinition.getScope())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad scope from RetrieveByName of 1)"); + } + if (! validValue1PreferredValue.equals(retrievedDefinition.getPreferredValue())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad preferredValue from RetrieveByName of 1)"); + } + + validValueList = client.findValidValues(userId, searchString, 0, maxPageSize); + + if (validValueList == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no valid value for findValidValues of 1)"); + } + else if (validValueList.isEmpty()) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Empty valid value list for findValidValues of 1)"); + } + else if (validValueList.size() != 2) + { + throw new FVTUnexpectedCondition(testCaseName, + activityName + "(Valid value list for findValidValues of 1 contains" + validValueList.size() + + " elements)"); + } + + validValueList = client.getValidValueSetMembers(userId, validValueSetGUID, 0, maxPageSize); + + if (validValueList == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no valid value for RetrieveSetMembers of 1)"); + } + else if (validValueList.isEmpty()) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Empty valid value list for RetrieveSetMembers of 1)"); + } + else if (validValueList.size() != 1) + { + throw new FVTUnexpectedCondition(testCaseName, + activityName + "(Valid value list for RetrieveSetMembers of 1 contains" + validValueList.size() + + " elements)"); + } + else + { + retrievedElement = validValueList.get(0); + retrievedDefinition = retrievedElement.getValidValueProperties(); + } + + if (retrievedDefinition == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no Valid Values definition 1 from RetrieveOfMembers)"); + } + + if (! validValue1Name.equals(retrievedDefinition.getQualifiedName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad qualifiedName from RetrieveOfMembers of 1)"); + } + if (! validValue1DisplayName.equals(retrievedDefinition.getDisplayName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad displayName from RetrieveOfMembers of 1)"); + } + if (! validValue1Description.equals(retrievedDefinition.getDescription())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad description from RetrieveOfMembers of 1)"); + } + if (! validValue1Usage.equals(retrievedDefinition.getUsage())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad usage from RetrieveOfMembers of 1)"); + } + if (! validValue1Scope.equals(retrievedDefinition.getScope())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad scope from RetrieveOfMembers of 1)"); + } + if (! validValue1PreferredValue.equals(retrievedDefinition.getPreferredValue())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad preferredValue from RetrieveOfMembers of 1)"); + } + + /* + * Check that not possible to create an element with the same qualified name. + */ + try + { + client.createValidValue(userId, null, null, validValueProperties); + + throw new FVTUnexpectedCondition(testCaseName, activityName + "(duplicate create of valid value definition allowed)"); + } + catch (InvalidParameterException okResult) + { + // nothing to do + } + + /* + * Now do the second value + */ + ValidValueProperties validValueProperties2 = new ValidValueProperties(); + + + validValueProperties2.setTypeName("ValidValuesSet"); // Yes this is deliberate + validValueProperties2.setQualifiedName(validValue2Name); + validValueProperties2.setDisplayName(validValue2DisplayName); + validValueProperties2.setDescription( validValue2Description); + validValueProperties2.setUsage(validValue2Usage); + validValueProperties2.setScope(validValue2Scope); + validValueProperties2.setAdditionalProperties(additionalProperties); + + String validValue2GUID = client.createValidValue(userId, null, null, validValueProperties2); + + if (validValue2GUID == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no GUID for Create of definition 2)"); + } + + client.setupValidValueMember(userId, null, null, validValueSetGUID, null, validValue2GUID); + + retrievedElement = client.getValidValueByGUID(userId, validValue2GUID); + retrievedDefinition = retrievedElement.getValidValueProperties(); + + if (retrievedDefinition == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no Valid Values definition 2 from Retrieve)"); + } + + if (! validValue2Name.equals(retrievedDefinition.getQualifiedName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad qualifiedName from Retrieve of 2)"); + } + if (! validValue2DisplayName.equals(retrievedDefinition.getDisplayName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad displayName from Retrieve of 2)"); + } + if (! validValue2Description.equals(retrievedDefinition.getDescription())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad description from Retrieve of 2)"); + } + if (! validValue2Usage.equals(retrievedDefinition.getUsage())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad usage from Retrieve of 2)"); + } + if (! validValue2Scope.equals(retrievedDefinition.getScope())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad scope from Retrieve of 2)"); + } + if (retrievedDefinition.getPreferredValue() != null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad preferredValue from Retrieve of 2)"); + } + if (retrievedDefinition.getIsDeprecated()) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad isDeprecated from Retrieve of 2)"); + } + + validValueList = client.getValidValuesByName(userId, validValue2Name, 0, maxPageSize); + + if (validValueList == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no valid value for RetrieveByName of 2)"); + } + else if (validValueList.isEmpty()) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Empty valid value list for RetrieveByName of 2)"); + } + else if (validValueList.size() != 1) + { + throw new FVTUnexpectedCondition(testCaseName, + activityName + "(Valid value list for RetrieveByName of 2 contains" + validValueList.size() + + " elements)"); + } + + retrievedElement = validValueList.get(0); + retrievedDefinition = retrievedElement.getValidValueProperties(); + + if (! validValue2Name.equals(retrievedDefinition.getQualifiedName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad qualifiedName from RetrieveByName of 2)"); + } + if (! validValue2DisplayName.equals(retrievedDefinition.getDisplayName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad displayName from RetrieveByName of 2)"); + } + if (! validValue2Description.equals(retrievedDefinition.getDescription())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad description from RetrieveByName of 2)"); + } + if (! validValue2Usage.equals(retrievedDefinition.getUsage())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad usage from RetrieveByName of 2)"); + } + if (! validValue2Scope.equals(retrievedDefinition.getScope())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad scope from RetrieveByName of 2)"); + } + if (retrievedDefinition.getPreferredValue() != null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad preferredValue from RetrieveByName of 2)"); + } + if (retrievedDefinition.getIsDeprecated()) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad isDeprecated from RetrieveByName of 2)"); + } + + validValueList = client.findValidValues(userId, searchString, 0, maxPageSize); + + if (validValueList == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no valid value for findValidValues of all)"); + } + else if (validValueList.isEmpty()) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Empty valid value list for findValidValues of all)"); + } + else if (validValueList.size() != 3) + { + throw new FVTUnexpectedCondition(testCaseName, + activityName + "(Valid value list for findValidValues of all contains" + validValueList.size() + + " elements)"); + } + + validValueList = client.getValidValueSetMembers(userId, validValueSetGUID, 0, maxPageSize); + + if (validValueList == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no valid value for RetrieveSetMembers of both)"); + } + else if (validValueList.isEmpty()) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Empty valid value list for RetrieveSetMembers of both)"); + } + else if (validValueList.size() != 2) + { + throw new FVTUnexpectedCondition(testCaseName, + activityName + "(Valid value list for RetrieveSetMembers of both contains" + validValueList.size() + + " elements)"); + } + + /* + * Add the preferred value and isDeprecated + */ + ValidValueProperties validValueProperties3 = new ValidValueProperties(); + validValueProperties3.setPreferredValue(validValue2PreferredValue); + validValueProperties3.setIsDeprecated(true); + + client.updateValidValue(userId, + null, + null, + validValue2GUID, + true, + validValueProperties3); + + retrievedElement = client.getValidValueByGUID(userId, validValue2GUID); + retrievedDefinition = retrievedElement.getValidValueProperties(); + + if (! validValue2Name.equals(retrievedDefinition.getQualifiedName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad qualifiedName from RetrieveUpdate of 2)"); + } + if (! validValue2DisplayName.equals(retrievedDefinition.getDisplayName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad displayName from RetrieveUpdate of 2)"); + } + if (! validValue2Description.equals(retrievedDefinition.getDescription())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad description from RetrieveUpdate of 2)"); + } + if (! validValue2Usage.equals(retrievedDefinition.getUsage())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad usage from RetrieveUpdate of 2)"); + } + if (! validValue2Scope.equals(retrievedDefinition.getScope())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad scope from RetrieveUpdate of 2)"); + } + if (! validValue2PreferredValue.equals(retrievedDefinition.getPreferredValue())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad preferredValue from RetrieveUpdate of 2)"); + } + if (! retrievedDefinition.getIsDeprecated()) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad isDeprecated from RetrieveUpdate of 2)"); + } + + + /* + * Update valid value 2 with valid value 1's qualified name - this should fail + */ + try + { + ValidValueProperties validValueProperties4 = new ValidValueProperties(); + + validValueProperties4.setQualifiedName(validValue1Name); + + client.updateValidValue(userId, + null, + null, + validValue2GUID, + true, + validValueProperties4); + + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Duplicate update allowed)"); + } + catch (InvalidParameterException expectedResult) + { + // all ok + } + + /* + * Valid value 2 should be exactly as it was + */ + retrievedElement = client.getValidValueByGUID(userId, validValue2GUID); + retrievedDefinition = retrievedElement.getValidValueProperties(); + + if (! validValue2Name.equals(retrievedDefinition.getQualifiedName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad qualifiedName from RetrieveUpdate of 2 after qualified name failed change)"); + } + if (! validValue2DisplayName.equals(retrievedDefinition.getDisplayName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad displayName from RetrieveUpdate of 2 after qualified name failed change)"); + } + if (! validValue2Description.equals(retrievedDefinition.getDescription())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad description from RetrieveUpdate of 2 after qualified name failed change)"); + } + if (! validValue2Usage.equals(retrievedDefinition.getUsage())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad usage from RetrieveUpdate of 2 after qualified name failed change)"); + } + if (! validValue2Scope.equals(retrievedDefinition.getScope())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad scope from RetrieveUpdate of 2 after qualified name failed change)"); + } + if (! validValue2PreferredValue.equals(retrievedDefinition.getPreferredValue())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad preferredValue from RetrieveUpdate of 2)"); + } + if (! retrievedDefinition.getIsDeprecated()) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad isDeprecated from RetrieveUpdate of 2)"); + } + + + /* + * Update valid value 2 with a new qualified name - this should work ok + */ + validValueProperties2.setQualifiedName(validValue2NameUpdate); + validValueProperties2.setPreferredValue(validValue2PreferredValue); + validValueProperties2.setIsDeprecated(true); + + client.updateValidValue(userId, + null, + null, + validValue2GUID, + false, + validValueProperties2); + + /* + * Valid value 2 should be updated + */ + retrievedElement = client.getValidValueByGUID(userId, validValue2GUID); + retrievedDefinition = retrievedElement.getValidValueProperties(); + + if (! validValue2NameUpdate.equals(retrievedDefinition.getQualifiedName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad qualifiedName from RetrieveUpdate of 2 after qualified name change)"); + } + if (! validValue2DisplayName.equals(retrievedDefinition.getDisplayName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad displayName from RetrieveUpdate of 2 after qualified name change)"); + } + if (! validValue2Description.equals(retrievedDefinition.getDescription())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad description from RetrieveUpdate of 2 after qualified name change)"); + } + if (! validValue2Usage.equals(retrievedDefinition.getUsage())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad usage from RetrieveUpdate of 2 after qualified name change)"); + } + if (! validValue2Scope.equals(retrievedDefinition.getScope())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad scope from RetrieveUpdate of 2 after qualified name change)"); + } + if (! validValue2PreferredValue.equals(retrievedDefinition.getPreferredValue())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad preferredValue from RetrieveUpdate of 2 after qualified name change)"); + } + if (! retrievedDefinition.getIsDeprecated()) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad isDeprecated from RetrieveUpdate of 2 after qualified name change)"); + } + + + /* + * By detaching definition 2, then should only get value 1 back from the set membership request. + */ + client.clearValidValueMember(userId, null, null, validValueSetGUID, validValue2GUID); + + validValueList = client.getValidValueSetMembers(userId, validValueSetGUID, 0, maxPageSize); + + if (validValueList == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no valid value for RetrieveSetMembers of 1 after detach)"); + } + else if (validValueList.isEmpty()) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Empty valid value list for RetrieveSetMembers of 1 after detach)"); + } + else if (validValueList.size() != 1) + { + throw new FVTUnexpectedCondition(testCaseName, + activityName + "(Valid value list for RetrieveSetMembers after detach of 1 contains" + validValueList.size() + + " elements)"); + } + else + { + retrievedElement = validValueList.get(0); + retrievedDefinition = retrievedElement.getValidValueProperties(); + } + + if (retrievedDefinition == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no Valid Values definition 1 from RetrieveOfMembers of 1 after detach)"); + } + + if (! validValue1Name.equals(retrievedDefinition.getQualifiedName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad qualifiedName from RetrieveOfMembers of 1 after detach)"); + } + if (! validValue1DisplayName.equals(retrievedDefinition.getDisplayName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad displayName from RetrieveOfMembers of 1 after detach)"); + } + if (! validValue1Description.equals(retrievedDefinition.getDescription())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad description from RetrieveOfMembers of 1 after detach)"); + } + if (! validValue1Usage.equals(retrievedDefinition.getUsage())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad usage from RetrieveOfMembers of 1 after detach)"); + } + if (! validValue1Scope.equals(retrievedDefinition.getScope())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad scope from RetrieveOfMembers of 1 after detach)"); + } + if (! validValue1PreferredValue.equals(retrievedDefinition.getPreferredValue())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad preferredValue from RetrieveOfMembers of 1 after detach)"); + } + + /* + * Now reattach value 2 and check it reappears in the set. + */ + ValidValueMembershipProperties membershipProperties = new ValidValueMembershipProperties(); + + membershipProperties.setDefaultValue(false); + + client.setupValidValueMember(userId, null,null, validValueSetGUID, null, validValue2GUID); + + validValueList = client.getValidValueSetMembers(userId, validValueSetGUID, 0, maxPageSize); + + if (validValueList == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no valid value for RetrieveSetMembers of both after reattach)"); + } + else if (validValueList.isEmpty()) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Empty valid value list for RetrieveSetMembers of of both after reattach)"); + } + else if (validValueList.size() != 2) + { + throw new FVTUnexpectedCondition(testCaseName, + activityName + "(Valid value list for RetrieveSetMembers of both after reattach contains" + validValueList.size() + + " elements)"); + } + } + catch (FVTUnexpectedCondition testCaseError) + { + throw testCaseError; + } + catch (Exception unexpectedError) + { + throw new FVTUnexpectedCondition(testCaseName, activityName, unexpectedError); + } + } + + + /** + * Delete the set and check that the valid value definitions connected to it are also gone. + * + * @param client interface to Digital Architecture OMAS + * @param validValueSetGUID unique identifier of the valid value set + * @param userId calling user + * @throws FVTUnexpectedCondition the test case failed + */ + private void deleteValidValuesSet(ValidValueManagement client, + String validValueSetGUID, + String userId) throws FVTUnexpectedCondition + { + final String activityName = "deleteValidValuesSet"; + + try + { + client.removeValidValue(userId, null, null, validValueSetGUID); + + /* + * Check it has really gone. + */ + try + { + client.getValidValueByGUID(userId, validValueSetGUID); + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Deleted value value set returned)"); + } + catch (InvalidParameterException expectedException) + { + // All ok + } + + /* + * Check for no cascaded delete + */ + List searchResults = client.findValidValues(userId, searchString, 0, maxPageSize); + + if (searchResults == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(cascaded delete occurred)"); + } + } + catch (FVTUnexpectedCondition testCaseError) + { + throw testCaseError; + } + catch (Exception unexpectedError) + { + throw new FVTUnexpectedCondition(testCaseName, activityName, unexpectedError); + } + } +} diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/validvalues/package-info.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/validvalues/package-info.java new file mode 100644 index 00000000000..70941eb605b --- /dev/null +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/validvalues/package-info.java @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +/** + * This package provides the tests that exercise the Valid Values (Reference Data) support in the Digital Architecture OMAS. + */ +package org.odpi.openmetadata.accessservices.communityprofile.fvt.validvalues; diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/test/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/execution/CommunityProfileOMASCreateValidValuesIT.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/test/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/execution/CommunityProfileOMASCreateValidValuesIT.java new file mode 100644 index 00000000000..8250b111d9e --- /dev/null +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/test/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/execution/CommunityProfileOMASCreateValidValuesIT.java @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.communityprofile.fvt.execution; + +import org.apache.commons.lang3.StringUtils; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; +import org.odpi.openmetadata.accessservices.communityprofile.fvt.validvalues.CreateValidValuesSetTest; +import org.odpi.openmetadata.fvt.utilities.FVTConstants; +import org.odpi.openmetadata.fvt.utilities.FVTResults; +import org.odpi.openmetadata.http.HttpHelper; + +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * CommunityProfileOMASCreateProfileIT is the failsafe wrapper for CreateValidValuesSetTest. + */ +public class CommunityProfileOMASCreateValidValuesIT +{ + @BeforeAll + public static void disableStrictSSL(){ + HttpHelper.noStrictSSL(); + } + + @ParameterizedTest + @ValueSource(strings = {FVTConstants.IN_MEMORY_SERVER}) + public void testCreateValidValues(String serverName) + { + FVTResults results = CreateValidValuesSetTest.performFVT(serverName, StringUtils.defaultIfEmpty(System.getProperty("fvt.url"), FVTConstants.SERVER_PLATFORM_URL_ROOT), FVTConstants.USERID); + + results.printResults(serverName); + assertTrue(results.isSuccessful()); + } +} diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/datamanager/fvt/DataManagerOMASFVTSuite.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/datamanager/fvt/DataManagerOMASFVTSuite.java index e38ee0eb1a4..82cf2d7c0c0 100644 --- a/open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/datamanager/fvt/DataManagerOMASFVTSuite.java +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/datamanager/fvt/DataManagerOMASFVTSuite.java @@ -7,6 +7,7 @@ import org.odpi.openmetadata.accessservices.datamanager.fvt.databases.CreateDatabaseTest; import org.odpi.openmetadata.accessservices.datamanager.fvt.errorhandling.InvalidParameterTest; import org.odpi.openmetadata.accessservices.datamanager.fvt.events.CreateEventsTest; +import org.odpi.openmetadata.accessservices.datamanager.fvt.validvalues.CreateValidValuesSetTest; import org.odpi.openmetadata.fvt.utilities.FVTResults; import org.odpi.openmetadata.fvt.utilities.FVTSuiteBase; import org.odpi.openmetadata.http.HttpHelper; @@ -72,6 +73,13 @@ public int performFVT(String serverName, FVTResults results; + results = CreateValidValuesSetTest.performFVT(serverName, serverPlatformRootURL, userId); + if (! results.isSuccessful()) + { + returnCode --; + } + results.printResults(serverName); + results = ClientConstructorTest.performFVT(serverName, serverPlatformRootURL); if (! results.isSuccessful()) { diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/datamanager/fvt/validvalues/CreateValidValuesSetTest.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/datamanager/fvt/validvalues/CreateValidValuesSetTest.java new file mode 100644 index 00000000000..1ac4f3e36d7 --- /dev/null +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/datamanager/fvt/validvalues/CreateValidValuesSetTest.java @@ -0,0 +1,931 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.datamanager.fvt.validvalues; + + +import org.odpi.openmetadata.accessservices.datamanager.client.ValidValueManagement; +import org.odpi.openmetadata.accessservices.datamanager.client.rest.DataManagerRESTClient; +import org.odpi.openmetadata.accessservices.datamanager.metadataelements.ValidValueElement; +import org.odpi.openmetadata.accessservices.datamanager.properties.ValidValueMembershipProperties; +import org.odpi.openmetadata.accessservices.datamanager.properties.ValidValueProperties; +import org.odpi.openmetadata.adminservices.configuration.registration.AccessServiceDescription; +import org.odpi.openmetadata.frameworks.auditlog.AuditLog; +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.fvt.utilities.FVTResults; +import org.odpi.openmetadata.fvt.utilities.auditlog.FVTAuditLogDestination; +import org.odpi.openmetadata.fvt.utilities.exceptions.FVTUnexpectedCondition; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +/** + * CreateValidValuesSetTest calls the ValidValueManagement to create a valid values set with nested definitions + * and then retrieve the results. + */ +public class CreateValidValuesSetTest +{ + private final static String testCaseName = "CreateValidValuesSetTest"; + + private final static int maxPageSize = 100; + + /* + * The values below describe the valid value set that is being built. + */ + private final static String validValuesSetName = "TestValidValuesSet"; + private final static String validValuesSetDisplayName = "TestValidValuesSet displayName"; + private final static String validValuesSetDescription = "TestValidValuesSet description"; + private final static String validValuesSetUsage = "TestValidValuesSet usage"; + private final static String validValuesSetScope = "TestValidValuesSet scope"; + + /* + * These are the two valid value definitions that are part of the set. + */ + private final static String validValue1Name = "TestValidValue1"; + private final static String validValue1DisplayName = "TestValidValue1 displayName"; + private final static String validValue1Description = "TestValidValue1 description"; + private final static String validValue1Usage = "TestValidValue1 usage"; + private final static String validValue1Scope = "TestValidValue1 scope"; + private final static String validValue1PreferredValue = "TestValidValue1 preferredValue"; + private final static String validValue1AdditionalPropertyName = "TestValidValue1 additionalPropertyName"; + private final static String validValue1AdditionalPropertyValue = "TestValidValue1 additionalPropertyValue"; + private final static String validValue2Name = "TestValidValue2"; + private final static String validValue2DisplayName = "TestValidValue2 displayName"; + private final static String validValue2Description = "TestValidValue2 description"; + private final static String validValue2Usage = "TestValidValue2 usage"; + private final static String validValue2Scope = "TestValidValue2 scope"; + private final static String validValue2PreferredValue = "TestValidValue2 preferredValue"; + private final static String validValue2NameUpdate = "TestValidValue2 - updated"; + + private final static String searchString = ".*Test.*"; + + + /** + * Run all the defined tests and capture the results. + * + * @param serverName name of the server to connect to + * @param serverPlatformRootURL the network address of the server running the OMAS REST servers + * @param userId calling user + * @return results of running test + */ + public static FVTResults performFVT(String serverName, + String serverPlatformRootURL, + String userId) + { + FVTResults results = new FVTResults(testCaseName); + + results.incrementNumberOfTests(); + try + { + CreateValidValuesSetTest.runIt(serverPlatformRootURL, serverName, userId, results.getAuditLogDestination()); + results.incrementNumberOfSuccesses(); + } + catch (Exception error) + { + results.addCapturedError(error); + } + + return results; + } + + + /** + * Run all the tests in this class. + * + * @param serverPlatformRootURL root url of the server + * @param serverName name of the server + * @param userId calling user + * @param auditLogDestination logging destination + * @throws FVTUnexpectedCondition the test case failed + */ + private static void runIt(String serverPlatformRootURL, + String serverName, + String userId, + FVTAuditLogDestination auditLogDestination) throws FVTUnexpectedCondition + { + CreateValidValuesSetTest thisTest = new CreateValidValuesSetTest(); + + AuditLog auditLog = new AuditLog(auditLogDestination, + AccessServiceDescription.COMMUNITY_PROFILE_OMAS.getAccessServiceCode(), + AccessServiceDescription.COMMUNITY_PROFILE_OMAS.getAccessServiceDevelopmentStatus(), + AccessServiceDescription.COMMUNITY_PROFILE_OMAS.getAccessServiceName(), + AccessServiceDescription.COMMUNITY_PROFILE_OMAS.getAccessServiceDescription(), + AccessServiceDescription.COMMUNITY_PROFILE_OMAS.getAccessServiceWiki()); + + ValidValueManagement client = thisTest.getValidValuesManagerClient(serverName, serverPlatformRootURL, auditLog); + String validValuesSet = thisTest.createValidValueSet(client, userId); + + thisTest.createValidValueDefinitions(client, validValuesSet, userId); + + thisTest.deleteValidValuesSet(client, validValuesSet, userId); + } + + + /** + * Create and return a valid values' manager client. + * + * @param serverName name of the server to connect to + * @param serverPlatformRootURL the network address of the server running the OMAS REST servers + * @param auditLog logging destination + * @return client + * @throws FVTUnexpectedCondition the test case failed + */ + private ValidValueManagement getValidValuesManagerClient(String serverName, + String serverPlatformRootURL, + AuditLog auditLog) throws FVTUnexpectedCondition + { + final String activityName = "getValidValuesManagerClient"; + + try + { + DataManagerRESTClient restClient = new DataManagerRESTClient(serverName, serverPlatformRootURL, auditLog); + + return new ValidValueManagement(serverName, serverPlatformRootURL, restClient, maxPageSize); + } + catch (Exception unexpectedError) + { + throw new FVTUnexpectedCondition(testCaseName, activityName, unexpectedError); + } + } + + + /** + * Create a valid value set and return its GUID. + * + * @param client interface to Digital Architecture OMAS + * @param userId calling user + * @return guid of set + * @throws FVTUnexpectedCondition the test case failed + */ + private String createValidValueSet(ValidValueManagement client, + String userId) throws FVTUnexpectedCondition + { + final String activityName = "createValidValueSet"; + + try + { + ValidValueProperties validValueProperties = new ValidValueProperties(); + + validValueProperties.setTypeName("ValidValuesSet"); + validValueProperties.setQualifiedName(validValuesSetName); + validValueProperties.setDisplayName(validValuesSetDisplayName); + validValueProperties.setDescription(validValuesSetDescription); + validValueProperties.setUsage(validValuesSetUsage); + validValueProperties.setScope(validValuesSetScope); + + String validValuesSetGUID = client.createValidValue(userId, null, null, validValueProperties); + + if (validValuesSetGUID == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no GUID for Create)"); + } + + ValidValueElement retrievedElement = client.getValidValueByGUID(userId, validValuesSetGUID); + ValidValueProperties retrievedSet = retrievedElement.getValidValueProperties(); + + if (retrievedSet == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no Valid Values Set from Retrieve)"); + } + + if (! validValuesSetName.equals(retrievedSet.getQualifiedName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad qualifiedName from Retrieve)"); + } + if (! validValuesSetDisplayName.equals(retrievedSet.getDisplayName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad displayName from Retrieve)"); + } + if (! validValuesSetDescription.equals(retrievedSet.getDescription())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad description from Retrieve)"); + } + if (! validValuesSetUsage.equals(retrievedSet.getUsage())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad usage from Retrieve)"); + } + if (! validValuesSetScope.equals(retrievedSet.getScope())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad scope from Retrieve)"); + } + if (retrievedSet.getPreferredValue() != null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad preferredValue from Retrieve)"); + } + + List validValueList = client.getValidValuesByName(userId, validValuesSetName, 0, maxPageSize); + + if (validValueList == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no valid value for RetrieveByName)"); + } + else if (validValueList.isEmpty()) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Empty valid value list for RetrieveByName)"); + } + else if (validValueList.size() != 1) + { + throw new FVTUnexpectedCondition(testCaseName, + activityName + "(Valid value list for RetrieveByName contains" + validValueList.size() + + " elements)"); + } + + retrievedElement = validValueList.get(0); + retrievedSet = retrievedElement.getValidValueProperties(); + + if (! validValuesSetName.equals(retrievedSet.getQualifiedName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad qualifiedName from RetrieveByName)"); + } + if (! validValuesSetDisplayName.equals(retrievedSet.getDisplayName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad displayName from RetrieveByName)"); + } + if (! validValuesSetDescription.equals(retrievedSet.getDescription())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad description from RetrieveByName)"); + } + if (! validValuesSetUsage.equals(retrievedSet.getUsage())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad usage from RetrieveByName)"); + } + if (! validValuesSetScope.equals(retrievedSet.getScope())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad scope from RetrieveByName)"); + } + if (retrievedSet.getPreferredValue() != null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad preferredValue from RetrieveByName)"); + } + + return validValuesSetGUID; + } + catch (FVTUnexpectedCondition testCaseError) + { + throw testCaseError; + } + catch (Exception unexpectedError) + { + throw new FVTUnexpectedCondition(testCaseName, activityName, unexpectedError); + } + } + + + /** + * Two valid value definitions for the set using a variety of mechanisms. + * + * @param client interface to Digital Architecture OMAS + * @param validValueSetGUID unique identifier of the valid value set + * @param userId calling user + * @throws FVTUnexpectedCondition the test case failed + */ + private void createValidValueDefinitions(ValidValueManagement client, + String validValueSetGUID, + String userId) throws FVTUnexpectedCondition + { + final String activityName = "createValidValueDefinitions"; + + try + { + Map additionalProperties = new HashMap<>(); + additionalProperties.put(validValue1AdditionalPropertyName, validValue1AdditionalPropertyValue); + + ValidValueProperties validValueProperties = new ValidValueProperties(); + + validValueProperties.setTypeName("ValidValuesSet"); // Yes this is deliberate + validValueProperties.setQualifiedName(validValue1Name); + validValueProperties.setDisplayName(validValue1DisplayName); + validValueProperties.setDescription( validValue1Description); + validValueProperties.setUsage(validValue1Usage); + validValueProperties.setScope(validValue1Scope); + validValueProperties.setPreferredValue(validValue1PreferredValue); + validValueProperties.setAdditionalProperties(additionalProperties); + + String validValue1GUID = client.createValidValue(userId, null, null, validValueProperties); + + if (validValue1GUID == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no GUID for Create of definition 1)"); + } + + client.setupValidValueMember(userId, null, null, validValueSetGUID, null, validValue1GUID); + + ValidValueElement retrievedElement = client.getValidValueByGUID(userId, validValue1GUID); + ValidValueProperties retrievedDefinition = retrievedElement.getValidValueProperties(); + + if (retrievedDefinition == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no Valid Values definition 1 from Retrieve)"); + } + + if (! validValue1Name.equals(retrievedDefinition.getQualifiedName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad qualifiedName from Retrieve of 1)"); + } + if (! validValue1DisplayName.equals(retrievedDefinition.getDisplayName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad displayName from Retrieve of 1)"); + } + if (! validValue1Description.equals(retrievedDefinition.getDescription())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad description from Retrieve of 1)"); + } + if (! validValue1Usage.equals(retrievedDefinition.getUsage())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad usage from Retrieve of 1)"); + } + if (! validValue1Scope.equals(retrievedDefinition.getScope())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad scope from Retrieve of 1)"); + } + if (! validValue1PreferredValue.equals(retrievedDefinition.getPreferredValue())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad preferredValue from Retrieve of 1)"); + } + if (retrievedDefinition.getAdditionalProperties() == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(null additionalProperties from Retrieve of 1)"); + } + else if (! validValue1AdditionalPropertyValue.equals(retrievedDefinition.getAdditionalProperties().get(validValue1AdditionalPropertyName))) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(bad additionalProperties from Retrieve of 1)"); + } + + List validValueList = client.getValidValuesByName(userId, validValue1Name, 0, maxPageSize); + + if (validValueList == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no valid value for RetrieveByName of 1)"); + } + else if (validValueList.isEmpty()) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Empty valid value list for RetrieveByName of 1)"); + } + else if (validValueList.size() != 1) + { + throw new FVTUnexpectedCondition(testCaseName, + activityName + "(Valid value list for RetrieveByName of 1 contains" + validValueList.size() + + " elements)"); + } + + retrievedElement = validValueList.get(0); + retrievedDefinition = retrievedElement.getValidValueProperties(); + + if (retrievedDefinition == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no Valid Values definition 1 from Retrieve)"); + } + + if (! validValue1Name.equals(retrievedDefinition.getQualifiedName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad qualifiedName from RetrieveByName of 1)"); + } + if (! validValue1DisplayName.equals(retrievedDefinition.getDisplayName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad displayName from RetrieveByName of 1)"); + } + if (! validValue1Description.equals(retrievedDefinition.getDescription())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad description from RetrieveByName of 1)"); + } + if (! validValue1Usage.equals(retrievedDefinition.getUsage())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad usage from RetrieveByName of 1)"); + } + if (! validValue1Scope.equals(retrievedDefinition.getScope())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad scope from RetrieveByName of 1)"); + } + if (! validValue1PreferredValue.equals(retrievedDefinition.getPreferredValue())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad preferredValue from RetrieveByName of 1)"); + } + + validValueList = client.findValidValues(userId, searchString, 0, maxPageSize); + + if (validValueList == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no valid value for findValidValues of 1)"); + } + else if (validValueList.isEmpty()) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Empty valid value list for findValidValues of 1)"); + } + else if (validValueList.size() != 2) + { + throw new FVTUnexpectedCondition(testCaseName, + activityName + "(Valid value list for findValidValues of 1 contains" + validValueList.size() + + " elements)"); + } + + validValueList = client.getValidValueSetMembers(userId, validValueSetGUID, 0, maxPageSize); + + if (validValueList == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no valid value for RetrieveSetMembers of 1)"); + } + else if (validValueList.isEmpty()) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Empty valid value list for RetrieveSetMembers of 1)"); + } + else if (validValueList.size() != 1) + { + throw new FVTUnexpectedCondition(testCaseName, + activityName + "(Valid value list for RetrieveSetMembers of 1 contains" + validValueList.size() + + " elements)"); + } + else + { + retrievedElement = validValueList.get(0); + retrievedDefinition = retrievedElement.getValidValueProperties(); + } + + if (retrievedDefinition == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no Valid Values definition 1 from RetrieveOfMembers)"); + } + + if (! validValue1Name.equals(retrievedDefinition.getQualifiedName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad qualifiedName from RetrieveOfMembers of 1)"); + } + if (! validValue1DisplayName.equals(retrievedDefinition.getDisplayName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad displayName from RetrieveOfMembers of 1)"); + } + if (! validValue1Description.equals(retrievedDefinition.getDescription())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad description from RetrieveOfMembers of 1)"); + } + if (! validValue1Usage.equals(retrievedDefinition.getUsage())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad usage from RetrieveOfMembers of 1)"); + } + if (! validValue1Scope.equals(retrievedDefinition.getScope())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad scope from RetrieveOfMembers of 1)"); + } + if (! validValue1PreferredValue.equals(retrievedDefinition.getPreferredValue())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad preferredValue from RetrieveOfMembers of 1)"); + } + + /* + * Check that not possible to create an element with the same qualified name. + */ + try + { + client.createValidValue(userId, null, null, validValueProperties); + + throw new FVTUnexpectedCondition(testCaseName, activityName + "(duplicate create of valid value definition allowed)"); + } + catch (InvalidParameterException okResult) + { + // nothing to do + } + + /* + * Now do the second value + */ + ValidValueProperties validValueProperties2 = new ValidValueProperties(); + + + validValueProperties2.setTypeName("ValidValuesSet"); // Yes this is deliberate + validValueProperties2.setQualifiedName(validValue2Name); + validValueProperties2.setDisplayName(validValue2DisplayName); + validValueProperties2.setDescription( validValue2Description); + validValueProperties2.setUsage(validValue2Usage); + validValueProperties2.setScope(validValue2Scope); + validValueProperties2.setAdditionalProperties(additionalProperties); + + String validValue2GUID = client.createValidValue(userId, null, null, validValueProperties2); + + if (validValue2GUID == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no GUID for Create of definition 2)"); + } + + client.setupValidValueMember(userId, null, null, validValueSetGUID, null, validValue2GUID); + + retrievedElement = client.getValidValueByGUID(userId, validValue2GUID); + retrievedDefinition = retrievedElement.getValidValueProperties(); + + if (retrievedDefinition == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no Valid Values definition 2 from Retrieve)"); + } + + if (! validValue2Name.equals(retrievedDefinition.getQualifiedName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad qualifiedName from Retrieve of 2)"); + } + if (! validValue2DisplayName.equals(retrievedDefinition.getDisplayName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad displayName from Retrieve of 2)"); + } + if (! validValue2Description.equals(retrievedDefinition.getDescription())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad description from Retrieve of 2)"); + } + if (! validValue2Usage.equals(retrievedDefinition.getUsage())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad usage from Retrieve of 2)"); + } + if (! validValue2Scope.equals(retrievedDefinition.getScope())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad scope from Retrieve of 2)"); + } + if (retrievedDefinition.getPreferredValue() != null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad preferredValue from Retrieve of 2)"); + } + if (retrievedDefinition.getIsDeprecated()) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad isDeprecated from Retrieve of 2)"); + } + + validValueList = client.getValidValuesByName(userId, validValue2Name, 0, maxPageSize); + + if (validValueList == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no valid value for RetrieveByName of 2)"); + } + else if (validValueList.isEmpty()) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Empty valid value list for RetrieveByName of 2)"); + } + else if (validValueList.size() != 1) + { + throw new FVTUnexpectedCondition(testCaseName, + activityName + "(Valid value list for RetrieveByName of 2 contains" + validValueList.size() + + " elements)"); + } + + retrievedElement = validValueList.get(0); + retrievedDefinition = retrievedElement.getValidValueProperties(); + + if (! validValue2Name.equals(retrievedDefinition.getQualifiedName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad qualifiedName from RetrieveByName of 2)"); + } + if (! validValue2DisplayName.equals(retrievedDefinition.getDisplayName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad displayName from RetrieveByName of 2)"); + } + if (! validValue2Description.equals(retrievedDefinition.getDescription())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad description from RetrieveByName of 2)"); + } + if (! validValue2Usage.equals(retrievedDefinition.getUsage())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad usage from RetrieveByName of 2)"); + } + if (! validValue2Scope.equals(retrievedDefinition.getScope())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad scope from RetrieveByName of 2)"); + } + if (retrievedDefinition.getPreferredValue() != null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad preferredValue from RetrieveByName of 2)"); + } + if (retrievedDefinition.getIsDeprecated()) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad isDeprecated from RetrieveByName of 2)"); + } + + validValueList = client.findValidValues(userId, searchString, 0, maxPageSize); + + if (validValueList == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no valid value for findValidValues of all)"); + } + else if (validValueList.isEmpty()) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Empty valid value list for findValidValues of all)"); + } + else if (validValueList.size() != 3) + { + throw new FVTUnexpectedCondition(testCaseName, + activityName + "(Valid value list for findValidValues of all contains" + validValueList.size() + + " elements)"); + } + + validValueList = client.getValidValueSetMembers(userId, validValueSetGUID, 0, maxPageSize); + + if (validValueList == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no valid value for RetrieveSetMembers of both)"); + } + else if (validValueList.isEmpty()) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Empty valid value list for RetrieveSetMembers of both)"); + } + else if (validValueList.size() != 2) + { + throw new FVTUnexpectedCondition(testCaseName, + activityName + "(Valid value list for RetrieveSetMembers of both contains" + validValueList.size() + + " elements)"); + } + + /* + * Add the preferred value + */ + ValidValueProperties validValueProperties3 = new ValidValueProperties(); + validValueProperties3.setPreferredValue(validValue2PreferredValue); + validValueProperties3.setIsDeprecated(true); + + client.updateValidValue(userId, + null, + null, + validValue2GUID, + true, + validValueProperties3); + + retrievedElement = client.getValidValueByGUID(userId, validValue2GUID); + retrievedDefinition = retrievedElement.getValidValueProperties(); + + if (! validValue2Name.equals(retrievedDefinition.getQualifiedName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad qualifiedName from RetrieveUpdate of 2)"); + } + if (! validValue2DisplayName.equals(retrievedDefinition.getDisplayName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad displayName from RetrieveUpdate of 2)"); + } + if (! validValue2Description.equals(retrievedDefinition.getDescription())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad description from RetrieveUpdate of 2)"); + } + if (! validValue2Usage.equals(retrievedDefinition.getUsage())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad usage from RetrieveUpdate of 2)"); + } + if (! validValue2Scope.equals(retrievedDefinition.getScope())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad scope from RetrieveUpdate of 2)"); + } + if (! validValue2PreferredValue.equals(retrievedDefinition.getPreferredValue())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad preferredValue from RetrieveUpdate of 2)"); + } + if (! retrievedDefinition.getIsDeprecated()) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad isDeprecated from RetrieveUpdate of 2)"); + } + + + /* + * Update valid value 2 with valid value 1's qualified name - this should fail + */ + try + { + ValidValueProperties validValueProperties4 = new ValidValueProperties(); + + validValueProperties4.setQualifiedName(validValue1Name); + + client.updateValidValue(userId, + null, + null, + validValue2GUID, + true, + validValueProperties4); + + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Duplicate update allowed)"); + } + catch (InvalidParameterException expectedResult) + { + // all ok + } + + /* + * Valid value 2 should be exactly as it was + */ + retrievedElement = client.getValidValueByGUID(userId, validValue2GUID); + retrievedDefinition = retrievedElement.getValidValueProperties(); + + if (! validValue2Name.equals(retrievedDefinition.getQualifiedName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad qualifiedName from RetrieveUpdate of 2 after qualified name failed change)"); + } + if (! validValue2DisplayName.equals(retrievedDefinition.getDisplayName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad displayName from RetrieveUpdate of 2 after qualified name failed change)"); + } + if (! validValue2Description.equals(retrievedDefinition.getDescription())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad description from RetrieveUpdate of 2 after qualified name failed change)"); + } + if (! validValue2Usage.equals(retrievedDefinition.getUsage())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad usage from RetrieveUpdate of 2 after qualified name failed change)"); + } + if (! validValue2Scope.equals(retrievedDefinition.getScope())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad scope from RetrieveUpdate of 2 after qualified name failed change)"); + } + if (! validValue2PreferredValue.equals(retrievedDefinition.getPreferredValue())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad preferredValue from RetrieveUpdate of 2)"); + } + if (! retrievedDefinition.getIsDeprecated()) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad isDeprecated from RetrieveUpdate of 2)"); + } + + + /* + * Update valid value 2 with a new qualified name - this should work ok + */ + validValueProperties2.setQualifiedName(validValue2NameUpdate); + validValueProperties2.setPreferredValue(validValue2PreferredValue); + validValueProperties2.setIsDeprecated(true); + client.updateValidValue(userId, + null, + null, + validValue2GUID, + false, + validValueProperties2); + + /* + * Valid value 2 should be updated + */ + retrievedElement = client.getValidValueByGUID(userId, validValue2GUID); + retrievedDefinition = retrievedElement.getValidValueProperties(); + + if (! validValue2NameUpdate.equals(retrievedDefinition.getQualifiedName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad qualifiedName from RetrieveUpdate of 2 after qualified name change)"); + } + if (! validValue2DisplayName.equals(retrievedDefinition.getDisplayName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad displayName from RetrieveUpdate of 2 after qualified name change)"); + } + if (! validValue2Description.equals(retrievedDefinition.getDescription())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad description from RetrieveUpdate of 2 after qualified name change)"); + } + if (! validValue2Usage.equals(retrievedDefinition.getUsage())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad usage from RetrieveUpdate of 2 after qualified name change)"); + } + if (! validValue2Scope.equals(retrievedDefinition.getScope())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad scope from RetrieveUpdate of 2 after qualified name change)"); + } + if (! validValue2PreferredValue.equals(retrievedDefinition.getPreferredValue())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad preferredValue from RetrieveUpdate of 2 after qualified name change)"); + } + if (! retrievedDefinition.getIsDeprecated()) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad isDeprecated from RetrieveUpdate of 2 after qualified name change)"); + } + + + /* + * By detaching definition 2, then should only get value 1 back from the set membership request. + */ + client.clearValidValueMember(userId, null, null, validValueSetGUID, validValue2GUID); + + validValueList = client.getValidValueSetMembers(userId, validValueSetGUID, 0, maxPageSize); + + if (validValueList == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no valid value for RetrieveSetMembers of 1 after detach)"); + } + else if (validValueList.isEmpty()) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Empty valid value list for RetrieveSetMembers of 1 after detach)"); + } + else if (validValueList.size() != 1) + { + throw new FVTUnexpectedCondition(testCaseName, + activityName + "(Valid value list for RetrieveSetMembers after detach of 1 contains" + validValueList.size() + + " elements)"); + } + else + { + retrievedElement = validValueList.get(0); + retrievedDefinition = retrievedElement.getValidValueProperties(); + } + + if (retrievedDefinition == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no Valid Values definition 1 from RetrieveOfMembers of 1 after detach)"); + } + + if (! validValue1Name.equals(retrievedDefinition.getQualifiedName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad qualifiedName from RetrieveOfMembers of 1 after detach)"); + } + if (! validValue1DisplayName.equals(retrievedDefinition.getDisplayName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad displayName from RetrieveOfMembers of 1 after detach)"); + } + if (! validValue1Description.equals(retrievedDefinition.getDescription())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad description from RetrieveOfMembers of 1 after detach)"); + } + if (! validValue1Usage.equals(retrievedDefinition.getUsage())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad usage from RetrieveOfMembers of 1 after detach)"); + } + if (! validValue1Scope.equals(retrievedDefinition.getScope())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad scope from RetrieveOfMembers of 1 after detach)"); + } + if (! validValue1PreferredValue.equals(retrievedDefinition.getPreferredValue())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad preferredValue from RetrieveOfMembers of 1 after detach)"); + } + + /* + * Now reattach value 2 and check it reappears in the set. + */ + ValidValueMembershipProperties membershipProperties = new ValidValueMembershipProperties(); + + membershipProperties.setDefaultValue(false); + + client.setupValidValueMember(userId, null,null, validValueSetGUID, null, validValue2GUID); + + validValueList = client.getValidValueSetMembers(userId, validValueSetGUID, 0, maxPageSize); + + if (validValueList == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no valid value for RetrieveSetMembers of both after reattach)"); + } + else if (validValueList.isEmpty()) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Empty valid value list for RetrieveSetMembers of of both after reattach)"); + } + else if (validValueList.size() != 2) + { + throw new FVTUnexpectedCondition(testCaseName, + activityName + "(Valid value list for RetrieveSetMembers of both after reattach contains" + validValueList.size() + + " elements)"); + } + } + catch (FVTUnexpectedCondition testCaseError) + { + throw testCaseError; + } + catch (Exception unexpectedError) + { + throw new FVTUnexpectedCondition(testCaseName, activityName, unexpectedError); + } + } + + + /** + * Delete the set and check that the valid value definitions connected to it are also gone. + * + * @param client interface to Digital Architecture OMAS + * @param validValueSetGUID unique identifier of the valid value set + * @param userId calling user + * @throws FVTUnexpectedCondition the test case failed + */ + private void deleteValidValuesSet(ValidValueManagement client, + String validValueSetGUID, + String userId) throws FVTUnexpectedCondition + { + final String activityName = "deleteValidValuesSet"; + + try + { + client.removeValidValue(userId, null, null, validValueSetGUID); + + /* + * Check it has really gone. + */ + try + { + client.getValidValueByGUID(userId, validValueSetGUID); + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Deleted value value set returned)"); + } + catch (InvalidParameterException expectedException) + { + // All ok + } + + /* + * Check for no cascaded delete + */ + List searchResults = client.findValidValues(userId, searchString, 0, maxPageSize); + + if (searchResults == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(cascaded delete occurred)"); + } + } + catch (FVTUnexpectedCondition testCaseError) + { + throw testCaseError; + } + catch (Exception unexpectedError) + { + throw new FVTUnexpectedCondition(testCaseName, activityName, unexpectedError); + } + } +} diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/datamanager/fvt/validvalues/package-info.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/datamanager/fvt/validvalues/package-info.java new file mode 100644 index 00000000000..f70dc39e7d0 --- /dev/null +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/datamanager/fvt/validvalues/package-info.java @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +/** + * This package provides the tests that exercise the Valid Values (Reference Data) support in the Digital Architecture OMAS. + */ +package org.odpi.openmetadata.accessservices.datamanager.fvt.validvalues; diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/test/java/org/odpi/openmetadata/accessservices/datamanager/fvt/execution/DataManagerOMASCreateValidValuesIT.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/test/java/org/odpi/openmetadata/accessservices/datamanager/fvt/execution/DataManagerOMASCreateValidValuesIT.java new file mode 100644 index 00000000000..2ff505704ee --- /dev/null +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/test/java/org/odpi/openmetadata/accessservices/datamanager/fvt/execution/DataManagerOMASCreateValidValuesIT.java @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.datamanager.fvt.execution; + +import org.apache.commons.lang3.StringUtils; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; +import org.odpi.openmetadata.accessservices.datamanager.fvt.validvalues.CreateValidValuesSetTest; +import org.odpi.openmetadata.fvt.utilities.FVTConstants; +import org.odpi.openmetadata.fvt.utilities.FVTResults; +import org.odpi.openmetadata.http.HttpHelper; + +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * CommunityProfileOMASCreateProfileIT is the failsafe wrapper for CreateValidValuesSetTest. + */ +public class DataManagerOMASCreateValidValuesIT +{ + @BeforeAll + public static void disableStrictSSL(){ + HttpHelper.noStrictSSL(); + } + + @ParameterizedTest + @ValueSource(strings = {FVTConstants.IN_MEMORY_SERVER}) + public void testCreateValidValues(String serverName) + { + FVTResults results = CreateValidValuesSetTest.performFVT(serverName, StringUtils.defaultIfEmpty(System.getProperty("fvt.url"), FVTConstants.SERVER_PLATFORM_URL_ROOT), FVTConstants.USERID); + + results.printResults(serverName); + assertTrue(results.isSuccessful()); + } +} diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/digital-architecture-fvt/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/fvt/validvalues/CreateValidValuesSetTest.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/digital-architecture-fvt/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/fvt/validvalues/CreateValidValuesSetTest.java index 0359493e240..de9f1f70376 100644 --- a/open-metadata-test/open-metadata-fvt/access-services-fvt/digital-architecture-fvt/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/fvt/validvalues/CreateValidValuesSetTest.java +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/digital-architecture-fvt/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/fvt/validvalues/CreateValidValuesSetTest.java @@ -62,7 +62,7 @@ public class CreateValidValuesSetTest /** - * Run all of the defined tests and capture the results. + * Run all the defined tests and capture the results. * * @param serverName name of the server to connect to * @param serverPlatformRootURL the network address of the server running the OMAS REST servers @@ -91,7 +91,7 @@ public static FVTResults performFVT(String serverName, /** - * Run all of the tests in this class. + * Run all the tests in this class. * * @param serverPlatformRootURL root url of the server * @param serverName name of the server @@ -107,11 +107,11 @@ private static void runIt(String serverPlatformRootURL, CreateValidValuesSetTest thisTest = new CreateValidValuesSetTest(); AuditLog auditLog = new AuditLog(auditLogDestination, - AccessServiceDescription.DATA_MANAGER_OMAS.getAccessServiceCode(), - AccessServiceDescription.DATA_MANAGER_OMAS.getAccessServiceDevelopmentStatus(), - AccessServiceDescription.DATA_MANAGER_OMAS.getAccessServiceName(), - AccessServiceDescription.DATA_MANAGER_OMAS.getAccessServiceDescription(), - AccessServiceDescription.DATA_MANAGER_OMAS.getAccessServiceWiki()); + AccessServiceDescription.DIGITAL_ARCHITECTURE_OMAS.getAccessServiceCode(), + AccessServiceDescription.DIGITAL_ARCHITECTURE_OMAS.getAccessServiceDevelopmentStatus(), + AccessServiceDescription.DIGITAL_ARCHITECTURE_OMAS.getAccessServiceName(), + AccessServiceDescription.DIGITAL_ARCHITECTURE_OMAS.getAccessServiceDescription(), + AccessServiceDescription.DIGITAL_ARCHITECTURE_OMAS.getAccessServiceWiki()); ReferenceDataManager client = thisTest.getValidValuesManagerClient(serverName, serverPlatformRootURL, auditLog); String validValuesSet = thisTest.createValidValueSet(client, userId); @@ -123,7 +123,7 @@ private static void runIt(String serverPlatformRootURL, /** - * Create and return a valid values manager client. + * Create and return a valid values' manager client. * * @param serverName name of the server to connect to * @param serverPlatformRootURL the network address of the server running the OMAS REST servers @@ -647,6 +647,7 @@ else if (validValueList.size() != 2) validValue2PreferredValue, true, null, + false, null, null); @@ -684,7 +685,7 @@ else if (validValueList.size() != 2) /* - * Update value value 2 with valid value 1's qualified name - this should fail + * Update valid value 2 with valid value 1's qualified name - this should fail */ try { @@ -698,6 +699,7 @@ else if (validValueList.size() != 2) validValue2PreferredValue, true, null, + true, null, null); @@ -745,7 +747,7 @@ else if (validValueList.size() != 2) /* - * Update value value 2 with a new qualified name - this should work ok + * Update valid value 2 with a new qualified name - this should work ok */ client.updateValidValue(userId, @@ -758,6 +760,7 @@ else if (validValueList.size() != 2) validValue2PreferredValue, true, null, + true, null, null);