From e3ceda2324c021aad5bfe6c3c5d2988961fa7fa2 Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Fri, 10 Dec 2021 10:10:20 +0000 Subject: [PATCH 01/14] Renaming for IT Infrastructure OMAS Signed-off-by: Mandy Chessell --- ...ce.java => ITProfileManagerInterface.java} | 0 ...wareServerCapabilityManagerInterface.java} | 107 ++---------------- .../ffdc}/rest/EffectiveTimeRequestBody.java | 0 3 files changed, 9 insertions(+), 98 deletions(-) rename open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/api/{ITProfileManagementInterface.java => ITProfileManagerInterface.java} (100%) rename open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/api/{SoftwareServerCapabilityManagementInterface.java => SoftwareServerCapabilityManagerInterface.java} (81%) rename open-metadata-implementation/{access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure => common-services/ffdc-services/src/main/java/org/odpi/openmetadata/commonservices/ffdc}/rest/EffectiveTimeRequestBody.java (100%) diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/api/ITProfileManagementInterface.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/api/ITProfileManagerInterface.java similarity index 100% rename from open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/api/ITProfileManagementInterface.java rename to open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/api/ITProfileManagerInterface.java diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/api/SoftwareServerCapabilityManagementInterface.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/api/SoftwareServerCapabilityManagerInterface.java similarity index 81% rename from open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/api/SoftwareServerCapabilityManagementInterface.java rename to open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/api/SoftwareServerCapabilityManagerInterface.java index dedc632f41e..915a9868015 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/api/SoftwareServerCapabilityManagementInterface.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/api/SoftwareServerCapabilityManagerInterface.java @@ -96,97 +96,6 @@ void updateSoftwareServerCapability(String userId, PropertyServerException; - - /** - * Link a software server capability to a software server. - * - * @param userId calling user - * @param externalSourceGUID guid of the software server capability entity that represented the external source - null for local - * @param externalSourceName name of the software server capability entity that represented the external source - * @param capabilityGUID unique identifier of the software server capability - * @param softwareServerGUID unique identifier of the software server - * @param deploymentTime time that the capability was enabled - * @param deployer user who/that deployed the capability - * @param enabledStatus is the capability enabled (or disabled) - * @param effectiveFrom start date for the relationship - * @param effectiveTo end date for the relationship - * - * @throws InvalidParameterException one of the guids is null or not known - * @throws PropertyServerException problem accessing property server - * @throws UserNotAuthorizedException security access problem - */ - void linkCapabilityToServer(String userId, - String externalSourceGUID, - String externalSourceName, - String capabilityGUID, - String softwareServerGUID, - Date deploymentTime, - String deployer, - boolean enabledStatus, - Date effectiveFrom, - Date effectiveTo) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; - - - /** - * Update the effectivity dates of a link from a piece of infrastructure to an IT profile. - * - * @param userId calling user - * @param externalSourceGUID guid of the software server capability entity that represented the external source - null for local - * @param externalSourceName name of the software server capability entity that represented the external source - * @param capabilityGUID unique identifier of the software server capability - * @param softwareServerGUID unique identifier of the software server - * @param isMergeUpdate are unspecified properties unchanged (true) or removed? - * @param deploymentTime time that the capability was enabled - * @param deployer user who/that deployed the capability - * @param enabledStatus is the capability enabled (or disabled) - * @param effectiveFrom start date for the relationship - * @param effectiveTo end date for the relationship - * - * @throws InvalidParameterException one of the guids is null or not known - * @throws PropertyServerException problem accessing property server - * @throws UserNotAuthorizedException security access problem - */ - void updateCapabilityToServer(String userId, - String externalSourceGUID, - String externalSourceName, - String capabilityGUID, - String softwareServerGUID, - boolean isMergeUpdate, - Date deploymentTime, - String deployer, - boolean enabledStatus, - Date effectiveFrom, - Date effectiveTo) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; - - - /** - * Remove the link between a software server capability and a software server. - * - * @param userId calling user - * @param externalSourceGUID guid of the software server capability entity that represented the external source - null for local - * @param externalSourceName name of the software server capability entity that represented the external source - * @param capabilityGUID unique identifier of the software server capability - * @param softwareServerGUID unique identifier of the software server - * @param effectiveTime time that the relationship is active - null for any time - * - * @throws InvalidParameterException one of the guids is null or not known - * @throws PropertyServerException problem accessing property server - * @throws UserNotAuthorizedException security access problem - */ - void unlinkCapabilityFromServer(String userId, - String externalSourceGUID, - String externalSourceName, - String capabilityGUID, - String softwareServerGUID, - Date effectiveTime) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; - - /** * Remove the metadata element representing a software server capability. * @@ -307,6 +216,7 @@ SoftwareServerCapabilityElement getSoftwareServerCapabilityByGUID(String userId, * @param userId calling user * @param infrastructureManagerGUID unique identifier of software server capability representing the caller * @param infrastructureManagerName unique name of software server capability representing the caller + * @param infrastructureManagerIsHome should the software server capability be marked as owned by the infrastructure manager so others can not update? * @param capabilityGUID unique identifier of a software server capability * @param assetGUID unique identifier of an asset * @param properties properties about the ServerAssetUse relationship @@ -320,6 +230,7 @@ SoftwareServerCapabilityElement getSoftwareServerCapabilityByGUID(String userId, String createServerAssetUse(String userId, String infrastructureManagerGUID, String infrastructureManagerName, + boolean infrastructureManagerIsHome, String capabilityGUID, String assetGUID, ServerAssetUseProperties properties) throws InvalidParameterException, @@ -413,13 +324,13 @@ List findServerAssetUses(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) */ - List getServerAssetUsesForCapabililty(String userId, - String capabilityGUID, - ServerAssetUseType useType, - int startFrom, - int pageSize) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; + List getServerAssetUsesForCapability(String userId, + String capabilityGUID, + ServerAssetUseType useType, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; /** * Return the list of software server capabilities that make use of a specific asset. diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/EffectiveTimeRequestBody.java b/open-metadata-implementation/common-services/ffdc-services/src/main/java/org/odpi/openmetadata/commonservices/ffdc/rest/EffectiveTimeRequestBody.java similarity index 100% rename from open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/EffectiveTimeRequestBody.java rename to open-metadata-implementation/common-services/ffdc-services/src/main/java/org/odpi/openmetadata/commonservices/ffdc/rest/EffectiveTimeRequestBody.java From 73bffeda64ea0f074b55682875164a0aec2e2ff7 Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Fri, 10 Dec 2021 10:18:11 +0000 Subject: [PATCH 02/14] Simplify EventType, APIOperation structures; remove APISpecification (#6027) Signed-off-by: Mandy Chessell --- .../datamanager/api/EventBrokerInterface.java | 2 +- .../metadataelements/APIOperationElement.java | 29 +-- .../APISpecificationElement.java | 173 ------------------ .../metadataelements/EventTypeElement.java | 29 +-- .../APISpecificationProperties.java | 67 ------- .../rest/APISpecificationResponse.java | 137 -------------- .../rest/APISpecificationsResponse.java | 149 --------------- .../converters/APIOperationConverter.java | 54 ++---- .../converters/APIParameterListConverter.java | 5 +- .../converters/APISpecificationConverter.java | 143 --------------- .../converters/EventTypeConverter.java | 54 ++---- .../server/DataManagerInstanceHandler.java | 31 ---- .../server/DataManagerServicesInstance.java | 31 ---- 13 files changed, 28 insertions(+), 876 deletions(-) delete mode 100644 open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/metadataelements/APISpecificationElement.java delete mode 100644 open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/APISpecificationProperties.java delete mode 100644 open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/APISpecificationResponse.java delete mode 100644 open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/APISpecificationsResponse.java delete mode 100644 open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/APISpecificationConverter.java diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/api/EventBrokerInterface.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/api/EventBrokerInterface.java index 2c1b800e374..9757942e64c 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/api/EventBrokerInterface.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/api/EventBrokerInterface.java @@ -368,7 +368,7 @@ List findEventTypes(String userId, /** - * Return the list of event types associated with an EvenSet. This is a collection of EventType definitions. + * Return the list of event types associated with an EventSet. This is a collection of EventType definitions. * These event types can be used as a template for adding the event types to a topic. * * @param userId calling user diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/metadataelements/APIOperationElement.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/metadataelements/APIOperationElement.java index 8871c7a1c99..b4d12adeca4 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/metadataelements/APIOperationElement.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/metadataelements/APIOperationElement.java @@ -26,7 +26,6 @@ public class APIOperationElement implements MetadataElement, Serializable private APIOperationProperties properties = null; private ElementHeader elementHeader = null; - private int payloadCount = 0; /** * Default constructor @@ -48,8 +47,6 @@ public APIOperationElement(APIOperationElement template) { elementHeader = template.getElementHeader(); properties = template.getProperties(); - - payloadCount = template.getPayloadCount(); } } @@ -100,26 +97,6 @@ public void setProperties(APIOperationProperties properties) } - - /** - * Return the count of the payloads (header, request, response) defined for this operation. - * - * @return int - */ - public int getPayloadCount() { return payloadCount; } - - - /** - * Set up the count of payloads (header, request, response) defined for this operation - * - * @param payloadCount int - */ - public void setPayloadCount(int payloadCount) - { - this.payloadCount = payloadCount; - } - - /** * JSON-style toString * @@ -131,7 +108,6 @@ public String toString() return "APIOperationElement{" + "properties=" + properties + ", elementHeader=" + elementHeader + - ", payloadCount=" + payloadCount + '}'; } @@ -154,8 +130,7 @@ public boolean equals(Object objectToCompare) return false; } APIOperationElement that = (APIOperationElement) objectToCompare; - return payloadCount == that.payloadCount && - Objects.equals(properties, that.properties) && + return Objects.equals(properties, that.properties) && Objects.equals(elementHeader, that.elementHeader); } @@ -168,6 +143,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), elementHeader, properties, payloadCount); + return Objects.hash(super.hashCode(), elementHeader, properties); } } diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/metadataelements/APISpecificationElement.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/metadataelements/APISpecificationElement.java deleted file mode 100644 index 25884bdb64b..00000000000 --- a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/metadataelements/APISpecificationElement.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.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.APISpecificationProperties; - -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; - -/** - * APISpecificationElement contains the properties and header for an API Specification (SchemaType) retrieved from the metadata repository. - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown=true) -public class APISpecificationElement implements MetadataElement, Serializable -{ - private static final long serialVersionUID = 1L; - - private APISpecificationProperties properties = null; - private ElementHeader elementHeader = null; - private int operationCount = 0; - - /** - * Default constructor - */ - public APISpecificationElement() - { - super(); - } - - - /** - * Copy/clone constructor - * - * @param template object to copy - */ - public APISpecificationElement(APISpecificationElement template) - { - if (template != null) - { - elementHeader = template.getElementHeader(); - properties = template.getProperties(); - - operationCount = template.getOperationCount(); - } - } - - - /** - * 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 API specification. - * - * @return schema properties (using appropriate subclass) - */ - public APISpecificationProperties getProperties() - { - return properties; - } - - - /** - * Set up the properties for the API specification. - * - * @param properties schema properties - */ - public void setProperties(APISpecificationProperties properties) - { - this.properties = properties; - } - - - - /** - * Return the count of operations in this API. - * - * @return String data type name - */ - public int getOperationCount() { return operationCount; } - - - /** - * Set up the count of operations in this API - * - * @param operationCount data type name - */ - public void setOperationCount(int operationCount) - { - this.operationCount = operationCount; - } - - - /** - * JSON-style toString - * - * @return return string containing the property names and values - */ - @Override - public String toString() - { - return "APISpecificationElement{" + - "properties=" + properties + - ", elementHeader=" + elementHeader + - ", operationCount=" + operationCount + - '}'; - } - - - /** - * 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; - } - APISpecificationElement that = (APISpecificationElement) objectToCompare; - return operationCount == that.operationCount && - Objects.equals(properties, that.properties) && - Objects.equals(elementHeader, that.elementHeader); - } - - - /** - * Return hash code for this object - * - * @return int hash code - */ - @Override - public int hashCode() - { - return Objects.hash(super.hashCode(), elementHeader, properties, operationCount); - } -} diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/metadataelements/EventTypeElement.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/metadataelements/EventTypeElement.java index 43ee237f346..077fd9ca633 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/metadataelements/EventTypeElement.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/metadataelements/EventTypeElement.java @@ -26,7 +26,6 @@ public class EventTypeElement implements MetadataElement, Serializable private EventTypeProperties properties = null; private ElementHeader elementHeader = null; - private int attributeCount = 0; /** * Default constructor @@ -48,8 +47,6 @@ public EventTypeElement(EventTypeElement template) { elementHeader = template.getElementHeader(); properties = template.getProperties(); - - attributeCount = template.getAttributeCount(); } } @@ -100,26 +97,6 @@ public void setProperties(EventTypeProperties properties) } - - /** - * Return the count of attributes in this schema type. - * - * @return String data type name - */ - public int getAttributeCount() { return attributeCount; } - - - /** - * Set up the count of attributes in this schema type - * - * @param attributeCount data type name - */ - public void setAttributeCount(int attributeCount) - { - this.attributeCount = attributeCount; - } - - /** * JSON-style toString * @@ -131,7 +108,6 @@ public String toString() return "EventTypeElement{" + "properties=" + properties + ", elementHeader=" + elementHeader + - ", attributeCount=" + attributeCount + '}'; } @@ -154,8 +130,7 @@ public boolean equals(Object objectToCompare) return false; } EventTypeElement that = (EventTypeElement) objectToCompare; - return attributeCount == that.attributeCount && - Objects.equals(properties, that.properties) && + return Objects.equals(properties, that.properties) && Objects.equals(elementHeader, that.elementHeader); } @@ -168,6 +143,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), elementHeader, properties, attributeCount); + return Objects.hash(super.hashCode(), elementHeader, properties); } } diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/APISpecificationProperties.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/APISpecificationProperties.java deleted file mode 100644 index 59ec1878bd8..00000000000 --- a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/APISpecificationProperties.java +++ /dev/null @@ -1,67 +0,0 @@ -/* 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 static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; - -/** - * APISpecificationProperties is a class for representing the top-level element for an API's schema. - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown=true) -public class APISpecificationProperties extends SchemaTypeProperties -{ - private static final long serialVersionUID = 1L; - - /** - * Default constructor - */ - public APISpecificationProperties() - { - super(); - } - - - /** - * Copy/clone constructor. - * - * @param template object to copy - */ - public APISpecificationProperties(APISpecificationProperties template) - { - super(template); - } - - - /** - * Standard toString method. - * - * @return print out of variables in a JSON-style - */ - @Override - public String toString() - { - return "APISpecificationProperties{" + - "versionNumber='" + getVersionNumber() + '\'' + - ", author='" + getAuthor() + '\'' + - ", usage='" + getUsage() + '\'' + - ", encodingStandard='" + getEncodingStandard() + '\'' + - ", namespace='" + getNamespace() + '\'' + - ", isDeprecated=" + getIsDeprecated() + - ", displayName='" + getDisplayName() + '\'' + - ", description='" + getDescription() + '\'' + - ", qualifiedName='" + getQualifiedName() + '\'' + - ", additionalProperties=" + getAdditionalProperties() + - ", vendorProperties=" + getVendorProperties() + - ", typeName='" + getTypeName() + '\'' + - ", extendedProperties=" + getExtendedProperties() + - '}'; - } -} diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/APISpecificationResponse.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/APISpecificationResponse.java deleted file mode 100644 index 3a9cd6f4f8f..00000000000 --- a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/APISpecificationResponse.java +++ /dev/null @@ -1,137 +0,0 @@ -/* 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.APISpecificationElement; - -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; - -/** - * APISpecificationResponse is a response object for passing back a single APISpecification - * element 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 APISpecificationResponse extends DataManagerOMASAPIResponse -{ - private static final long serialVersionUID = 1L; - - private APISpecificationElement element = null; - - - /** - * Default constructor - */ - public APISpecificationResponse() - { - } - - - /** - * Copy/clone constructor - * - * @param template object to copy - */ - public APISpecificationResponse(APISpecificationResponse template) - { - super(template); - - if (template != null) - { - element = template.getElement(); - } - } - - - /** - * Return the metadata element. - * - * @return result object - */ - public APISpecificationElement getElement() - { - return element; - } - - - /** - * Set up the metadata element to return. - * - * @param element result object - */ - public void setElement(APISpecificationElement element) - { - this.element = element; - } - - - /** - * JSON-style toString - * - * @return return string containing the property names and values - */ - @Override - public String toString() - { - return "APISpecificationResponse{" + - "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; - } - APISpecificationResponse that = (APISpecificationResponse) 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-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/APISpecificationsResponse.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/APISpecificationsResponse.java deleted file mode 100644 index 5c31e66d249..00000000000 --- a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/APISpecificationsResponse.java +++ /dev/null @@ -1,149 +0,0 @@ -/* 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.APISpecificationElement; - -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; - -/** - * APISpecificationsResponse is a response object for passing back a a list of APISpecifications - * 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 APISpecificationsResponse extends DataManagerOMASAPIResponse -{ - private static final long serialVersionUID = 1L; - - private List elementList = null; - - - /** - * Default constructor - */ - public APISpecificationsResponse() - { - } - - - /** - * Copy/clone constructor - * - * @param template object to copy - */ - public APISpecificationsResponse(APISpecificationsResponse 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 "APISpecificationsResponse{" + - "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; - } - APISpecificationsResponse that = (APISpecificationsResponse) 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-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/APIOperationConverter.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/APIOperationConverter.java index b3912553412..137dda2abc2 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/APIOperationConverter.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/APIOperationConverter.java @@ -6,6 +6,7 @@ import org.odpi.openmetadata.accessservices.datamanager.properties.APIOperationProperties; 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.InstanceHeader; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship; @@ -38,49 +39,18 @@ public APIOperationConverter(OMRSRepositoryHelper repositoryHelper, /** - * Return the converted bean. This is a special method used for schema types since they are stored - * as a collection of instances. For external schema types and map elements, both the GUID and the bean are returned to - * allow the consuming OMAS to choose whether it is returning GUIDs of the linked to schema or the schema type bean itself. + * 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 schemaRootHeader header of the schema element that holds the root information - * @param schemaTypeTypeName name of type of the schema type to create - * @param instanceProperties properties describing the schema type - * @param schemaRootClassifications classifications from the schema root entity - * @param attributeCount number of attributes (for a complex schema type) - * @param validValueSetGUID unique identifier of the set of valid values (for an enum schema type) - * @param externalSchemaTypeGUID unique identifier of the external schema type - * @param externalSchemaType unique identifier for the properties of the schema type that is shared by multiple attributes/assets - * @param mapFromSchemaTypeGUID unique identifier of the mapFrom schema type - * @param mapFromSchemaType bean containing the properties of the schema type that is part of a map definition - * @param mapToSchemaTypeGUID unique identifier of the mapTo schema type - * @param mapToSchemaType bean containing the properties of the schema type that is part of a map definition - * @param schemaTypeOptionGUIDs list of unique identifiers for schema types that could be the type for this attribute - * @param schemaTypeOptions list of schema types that could be the type for this attribute - * @param queryTargetRelationships list of relationships to schema types that contain data values used to derive the schema type value(s) + * @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 */ - @SuppressWarnings(value = "unused") - @Override - public B getNewSchemaTypeBean(Class beanClass, - InstanceHeader schemaRootHeader, - String schemaTypeTypeName, - InstanceProperties instanceProperties, - List schemaRootClassifications, - int attributeCount, - String validValueSetGUID, - String externalSchemaTypeGUID, - B externalSchemaType, - String mapFromSchemaTypeGUID, - B mapFromSchemaType, - String mapToSchemaTypeGUID, - B mapToSchemaType, - List schemaTypeOptionGUIDs, - List schemaTypeOptions, - List queryTargetRelationships, - String methodName) throws PropertyServerException + public B getNewBean(Class beanClass, + EntityDetail entity, + String methodName) throws PropertyServerException { try { @@ -91,7 +61,7 @@ public B getNewSchemaTypeBean(Class beanClass, if (returnBean instanceof APIOperationElement) { - if ((schemaRootHeader != null) && (instanceProperties != null)) + if ((entity != null) && (entity.getProperties() != null)) { /* * The schema type has many different subtypes. @@ -99,11 +69,11 @@ public B getNewSchemaTypeBean(Class beanClass, */ APIOperationElement bean = (APIOperationElement) returnBean; - bean.setElementHeader(this.getMetadataElementHeader(beanClass, schemaRootHeader, schemaRootClassifications, methodName)); + bean.setElementHeader(this.getMetadataElementHeader(beanClass, entity, entity.getClassifications(), methodName)); APIOperationProperties apiOperationProperties = new APIOperationProperties(); - InstanceProperties propertiesCopy = new InstanceProperties(instanceProperties); + InstanceProperties propertiesCopy = new InstanceProperties(entity.getProperties()); apiOperationProperties.setDisplayName(this.removeDisplayName(propertiesCopy)); apiOperationProperties.setDescription(this.removeDescription(propertiesCopy)); @@ -123,8 +93,6 @@ public B getNewSchemaTypeBean(Class beanClass, bean.setProperties(apiOperationProperties); - bean.setPayloadCount(attributeCount); - return returnBean; } else diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/APIParameterListConverter.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/APIParameterListConverter.java index 43da7384751..8f4eb20db51 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/APIParameterListConverter.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/APIParameterListConverter.java @@ -48,14 +48,11 @@ public APIParameterListConverter(OMRSRepositoryHelper repositoryHelper, * @return bean populated with properties from the instances supplied * @throws PropertyServerException there is a problem instantiating the bean */ - @SuppressWarnings(value = "unused") public B getNewComplexBean(Class beanClass, EntityDetail primaryEntity, List relationships, String methodName) throws PropertyServerException { - final String thisMethodName = "getNewComplexBean"; - try { /* @@ -65,7 +62,7 @@ public B getNewComplexBean(Class beanClass, if (returnBean instanceof APIParameterListElement) { - if (primaryEntity != null) + if ((primaryEntity != null) && (primaryEntity.getProperties() != null)) { /* * The API Parameter List has many different subtypes. diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/APISpecificationConverter.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/APISpecificationConverter.java deleted file mode 100644 index 5ad9c03308b..00000000000 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/APISpecificationConverter.java +++ /dev/null @@ -1,143 +0,0 @@ -/* 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.APISpecificationElement; -import org.odpi.openmetadata.accessservices.datamanager.properties.APISpecificationProperties; -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.InstanceHeader; -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.List; - - -/** - * EventTypeConverter provides common methods for transferring relevant properties from an Open Metadata Repository Services (OMRS) - * EntityDetail object into a bean that inherits from EventTypeElement. It is working with a ComplexSchemaType. - */ -public class APISpecificationConverter extends DataManagerOMASConverter -{ - /** - * Constructor - * - * @param repositoryHelper helper object to parse entity - * @param serviceName name of this component - * @param serverName local server name - */ - public APISpecificationConverter(OMRSRepositoryHelper repositoryHelper, - String serviceName, - String serverName) - { - super(repositoryHelper, serviceName, serverName); - } - - - /** - * Return the converted bean. This is a special method used for schema types since they are stored - * as a collection of instances. For external schema types and map elements, both the GUID and the bean are returned to - * allow the consuming OMAS to choose whether it is returning GUIDs of the linked to schema or the schema type bean itself. - * - * @param beanClass name of the class to create - * @param schemaRootHeader header of the schema element that holds the root information - * @param schemaTypeTypeName name of type of the schema type to create - * @param instanceProperties properties describing the schema type - * @param schemaRootClassifications classifications from the schema root entity - * @param attributeCount number of attributes (for a complex schema type) - * @param validValueSetGUID unique identifier of the set of valid values (for an enum schema type) - * @param externalSchemaTypeGUID unique identifier of the external schema type - * @param externalSchemaType unique identifier for the properties of the schema type that is shared by multiple attributes/assets - * @param mapFromSchemaTypeGUID unique identifier of the mapFrom schema type - * @param mapFromSchemaType bean containing the properties of the schema type that is part of a map definition - * @param mapToSchemaTypeGUID unique identifier of the mapTo schema type - * @param mapToSchemaType bean containing the properties of the schema type that is part of a map definition - * @param schemaTypeOptionGUIDs list of unique identifiers for schema types that could be the type for this attribute - * @param schemaTypeOptions list of schema types that could be the type for this attribute - * @param queryTargetRelationships list of relationships to schema types that contain data values used to derive the schema type value(s) - * @param methodName calling method - * @return bean populated with properties from the instances supplied - * @throws PropertyServerException there is a problem instantiating the bean - */ - @SuppressWarnings(value = "unused") - @Override - public B getNewSchemaTypeBean(Class beanClass, - InstanceHeader schemaRootHeader, - String schemaTypeTypeName, - InstanceProperties instanceProperties, - List schemaRootClassifications, - int attributeCount, - String validValueSetGUID, - String externalSchemaTypeGUID, - B externalSchemaType, - String mapFromSchemaTypeGUID, - B mapFromSchemaType, - String mapToSchemaTypeGUID, - B mapToSchemaType, - List schemaTypeOptionGUIDs, - List schemaTypeOptions, - List queryTargetRelationships, - 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 APISpecificationElement) - { - if ((schemaRootHeader != null) && (instanceProperties != null)) - { - /* - * The schema type has many different subtypes. - * This next piece of logic sorts out which type of schema bean to create. - */ - APISpecificationElement bean = (APISpecificationElement) returnBean; - - bean.setElementHeader(this.getMetadataElementHeader(beanClass, schemaRootHeader, schemaRootClassifications, methodName)); - - APISpecificationProperties apiSpecificationProperties = new APISpecificationProperties(); - - InstanceProperties propertiesCopy = new InstanceProperties(instanceProperties); - - apiSpecificationProperties.setDisplayName(this.removeDisplayName(propertiesCopy)); - apiSpecificationProperties.setDescription(this.removeDescription(propertiesCopy)); - apiSpecificationProperties.setIsDeprecated(this.removeIsDeprecated(propertiesCopy)); - apiSpecificationProperties.setVersionNumber(this.removeVersionNumber(propertiesCopy)); - apiSpecificationProperties.setAuthor(this.removeAuthor(propertiesCopy)); - apiSpecificationProperties.setUsage(this.removeUsage(propertiesCopy)); - apiSpecificationProperties.setEncodingStandard(this.removeEncodingStandard(propertiesCopy)); - apiSpecificationProperties.setNamespace(this.removeNamespace(propertiesCopy)); - apiSpecificationProperties.setAdditionalProperties(this.removeAdditionalProperties(propertiesCopy)); - - /* - * Any remaining properties are returned in the extended properties. They are - * assumed to be defined in a subtype. - */ - apiSpecificationProperties.setExtendedProperties(this.getRemainingExtendedProperties(propertiesCopy)); - - bean.setProperties(apiSpecificationProperties); - - bean.setOperationCount(attributeCount); - - return returnBean; - } - else - { - handleMissingMetadataInstance(beanClass.getName(), TypeDefCategory.ENTITY_DEF, methodName); - } - } - } - catch (IllegalAccessException | InstantiationException | ClassCastException | NoSuchMethodException | InvocationTargetException 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/EventTypeConverter.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/EventTypeConverter.java index d31390d2f70..753d03dd187 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/EventTypeConverter.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/EventTypeConverter.java @@ -8,6 +8,7 @@ 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.InstanceHeader; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship; @@ -40,49 +41,18 @@ public EventTypeConverter(OMRSRepositoryHelper repositoryHelper, /** - * Return the converted bean. This is a special method used for schema types since they are stored - * as a collection of instances. For external schema types and map elements, both the GUID and the bean are returned to - * allow the consuming OMAS to choose whether it is returning GUIDs of the linked to schema or the schema type bean itself. + * 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 schemaRootHeader header of the schema element that holds the root information - * @param schemaTypeTypeName name of type of the schema type to create - * @param instanceProperties properties describing the schema type - * @param schemaRootClassifications classifications from the schema root entity - * @param attributeCount number of attributes (for a complex schema type) - * @param validValueSetGUID unique identifier of the set of valid values (for an enum schema type) - * @param externalSchemaTypeGUID unique identifier of the external schema type - * @param externalSchemaType unique identifier for the properties of the schema type that is shared by multiple attributes/assets - * @param mapFromSchemaTypeGUID unique identifier of the mapFrom schema type - * @param mapFromSchemaType bean containing the properties of the schema type that is part of a map definition - * @param mapToSchemaTypeGUID unique identifier of the mapTo schema type - * @param mapToSchemaType bean containing the properties of the schema type that is part of a map definition - * @param schemaTypeOptionGUIDs list of unique identifiers for schema types that could be the type for this attribute - * @param schemaTypeOptions list of schema types that could be the type for this attribute - * @param queryTargetRelationships list of relationships to schema types that contain data values used to derive the schema type value(s) + * @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 */ - @SuppressWarnings(value = "unused") - @Override - public B getNewSchemaTypeBean(Class beanClass, - InstanceHeader schemaRootHeader, - String schemaTypeTypeName, - InstanceProperties instanceProperties, - List schemaRootClassifications, - int attributeCount, - String validValueSetGUID, - String externalSchemaTypeGUID, - B externalSchemaType, - String mapFromSchemaTypeGUID, - B mapFromSchemaType, - String mapToSchemaTypeGUID, - B mapToSchemaType, - List schemaTypeOptionGUIDs, - List schemaTypeOptions, - List queryTargetRelationships, - String methodName) throws PropertyServerException + public B getNewBean(Class beanClass, + EntityDetail entity, + String methodName) throws PropertyServerException { try { @@ -93,15 +63,15 @@ public B getNewSchemaTypeBean(Class beanClass, if (returnBean instanceof EventTypeElement) { - if ((schemaRootHeader != null) && (instanceProperties != null)) + if ((entity != null) && (entity.getProperties() != null)) { EventTypeElement bean = (EventTypeElement) returnBean; - bean.setElementHeader(this.getMetadataElementHeader(beanClass, schemaRootHeader, schemaRootClassifications, methodName)); + bean.setElementHeader(this.getMetadataElementHeader(beanClass, entity, entity.getClassifications(), methodName)); EventTypeProperties eventType = new EventTypeProperties(); - InstanceProperties propertiesCopy = new InstanceProperties(instanceProperties); + InstanceProperties propertiesCopy = new InstanceProperties(entity.getProperties()); eventType.setDisplayName(this.removeDisplayName(propertiesCopy)); eventType.setDescription(this.removeDescription(propertiesCopy)); @@ -121,8 +91,6 @@ public B getNewSchemaTypeBean(Class beanClass, bean.setProperties(eventType); - bean.setAttributeCount(attributeCount); - return returnBean; } else 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 77ee3b947f7..c68952ce2f3 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 @@ -246,37 +246,6 @@ AssetHandler getAPIHandler(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 - */ - SchemaTypeHandler getAPISpecificationHandler(String userId, - String serverName, - String serviceOperationName) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException - { - - DataManagerServicesInstance instance = (DataManagerServicesInstance)super.getServerServiceInstance(userId, - serverName, - serviceOperationName); - - if (instance != null) - { - return instance.getAPISpecificationHandler(); - } - - return null; - } - - /** * Retrieve the specific handler for the access service. * 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 ad71f685ede..434a7fe445e 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 @@ -43,7 +43,6 @@ public class DataManagerServicesInstance extends OMASServiceInstance private EventTypeHandler eventTypeHandler; private AssetHandler apiHandler; - private SchemaTypeHandler apiSpecificationHandler; private APIOperationHandler apiOperationHandler; private APIParameterListHandler apiParameterListHandler; @@ -233,20 +232,6 @@ public DataManagerServicesInstance(OMRSRepositoryConnector repositoryConnector, publishZones, auditLog); - this.apiSpecificationHandler = new SchemaTypeHandler<>(new APISpecificationConverter<>(repositoryHelper, serviceName,serverName), - APISpecificationElement.class, - serviceName, - serverName, - invalidParameterHandler, - repositoryHandler, - repositoryHelper, - localServerUserId, - securityVerifier, - supportedZones, - defaultZones, - publishZones, - auditLog); - this.apiOperationHandler = new APIOperationHandler<>(new APIOperationConverter<>(repositoryHelper, serviceName,serverName), APIOperationElement.class, @@ -561,22 +546,6 @@ AssetHandler getAPIHandler() throws PropertyServerException } - /** - * Return the handler for managing APISpecificationElement objects. - * - * @return handler object - * @throws PropertyServerException the instance has not been initialized successfully - */ - SchemaTypeHandler getAPISpecificationHandler() throws PropertyServerException - { - final String methodName = "getAPISpecificationHandler"; - - validateActiveRepository(methodName); - - return apiSpecificationHandler; - } - - /** * Return the handler for managing APIOperationElement objects. * From 096f76658841f68491e93309c8e24bfd6805046e Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Fri, 10 Dec 2021 10:41:39 +0000 Subject: [PATCH 03/14] Handle missing metadata server on startup (#6025) Signed-off-by: Mandy Chessell --- .../EngineConfigurationRefreshThread.java | 1 - .../IntegrationConnectorStatus.java | 9 +- .../handlers/IntegrationConnectorHandler.java | 95 +++++++++++++++---- 3 files changed, 83 insertions(+), 22 deletions(-) diff --git a/open-metadata-implementation/governance-servers/engine-host-services/engine-host-services-server/src/main/java/org/odpi/openmetadata/governanceservers/enginehostservices/threads/EngineConfigurationRefreshThread.java b/open-metadata-implementation/governance-servers/engine-host-services/engine-host-services-server/src/main/java/org/odpi/openmetadata/governanceservers/enginehostservices/threads/EngineConfigurationRefreshThread.java index e65a1cb09ad..b76babdad2d 100644 --- a/open-metadata-implementation/governance-servers/engine-host-services/engine-host-services-server/src/main/java/org/odpi/openmetadata/governanceservers/enginehostservices/threads/EngineConfigurationRefreshThread.java +++ b/open-metadata-implementation/governance-servers/engine-host-services/engine-host-services-server/src/main/java/org/odpi/openmetadata/governanceservers/enginehostservices/threads/EngineConfigurationRefreshThread.java @@ -3,7 +3,6 @@ package org.odpi.openmetadata.governanceservers.enginehostservices.threads; -import org.odpi.openmetadata.accessservices.governanceengine.client.GovernanceEngineConfigurationClient; import org.odpi.openmetadata.accessservices.governanceengine.client.GovernanceEngineEventClient; import org.odpi.openmetadata.governanceservers.enginehostservices.admin.GovernanceEngineHandler; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; diff --git a/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-api/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/properties/IntegrationConnectorStatus.java b/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-api/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/properties/IntegrationConnectorStatus.java index fc178c936ac..a55a576869d 100644 --- a/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-api/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/properties/IntegrationConnectorStatus.java +++ b/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-api/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/properties/IntegrationConnectorStatus.java @@ -19,10 +19,11 @@ @JsonIgnoreProperties(ignoreUnknown=true) public enum IntegrationConnectorStatus implements Serializable { - INITIALIZED (0, "Initialized", "The connector is set up and waiting to start."), - RUNNING (1, "Running", "The connector is running."), - STOPPED (2, "Stopped", "The connector has been stopped (as server is shutting down."), - FAILED (99, "Failed", "The connector threw an exception."), + INITIALIZED (0, "Initialized", "The connector is set up and waiting to start."), + RUNNING (1, "Running", "The connector is running."), + STOPPED (2, "Stopped", "The connector has been stopped (as server is shutting down."), + INITIALIZE_FAILED (3, "Initialize Failed", "The integration daemon is not able to initialize the connector because the metadata server is not available."), + FAILED (99, "Failed", "The connector threw an exception and will not be called until it is restarted."), ; private static final long serialVersionUID = 1L; diff --git a/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-server/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/handlers/IntegrationConnectorHandler.java b/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-server/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/handlers/IntegrationConnectorHandler.java index 9b1973641ec..027477f11dd 100644 --- a/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-server/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/handlers/IntegrationConnectorHandler.java +++ b/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-server/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/handlers/IntegrationConnectorHandler.java @@ -231,23 +231,6 @@ synchronized void reinitializeConnector(String actionDescription) genericConnector = this.getConnector(connection, actionDescription); integrationConnector = (IntegrationConnector)genericConnector; - - contextManager.setContext(integrationConnectorId, - integrationConnectorName, - metadataSourceQualifiedName, - integrationConnector, - permittedSynchronization); - - this.updateStatus(IntegrationConnectorStatus.INITIALIZED); - - if (needDedicatedThread) - { - integrationConnectorDedicatedThread = new IntegrationConnectorDedicatedThread(integrationDaemonName, - this, - auditLog); - - integrationConnectorDedicatedThread.start(); - } } catch (ClassCastException error) { @@ -266,6 +249,39 @@ synchronized void reinitializeConnector(String actionDescription) processConnectorException(actionDescription, operationName, error); } catch (Exception error) + { + + processConnectorException(actionDescription, operationName, error); + } + + + try + { + contextManager.setContext(integrationConnectorId, + integrationConnectorName, + metadataSourceQualifiedName, + integrationConnector, + permittedSynchronization); + + this.updateStatus(IntegrationConnectorStatus.INITIALIZED); + } + catch (Exception error) + { + processInitializeException(actionDescription, error); + } + + try + { + if (needDedicatedThread) + { + integrationConnectorDedicatedThread = new IntegrationConnectorDedicatedThread(integrationDaemonName, + this, + auditLog); + + integrationConnectorDedicatedThread.start(); + } + } + catch (Exception error) { processConnectorException(actionDescription, operationName, error); } @@ -365,6 +381,10 @@ public synchronized void engageConnector(String actionDescription) try { + if (integrationConnectorStatus == IntegrationConnectorStatus.INITIALIZE_FAILED) + { + this.reinitializeConnector(actionDescription); + } if (integrationConnectorStatus == IntegrationConnectorStatus.INITIALIZED) { this.startConnector(actionDescription); @@ -394,6 +414,10 @@ public synchronized void refreshConnector(String actionDescription, try { + if (integrationConnectorStatus == IntegrationConnectorStatus.INITIALIZE_FAILED) + { + this.reinitializeConnector(actionDescription); + } if (integrationConnectorStatus == IntegrationConnectorStatus.INITIALIZED) { this.startConnector(actionDescription); @@ -547,6 +571,43 @@ private void processConnectorException(String actionDescription, } + /** + * This private method ensures consistent logging of connector issues. + * + * @param actionDescription external caller's activity + * @param error resulting exception + */ + private void processInitializeException(String actionDescription, + Exception error) + { + final String operationName = "setContext"; + + updateStatus(IntegrationConnectorStatus.INITIALIZE_FAILED); + failingExceptionMessage = error.getMessage(); + + if (error instanceof OCFCheckedExceptionBase) + { + auditLog.logMessage(actionDescription, + IntegrationDaemonServicesAuditCode.INITIALIZE_ERROR.getMessageDefinition(integrationConnectorName, + operationName, + error.getClass().getName(), + error.getMessage())); + } + else + { + auditLog.logException(actionDescription, + IntegrationDaemonServicesAuditCode.INITIALIZE_ERROR.getMessageDefinition(integrationConnectorName, + operationName, + error.getClass().getName(), + error.getMessage()), + error); + } + } + + + + + /** * This private method makes sure that the timestamp is updated with the status. * From 6da9c01186c63cf2d6a6880448dde8e9a1ce9585 Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Mon, 13 Dec 2021 10:51:33 +0000 Subject: [PATCH 04/14] Use latest generic handler call Signed-off-by: Mandy Chessell --- .../server/AssetManagerRESTServices.java | 2 +- .../properties/PersonalProfileProperties.java | 202 +++++++++++++++++- .../converters/PersonalProfileConverter.java | 7 + .../server/CommunityProfileRESTServices.java | 2 +- .../server/DataManagerRESTServices.java | 14 +- .../DiscoveryConfigurationHandler.java | 2 +- .../GovernanceConfigurationHandler.java | 8 +- 7 files changed, 212 insertions(+), 25 deletions(-) diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/AssetManagerRESTServices.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/AssetManagerRESTServices.java index f124b00dc66..9460808311f 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/AssetManagerRESTServices.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/AssetManagerRESTServices.java @@ -138,7 +138,6 @@ public GUIDResponse createExternalAssetManager(String serverName response.setGUID(handler.createSoftwareServerCapability(userId, null, null, - OpenMetadataAPIMapper.CATALOG_TYPE_GUID, OpenMetadataAPIMapper.CATALOG_TYPE_NAME, OpenMetadataAPIMapper.ASSET_MANAGER_TYPE_NAME, assetManagerProperties.getQualifiedName(), @@ -149,6 +148,7 @@ public GUIDResponse createExternalAssetManager(String serverName assetManagerProperties.getPatchLevel(), assetManagerProperties.getSource(), assetManagerProperties.getAdditionalProperties(), + null, assetManagerProperties.getVendorProperties(), null, null, 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 caa326060c4..a5c5fe3f34c 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 @@ -23,11 +23,20 @@ public class PersonalProfileProperties extends ActorProfileProperties { private static final long serialVersionUID = 1L; - private String fullName = null; - private String jobTitle = null; + private String title = null; + private String initials = null; + private String givenNames = null; + private String surname = null; + private String fullName = null; + private String jobTitle = null; + private String employeeNumber = null; + private String employeeType = null; + private String preferredLanguage = null; + private boolean isPublic = false; + /** * Default Constructor */ @@ -50,6 +59,13 @@ public PersonalProfileProperties(PersonalProfileProperties template) { this.fullName = template.getFullName(); this.jobTitle = template.getJobTitle(); + this.title = template.getTitle(); + this.initials = template.getInitials(); + this.givenNames = template.getGivenNames(); + this.surname = template.getSurname(); + this.employeeNumber = template.getEmployeeNumber(); + this.employeeType = template.getEmployeeType(); + this.preferredLanguage = template.getPreferredLanguage(); this.isPublic = template.getIsPublic(); } } @@ -100,7 +116,161 @@ public void setJobTitle(String jobTitle) /** - * Return if the contents of this profile be shared with colleagues. + * Return the courtesy title for the person. + * + * @return string + */ + public String getTitle() + { + return title; + } + + + /** + * Set up the courtesy title for the person. + * + * @param title string + */ + public void setTitle(String title) + { + this.title = title; + } + + + /** + * Return first letter of each of the person's given names. + * + * @return string + */ + public String getInitials() + { + return initials; + } + + + /** + * Set up first letter of each of the person's given names. + * + * @param initials string + */ + public void setInitials(String initials) + { + this.initials = initials; + } + + + /** + * Return the name strings that are the part of a person's name that is not their surname. + * + * @return space separated list of names + */ + public String getGivenNames() + { + return givenNames; + } + + + /** + * Set up the name strings that are the part of a person's name that is not their surname. + * + * @param givenNames space separated list of names + */ + public void setGivenNames(String givenNames) + { + this.givenNames = givenNames; + } + + + /** + * Return the family name of the person. + * + * @return string + */ + public String getSurname() + { + return surname; + } + + + /** + * Set up the family name of the person. + * + * @param surname string + */ + public void setSurname(String surname) + { + this.surname = surname; + } + + + /** + * Return the unique identifier of the person used by their employer. + * + * @return string + */ + public String getEmployeeNumber() + { + return employeeNumber; + } + + + /** + * Set up the unique identifier of the person used by their employer. + * + * @param employeeNumber string + */ + public void setEmployeeNumber(String employeeNumber) + { + this.employeeNumber = employeeNumber; + } + + + /** + * Return code used by employer typically to describe the type of employment contract. + * + * @return string + */ + public String getEmployeeType() + { + return employeeType; + } + + + /** + * Set up code used by employer typically to describe the type of employment contract. + * + * @param employeeType string + */ + public void setEmployeeType(String employeeType) + { + this.employeeType = employeeType; + } + + + /** + * Return spoken or written language preferred by the person. + * + * @return string + */ + public String getPreferredLanguage() + { + return preferredLanguage; + } + + + /** + * Set up spoken or written language preferred by the person. + * + * @param preferredLanguage string + */ + public void setPreferredLanguage(String preferredLanguage) + { + this.preferredLanguage = preferredLanguage; + } + + + /** + * Return if the contents of this profile is to be shared with colleagues. * * @return flag */ @@ -111,7 +281,7 @@ public boolean getIsPublic() /** - * Set up if the contents of this profile be shared with colleagues. + * Set up if the contents of this profile is to be shared with colleagues. * * @param isPublic flag */ @@ -132,6 +302,13 @@ public String toString() return "PersonalProfileProperties{" + "fullName='" + fullName + '\'' + ", jobTitle='" + jobTitle + '\'' + + ", title='" + title + '\'' + + ", initials='" + initials + '\'' + + ", givenNames='" + givenNames + '\'' + + ", surname='" + surname + '\'' + + ", employeeNumber='" + employeeNumber + '\'' + + ", employeeType='" + employeeType + '\'' + + ", preferredLanguage='" + preferredLanguage + '\'' + ", isPublic=" + isPublic + ", knownName='" + getKnownName() + '\'' + ", description='" + getDescription() + '\'' + @@ -163,13 +340,21 @@ public boolean equals(Object objectToCompare) { return false; } - if (!super.equals(objectToCompare)) + if (! super.equals(objectToCompare)) { return false; } PersonalProfileProperties that = (PersonalProfileProperties) objectToCompare; - return Objects.equals(fullName, that.fullName) && - Objects.equals(jobTitle, that.jobTitle); + return isPublic == that.isPublic && + Objects.equals(fullName, that.fullName) && + Objects.equals(jobTitle, that.jobTitle) && + Objects.equals(title, that.title) && + Objects.equals(initials, that.initials) && + Objects.equals(givenNames, that.givenNames) && + Objects.equals(surname, that.surname) && + Objects.equals(employeeNumber, that.employeeNumber) && + Objects.equals(employeeType, that.employeeType) && + Objects.equals(preferredLanguage, that.preferredLanguage); } @@ -181,6 +366,7 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), fullName, jobTitle); + return Objects.hash(super.hashCode(), fullName, jobTitle, title, initials, givenNames, surname, employeeNumber, employeeType, + preferredLanguage, isPublic); } } 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 1e3913e8b9f..e47b8932e1f 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,8 +88,15 @@ public B getNewComplexBean(Class beanClass, profileProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); profileProperties.setKnownName(this.removeName(instanceProperties)); profileProperties.setDescription(this.removeDescription(instanceProperties)); + profileProperties.setTitle(this.removeTitle(instanceProperties)); + profileProperties.setInitials(this.removeInitials(instanceProperties)); + profileProperties.setGivenNames(this.removeGivenNames(instanceProperties)); + profileProperties.setSurname(this.removeSurname(instanceProperties)); profileProperties.setFullName(this.removeFullName(instanceProperties)); + profileProperties.setPreferredLanguage(this.removePreferredLanguage(instanceProperties)); profileProperties.setJobTitle(this.removeJobTitle(instanceProperties)); + profileProperties.setEmployeeNumber(this.removeEmployeeNumber(instanceProperties)); + profileProperties.setEmployeeType(this.removeEmployeeType(instanceProperties)); profileProperties.setIsPublic(this.removeIsPublic(instanceProperties)); profileProperties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); profileProperties.setEffectiveFrom(instanceProperties.getEffectiveFromTime()); diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/CommunityProfileRESTServices.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/CommunityProfileRESTServices.java index f1d4dfb8a9a..2a97ad3c52c 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/CommunityProfileRESTServices.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/CommunityProfileRESTServices.java @@ -122,7 +122,6 @@ public GUIDResponse createMetadataSource(String serverName, null, null, null, - null, requestBody.getQualifiedName(), requestBody.getDisplayName(), requestBody.getDescription(), @@ -131,6 +130,7 @@ public GUIDResponse createMetadataSource(String serverName, requestBody.getPatchLevel(), requestBody.getSource(), requestBody.getAdditionalProperties(), + null, requestBody.getVendorProperties(), null, null, diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/DataManagerRESTServices.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/DataManagerRESTServices.java index 1243a1354dd..384c587ed3b 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/DataManagerRESTServices.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/DataManagerRESTServices.java @@ -155,7 +155,7 @@ public GUIDResponse createFileSystemInCatalog(String serverName * PropertyServerException problem accessing property server or * UserNotAuthorizedException security access problem */ - public GUIDResponse createFileManagerInCatalog(String serverName, + public GUIDResponse createFileManagerInCatalog(String serverName, String userId, FileManagerRequestBody requestBody) { @@ -179,7 +179,6 @@ public GUIDResponse createFileManagerInCatalog(String serverName response.setGUID(handler.createSoftwareServerCapability(userId, requestBody.getExternalSourceGUID(), requestBody.getExternalSourceName(), - OpenMetadataAPIMapper.DATA_MANAGER_TYPE_GUID, OpenMetadataAPIMapper.DATA_MANAGER_TYPE_NAME, OpenMetadataAPIMapper.FILE_MANAGER_CLASSIFICATION_TYPE_NAME, requestBody.getQualifiedName(), @@ -190,6 +189,7 @@ public GUIDResponse createFileManagerInCatalog(String serverName requestBody.getPatchLevel(), requestBody.getSource(), requestBody.getAdditionalProperties(), + requestBody.getExtendedProperties(), requestBody.getVendorProperties(), null, null, @@ -240,7 +240,6 @@ public GUIDResponse createDatabaseManagerInCatalog(String se response.setGUID(handler.createSoftwareServerCapability(userId, requestBody.getExternalSourceGUID(), requestBody.getExternalSourceName(), - OpenMetadataAPIMapper.DATABASE_MANAGER_TYPE_GUID, OpenMetadataAPIMapper.DATABASE_MANAGER_TYPE_NAME, null, requestBody.getQualifiedName(), @@ -251,6 +250,7 @@ public GUIDResponse createDatabaseManagerInCatalog(String se requestBody.getPatchLevel(), requestBody.getSource(), requestBody.getAdditionalProperties(), + requestBody.getExtendedProperties(), requestBody.getVendorProperties(), null, null, @@ -301,7 +301,6 @@ public GUIDResponse createAPIManagerInCatalog(String serverName, response.setGUID(handler.createSoftwareServerCapability(userId, requestBody.getExternalSourceGUID(), requestBody.getExternalSourceName(), - OpenMetadataAPIMapper.API_MANAGER_TYPE_GUID, OpenMetadataAPIMapper.API_MANAGER_TYPE_NAME, null, requestBody.getQualifiedName(), @@ -312,6 +311,7 @@ public GUIDResponse createAPIManagerInCatalog(String serverName, requestBody.getPatchLevel(), requestBody.getSource(), requestBody.getAdditionalProperties(), + requestBody.getExtendedProperties(), requestBody.getVendorProperties(), null, null, @@ -361,7 +361,6 @@ public GUIDResponse createEventBrokerInCatalog(String serverName response.setGUID(handler.createSoftwareServerCapability(userId, requestBody.getExternalSourceGUID(), requestBody.getExternalSourceName(), - OpenMetadataAPIMapper.EVENT_BROKER_TYPE_GUID, OpenMetadataAPIMapper.EVENT_BROKER_TYPE_NAME, null, requestBody.getQualifiedName(), @@ -372,6 +371,7 @@ public GUIDResponse createEventBrokerInCatalog(String serverName requestBody.getPatchLevel(), requestBody.getSource(), requestBody.getAdditionalProperties(), + requestBody.getExtendedProperties(), requestBody.getVendorProperties(), null, null, @@ -421,7 +421,6 @@ public GUIDResponse createApplicationInCatalog(String serverName response.setGUID(handler.createSoftwareServerCapability(userId, requestBody.getExternalSourceGUID(), requestBody.getExternalSourceName(), - OpenMetadataAPIMapper.APPLICATION_TYPE_GUID, OpenMetadataAPIMapper.APPLICATION_TYPE_NAME, null, requestBody.getQualifiedName(), @@ -432,6 +431,7 @@ public GUIDResponse createApplicationInCatalog(String serverName requestBody.getPatchLevel(), requestBody.getSource(), requestBody.getAdditionalProperties(), + requestBody.getExtendedProperties(), requestBody.getVendorProperties(), null, null, @@ -481,7 +481,6 @@ public GUIDResponse createDataProcessingEngineInCatalog(String response.setGUID(handler.createSoftwareServerCapability(userId, requestBody.getExternalSourceGUID(), requestBody.getExternalSourceName(), - OpenMetadataAPIMapper.ENGINE_TYPE_GUID, OpenMetadataAPIMapper.ENGINE_TYPE_NAME, null, requestBody.getQualifiedName(), @@ -492,6 +491,7 @@ public GUIDResponse createDataProcessingEngineInCatalog(String requestBody.getPatchLevel(), requestBody.getSource(), requestBody.getAdditionalProperties(), + requestBody.getExtendedProperties(), requestBody.getVendorProperties(), null, null, diff --git a/open-metadata-implementation/access-services/discovery-engine/discovery-engine-server/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/handlers/DiscoveryConfigurationHandler.java b/open-metadata-implementation/access-services/discovery-engine/discovery-engine-server/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/handlers/DiscoveryConfigurationHandler.java index 920e50f6940..0f2833ec6e0 100644 --- a/open-metadata-implementation/access-services/discovery-engine/discovery-engine-server/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/handlers/DiscoveryConfigurationHandler.java +++ b/open-metadata-implementation/access-services/discovery-engine/discovery-engine-server/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/handlers/DiscoveryConfigurationHandler.java @@ -167,7 +167,6 @@ public String createDiscoveryEngine(String userId, return discoveryEngineHandler.createSoftwareServerCapability(userId, null, null, - OpenMetadataAPIMapper.DISCOVERY_ENGINE_TYPE_GUID, OpenMetadataAPIMapper.DISCOVERY_ENGINE_TYPE_NAME, null, qualifiedName, @@ -181,6 +180,7 @@ public String createDiscoveryEngine(String userId, null, null, null, + null, methodName); } diff --git a/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/handlers/GovernanceConfigurationHandler.java b/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/handlers/GovernanceConfigurationHandler.java index f2e86944c6f..137c273cc82 100644 --- a/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/handlers/GovernanceConfigurationHandler.java +++ b/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/handlers/GovernanceConfigurationHandler.java @@ -174,16 +174,9 @@ public String createGovernanceEngine(String userId, invalidParameterHandler.validateName(typeName, typeNameParameterName, methodName); - String typeGUID = invalidParameterHandler.validateTypeName(typeName, - OpenMetadataAPIMapper.GOVERNANCE_ENGINE_TYPE_NAME, - serviceName, - methodName, - repositoryHelper); - return governanceEngineHandler.createSoftwareServerCapability(userId, null, null, - typeGUID, typeName, null, qualifiedName, @@ -197,6 +190,7 @@ public String createGovernanceEngine(String userId, null, null, null, + null, methodName); } From 2d3d1ff5bc0eb757d4348bf510c0b93d690930c3 Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Mon, 13 Dec 2021 10:52:16 +0000 Subject: [PATCH 05/14] Support software server capabilities Signed-off-by: Mandy Chessell --- .../generichandlers/ConnectionHandler.java | 2 +- .../OpenMetadataAPIGenericConverter.java | 142 ++++++++++- .../OpenMetadataAPIGenericHandler.java | 106 +++++++- .../OpenMetadataAPIMapper.java | 12 +- .../SoftwareServerCapabilityBuilder.java | 31 +++ .../SoftwareServerCapabilityHandler.java | 233 ++++++++++++++---- 6 files changed, 464 insertions(+), 62 deletions(-) diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ConnectionHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ConnectionHandler.java index 7ae6db9f472..784b015048c 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ConnectionHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ConnectionHandler.java @@ -1817,7 +1817,7 @@ public void removeConnection(String userId, null, false, false, - new Date(), + null, 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 25940f1053a..bb7747ca242 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 @@ -780,9 +780,9 @@ protected String getDescription(InstanceProperties instanceProperties) if (instanceProperties != null) { return repositoryHelper.getStringProperty(serviceName, - OpenMetadataAPIMapper.DESCRIPTION_PROPERTY_NAME, - instanceProperties, - methodName); + OpenMetadataAPIMapper.DESCRIPTION_PROPERTY_NAME, + instanceProperties, + methodName); } return null; @@ -898,6 +898,73 @@ protected int removeMaximumInstances(InstanceProperties instanceProperties) } + /** + * Extract and delete the initials property from the supplied instance properties. + * + * @param instanceProperties properties from entity + * @return string text or null + */ + protected String removeInitials(InstanceProperties instanceProperties) + { + final String methodName = "removeInitials"; + + if (instanceProperties != null) + { + return repositoryHelper.removeStringProperty(serviceName, + OpenMetadataAPIMapper.INITIALS_PROPERTY_NAME, + instanceProperties, + methodName); + } + + return null; + } + + + /** + * Extract and delete the givenNames property from the supplied instance properties. + * + * @param instanceProperties properties from entity + * @return string text or null + */ + protected String removeGivenNames(InstanceProperties instanceProperties) + { + final String methodName = "removeGivenNames"; + + if (instanceProperties != null) + { + return repositoryHelper.removeStringProperty(serviceName, + OpenMetadataAPIMapper.GIVEN_NAMES_PROPERTY_NAME, + instanceProperties, + methodName); + } + + return null; + } + + + /** + * Extract and delete the surname property from the supplied instance properties. + * + * @param instanceProperties properties from entity + * @return string text or null + */ + protected String removeSurname(InstanceProperties instanceProperties) + { + final String methodName = "removeSurname"; + + if (instanceProperties != null) + { + return repositoryHelper.removeStringProperty(serviceName, + OpenMetadataAPIMapper.SURNAME_PROPERTY_NAME, + instanceProperties, + methodName); + } + + return null; + } + + + /** * Extract and delete the fullName property from the supplied instance properties. * @@ -920,6 +987,29 @@ protected String removeFullName(InstanceProperties instanceProperties) } + /** + * Extract and delete the preferredLanguage property from the supplied instance properties. + * + * @param instanceProperties properties from entity + * @return string text or null + */ + protected String removePreferredLanguage(InstanceProperties instanceProperties) + { + final String methodName = "removePreferredLanguage"; + + if (instanceProperties != null) + { + return repositoryHelper.removeStringProperty(serviceName, + OpenMetadataAPIMapper.PREFERRED_LANGUAGE_PROPERTY_NAME, + instanceProperties, + methodName); + } + + return null; + } + + + /** * Extract and delete the jobTitle property from the supplied instance properties. * @@ -942,6 +1032,52 @@ protected String removeJobTitle(InstanceProperties instanceProperties) } + + /** + * Extract and delete the employeeNumber property from the supplied instance properties. + * + * @param instanceProperties properties from entity + * @return string text or null + */ + protected String removeEmployeeNumber(InstanceProperties instanceProperties) + { + final String methodName = "removeEmployeeNumber"; + + if (instanceProperties != null) + { + return repositoryHelper.removeStringProperty(serviceName, + OpenMetadataAPIMapper.EMPLOYEE_NUMBER_PROPERTY_NAME, + instanceProperties, + methodName); + } + + return null; + } + + + + /** + * Extract and delete the employeeType property from the supplied instance properties. + * + * @param instanceProperties properties from entity + * @return string text or null + */ + protected String removeEmployeeType(InstanceProperties instanceProperties) + { + final String methodName = "removeEmployeeType"; + + if (instanceProperties != null) + { + return repositoryHelper.removeStringProperty(serviceName, + OpenMetadataAPIMapper.EMPLOYEE_TYPE_PROPERTY_NAME, + instanceProperties, + methodName); + } + + return null; + } + + /** * Extract and delete the contactMethodService property from the supplied instance properties. * 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 58944bd9b12..4a3ac281126 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 @@ -1182,6 +1182,81 @@ public void updateRelationshipProperties(String userId, } + + /** + * Update the properties associated with a relationship. Effectivity dates are unchanged. + * + * @param userId caller's userId + * @param externalSourceGUID guid of the software server capability entity that represented the external source - null for local + * @param externalSourceName name of the software server capability entity that represented the external source + * @param relationshipGUID unique identifier of the relationship to update + * @param relationshipGUIDParameterName name of the parameter supplying the relationshipGUID + * @param relationshipTypeName type name of relationship if known (null is ok) + * @param methodName calling method + * + * @throws InvalidParameterException the unique identifier of the relationship is null or invalid in some way; the properties are + * not valid for this type of relationship + * @throws UserNotAuthorizedException the governance action service is not authorized to update this relationship + * @throws PropertyServerException there is a problem with the metadata store + */ + public void deleteRelationship(String userId, + String externalSourceGUID, + String externalSourceName, + String relationshipGUID, + String relationshipGUIDParameterName, + String relationshipTypeName, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(relationshipGUID, relationshipGUIDParameterName, methodName); + + Relationship relationship = repositoryHandler.getRelationshipByGUID(userId, + relationshipGUID, + relationshipGUIDParameterName, + relationshipTypeName, + null, + methodName); + + if (this.visibleToUserThroughRelationship(userId, relationship, methodName)) + { + + + final String entityOneParameterName = "relationship.getEntityOneProxy().getGUID()"; + final String entityTwoParameterName = "relationship.getEntityTwoProxy().getGUID()"; + + this.validateAnchorEntity(userId, + relationship.getEntityOneProxy().getGUID(), + entityOneParameterName, + OpenMetadataAPIMapper.OPEN_METADATA_ROOT_TYPE_NAME, + false, + false, + false, + supportedZones, + null, + methodName); + + this.validateAnchorEntity(userId, + relationship.getEntityTwoProxy().getGUID(), + entityTwoParameterName, + OpenMetadataAPIMapper.OPEN_METADATA_ROOT_TYPE_NAME, + false, + false, + false, + supportedZones, + null, + methodName); + + repositoryHandler.removeRelationship(userId, + externalSourceGUID, + externalSourceName, + relationship, + methodName); + } + } + + /** * Locate the requested classification in the supplied entity. * @@ -5070,6 +5145,34 @@ public List getAttachedEntities(String userId, } + + + public Relationship getAttachmentLink(String userId, + String relationshipGUID, + String relationshipGUIDParameterName, + String relationshipTypeName, + Date effectiveTime, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + + { + Relationship relationship = repositoryHandler.getRelationshipByGUID(userId, + relationshipGUID, + relationshipGUIDParameterName, + relationshipTypeName, + effectiveTime, + methodName); + + if (this.visibleToUserThroughRelationship(userId, relationship, methodName)) + { + return relationship; + } + + return null; + } + + /** * Return the relationship between the requested elements - there should be only one. Note that the entities are not checked. * @@ -5235,6 +5338,7 @@ public List getAllAttachmentLinks(String userId, } + /** * Return the relationships to required elements attached to a specific entity. Note that the entities are not checked. * @@ -5640,7 +5744,7 @@ public String createBeanInRepository(String userId, entityTypeGUID, entityTypeName, uniqueParameterValue, - uniqueParameterValue, + uniqueParameterName, this.getEffectiveTime(propertyBuilder.getInstanceProperties(methodName)), methodName); } 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 aa851950733..01f7892d74a 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 @@ -578,8 +578,15 @@ public class OpenMetadataAPIMapper public static final String PERSON_TYPE_NAME = "Person"; /* from Area 1 */ /* ActorProfile */ - public static final String FULL_NAME_PROPERTY_NAME = "fullName"; /* from Person entity */ - public static final String JOB_TITLE_PROPERTY_NAME = "jobTitle"; /* from Person entity */ + public static final String TITLE_PROPERTY_NAME = "title"; /* from Person entity */ + public static final String INITIALS_PROPERTY_NAME = "initials"; /* from Person entity */ + 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 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 */ public static final String PERSONAL_CONTRIBUTION_RELATIONSHIP_TYPE_GUID = "4a316abe-eeee-4d11-ad5a-4bfb4079b80b"; /* from Area 1 */ public static final String PERSONAL_CONTRIBUTION_RELATIONSHIP_TYPE_NAME = "PersonalContribution"; @@ -1294,7 +1301,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 TITLE_PROPERTY_NAME = "title"; /* from GovernanceDefinition entity */ 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 */ diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/SoftwareServerCapabilityBuilder.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/SoftwareServerCapabilityBuilder.java index 54932e042cd..af684644f89 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/SoftwareServerCapabilityBuilder.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/SoftwareServerCapabilityBuilder.java @@ -76,6 +76,37 @@ public SoftwareServerCapabilityBuilder(String qualifiedName, } + /** + * Create constructor - when templating + * + * @param qualifiedName unique name for the connection + * @param displayName short display name for the connection + * @param description description of the connection + * @param repositoryHelper helper methods + * @param serviceName name of this OMAS + * @param serverName name of local server + */ + SoftwareServerCapabilityBuilder(String qualifiedName, + String displayName, + String description, + OMRSRepositoryHelper repositoryHelper, + String serviceName, + String serverName) + { + super(qualifiedName, + null, + OpenMetadataAPIMapper.SOFTWARE_SERVER_CAPABILITY_TYPE_GUID, + OpenMetadataAPIMapper.SOFTWARE_SERVER_CAPABILITY_TYPE_NAME, + null, + repositoryHelper, + serviceName, + serverName); + + this.displayName = displayName; + this.description = description; + } + + /** * Create constructor * diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/SoftwareServerCapabilityHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/SoftwareServerCapabilityHandler.java index 49eb22b9d3d..f45d66fa557 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/SoftwareServerCapabilityHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/SoftwareServerCapabilityHandler.java @@ -153,6 +153,7 @@ public String createFileSystem(String userId, } + /** * Create specialized Software Server Capabilities entities. Most software service capabilities * either specialize Software Server Capability or have a special classification. @@ -160,7 +161,6 @@ public String createFileSystem(String userId, * @param userId calling user * @param externalSourceGUID guid of the software server capability entity that represented the external source - null for local * @param externalSourceName name of the software server capability entity that represented the external source - * @param specializedTypeGUID unique identifier of the software server capability type * @param specializedTypeName unique name of the software server capability type * @param classificationName name of classification if any * @param uniqueName qualified name for the software server capability @@ -171,7 +171,10 @@ public String createFileSystem(String userId, * @param patchLevel patchLevel of software supporting the file system * @param source supplier of the software for this file system * @param additionalProperties additional properties + * @param extendedProperties properties defined for the subtype * @param vendorProperties properties about the vendor and/or their product + * @param effectiveFrom when is this element effective from + * @param effectiveTo when is this element effect to * @param methodName calling method * * @return unique identifier for the file system @@ -183,7 +186,6 @@ public String createFileSystem(String userId, public String createSoftwareServerCapability(String userId, String externalSourceGUID, String externalSourceName, - String specializedTypeGUID, String specializedTypeName, String classificationName, String uniqueName, @@ -194,6 +196,7 @@ public String createSoftwareServerCapability(String userId, String patchLevel, String source, Map additionalProperties, + Map extendedProperties, Map vendorProperties, Date effectiveFrom, Date effectiveTo, @@ -201,16 +204,17 @@ public String createSoftwareServerCapability(String userId, UserNotAuthorizedException, PropertyServerException { - String typeId = OpenMetadataAPIMapper.SOFTWARE_SERVER_CAPABILITY_TYPE_GUID; + String typeGUID = OpenMetadataAPIMapper.SOFTWARE_SERVER_CAPABILITY_TYPE_GUID; String typeName = OpenMetadataAPIMapper.SOFTWARE_SERVER_CAPABILITY_TYPE_NAME; - if (specializedTypeGUID != null) - { - typeId = specializedTypeGUID; - } if (specializedTypeName != null) { typeName = specializedTypeName; + typeGUID = invalidParameterHandler.validateTypeName(typeName, + OpenMetadataAPIMapper.SOFTWARE_SERVER_CAPABILITY_TYPE_NAME, + serviceName, + methodName, + repositoryHelper); } SoftwareServerCapabilityBuilder builder = new SoftwareServerCapabilityBuilder(uniqueName, @@ -221,9 +225,9 @@ public String createSoftwareServerCapability(String userId, patchLevel, source, additionalProperties, - typeId, + typeGUID, typeName, - null, + extendedProperties, repositoryHelper, serviceName, serverName); @@ -235,25 +239,26 @@ public String createSoftwareServerCapability(String userId, builder.setCapabilityTypeClassification(userId, classificationName, methodName); } - String fileSystemGUID = this.createBeanInRepository(userId, + String capabilityGUID = this.createBeanInRepository(userId, externalSourceGUID, externalSourceName, - typeId, + typeGUID, typeName, uniqueName, OpenMetadataAPIMapper.QUALIFIED_NAME_PROPERTY_NAME, builder, methodName); - if (fileSystemGUID != null) + if (capabilityGUID != null) { - this.setVendorProperties(userId, fileSystemGUID, vendorProperties, methodName); + this.setVendorProperties(userId, capabilityGUID, vendorProperties, methodName); } - return fileSystemGUID; + return capabilityGUID; } + /** * Create specialized Software Server Capabilities entities. Most software service capabilities * either specialize Software Server Capability or have a special classification. @@ -281,6 +286,7 @@ public String createSoftwareServerCapability(String userId, * @throws PropertyServerException problem accessing property server * @throws UserNotAuthorizedException security access problem */ + @SuppressWarnings(value = "unused") public String createSoftwareServerCapability(String userId, String externalSourceGUID, String externalSourceName, @@ -300,54 +306,83 @@ public String createSoftwareServerCapability(String userId, UserNotAuthorizedException, PropertyServerException { - String typeId = OpenMetadataAPIMapper.SOFTWARE_SERVER_CAPABILITY_TYPE_GUID; - String typeName = OpenMetadataAPIMapper.SOFTWARE_SERVER_CAPABILITY_TYPE_NAME; + return this.createSoftwareServerCapability(userId, + externalSourceGUID, + externalSourceName, + specializedTypeName, + classificationName, + uniqueName, + displayName, + description, + type, + version, + patchLevel, + source, + additionalProperties, + null, + vendorProperties, + null, + null, + methodName); + } - if (specializedTypeGUID != null) - { - typeId = specializedTypeGUID; - } - if (specializedTypeName != null) - { - typeName = specializedTypeName; - } - SoftwareServerCapabilityBuilder builder = new SoftwareServerCapabilityBuilder(uniqueName, + /** + * 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 element. + * + * @param userId calling user + * @param externalSourceGUID guid of the software server capability entity that represented the external source - null for local + * @param externalSourceName name of the software server capability entity that represented the external source + * @param templateGUID unique identifier of the metadata element to copy + * @param templateGUIDParameterName parameter name for templateGUID + * @param qualifiedName unique name for the element - used in other configuration + * @param qualifiedNameParameterName parameter name for qualifiedName + * @param displayName short display name for the new element + * @param description description of the new element + * @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 createSoftwareServerCapabilityFromTemplate(String userId, + String externalSourceGUID, + String externalSourceName, + String templateGUID, + String templateGUIDParameterName, + String qualifiedName, + String qualifiedNameParameterName, + String displayName, + String description, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(templateGUID, templateGUIDParameterName, methodName); + invalidParameterHandler.validateName(qualifiedName, qualifiedNameParameterName, methodName); + + SoftwareServerCapabilityBuilder builder = new SoftwareServerCapabilityBuilder(qualifiedName, displayName, description, - type, - version, - patchLevel, - source, - additionalProperties, - typeId, - typeName, - null, repositoryHelper, serviceName, serverName); - if (classificationName != null) - { - builder.setCapabilityTypeClassification(userId, classificationName, methodName); - } - - String fileSystemGUID = this.createBeanInRepository(userId, - externalSourceGUID, - externalSourceName, - typeId, - typeName, - uniqueName, - OpenMetadataAPIMapper.QUALIFIED_NAME_PROPERTY_NAME, - builder, - methodName); - - if (fileSystemGUID != null) - { - this.setVendorProperties(userId, fileSystemGUID, vendorProperties, methodName); - } - - return fileSystemGUID; + return this.createBeanFromTemplate(userId, + externalSourceGUID, + externalSourceName, + templateGUID, + templateGUIDParameterName, + OpenMetadataAPIMapper.SOFTWARE_SERVER_CAPABILITY_TYPE_GUID, + OpenMetadataAPIMapper.SOFTWARE_SERVER_CAPABILITY_TYPE_NAME, + qualifiedName, + OpenMetadataAPIMapper.QUALIFIED_NAME_PROPERTY_NAME, + builder, + methodName); } @@ -405,6 +440,96 @@ public void addSoftwareServerCapabilityClassification(String userId, } + /** + * Update a software server capability entity - the classification is not updated - assumed not to change as the classification is like its type. + * + * @param userId calling user + * @param externalSourceGUID guid of the software server capability entity that represented the external source - null for local + * @param externalSourceName name of the software server capability entity that represented the external source + * @param capabilityGUID unique identifier for the capability + * @param capabilityGUIDParameterName parameter providing capabilityGUID + * @param uniqueName qualified name for the software server capability + * @param displayName short display name + * @param description description of the file system + * @param type type of file system + * @param version version of file system + * @param patchLevel patchLevel of software supporting the file system + * @param source supplier of the software for this file system + * @param additionalProperties additional properties + * @param extendedProperties properties defined for the subtype + * @param vendorProperties properties about the vendor and/or their product + * @param isMergeUpdate should the properties be merged with existing properties or replace the existing properties? + * @param effectiveFrom when is this element effective from + * @param effectiveTo when is this element effect to + * @param methodName calling method + * + * + * @throws InvalidParameterException one of the parameters is null or invalid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + public void updateSoftwareServerCapability(String userId, + String externalSourceGUID, + String externalSourceName, + String capabilityGUID, + String capabilityGUIDParameterName, + String uniqueName, + String displayName, + String description, + String type, + String version, + String patchLevel, + String source, + Map additionalProperties, + Map extendedProperties, + Map vendorProperties, + boolean isMergeUpdate, + Date effectiveFrom, + Date effectiveTo, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + String typeGUID = OpenMetadataAPIMapper.SOFTWARE_SERVER_CAPABILITY_TYPE_GUID; + String typeName = OpenMetadataAPIMapper.SOFTWARE_SERVER_CAPABILITY_TYPE_NAME; + + SoftwareServerCapabilityBuilder builder = new SoftwareServerCapabilityBuilder(uniqueName, + displayName, + description, + type, + version, + patchLevel, + source, + additionalProperties, + typeGUID, + typeName, + extendedProperties, + repositoryHelper, + serviceName, + serverName); + + builder.setEffectivityDates(effectiveFrom, effectiveTo); + + this.updateBeanInRepository(userId, + externalSourceGUID, + externalSourceName, + capabilityGUID, + capabilityGUIDParameterName, + typeGUID, + typeName, + false, + false, + supportedZones, + builder.getInstanceProperties(methodName), + isMergeUpdate, + this.getEffectiveTime(effectiveFrom, effectiveTo), + methodName); + + this.setVendorProperties(userId, capabilityGUID, vendorProperties, methodName); + } + + + /** * Retrieve a list of unique identifiers for defined software server capabilities. * From c5fc17da016b36b7bfab7e153d56d5ead012a3d7 Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Mon, 13 Dec 2021 10:53:23 +0000 Subject: [PATCH 06/14] SoftwareServerCapability support Signed-off-by: Mandy Chessell --- .../api/HostManagerInterface.java | 381 +++++ .../api/ITProfileManagerInterface.java | 4 +- ...twareServerCapabilityManagerInterface.java | 107 +- .../api/SoftwareServerManagerInterface.java | 356 +++++ ...oftwareServerPlatformManagerInterface.java | 366 +++++ .../PlatformDeploymentElement.java | 202 +++ .../SupportedCapabilityElement.java | 176 +++ ...nfigurationItemRelationshipProperties.java | 157 ++ .../properties/OperationalStatus.java | 118 ++ .../PlatformDeploymentProperties.java | 180 +++ .../properties/ServerAssetUseProperties.java | 12 +- .../SupportedCapabilityProperties.java | 181 +++ .../rest/EffectiveDatesRequestBody.java | 2 +- ...ffectiveTimeMetadataSourceRequestBody.java | 126 ++ .../rest/HostListResponse.java | 149 ++ .../rest/HostRequestBody.java | 173 +++ .../itinfrastructure/rest/HostResponse.java | 137 ++ .../rest/MetadataSourceRequestBody.java | 2 +- .../rest/PlatformDeploymentListResponse.java | 148 ++ .../rest/PlatformDeploymentRequestBody.java | 126 ++ .../rest/ProfileIdentityRequestBody.java | 2 +- .../rest/ServerAssetUseListResponse.java | 3 +- .../rest/ServerAssetUseRequestBody.java | 126 ++ .../rest/ServerAssetUseResponse.java | 137 ++ .../SoftwareServerCapabilityListResponse.java | 149 ++ .../SoftwareServerCapabilityRequestBody.java | 204 +++ .../SoftwareServerCapabilityResponse.java | 137 ++ .../rest/SoftwareServerListResponse.java | 149 ++ .../SoftwareServerPlatformListResponse.java | 149 ++ .../SoftwareServerPlatformRequestBody.java | 177 +++ .../rest/SoftwareServerPlatformResponse.java | 137 ++ .../rest/SoftwareServerRequestBody.java | 177 +++ .../rest/SoftwareServerResponse.java | 137 ++ .../rest/SupportedCapabilityListResponse.java | 148 ++ .../rest/SupportedCapabilityRequestBody.java | 126 ++ .../rest/UseTypeRequestBody.java | 126 ++ .../client/CapabilityManagerClient.java | 872 +++++++++++ .../client/HostManagerClient.java | 932 +++++++++++ .../client/ITProfileManagerClient.java | 8 +- .../rest/ITInfrastructureRESTClient.java | 447 ++++++ .../converters/AssetConverter.java | 125 ++ .../converters/ElementStubConverter.java | 150 ++ .../ITInfrastructureInstanceHandler.java | 35 + .../server/ITInfrastructureRESTServices.java | 1374 ++++++++++++++++- .../ITInfrastructureServicesInstance.java | 35 + .../spring/ITInfrastructureResource.java | 387 ++++- .../server/spring/ITProfileResource.java | 4 +- 47 files changed, 9437 insertions(+), 119 deletions(-) create mode 100644 open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/api/HostManagerInterface.java create mode 100644 open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/api/SoftwareServerManagerInterface.java create mode 100644 open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/api/SoftwareServerPlatformManagerInterface.java create mode 100644 open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/metadataelements/PlatformDeploymentElement.java create mode 100644 open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/metadataelements/SupportedCapabilityElement.java create mode 100644 open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/ConfigurationItemRelationshipProperties.java create mode 100644 open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/OperationalStatus.java create mode 100644 open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/PlatformDeploymentProperties.java create mode 100644 open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/SupportedCapabilityProperties.java create mode 100644 open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/EffectiveTimeMetadataSourceRequestBody.java create mode 100644 open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/HostListResponse.java create mode 100644 open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/HostRequestBody.java create mode 100644 open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/HostResponse.java create mode 100644 open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/PlatformDeploymentListResponse.java create mode 100644 open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/PlatformDeploymentRequestBody.java create mode 100644 open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/ServerAssetUseRequestBody.java create mode 100644 open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/ServerAssetUseResponse.java create mode 100644 open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SoftwareServerCapabilityListResponse.java create mode 100644 open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SoftwareServerCapabilityRequestBody.java create mode 100644 open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SoftwareServerCapabilityResponse.java create mode 100644 open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SoftwareServerListResponse.java create mode 100644 open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SoftwareServerPlatformListResponse.java create mode 100644 open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SoftwareServerPlatformRequestBody.java create mode 100644 open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SoftwareServerPlatformResponse.java create mode 100644 open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SoftwareServerRequestBody.java create mode 100644 open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SoftwareServerResponse.java create mode 100644 open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SupportedCapabilityListResponse.java create mode 100644 open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SupportedCapabilityRequestBody.java create mode 100644 open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/UseTypeRequestBody.java create mode 100644 open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-client/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/client/CapabilityManagerClient.java create mode 100644 open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-client/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/client/HostManagerClient.java create mode 100644 open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/AssetConverter.java create mode 100644 open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/ElementStubConverter.java diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/api/HostManagerInterface.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/api/HostManagerInterface.java new file mode 100644 index 00000000000..899ce945a52 --- /dev/null +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/api/HostManagerInterface.java @@ -0,0 +1,381 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.itinfrastructure.api; + +import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.HostElement; +import org.odpi.openmetadata.accessservices.itinfrastructure.properties.HostProperties; +import org.odpi.openmetadata.accessservices.itinfrastructure.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.Date; +import java.util.List; + +/** + * HostManagerInterface defines the client side interface for the IT Infrastructure OMAS that is + * relevant for host assets. It provides the ability to + * define and maintain the metadata about a host and relationships between hosts. + */ +public interface HostManagerInterface +{ + /** + * Create a new metadata element to represent a host. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the infrastructure manager + * @param infrastructureManagerName unique name of software server capability representing the infrastructure manager + * @param infrastructureManagerIsHome should the host be marked as owned by the infrastructure manager so others can not update? + * @param hostProperties 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 createHost(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + boolean infrastructureManagerIsHome, + HostProperties hostProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Create a new metadata element to represent a host using an existing metadata element as a template. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the infrastructure manager + * @param infrastructureManagerName unique name of software server capability representing the infrastructure manager + * @param infrastructureManagerIsHome should the host be marked as owned by the infrastructure manager so others can not update? + * @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 createHostFromTemplate(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + boolean infrastructureManagerIsHome, + String templateGUID, + TemplateProperties templateProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Update the metadata element representing a host. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the infrastructure manager + * @param infrastructureManagerName unique name of software server capability representing the infrastructure manager + * @param hostGUID unique identifier of the metadata element to update + * @param isMergeUpdate are unspecified properties unchanged (true) or removed? + * @param hostProperties 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 updateHost(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + String hostGUID, + boolean isMergeUpdate, + HostProperties hostProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + + /** + * Create a relationship between a host and a hosted host. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the infrastructure manager + * @param infrastructureManagerName unique name of software server capability representing the infrastructure manager + * @param hostGUID unique identifier of the host + * @param hostedHostGUID unique identifier of the hosted host + * + * @throws InvalidParameterException one of the parameters is invalid + * @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 setupHostedHost(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + String hostGUID, + String hostedHostGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove a relationship between a host and a hosted host. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the infrastructure manager + * @param infrastructureManagerName unique name of software server capability representing the infrastructure manager + * @param hostGUID unique identifier of the host + * @param hostedHostGUID unique identifier of the hosted host + * + * @throws InvalidParameterException one of the parameters is invalid + * @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 clearHostedHost(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + String hostGUID, + String hostedHostGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Create a relationship between a host and an cluster member host. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the infrastructure manager + * @param infrastructureManagerName unique name of software server capability representing the infrastructure manager + * @param hostGUID unique identifier of the host + * @param clusterMemberGUID unique identifier of the cluster member host + * + * @throws InvalidParameterException one of the parameters is invalid + * @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 setupClusterMember(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + String hostGUID, + String clusterMemberGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove a relationship between a host and an cluster member host. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the infrastructure manager + * @param infrastructureManagerName unique name of software server capability representing the infrastructure manager + * @param hostGUID unique identifier of the host + * @param clusterMemberGUID unique identifier of the cluster member host + * + * @throws InvalidParameterException one of the parameters is invalid + * @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 clearClusterMember(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + String hostGUID, + String clusterMemberGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + + /** + * Update the zones for the host asset so that it becomes visible to consumers. + * (The zones are set to the list of zones in the publishedZones option configured for each + * instance of the IT Infrastructure OMAS). + * + * @param userId calling user + * @param hostGUID unique identifier of the metadata element to publish + * + * @throws InvalidParameterException one of the parameters is invalid + * @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 publishHost(String userId, + String hostGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Update the zones for the host asset so that it is no longer visible to consumers. + * (The zones are set to the list of zones in the defaultZones option configured for each + * instance of the IT Infrastructure OMAS. This is the setting when the host is first created). + * + * @param userId calling user + * @param hostGUID unique identifier of the metadata element to withdraw + * + * @throws InvalidParameterException one of the parameters is invalid + * @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 withdrawHost(String userId, + String hostGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the metadata element representing a host. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the infrastructure manager + * @param infrastructureManagerName unique name of software server capability representing the infrastructure manager + * @param hostGUID 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 removeHost(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + String hostGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + + /** + * Retrieve the list of host 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 effectiveTime effective time for the query + * @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 findHosts(String userId, + String searchString, + Date effectiveTime, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of host 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 effectiveTime effective time for the query + * @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 getHostsByName(String userId, + String name, + Date effectiveTime, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of hosts created by this caller. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the infrastructure manager + * @param infrastructureManagerName unique name of software server capability representing the infrastructure manager + * @param effectiveTime effective time for the query + * @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 getHostsForInfrastructureManager(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + Date effectiveTime, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the host metadata element with the supplied unique identifier. + * + * @param userId calling user + * @param guid 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) + */ + HostElement getHostByGUID(String userId, + String guid) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + /** + * Return the list of hosts hosted by another host. + * + * @param userId calling user + * @param supportingHostGUID unique identifier of the host to query + * @param effectiveTime effective time for the query + * @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 getHostedHosts(String userId, + String supportingHostGUID, + Date effectiveTime, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + /** + * Return the list of cluster members associated with a host. + * + * @param userId calling user + * @param hostGUID unique identifier of the host to query + * @param effectiveTime effective time for the query + * @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 getClusterMembersForHost(String userId, + String hostGUID, + Date effectiveTime, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; +} diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/api/ITProfileManagerInterface.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/api/ITProfileManagerInterface.java index 088bb88772a..3239713a5ab 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/api/ITProfileManagerInterface.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/api/ITProfileManagerInterface.java @@ -17,9 +17,9 @@ /** - * ITProfileManagementInterface defines the client interface for setting up the profile and userId for a piece of IT infrastructure. + * ITProfileManagerInterface defines the client interface for setting up the profile and userId for a piece of IT infrastructure. */ -public interface ITProfileManagementInterface +public interface ITProfileManagerInterface { /** * Create a definition of an IT profile. If the itInfrastructureGUID is provided, it is connected to the infrastructure element that the diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/api/SoftwareServerCapabilityManagerInterface.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/api/SoftwareServerCapabilityManagerInterface.java index 915a9868015..b15917780f2 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/api/SoftwareServerCapabilityManagerInterface.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/api/SoftwareServerCapabilityManagerInterface.java @@ -16,11 +16,11 @@ import java.util.List; /** - * SoftwareServerCapabilityManagementInterface defines the client side interface for the IT Infrastructure OMAS that is + * SoftwareServerCapabilityManagerInterface defines the client side interface for the IT Infrastructure OMAS that is * relevant for cataloguing software server capabilities. It provides the ability to * define and maintain the metadata about a software server capability and the assets it interacts with. */ -public interface SoftwareServerCapabilityManagementInterface +public interface SoftwareServerCapabilityManagerInterface { /** * Create a new metadata element to represent a software server capability. @@ -29,6 +29,7 @@ public interface SoftwareServerCapabilityManagementInterface * @param infrastructureManagerGUID unique identifier of software server capability representing the caller * @param infrastructureManagerName unique name of software server capability representing the caller * @param infrastructureManagerIsHome should the software server capability be marked as owned by the infrastructure manager so others can not update? + * @param classificationName optional classification name that refines the type of the software server capability. * @param capabilityProperties properties to store * * @return unique identifier of the new metadata element @@ -41,6 +42,7 @@ String createSoftwareServerCapability(String userId, String infrastructureManagerGUID, String infrastructureManagerName, boolean infrastructureManagerIsHome, + String classificationName, SoftwareServerCapabilityProperties capabilityProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException; @@ -103,7 +105,6 @@ void updateSoftwareServerCapability(String userId, * @param infrastructureManagerGUID unique identifier of software server capability representing the caller * @param infrastructureManagerName unique name of software server capability representing the caller * @param capabilityGUID unique identifier of the metadata element to remove - * @param qualifiedName unique name 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 @@ -112,10 +113,9 @@ void updateSoftwareServerCapability(String userId, void removeSoftwareServerCapability(String userId, String infrastructureManagerGUID, String infrastructureManagerName, - String capabilityGUID, - String qualifiedName) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; + String capabilityGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; /** @@ -124,6 +124,7 @@ void removeSoftwareServerCapability(String userId, * * @param userId calling user * @param searchString string to find in the properties + * @param effectiveTime effective time for the query * @param startFrom paging start point * @param pageSize maximum results that can be returned * @@ -135,6 +136,7 @@ void removeSoftwareServerCapability(String userId, */ List findSoftwareServerCapabilities(String userId, String searchString, + Date effectiveTime, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, @@ -147,6 +149,7 @@ List findSoftwareServerCapabilities(String user * * @param userId calling user * @param name name to search for + * @param effectiveTime effective time for the query * @param startFrom paging start point * @param pageSize maximum results that can be returned * @@ -158,36 +161,13 @@ List findSoftwareServerCapabilities(String user */ List getSoftwareServerCapabilitiesByName(String userId, String name, + Date effectiveTime, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException; - /** - * Retrieve the list of software server capabilities originating from this caller. - * - * @param userId calling user - * @param infrastructureManagerGUID unique identifier of software server capability representing the software server capability manager (infrastructure manager) - * @param infrastructureManagerName unique name of software server capability representing the software server capability manager (infrastructure manager) - * @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 getSoftwareServerCapabilitiesForInfrastructureManager(String userId, - String infrastructureManagerGUID, - String infrastructureManagerName, - int startFrom, - int pageSize) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; - - /** * Retrieve the software server capability metadata element with the supplied unique identifier. * @@ -244,8 +224,7 @@ String createServerAssetUse(String userId, * @param userId calling user * @param infrastructureManagerGUID unique identifier of software server capability representing the caller * @param infrastructureManagerName unique name of software server capability representing the caller - * @param capabilityGUID unique identifier of a software server capability - * @param assetGUID unique identifier of an asset + * @param serverAssetUseGUID unique identifier of the relationship between a software server capability and an asset * @param isMergeUpdate are unspecified properties unchanged (true) or removed? * @param properties new properties for the ServerAssetUse relationship * @@ -256,8 +235,7 @@ String createServerAssetUse(String userId, void updateServerAssetUse(String userId, String infrastructureManagerGUID, String infrastructureManagerName, - String capabilityGUID, - String assetGUID, + String serverAssetUseGUID, boolean isMergeUpdate, ServerAssetUseProperties properties) throws InvalidParameterException, UserNotAuthorizedException, @@ -270,8 +248,7 @@ void updateServerAssetUse(String userId, * @param userId calling user * @param infrastructureManagerGUID unique identifier of software server capability representing the caller * @param infrastructureManagerName unique name of software server capability representing the caller - * @param capabilityGUID unique identifier of a software server capability - * @param assetGUID unique identifier of an asset + * @param serverAssetUseGUID unique identifier of the relationship between a software server capability and an asset * * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request @@ -280,33 +257,9 @@ void updateServerAssetUse(String userId, void removeServerAssetUse(String userId, String infrastructureManagerGUID, String infrastructureManagerName, - String capabilityGUID, - String assetGUID) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; - - - /** - * Retrieve the list of server asset use relationships that contain the search string in the description. - * 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 findServerAssetUses(String userId, - String searchString, - int startFrom, - int pageSize) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; + String serverAssetUseGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; /** @@ -315,6 +268,7 @@ List findServerAssetUses(String userId, * @param userId calling user * @param capabilityGUID unique identifier of the software server capability to query * @param useType value to search for. Null means all use types. + * @param effectiveTime effective time for the query * @param startFrom paging start point * @param pageSize maximum results that can be returned * @@ -327,17 +281,20 @@ List findServerAssetUses(String userId, List getServerAssetUsesForCapability(String userId, String capabilityGUID, ServerAssetUseType useType, + Date effectiveTime, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException; + /** * Return the list of software server capabilities that make use of a specific asset. * * @param userId calling user * @param assetGUID unique identifier of the asset to query * @param useType Optionally restrict the search to a specific user type. Null means all use types. + * @param effectiveTime effective time for the query * @param startFrom paging start point * @param pageSize maximum results that can be returned * @@ -350,6 +307,7 @@ List getServerAssetUsesForCapability(String u List getCapabilityUsesForAsset(String userId, String assetGUID, ServerAssetUseType useType, + Date effectiveTime, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, @@ -357,11 +315,12 @@ List getCapabilityUsesForAsset(String userId, /** - * Retrieve the list of relationships between software server capabilities and assets where the use type - * is set to the desired value. + * Retrieve the list of relationships between a specific software server capability and a specific asset. * * @param userId calling user - * @param useType value to search for. Null means all use types. + * @param capabilityGUID unique identifier of a software server capability + * @param assetGUID unique identifier of an asset + * @param effectiveTime effective time for the query * @param startFrom paging start point * @param pageSize maximum results that can be returned * @@ -371,12 +330,14 @@ List getCapabilityUsesForAsset(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) */ - List getServerAssetUsesByType(String userId, - ServerAssetUseType useType, - int startFrom, - int pageSize) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; + List getServerAssetUsesForElements(String userId, + String capabilityGUID, + String assetGUID, + Date effectiveTime, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; /** diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/api/SoftwareServerManagerInterface.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/api/SoftwareServerManagerInterface.java new file mode 100644 index 00000000000..edf0ae9af36 --- /dev/null +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/api/SoftwareServerManagerInterface.java @@ -0,0 +1,356 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.itinfrastructure.api; + +import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.SoftwareServerElement; +import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.SupportedCapabilityElement; +import org.odpi.openmetadata.accessservices.itinfrastructure.properties.SoftwareServerProperties; +import org.odpi.openmetadata.accessservices.itinfrastructure.properties.SupportedCapabilityProperties; +import org.odpi.openmetadata.accessservices.itinfrastructure.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.Date; +import java.util.List; + +/** + * SoftwareServerManagerInterface defines the client side interface for the IT Infrastructure OMAS that is + * relevant for softwareServer assets. It provides the ability to + * define and maintain the metadata about a software server and the capabilities deployed on it. + */ +public interface SoftwareServerManagerInterface +{ + + /* + * The software server is an IT Infrastructure asset + */ + + /** + * Create a new metadata element to represent a software server. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the caller + * @param infrastructureManagerName unique name of software server capability representing the caller + * @param infrastructureManagerIsHome should the softwareServer be marked as owned by the infrastructure manager so others can not update? + * @param softwareServerProperties 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 createSoftwareServer(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + boolean infrastructureManagerIsHome, + SoftwareServerProperties softwareServerProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Create a new metadata element to represent a software server using an existing metadata element as a template. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the caller + * @param infrastructureManagerName unique name of software server capability representing the caller + * @param infrastructureManagerIsHome should the softwareServer be marked as owned by the infrastructure manager so others can not update? + * @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 createSoftwareServerFromTemplate(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + boolean infrastructureManagerIsHome, + String templateGUID, + TemplateProperties templateProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Update the metadata element representing a software server. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the caller + * @param infrastructureManagerName unique name of software server capability representing the caller + * @param softwareServerGUID unique identifier of the metadata element to update + * @param isMergeUpdate are unspecified properties unchanged (true) or removed? + * @param softwareServerProperties 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 updateSoftwareServer(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + String softwareServerGUID, + boolean isMergeUpdate, + SoftwareServerProperties softwareServerProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Update the zones for the software server asset so that it becomes visible to consumers. + * (The zones are set to the list of zones in the publishedZones option configured for each + * instance of the IT Infrastructure OMAS). + * + * @param userId calling user + * @param softwareServerGUID unique identifier of the metadata element to publish + * + * @throws InvalidParameterException one of the parameters is invalid + * @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 publishSoftwareServer(String userId, + String softwareServerGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Update the zones for the software server asset so that it is no longer visible to consumers. + * (The zones are set to the list of zones in the defaultZones option configured for each + * instance of the IT Infrastructure OMAS. This is the setting when the softwareServer is first created). + * + * @param userId calling user + * @param softwareServerGUID unique identifier of the metadata element to withdraw + * + * @throws InvalidParameterException one of the parameters is invalid + * @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 withdrawSoftwareServer(String userId, + String softwareServerGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the metadata element representing a software server. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the caller + * @param infrastructureManagerName unique name of software server capability representing the caller + * @param softwareServerGUID 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 removeSoftwareServer(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + String softwareServerGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Link a software server capability to a software server. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the caller + * @param infrastructureManagerName unique name of software server capability representing the caller + * @param infrastructureManagerIsHome should the software server capability be marked as owned by the infrastructure manager so others can not update? + * @param capabilityGUID unique identifier of the software server capability + * @param softwareServerGUID unique identifier of the software server + * @param properties describes the deployment of the capability onto the server + * + * @throws InvalidParameterException one of the guids is null or not known + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + void linkCapabilityToServer(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + boolean infrastructureManagerIsHome, + String softwareServerGUID, + String capabilityGUID, + SupportedCapabilityProperties properties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Update the effectivity dates of a link from a piece of infrastructure to an IT profile. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the caller + * @param infrastructureManagerName unique name of software server capability representing the caller + * @param capabilityGUID unique identifier of the software server capability + * @param softwareServerGUID unique identifier of the software server + * @param isMergeUpdate are unspecified properties unchanged (true) or removed? + * @param properties describes the deployment of the capability onto the server + + * + * @throws InvalidParameterException one of the guids is null or not known + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + void updateCapabilityOnServer(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + String softwareServerGUID, + String capabilityGUID, + boolean isMergeUpdate, + SupportedCapabilityProperties properties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the link between a software server capability and a software server. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the caller + * @param infrastructureManagerName unique name of software server capability representing the caller + * @param softwareServerGUID unique identifier of the software server + * @param capabilityGUID unique identifier of the software server capability + * @param effectiveTime time that the relationship is effective + * + * @throws InvalidParameterException one of the guids is null or not known + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + void unlinkCapabilityFromServer(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + String softwareServerGUID, + String capabilityGUID, + Date effectiveTime) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + + /** + * Retrieve the list of software server 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 effectiveTime time that the element is effective + * @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 findSoftwareServers(String userId, + String searchString, + Date effectiveTime, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of softwareServer 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 effectiveTime time that the element is effective + * @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 getSoftwareServersByName(String userId, + String name, + Date effectiveTime, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of software servers created by this caller. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the caller + * @param infrastructureManagerName unique name of software server capability representing the caller + * @param effectiveTime time that the element is effective + * @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 getSoftwareServersForInfrastructureManager(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + Date effectiveTime, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + + /** + * Retrieve the list of software servers created by this caller. + * + * @param userId calling user + * @param softwareServerGUID unique identifier of the requested metadata element + * @param effectiveTime time that the element is effective + * @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 getSupportedCapabilities(String userId, + String softwareServerGUID, + Date effectiveTime, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the softwareServer metadata element with the supplied unique identifier. + * + * @param userId calling user + * @param guid 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) + */ + SoftwareServerElement getSoftwareServerByGUID(String userId, + String guid) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + +} diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/api/SoftwareServerPlatformManagerInterface.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/api/SoftwareServerPlatformManagerInterface.java new file mode 100644 index 00000000000..770bc7153fa --- /dev/null +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/api/SoftwareServerPlatformManagerInterface.java @@ -0,0 +1,366 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.itinfrastructure.api; + +import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.PlatformDeploymentElement; +import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.SoftwareServerPlatformElement; +import org.odpi.openmetadata.accessservices.itinfrastructure.properties.PlatformDeploymentProperties; +import org.odpi.openmetadata.accessservices.itinfrastructure.properties.SoftwareServerPlatformProperties; +import org.odpi.openmetadata.accessservices.itinfrastructure.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.Date; +import java.util.List; + +/** + * SoftwareServerPlatformManagerInterface defines the client side interface for the IT Infrastructure OMAS that is + * relevant for software server platform assets. It provides the ability to + * define and maintain the metadata about a platform and relationships between platforms and hosts. + */ +public interface SoftwareServerPlatformManagerInterface +{ + /** + * Create a new metadata element to represent a platform. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the infrastructure manager + * @param infrastructureManagerName unique name of software server capability representing the infrastructure manager + * @param infrastructureManagerIsHome should the platform be marked as owned by the infrastructure manager so others can not update? + * @param platformProperties 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 createSoftwareServerPlatform(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + boolean infrastructureManagerIsHome, + SoftwareServerPlatformProperties platformProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Create a new metadata element to represent a platform using an existing metadata element as a template. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the infrastructure manager + * @param infrastructureManagerName unique name of software server capability representing the infrastructure manager + * @param infrastructureManagerIsHome should the platform be marked as owned by the infrastructure manager so others can not update? + * @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 createSoftwareServerPlatformFromTemplate(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + boolean infrastructureManagerIsHome, + String templateGUID, + TemplateProperties templateProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Update the metadata element representing a platform. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the infrastructure manager + * @param infrastructureManagerName unique name of software server capability representing the infrastructure manager + * @param platformGUID unique identifier of the metadata element to update + * @param isMergeUpdate are unspecified properties unchanged (true) or removed? + * @param platformProperties 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 updateSoftwareServerPlatform(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + String platformGUID, + boolean isMergeUpdate, + SoftwareServerPlatformProperties platformProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + + /** + * Create a relationship between a platform and a host. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the infrastructure manager + * @param infrastructureManagerName unique name of software server capability representing the infrastructure manager + * @param platformGUID unique identifier of the platform + * @param hostGUID unique identifier of the host + * + * @throws InvalidParameterException one of the parameters is invalid + * @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 deploySoftwareServerPlatformToHost(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + String platformGUID, + String hostGUID, + PlatformDeploymentProperties deploymentProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + /** + * Update a relationship between a platform and a host. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the infrastructure manager + * @param infrastructureManagerName unique name of software server capability representing the infrastructure manager + * @param platformGUID unique identifier of the platform + * @param hostGUID unique identifier of the host + * @param isMergeUpdate are unspecified properties unchanged (true) or removed? + * @param deploymentProperties properties for the relationship + * + * @throws InvalidParameterException one of the parameters is invalid + * @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 updateSoftwareServerPlatformOnHost(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + String platformGUID, + String hostGUID, + boolean isMergeUpdate, + PlatformDeploymentProperties deploymentProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + + /** + * Remove a relationship between a platform and a host. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the infrastructure manager + * @param infrastructureManagerName unique name of software server capability representing the infrastructure manager + * @param platformGUID unique identifier of the platform + * @param hostGUID unique identifier of the host + * + * @throws InvalidParameterException one of the parameters is invalid + * @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 clearSoftwareServerPlatformFromHost(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + String platformGUID, + String hostGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Update the zones for the platform asset so that it becomes visible to consumers. + * (The zones are set to the list of zones in the publishedZones option configured for each + * instance of the IT Infrastructure OMAS). + * + * @param userId calling user + * @param platformGUID unique identifier of the metadata element to publish + * + * @throws InvalidParameterException one of the parameters is invalid + * @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 publishSoftwareServerPlatform(String userId, + String platformGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Update the zones for the platform asset so that it is no longer visible to consumers. + * (The zones are set to the list of zones in the defaultZones option configured for each + * instance of the IT Infrastructure OMAS. This is the setting when the platform is first created). + * + * @param userId calling user + * @param platformGUID unique identifier of the metadata element to withdraw + * + * @throws InvalidParameterException one of the parameters is invalid + * @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 withdrawSoftwareServerPlatform(String userId, + String platformGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the metadata element representing a platform. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the infrastructure manager + * @param infrastructureManagerName unique name of software server capability representing the infrastructure manager + * @param platformGUID 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 removeSoftwareServerPlatform(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + String platformGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + + /** + * Retrieve the list of platform 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 effectiveTime effective time for the query + * @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 findSoftwareServerPlatforms(String userId, + String searchString, + Date effectiveTime, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of platform 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 effectiveTime effective time for the query + * @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 getSoftwareServerPlatformsByName(String userId, + String name, + Date effectiveTime, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of platforms created by this caller. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the infrastructure manager + * @param infrastructureManagerName unique name of software server capability representing the infrastructure manager + * @param effectiveTime effective time for the query + * @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 getSoftwareServerPlatformsForInfrastructureManager(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + Date effectiveTime, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Return the list of software server platforms deployed on a particular host. + * + * @param userId calling user + * @param hostGUID unique identifier of the platform to query + * @param effectiveTime effective time for the query + * @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 getSoftwareServerPlatformsForHost(String userId, + String hostGUID, + Date effectiveTime, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + /** + * Return the list of hosts where a software server platform is deployed to. + * + * @param userId calling user + * @param platformGUID unique identifier of the platform to query + * @param effectiveTime effective time for the query + * @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 getHostsForSoftwareServerPlatform(String userId, + String platformGUID, + Date effectiveTime, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the platform metadata element with the supplied unique identifier. + * + * @param userId calling user + * @param guid 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) + */ + SoftwareServerPlatformElement getSoftwareServerPlatformByGUID(String userId, + String guid) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; +} diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/metadataelements/PlatformDeploymentElement.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/metadataelements/PlatformDeploymentElement.java new file mode 100644 index 00000000000..a5c439f7de0 --- /dev/null +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/metadataelements/PlatformDeploymentElement.java @@ -0,0 +1,202 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.itinfrastructure.properties.PlatformDeploymentProperties; + +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; + +/** + * PlatformDeploymentElement contains the properties and header for a SoftwareServerPlatformDeployment relationship retrieved from the repository. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class PlatformDeploymentElement implements MetadataElement, Serializable +{ + private static final long serialVersionUID = 1L; + + private ElementHeader elementHeader = null; + private PlatformDeploymentProperties platformDeploymentProperties = null; + private ElementStub platformElement = null; + private ElementStub hostElement = null; + + + /** + * Default constructor + */ + public PlatformDeploymentElement() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public PlatformDeploymentElement(PlatformDeploymentElement template) + { + if (template != null) + { + elementHeader = template.getElementHeader(); + platformDeploymentProperties = template.getPlatformDeploymentProperties(); + platformElement = template.getPlatformElement(); + hostElement = template.getHostElement(); + } + } + + + /** + * Return the element header associated with the relationship. + * + * @return element header object + */ + @Override + public ElementHeader getElementHeader() + { + return elementHeader; + } + + + /** + * Set up the element header associated with the relationship. + * + * @param elementHeader element header object + */ + @Override + public void setElementHeader(ElementHeader elementHeader) + { + this.elementHeader = elementHeader; + } + + + /** + * Return the properties from the software server platform deployment relationship. + * + * @return properties + */ + public PlatformDeploymentProperties getPlatformDeploymentProperties() + { + return platformDeploymentProperties; + } + + + /** + * Set up the properties from the software server platform deployment relationship. + * + * @param platformDeploymentProperties server asset use + */ + public void setPlatformDeploymentProperties(PlatformDeploymentProperties platformDeploymentProperties) + { + this.platformDeploymentProperties = platformDeploymentProperties; + } + + + /** + * Return the header of the linked software server platform. + * + * @return header + */ + public ElementStub getPlatformElement() + { + return platformElement; + } + + + /** + * Set up the header of the linked software server platform. + * + * @param platformElement header + */ + public void setPlatformElement(ElementStub platformElement) + { + this.platformElement = platformElement; + } + + + + /** + * Return the header of the linked host. + * + * @return header + */ + public ElementStub getHostElement() + { + return platformElement; + } + + + /** + * Set up the header of the linked host. + * + * @param platformElement header + */ + public void setHostElement(ElementStub platformElement) + { + this.platformElement = platformElement; + } + + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "PlatformDeploymentElement{" + + "elementHeader=" + elementHeader + + ", platformDeploymentProperties=" + platformDeploymentProperties + + ", platformElement=" + platformElement + + ", hostElement=" + hostElement + + '}'; + } + + + /** + * 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; + } + PlatformDeploymentElement that = (PlatformDeploymentElement) objectToCompare; + return Objects.equals(elementHeader, that.elementHeader) && + Objects.equals(platformDeploymentProperties, that.platformDeploymentProperties) && + Objects.equals(platformElement, that.platformElement); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(elementHeader, platformDeploymentProperties, platformElement, hostElement); + } +} diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/metadataelements/SupportedCapabilityElement.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/metadataelements/SupportedCapabilityElement.java new file mode 100644 index 00000000000..fb9e3f9bd6d --- /dev/null +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/metadataelements/SupportedCapabilityElement.java @@ -0,0 +1,176 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.itinfrastructure.properties.ServerAssetUseProperties; +import org.odpi.openmetadata.accessservices.itinfrastructure.properties.SupportedCapabilityProperties; + +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; + +/** + * SupportedCapabilityElement contains the properties and header for a SoftwareServerSupportedCapability relationship retrieved from the repository. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class SupportedCapabilityElement implements MetadataElement, Serializable +{ + private static final long serialVersionUID = 1L; + + private ElementHeader elementHeader = null; + private SupportedCapabilityProperties supportedCapabilityProperties = null; + private SoftwareServerCapabilityElement capabilityElement = null; + + + /** + * Default constructor + */ + public SupportedCapabilityElement() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public SupportedCapabilityElement(SupportedCapabilityElement template) + { + if (template != null) + { + elementHeader = template.getElementHeader(); + supportedCapabilityProperties = template.getSupportedCapabilityProperties(); + capabilityElement = template.getCapabilityElement(); + } + } + + + /** + * Return the element header associated with the relationship. + * + * @return element header object + */ + @Override + public ElementHeader getElementHeader() + { + return elementHeader; + } + + + /** + * Set up the element header associated with the relationship. + * + * @param elementHeader element header object + */ + @Override + public void setElementHeader(ElementHeader elementHeader) + { + this.elementHeader = elementHeader; + } + + + /** + * Return the properties from the software server supported capability relationship. + * + * @return properties + */ + public SupportedCapabilityProperties getSupportedCapabilityProperties() + { + return supportedCapabilityProperties; + } + + + /** + * Set up the properties from the software server supported capability relationship. + * + * @param supportedCapabilityProperties server asset use + */ + public void setSupportedCapabilityProperties(SupportedCapabilityProperties supportedCapabilityProperties) + { + this.supportedCapabilityProperties = supportedCapabilityProperties; + } + + + /** + * Return the properties of the linked software server capability. + * + * @return properties + */ + public SoftwareServerCapabilityElement getCapabilityElement() + { + return capabilityElement; + } + + + /** + * Set up the properties of the linked software server capability. + * + * @param capabilityElement properties + */ + public void setCapabilityElement(SoftwareServerCapabilityElement capabilityElement) + { + this.capabilityElement = capabilityElement; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "SupportedCapabilityElement{" + + "elementHeader=" + elementHeader + + ", supportedCapabilityProperties=" + supportedCapabilityProperties + + ", capabilityElement=" + capabilityElement + + '}'; + } + + + /** + * 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; + } + SupportedCapabilityElement that = (SupportedCapabilityElement) objectToCompare; + return Objects.equals(elementHeader, that.elementHeader) && + Objects.equals(supportedCapabilityProperties, that.supportedCapabilityProperties) && + Objects.equals(capabilityElement, that.capabilityElement); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(elementHeader, supportedCapabilityProperties, capabilityElement); + } +} diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/ConfigurationItemRelationshipProperties.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/ConfigurationItemRelationshipProperties.java new file mode 100644 index 00000000000..ffb16b96945 --- /dev/null +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/ConfigurationItemRelationshipProperties.java @@ -0,0 +1,157 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.itinfrastructure.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.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ConfigurationItemProperties provides the base class for infrastructure items. This extends referenceable 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 = ServerAssetUseProperties.class, name = "ServerAssetUseProperties"), + @JsonSubTypes.Type(value = SupportedCapabilityProperties.class, name = "SupportedCapabilityProperties"), + }) +public class ConfigurationItemRelationshipProperties implements Serializable +{ + private static final long serialVersionUID = 1L; + + private Date effectiveFrom = null; + private Date effectiveTo = null; + + + /** + * Default constructor + */ + public ConfigurationItemRelationshipProperties() + { + super(); + } + + + /** + * Copy/clone constructor. Retrieves values from the supplied template + * + * @param template element to copy + */ + public ConfigurationItemRelationshipProperties(ConfigurationItemRelationshipProperties template) + { + if (template != null) + { + effectiveFrom = template.getEffectiveFrom(); + effectiveTo = template.getEffectiveTo(); + } + } + + + /** + * 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; + } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "ConfigurationItemRelationshipProperties{" + + "effectiveFrom=" + effectiveFrom + + ", effectiveTo=" + effectiveTo + + '}'; + } + + + /** + * 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; + } + ConfigurationItemRelationshipProperties that = (ConfigurationItemRelationshipProperties) 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/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/OperationalStatus.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/OperationalStatus.java new file mode 100644 index 00000000000..4096fac072e --- /dev/null +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/OperationalStatus.java @@ -0,0 +1,118 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.itinfrastructure.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; + +/** + * OperationalStatus defines whether a component is usable. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public enum OperationalStatus implements Serializable +{ + DISABLED (0, 0, "Disabled", "The component is deployed but not operational."), + ENABLED (1, 1, "Enabled", "The component is operational."); + + public static final String ENUM_TYPE_GUID = "24e1e33e-9250-4a6c-8b07-05c7adec3a1d"; + public static final String ENUM_TYPE_NAME = "OperationalStatus"; + + private int openTypeOrdinal; + + private int ordinal; + private String name; + private String description; + + private static final long serialVersionUID = 1L; + + + /** + * 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 + */ + OperationalStatus(int ordinal, + int openTypeOrdinal, + String name, + String description) + { + this.ordinal = ordinal; + this.openTypeOrdinal = openTypeOrdinal; + this.name = name; + this.description = description; + } + + + /** + * 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; } + + + /** + * 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; } + + + /** + * toString() JSON-style + * + * @return string description + */ + @Override + public String toString() + { + return "OperationalStatus : " + name; + } +} diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/PlatformDeploymentProperties.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/PlatformDeploymentProperties.java new file mode 100644 index 00000000000..d4394e10aad --- /dev/null +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/PlatformDeploymentProperties.java @@ -0,0 +1,180 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.itinfrastructure.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; + +/** + * PlatformDeploymentProperties describes the properties for the SoftwareServerPlatformDeployment relationship between a Software Server Platform + * and a Host. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class PlatformDeploymentProperties extends ConfigurationItemRelationshipProperties +{ + private static final long serialVersionUID = 1L; + + private Date deploymentTime = null; + private String deployer = null; + private OperationalStatus platformDeploymentStatus = null; + + + /** + * Default constructor + */ + public PlatformDeploymentProperties() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public PlatformDeploymentProperties(PlatformDeploymentProperties template) + { + super(template); + + if (template != null) + { + deploymentTime = template.getDeploymentTime(); + deployer = template.getDeployer(); + platformDeploymentStatus = template.getPlatformDeploymentStatus(); + } + } + + + /** + * Return the time that the platform was deployed into the host. + * + * @return date/time + */ + public Date getDeploymentTime() + { + return deploymentTime; + } + + + /** + * Set up the time that the platform was deployed into the host. + * + * @param deploymentTime date/time + */ + public void setDeploymentTime(Date deploymentTime) + { + this.deploymentTime = deploymentTime; + } + + + /** + * Return the userId of the deployer. + * + * @return name + */ + public String getDeployer() + { + return deployer; + } + + + /** + * Set up the userId of the deployer. + * + * @param deployer name + */ + public void setDeployer(String deployer) + { + this.deployer = deployer; + } + + + /** + * Return whether the platform is ready to use. + * + * @return operational status enum + */ + public OperationalStatus getPlatformDeploymentStatus() + { + return platformDeploymentStatus; + } + + + /** + * Set up whether the platform is ready to use. + * + * @param platformDeploymentStatus operational status enum + */ + public void setPlatformDeploymentStatus(OperationalStatus platformDeploymentStatus) + { + this.platformDeploymentStatus = platformDeploymentStatus; + } + + + /** + * JSON-style toString. + * + * @return list of properties and their values. + */ + @Override + public String toString() + { + return "PlatformDeploymentProperties{" + + "deploymentTime=" + deploymentTime + + ", deployer='" + deployer + '\'' + + ", platformDeploymentStatus=" + platformDeploymentStatus + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + '}'; + } + + + /** + * 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; + } + PlatformDeploymentProperties that = (PlatformDeploymentProperties) objectToCompare; + return Objects.equals(deploymentTime, that.deploymentTime) && + Objects.equals(deployer, that.deployer) && + platformDeploymentStatus == that.platformDeploymentStatus; + } + + + /** + * Hash code for this object + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), deploymentTime, deployer, platformDeploymentStatus); + } +} diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/ServerAssetUseProperties.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/ServerAssetUseProperties.java index ccbb7f7a065..786fe58d231 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/ServerAssetUseProperties.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/ServerAssetUseProperties.java @@ -19,7 +19,7 @@ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown=true) -public class ServerAssetUseProperties implements Serializable +public class ServerAssetUseProperties extends ConfigurationItemRelationshipProperties { private static final long serialVersionUID = 1L; @@ -47,6 +47,8 @@ public ServerAssetUseProperties() */ public ServerAssetUseProperties(ServerAssetUseProperties template) { + super(template); + if (template != null) { this.useType = template.getUseType(); @@ -206,6 +208,8 @@ public String toString() ", minimumInstances=" + minimumInstances + ", maximumInstancesSet=" + maximumInstancesSet + ", maximumInstances=" + maximumInstances + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + '}'; } @@ -227,6 +231,10 @@ public boolean equals(Object objectToCompare) { return false; } + if (! super.equals(objectToCompare)) + { + return false; + } ServerAssetUseProperties that = (ServerAssetUseProperties) objectToCompare; return minimumInstancesSet == that.minimumInstancesSet && minimumInstances == that.minimumInstances && @@ -245,6 +253,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(useType, description, minimumInstancesSet, minimumInstances, maximumInstancesSet, maximumInstances); + return Objects.hash(super.hashCode(), useType, description, minimumInstancesSet, minimumInstances, maximumInstancesSet, maximumInstances); } } diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/SupportedCapabilityProperties.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/SupportedCapabilityProperties.java new file mode 100644 index 00000000000..4db79e6be72 --- /dev/null +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/SupportedCapabilityProperties.java @@ -0,0 +1,181 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.itinfrastructure.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.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * SupportedCapabilityProperties describes the properties for the SoftwareServerSupportedCapabilities relationship between a Software Server + * and a Software Server Capability. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class SupportedCapabilityProperties extends ConfigurationItemRelationshipProperties +{ + private static final long serialVersionUID = 1L; + + private Date deploymentTime = null; + private String deployer = null; + private OperationalStatus serverCapabilityStatus = null; + + + /** + * Default constructor + */ + public SupportedCapabilityProperties() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public SupportedCapabilityProperties(SupportedCapabilityProperties template) + { + super(template); + + if (template != null) + { + deploymentTime = template.getDeploymentTime(); + deployer = template.getDeployer(); + serverCapabilityStatus = template.getServerCapabilityStatus(); + } + } + + + /** + * Return the time that the capability was deployed into the server. + * + * @return date/time + */ + public Date getDeploymentTime() + { + return deploymentTime; + } + + + /** + * Set up the time that the capability was deployed into the server. + * + * @param deploymentTime date/time + */ + public void setDeploymentTime(Date deploymentTime) + { + this.deploymentTime = deploymentTime; + } + + + /** + * Return the userId of the deployer. + * + * @return name + */ + public String getDeployer() + { + return deployer; + } + + + /** + * Set up the userId of the deployer. + * + * @param deployer name + */ + public void setDeployer(String deployer) + { + this.deployer = deployer; + } + + + /** + * Return whether the capability is ready to use. + * + * @return operational status enum + */ + public OperationalStatus getServerCapabilityStatus() + { + return serverCapabilityStatus; + } + + + /** + * Set up whether the capability is ready to use. + * + * @param serverCapabilityStatus operational status enum + */ + public void setServerCapabilityStatus(OperationalStatus serverCapabilityStatus) + { + this.serverCapabilityStatus = serverCapabilityStatus; + } + + + /** + * JSON-style toString. + * + * @return list of properties and their values. + */ + @Override + public String toString() + { + return "SupportedCapabilityProperties{" + + "deploymentTime=" + deploymentTime + + ", deployer='" + deployer + '\'' + + ", serverCapabilityStatus=" + serverCapabilityStatus + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + '}'; + } + + + /** + * 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; + } + SupportedCapabilityProperties that = (SupportedCapabilityProperties) objectToCompare; + return Objects.equals(deploymentTime, that.deploymentTime) && + Objects.equals(deployer, that.deployer) && + serverCapabilityStatus == that.serverCapabilityStatus; + } + + + /** + * Hash code for this object + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), deploymentTime, deployer, serverCapabilityStatus); + } +} diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/EffectiveDatesRequestBody.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/EffectiveDatesRequestBody.java index 2de07917191..a508122c015 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/EffectiveDatesRequestBody.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/EffectiveDatesRequestBody.java @@ -13,7 +13,7 @@ import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; /** - * MetadataSourceRequestBody carries the parameters for marking an asset or schema as external. + * MetadataSourceRequestBody carries the parameters for marking an element as external with the effective time set up. */ @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/rest/EffectiveTimeMetadataSourceRequestBody.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/EffectiveTimeMetadataSourceRequestBody.java new file mode 100644 index 00000000000..bcf08a05739 --- /dev/null +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/EffectiveTimeMetadataSourceRequestBody.java @@ -0,0 +1,126 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.itinfrastructure.rest; + +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; + +/** + * EffectiveTimeRequestBody carries the date/time for a query. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class EffectiveTimeMetadataSourceRequestBody extends MetadataSourceRequestBody +{ + private static final long serialVersionUID = 1L; + + private Date effectiveTime = null; + + + /** + * Default constructor + */ + public EffectiveTimeMetadataSourceRequestBody() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public EffectiveTimeMetadataSourceRequestBody(EffectiveTimeMetadataSourceRequestBody template) + { + if (template != null) + { + effectiveTime = template.getEffectiveTime(); + } + } + + + /** + * Return the date/time to use for the query. + * + * @return date object + */ + public Date getEffectiveTime() + { + return effectiveTime; + } + + + /** + * Set up the date/time to use for the query. + * + * @param effectiveTime date object + */ + public void setEffectiveTime(Date effectiveTime) + { + this.effectiveTime = effectiveTime; + } + + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "EffectiveTimeMetadataSourceRequestBody{" + + "effectiveTime=" + effectiveTime + + ", externalSourceGUID='" + getExternalSourceGUID() + '\'' + + ", externalSourceName='" + getExternalSourceName() + '\'' + + '}'; + } + + + /** + * 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; + } + EffectiveTimeMetadataSourceRequestBody that = (EffectiveTimeMetadataSourceRequestBody) objectToCompare; + return Objects.equals(effectiveTime, that.effectiveTime); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), effectiveTime); + } +} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/HostListResponse.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/HostListResponse.java new file mode 100644 index 00000000000..ebdac067200 --- /dev/null +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/HostListResponse.java @@ -0,0 +1,149 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.itinfrastructure.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.HostElement; + +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; + +/** + * HostListResponse is a response object for passing back a a list of hosts + * 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 HostListResponse extends ITInfrastructureOMASAPIResponse +{ + private static final long serialVersionUID = 1L; + + private List elementList = null; + + + /** + * Default constructor + */ + public HostListResponse() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public HostListResponse(HostListResponse 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 "HostListResponse{" + + "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; + } + HostListResponse that = (HostListResponse) 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/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/HostRequestBody.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/HostRequestBody.java new file mode 100644 index 00000000000..36bdf844014 --- /dev/null +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/HostRequestBody.java @@ -0,0 +1,173 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.itinfrastructure.rest; + + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.itinfrastructure.properties.HostProperties; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + + +/** + * HostRequestBody describes the properties of the software server for creation and update. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class HostRequestBody extends HostProperties +{ + private static final long serialVersionUID = 1L; + + private String externalSourceGUID = null; + private String externalSourceName = null; + + + /** + * Default constructor + */ + public HostRequestBody() + { + super(); + } + + + /** + * Copy/clone constructor. + * + * @param template object to copy + */ + public HostRequestBody(HostRequestBody template) + { + super(template); + + if (template != null) + { + externalSourceGUID = template.getExternalSourceGUID(); + externalSourceName = template.getExternalSourceName(); + } + } + + + /** + * Copy/clone constructor. + * + * @param template object to copy + */ + public HostRequestBody(HostProperties 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 "HostRequestBody{" + + "externalSourceGUID='" + externalSourceGUID + '\'' + + ", externalSourceName='" + externalSourceName + '\'' + + ", displayName='" + getDisplayName() + '\'' + + ", description='" + getDescription() + '\'' + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", qualifiedName='" + getQualifiedName() + '\'' + + ", additionalProperties=" + getAdditionalProperties() + + ", 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; + } + HostRequestBody that = (HostRequestBody) 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); + } +} diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/HostResponse.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/HostResponse.java new file mode 100644 index 00000000000..8a26df0f050 --- /dev/null +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/HostResponse.java @@ -0,0 +1,137 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.itinfrastructure.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.HostElement; + +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; + +/** + * HostResponse is a response object for passing back a single host + * element 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 HostResponse extends ITInfrastructureOMASAPIResponse +{ + private static final long serialVersionUID = 1L; + + private HostElement element = null; + + + /** + * Default constructor + */ + public HostResponse() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public HostResponse(HostResponse template) + { + super(template); + + if (template != null) + { + element = template.getElement(); + } + } + + + /** + * Return the metadata element. + * + * @return result object + */ + public HostElement getElement() + { + return element; + } + + + /** + * Set up the metadata element to return. + * + * @param element result object + */ + public void setElement(HostElement element) + { + this.element = element; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "HostResponse{" + + "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; + } + HostResponse that = (HostResponse) 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/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/MetadataSourceRequestBody.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/MetadataSourceRequestBody.java index fc1391166eb..fe40a7280cf 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/MetadataSourceRequestBody.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/MetadataSourceRequestBody.java @@ -12,7 +12,7 @@ import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; /** - * MetadataSourceRequestBody carries the parameters for marking an asset or schema as external. + * MetadataSourceRequestBody carries the parameters for marking an element as external. */ @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/rest/PlatformDeploymentListResponse.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/PlatformDeploymentListResponse.java new file mode 100644 index 00000000000..67967c08702 --- /dev/null +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/PlatformDeploymentListResponse.java @@ -0,0 +1,148 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.itinfrastructure.rest; + + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.PlatformDeploymentElement; + +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; + +/** + * PlatformDeploymentListResponse returns a list of SoftwareServerPlatformDeployment relationships from the server. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class PlatformDeploymentListResponse extends ITInfrastructureOMASAPIResponse +{ + private static final long serialVersionUID = 1L; + + private List elements = null; + + + /** + * Default constructor + */ + public PlatformDeploymentListResponse() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public PlatformDeploymentListResponse(PlatformDeploymentListResponse template) + { + super(template); + + if (template != null) + { + this.elements = template.getElements(); + } + } + + + /** + * Return the list of assets in the response. + * + * @return list of assets + */ + public List getElements() + { + if (elements == null) + { + return null; + } + else if (elements.isEmpty()) + { + return null; + } + else + { + return elements; + } + } + + + /** + * Set up the list of assets for the response. + * + * @param elements list of assets + */ + 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 "PlatformDeploymentListResponse{" + + "assets=" + 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; + } + PlatformDeploymentListResponse that = (PlatformDeploymentListResponse) 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/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/PlatformDeploymentRequestBody.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/PlatformDeploymentRequestBody.java new file mode 100644 index 00000000000..606f7f31f10 --- /dev/null +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/PlatformDeploymentRequestBody.java @@ -0,0 +1,126 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.itinfrastructure.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.itinfrastructure.properties.PlatformDeploymentProperties; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * PlatformDeploymentRequestBody provides the request body payload for working with the relationships between + * software server platforms and hosts. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class PlatformDeploymentRequestBody extends MetadataSourceRequestBody +{ + private static final long serialVersionUID = 1L; + + private PlatformDeploymentProperties properties = null; + + /** + * Default constructor + */ + public PlatformDeploymentRequestBody() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public PlatformDeploymentRequestBody(PlatformDeploymentRequestBody template) + { + super(template); + + if (template != null) + { + this.properties = template.getProperties(); + } + } + + + /** + * Return the properties for this profile identity. + * + * @return properties bean + */ + public PlatformDeploymentProperties getProperties() + { + return properties; + } + + + /** + * Set up the properties for this profile identity. + * + * @param properties properties bean + */ + public void setProperties(PlatformDeploymentProperties properties) + { + this.properties = properties; + } + + + /** + * JSON-style toString. + * + * @return list of properties and their values. + */ + @Override + public String toString() + { + return "PlatformDeploymentRequestBody{" + + "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; + } + PlatformDeploymentRequestBody that = (PlatformDeploymentRequestBody) 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/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/ProfileIdentityRequestBody.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/ProfileIdentityRequestBody.java index a166babe5e8..eab4ad46fee 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/ProfileIdentityRequestBody.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/ProfileIdentityRequestBody.java @@ -13,7 +13,7 @@ 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 with ProfileIdentity relationships. */ @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/rest/ServerAssetUseListResponse.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/ServerAssetUseListResponse.java index df915352de9..dfc755522c4 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/ServerAssetUseListResponse.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/ServerAssetUseListResponse.java @@ -16,8 +16,7 @@ import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; /** - * ServerAssetUseListResponse returns a list of serverAssetUse relationships from the server. The list may be too long to - * retrieve in a single call so there is support for paging of replies. + * ServerAssetUseListResponse returns a list of serverAssetUse relationships from the server. */ @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/rest/ServerAssetUseRequestBody.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/ServerAssetUseRequestBody.java new file mode 100644 index 00000000000..a76450e5dc2 --- /dev/null +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/ServerAssetUseRequestBody.java @@ -0,0 +1,126 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.itinfrastructure.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.itinfrastructure.properties.ServerAssetUseProperties; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ServerAssetUseRequestBody provides the request body payload for working with the relationships between + * software server capabilities and assets. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ServerAssetUseRequestBody extends MetadataSourceRequestBody +{ + private static final long serialVersionUID = 1L; + + private ServerAssetUseProperties properties = null; + + /** + * Default constructor + */ + public ServerAssetUseRequestBody() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ServerAssetUseRequestBody(ServerAssetUseRequestBody template) + { + super(template); + + if (template != null) + { + this.properties = template.getProperties(); + } + } + + + /** + * Return the properties for this profile identity. + * + * @return properties bean + */ + public ServerAssetUseProperties getProperties() + { + return properties; + } + + + /** + * Set up the properties for this profile identity. + * + * @param properties properties bean + */ + public void setProperties(ServerAssetUseProperties properties) + { + this.properties = properties; + } + + + /** + * JSON-style toString. + * + * @return list of properties and their values. + */ + @Override + public String toString() + { + return "ServerAssetUseRequestBody{" + + "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; + } + ServerAssetUseRequestBody that = (ServerAssetUseRequestBody) 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/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/ServerAssetUseResponse.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/ServerAssetUseResponse.java new file mode 100644 index 00000000000..fce5eb9548a --- /dev/null +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/ServerAssetUseResponse.java @@ -0,0 +1,137 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.itinfrastructure.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.ServerAssetUseElement; + +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; + +/** + * ServerAssetUseResponse is a response object for passing back a single relationship between a software server + * capability and an asset (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 ServerAssetUseResponse extends ITInfrastructureOMASAPIResponse +{ + private static final long serialVersionUID = 1L; + + private ServerAssetUseElement element = null; + + + /** + * Default constructor + */ + public ServerAssetUseResponse() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ServerAssetUseResponse(ServerAssetUseResponse template) + { + super(template); + + if (template != null) + { + element = template.getElement(); + } + } + + + /** + * Return the metadata element. + * + * @return result object + */ + public ServerAssetUseElement getElement() + { + return element; + } + + + /** + * Set up the metadata element to return. + * + * @param element result object + */ + public void setElement(ServerAssetUseElement element) + { + this.element = element; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ServerAssetUseResponse{" + + "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; + } + ServerAssetUseResponse that = (ServerAssetUseResponse) 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/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SoftwareServerCapabilityListResponse.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SoftwareServerCapabilityListResponse.java new file mode 100644 index 00000000000..74a14015aaf --- /dev/null +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SoftwareServerCapabilityListResponse.java @@ -0,0 +1,149 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.itinfrastructure.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.SoftwareServerCapabilityElement; + +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; + +/** + * SoftwareServerCapabilityListResponse is a response object for passing back a a list of software server capabilities + * 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 SoftwareServerCapabilityListResponse extends ITInfrastructureOMASAPIResponse +{ + private static final long serialVersionUID = 1L; + + private List elementList = null; + + + /** + * Default constructor + */ + public SoftwareServerCapabilityListResponse() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public SoftwareServerCapabilityListResponse(SoftwareServerCapabilityListResponse 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 "SoftwareServerCapabilityListResponse{" + + "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; + } + SoftwareServerCapabilityListResponse that = (SoftwareServerCapabilityListResponse) 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/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SoftwareServerCapabilityRequestBody.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SoftwareServerCapabilityRequestBody.java new file mode 100644 index 00000000000..3367da10095 --- /dev/null +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SoftwareServerCapabilityRequestBody.java @@ -0,0 +1,204 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.itinfrastructure.rest; + + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.itinfrastructure.properties.SoftwareServerCapabilityProperties; + + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + + +/** + * SoftwareServerCapabilityRequestBody describes the properties of the software server capability for creation and update. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class SoftwareServerCapabilityRequestBody extends SoftwareServerCapabilityProperties +{ + private static final long serialVersionUID = 1L; + + private String externalSourceGUID = null; + private String externalSourceName = null; + private String classificationName = null; + + + /** + * Default constructor + */ + public SoftwareServerCapabilityRequestBody() + { + super(); + } + + + /** + * Copy/clone constructor. + * + * @param template object to copy + */ + public SoftwareServerCapabilityRequestBody(SoftwareServerCapabilityRequestBody template) + { + super(template); + + if (template != null) + { + externalSourceGUID = template.getExternalSourceGUID(); + externalSourceName = template.getExternalSourceName(); + classificationName = template.getClassificationName(); + } + } + + + /** + * Copy/clone constructor. + * + * @param template object to copy + */ + public SoftwareServerCapabilityRequestBody(SoftwareServerCapabilityProperties 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; + } + + + /** + * Return the optional classification name for the software server capability. + * + * @return string name + */ + public String getClassificationName() + { + return classificationName; + } + + + /** + * Set up the optional classification name for the software server capability. + * + * @param classificationName string name + */ + public void setClassificationName(String classificationName) + { + this.classificationName = classificationName; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "SoftwareServerCapabilityRequestBody{" + + "externalSourceGUID='" + externalSourceGUID + '\'' + + ", externalSourceName='" + externalSourceName + '\'' + + ", classificationName='" + classificationName + '\'' + + ", displayName='" + getDisplayName() + '\'' + + ", description='" + getDescription() + '\'' + + ", typeDescription='" + getTypeDescription() + '\'' + + ", version='" + getVersion() + '\'' + + ", patchLevel='" + getPatchLevel() + '\'' + + ", source='" + getSource() + '\'' + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", qualifiedName='" + getQualifiedName() + '\'' + + ", additionalProperties=" + getAdditionalProperties() + + ", 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; + } + SoftwareServerCapabilityRequestBody that = (SoftwareServerCapabilityRequestBody) objectToCompare; + return Objects.equals(externalSourceGUID, that.externalSourceGUID) && + Objects.equals(externalSourceName, that.externalSourceName) && + Objects.equals(classificationName, that.classificationName); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), externalSourceGUID, externalSourceName, classificationName); + } +} diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SoftwareServerCapabilityResponse.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SoftwareServerCapabilityResponse.java new file mode 100644 index 00000000000..f82b98d7b4a --- /dev/null +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SoftwareServerCapabilityResponse.java @@ -0,0 +1,137 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.itinfrastructure.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.SoftwareServerCapabilityElement; + +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; + +/** + * SoftwareServerCapabilityResponse is a response object for passing back a single software server capability + * element 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 SoftwareServerCapabilityResponse extends ITInfrastructureOMASAPIResponse +{ + private static final long serialVersionUID = 1L; + + private SoftwareServerCapabilityElement element = null; + + + /** + * Default constructor + */ + public SoftwareServerCapabilityResponse() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public SoftwareServerCapabilityResponse(SoftwareServerCapabilityResponse template) + { + super(template); + + if (template != null) + { + element = template.getElement(); + } + } + + + /** + * Return the metadata element. + * + * @return result object + */ + public SoftwareServerCapabilityElement getElement() + { + return element; + } + + + /** + * Set up the metadata element to return. + * + * @param element result object + */ + public void setElement(SoftwareServerCapabilityElement element) + { + this.element = element; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "SoftwareServerCapabilityResponse{" + + "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; + } + SoftwareServerCapabilityResponse that = (SoftwareServerCapabilityResponse) 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/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SoftwareServerListResponse.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SoftwareServerListResponse.java new file mode 100644 index 00000000000..2f30369d0db --- /dev/null +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SoftwareServerListResponse.java @@ -0,0 +1,149 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.itinfrastructure.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.SoftwareServerElement; + +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; + +/** + * SoftwareServerListResponse is a response object for passing back a a list of software servers + * 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 SoftwareServerListResponse extends ITInfrastructureOMASAPIResponse +{ + private static final long serialVersionUID = 1L; + + private List elementList = null; + + + /** + * Default constructor + */ + public SoftwareServerListResponse() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public SoftwareServerListResponse(SoftwareServerListResponse 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 "SoftwareServerListResponse{" + + "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; + } + SoftwareServerListResponse that = (SoftwareServerListResponse) 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/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SoftwareServerPlatformListResponse.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SoftwareServerPlatformListResponse.java new file mode 100644 index 00000000000..85016ee183b --- /dev/null +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SoftwareServerPlatformListResponse.java @@ -0,0 +1,149 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.itinfrastructure.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.SoftwareServerPlatformElement; + +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; + +/** + * SoftwareServerPlatformListResponse is a response object for passing back a a list of software server platforms + * 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 SoftwareServerPlatformListResponse extends ITInfrastructureOMASAPIResponse +{ + private static final long serialVersionUID = 1L; + + private List elementList = null; + + + /** + * Default constructor + */ + public SoftwareServerPlatformListResponse() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public SoftwareServerPlatformListResponse(SoftwareServerPlatformListResponse 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 "SoftwareServerPlatformListResponse{" + + "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; + } + SoftwareServerPlatformListResponse that = (SoftwareServerPlatformListResponse) 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/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SoftwareServerPlatformRequestBody.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SoftwareServerPlatformRequestBody.java new file mode 100644 index 00000000000..62ff442f730 --- /dev/null +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SoftwareServerPlatformRequestBody.java @@ -0,0 +1,177 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.itinfrastructure.rest; + + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.itinfrastructure.properties.SoftwareServerPlatformProperties; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + + +/** + * SoftwareServerPlatformRequestBody describes the properties of the software server platform for creation and update. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class SoftwareServerPlatformRequestBody extends SoftwareServerPlatformProperties +{ + private static final long serialVersionUID = 1L; + + private String externalSourceGUID = null; + private String externalSourceName = null; + + + /** + * Default constructor + */ + public SoftwareServerPlatformRequestBody() + { + super(); + } + + + /** + * Copy/clone constructor. + * + * @param template object to copy + */ + public SoftwareServerPlatformRequestBody(SoftwareServerPlatformRequestBody template) + { + super(template); + + if (template != null) + { + externalSourceGUID = template.getExternalSourceGUID(); + externalSourceName = template.getExternalSourceName(); + } + } + + + /** + * Copy/clone constructor. + * + * @param template object to copy + */ + public SoftwareServerPlatformRequestBody(SoftwareServerPlatformProperties 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 "SoftwareServerPlatformRequestBody{" + + "externalSourceGUID='" + externalSourceGUID + '\'' + + ", externalSourceName='" + externalSourceName + '\'' + + ", softwareServerType='" + getSoftwareServerType() + '\'' + + ", softwareServerVersion='" + getSoftwareServerVersion() + '\'' + + ", softwareServerSource='" + getSoftwareServerSource() + '\'' + + ", softwareServerUserId='" + getSoftwareServerUserId() + '\'' + + ", displayName='" + getDisplayName() + '\'' + + ", description='" + getDescription() + '\'' + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", qualifiedName='" + getQualifiedName() + '\'' + + ", additionalProperties=" + getAdditionalProperties() + + ", 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; + } + SoftwareServerPlatformRequestBody that = (SoftwareServerPlatformRequestBody) 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); + } +} diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SoftwareServerPlatformResponse.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SoftwareServerPlatformResponse.java new file mode 100644 index 00000000000..d5d1b2999f0 --- /dev/null +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SoftwareServerPlatformResponse.java @@ -0,0 +1,137 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.itinfrastructure.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.SoftwareServerPlatformElement; + +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; + +/** + * SoftwareServerPlatformResponse is a response object for passing back a single software server platform + * element 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 SoftwareServerPlatformResponse extends ITInfrastructureOMASAPIResponse +{ + private static final long serialVersionUID = 1L; + + private SoftwareServerPlatformElement element = null; + + + /** + * Default constructor + */ + public SoftwareServerPlatformResponse() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public SoftwareServerPlatformResponse(SoftwareServerPlatformResponse template) + { + super(template); + + if (template != null) + { + element = template.getElement(); + } + } + + + /** + * Return the metadata element. + * + * @return result object + */ + public SoftwareServerPlatformElement getElement() + { + return element; + } + + + /** + * Set up the metadata element to return. + * + * @param element result object + */ + public void setElement(SoftwareServerPlatformElement element) + { + this.element = element; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "SoftwareServerPlatformResponse{" + + "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; + } + SoftwareServerPlatformResponse that = (SoftwareServerPlatformResponse) 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/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SoftwareServerRequestBody.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SoftwareServerRequestBody.java new file mode 100644 index 00000000000..5c8d2bdff08 --- /dev/null +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SoftwareServerRequestBody.java @@ -0,0 +1,177 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.itinfrastructure.rest; + + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.itinfrastructure.properties.SoftwareServerProperties; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + + +/** + * SoftwareServerRequestBody describes the properties of the software server for creation and update. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class SoftwareServerRequestBody extends SoftwareServerProperties +{ + private static final long serialVersionUID = 1L; + + private String externalSourceGUID = null; + private String externalSourceName = null; + + + /** + * Default constructor + */ + public SoftwareServerRequestBody() + { + super(); + } + + + /** + * Copy/clone constructor. + * + * @param template object to copy + */ + public SoftwareServerRequestBody(SoftwareServerRequestBody template) + { + super(template); + + if (template != null) + { + externalSourceGUID = template.getExternalSourceGUID(); + externalSourceName = template.getExternalSourceName(); + } + } + + + /** + * Copy/clone constructor. + * + * @param template object to copy + */ + public SoftwareServerRequestBody(SoftwareServerProperties 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 "SoftwareServerRequestBody{" + + "externalSourceGUID='" + externalSourceGUID + '\'' + + ", externalSourceName='" + externalSourceName + '\'' + + ", softwareServerType='" + getSoftwareServerType() + '\'' + + ", softwareServerVersion='" + getSoftwareServerVersion() + '\'' + + ", softwareServerSource='" + getSoftwareServerSource() + '\'' + + ", softwareServerUserId='" + getSoftwareServerUserId() + '\'' + + ", displayName='" + getDisplayName() + '\'' + + ", description='" + getDescription() + '\'' + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", qualifiedName='" + getQualifiedName() + '\'' + + ", additionalProperties=" + getAdditionalProperties() + + ", 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; + } + SoftwareServerRequestBody that = (SoftwareServerRequestBody) 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); + } +} diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SoftwareServerResponse.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SoftwareServerResponse.java new file mode 100644 index 00000000000..8456dbf0251 --- /dev/null +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SoftwareServerResponse.java @@ -0,0 +1,137 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.itinfrastructure.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.SoftwareServerElement; + +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; + +/** + * SoftwareServerResponse is a response object for passing back a single software server + * element 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 SoftwareServerResponse extends ITInfrastructureOMASAPIResponse +{ + private static final long serialVersionUID = 1L; + + private SoftwareServerElement element = null; + + + /** + * Default constructor + */ + public SoftwareServerResponse() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public SoftwareServerResponse(SoftwareServerResponse template) + { + super(template); + + if (template != null) + { + element = template.getElement(); + } + } + + + /** + * Return the metadata element. + * + * @return result object + */ + public SoftwareServerElement getElement() + { + return element; + } + + + /** + * Set up the metadata element to return. + * + * @param element result object + */ + public void setElement(SoftwareServerElement element) + { + this.element = element; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "SoftwareServerResponse{" + + "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; + } + SoftwareServerResponse that = (SoftwareServerResponse) 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/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SupportedCapabilityListResponse.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SupportedCapabilityListResponse.java new file mode 100644 index 00000000000..b93957906ea --- /dev/null +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SupportedCapabilityListResponse.java @@ -0,0 +1,148 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.itinfrastructure.rest; + + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.SupportedCapabilityElement; + +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; + +/** + * SupportedCapabilityListResponse returns a list of SoftwareServerSupportedCapability relationships from the server. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class SupportedCapabilityListResponse extends ITInfrastructureOMASAPIResponse +{ + private static final long serialVersionUID = 1L; + + private List elements = null; + + + /** + * Default constructor + */ + public SupportedCapabilityListResponse() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public SupportedCapabilityListResponse(SupportedCapabilityListResponse template) + { + super(template); + + if (template != null) + { + this.elements = template.getElements(); + } + } + + + /** + * Return the list of assets in the response. + * + * @return list of assets + */ + public List getElements() + { + if (elements == null) + { + return null; + } + else if (elements.isEmpty()) + { + return null; + } + else + { + return elements; + } + } + + + /** + * Set up the list of assets for the response. + * + * @param elements list of assets + */ + 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 "SupportedCapabilityListResponse{" + + "assets=" + 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; + } + SupportedCapabilityListResponse that = (SupportedCapabilityListResponse) 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/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SupportedCapabilityRequestBody.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SupportedCapabilityRequestBody.java new file mode 100644 index 00000000000..2ca336f625f --- /dev/null +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/SupportedCapabilityRequestBody.java @@ -0,0 +1,126 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.itinfrastructure.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.itinfrastructure.properties.SupportedCapabilityProperties; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * SupportedCapabilityRequestBody provides the request body payload for working with the relationships between + * software servers and software server capabilities. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class SupportedCapabilityRequestBody extends MetadataSourceRequestBody +{ + private static final long serialVersionUID = 1L; + + private SupportedCapabilityProperties properties = null; + + /** + * Default constructor + */ + public SupportedCapabilityRequestBody() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public SupportedCapabilityRequestBody(SupportedCapabilityRequestBody template) + { + super(template); + + if (template != null) + { + this.properties = template.getProperties(); + } + } + + + /** + * Return the properties for this profile identity. + * + * @return properties bean + */ + public SupportedCapabilityProperties getProperties() + { + return properties; + } + + + /** + * Set up the properties for this profile identity. + * + * @param properties properties bean + */ + public void setProperties(SupportedCapabilityProperties properties) + { + this.properties = properties; + } + + + /** + * JSON-style toString. + * + * @return list of properties and their values. + */ + @Override + public String toString() + { + return "SupportedCapabilityRequestBody{" + + "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; + } + SupportedCapabilityRequestBody that = (SupportedCapabilityRequestBody) 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/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/UseTypeRequestBody.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/UseTypeRequestBody.java new file mode 100644 index 00000000000..76b425bdd39 --- /dev/null +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/UseTypeRequestBody.java @@ -0,0 +1,126 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.itinfrastructure.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.itinfrastructure.properties.ServerAssetUseType; +import org.odpi.openmetadata.commonservices.ffdc.rest.EffectiveTimeRequestBody; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * UseTypeRequestBody for passing the use type and effective time. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class UseTypeRequestBody extends EffectiveTimeRequestBody +{ + private static final long serialVersionUID = 1L; + + private ServerAssetUseType useType = null; + + + /** + * Default constructor + */ + public UseTypeRequestBody() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public UseTypeRequestBody(UseTypeRequestBody template) + { + if (template != null) + { + useType = template.getUseType(); + } + } + + + /** + * Return the use type to use for the query. + * + * @return enum + */ + public ServerAssetUseType getUseType() + { + return useType; + } + + + /** + * Set up the use type to use for the query. + * + * @param useType enum + */ + public void setUseType(ServerAssetUseType useType) + { + this.useType = useType; + } + + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "UseTypeRequestBody{" + + "useType=" + useType + + ", effectiveTime=" + getEffectiveTime() + + '}'; + } + + + /** + * 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; + } + UseTypeRequestBody that = (UseTypeRequestBody) objectToCompare; + return Objects.equals(useType, that.useType); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), useType); + } +} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-client/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/client/CapabilityManagerClient.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-client/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/client/CapabilityManagerClient.java new file mode 100644 index 00000000000..4bc863ea26e --- /dev/null +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-client/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/client/CapabilityManagerClient.java @@ -0,0 +1,872 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.itinfrastructure.client; + +import org.odpi.openmetadata.accessservices.itinfrastructure.api.SoftwareServerCapabilityManagerInterface; +import org.odpi.openmetadata.accessservices.itinfrastructure.client.rest.ITInfrastructureRESTClient; +import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.ServerAssetUseElement; +import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.SoftwareServerCapabilityElement; +import org.odpi.openmetadata.accessservices.itinfrastructure.properties.ServerAssetUseProperties; +import org.odpi.openmetadata.accessservices.itinfrastructure.properties.ServerAssetUseType; +import org.odpi.openmetadata.accessservices.itinfrastructure.properties.SoftwareServerCapabilityProperties; +import org.odpi.openmetadata.accessservices.itinfrastructure.properties.TemplateProperties; +import org.odpi.openmetadata.accessservices.itinfrastructure.rest.MetadataSourceRequestBody; +import org.odpi.openmetadata.accessservices.itinfrastructure.rest.ServerAssetUseListResponse; +import org.odpi.openmetadata.accessservices.itinfrastructure.rest.ServerAssetUseRequestBody; +import org.odpi.openmetadata.accessservices.itinfrastructure.rest.ServerAssetUseResponse; +import org.odpi.openmetadata.accessservices.itinfrastructure.rest.SoftwareServerCapabilityListResponse; +import org.odpi.openmetadata.accessservices.itinfrastructure.rest.SoftwareServerCapabilityRequestBody; +import org.odpi.openmetadata.accessservices.itinfrastructure.rest.SoftwareServerCapabilityResponse; +import org.odpi.openmetadata.accessservices.itinfrastructure.rest.TemplateRequestBody; +import org.odpi.openmetadata.accessservices.itinfrastructure.rest.UseTypeRequestBody; +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.commonservices.ffdc.rest.SearchStringRequestBody; +import org.odpi.openmetadata.commonservices.ffdc.rest.EffectiveTimeRequestBody; +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.Date; +import java.util.List; + +/** + * CapabilityManagerClient supports the APIs to maintain software server capabilities and their related objects. + */ +public class CapabilityManagerClient implements SoftwareServerCapabilityManagerInterface +{ + private static final String capabilityURLTemplatePrefix = "/servers/{0}/open-metadata/access-services/it-infrastructure/users/{1}/software-server-capabilities"; + private static final String assetUsesURLTemplatePrefix = "/servers/{0}/open-metadata/access-services/it-infrastructure/users/{1}/server-asset-uses"; + + private String serverName; /* Initialized in constructor */ + private String serverPlatformURLRoot; /* Initialized in constructor */ + + private InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); + private ITInfrastructureRESTClient 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 CapabilityManagerClient(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 ITInfrastructureRESTClient(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 CapabilityManagerClient(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 ITInfrastructureRESTClient(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 CapabilityManagerClient(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 ITInfrastructureRESTClient(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 CapabilityManagerClient(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 ITInfrastructureRESTClient(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 CapabilityManagerClient(String serverName, + String serverPlatformURLRoot, + ITInfrastructureRESTClient 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; + } + + + /* ===================================================================================================================== + * The software server capability links assets to the hosting server. + */ + + + /** + * Create a new metadata element to represent a software server capability. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the caller + * @param infrastructureManagerName unique name of software server capability representing the caller + * @param infrastructureManagerIsHome should the software server capability be marked as owned by the infrastructure manager so others can not update? + * @param classificationName optional classification name that refines the type of the software server capability. + * @param capabilityProperties 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) + */ + @Override + public String createSoftwareServerCapability(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + boolean infrastructureManagerIsHome, + String classificationName, + SoftwareServerCapabilityProperties capabilityProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "createSoftwareServerCapability"; + final String propertiesParameterName = "capabilityProperties"; + final String qualifiedNameParameterName = "qualifiedName"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateObject(capabilityProperties, propertiesParameterName, methodName); + invalidParameterHandler.validateName(capabilityProperties.getQualifiedName(), qualifiedNameParameterName, methodName); + + final String urlTemplate = serverPlatformURLRoot + capabilityURLTemplatePrefix + "?infrastructureManagerIsHome={2}"; + + SoftwareServerCapabilityRequestBody requestBody = new SoftwareServerCapabilityRequestBody(capabilityProperties); + + requestBody.setExternalSourceGUID(infrastructureManagerGUID); + requestBody.setExternalSourceName(infrastructureManagerName); + requestBody.setClassificationName(classificationName); + + GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + infrastructureManagerIsHome); + + return restResult.getGUID(); + } + + + /** + * Create a new metadata element to represent a software server capability using an existing metadata element as a template. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the caller + * @param infrastructureManagerName unique name of software server capability representing the caller + * @param infrastructureManagerIsHome should the software server capability be marked as owned by the infrastructure manager so others can not update? + * @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) + */ + @Override + public String createSoftwareServerCapabilityFromTemplate(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + boolean infrastructureManagerIsHome, + String templateGUID, + TemplateProperties templateProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "createSoftwareServerCapabilityFromTemplate"; + 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); + + final String urlTemplate = serverPlatformURLRoot + capabilityURLTemplatePrefix + "/from-template/{2}?infrastructureManagerIsHome={3}"; + + TemplateRequestBody requestBody = new TemplateRequestBody(templateProperties); + + requestBody.setExternalSourceGUID(infrastructureManagerGUID); + requestBody.setExternalSourceName(infrastructureManagerName); + + GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + templateGUID, + infrastructureManagerIsHome); + + return restResult.getGUID(); + } + + + /** + * Update the metadata element representing a software server capability. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the caller + * @param infrastructureManagerName unique name of software server capability representing the caller + * @param capabilityGUID unique identifier of the metadata element to update + * @param isMergeUpdate are unspecified properties unchanged (true) or removed? + * @param capabilityProperties 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) + */ + @Override + public void updateSoftwareServerCapability(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + String capabilityGUID, + boolean isMergeUpdate, + SoftwareServerCapabilityProperties capabilityProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "updateSoftwareServerCapability"; + final String elementGUIDParameterName = "capabilityGUID"; + final String propertiesParameterName = "capabilityProperties"; + final String qualifiedNameParameterName = "qualifiedName"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(capabilityGUID, elementGUIDParameterName, methodName); + invalidParameterHandler.validateObject(capabilityProperties, propertiesParameterName, methodName); + invalidParameterHandler.validateName(capabilityProperties.getQualifiedName(), qualifiedNameParameterName, methodName); + + final String urlTemplate = serverPlatformURLRoot + capabilityURLTemplatePrefix + "/{2}?isMergeUpdate={3}"; + + SoftwareServerCapabilityRequestBody requestBody = new SoftwareServerCapabilityRequestBody(capabilityProperties); + + requestBody.setExternalSourceGUID(infrastructureManagerGUID); + requestBody.setExternalSourceName(infrastructureManagerName); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + capabilityGUID, + isMergeUpdate); + } + + + /** + * Remove the metadata element representing a software server capability. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the caller + * @param infrastructureManagerName unique name of software server capability representing the caller + * @param capabilityGUID 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 removeSoftwareServerCapability(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + String capabilityGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "removeSoftwareServerCapability"; + final String elementGUIDParameterName = "capabilityGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(capabilityGUID, elementGUIDParameterName, methodName); + + final String urlTemplate = serverPlatformURLRoot + capabilityURLTemplatePrefix + "/{2}/delete"; + + MetadataSourceRequestBody requestBody = new MetadataSourceRequestBody(); + + requestBody.setExternalSourceGUID(infrastructureManagerGUID); + requestBody.setExternalSourceName(infrastructureManagerName); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + capabilityGUID); + } + + + /** + * Retrieve the list of software server capability 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 effectiveTime effective time for the query + * @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 findSoftwareServerCapabilities(String userId, + String searchString, + Date effectiveTime, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "findSoftwareServerCapabilities"; + final String searchStringParameterName = "searchString"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateSearchString(searchString, searchStringParameterName, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = serverPlatformURLRoot + capabilityURLTemplatePrefix + "/by-search-string?startFrom={2}&pageSize={3}"; + + SearchStringRequestBody requestBody = new SearchStringRequestBody(); + + requestBody.setEffectiveTime(effectiveTime); + requestBody.setSearchString(searchString); + requestBody.setSearchStringParameterName(searchStringParameterName); + + SoftwareServerCapabilityListResponse restResult = restClient.callSoftwareServerCapabilityListPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + startFrom, + validatedPageSize); + + return restResult.getElementList(); + } + + + /** + * Retrieve the list of software server capability 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 effectiveTime effective time for the query + * @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 getSoftwareServerCapabilitiesByName(String userId, + String name, + Date effectiveTime, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getSoftwareServerCapabilitiesByName"; + final String nameParameterName = "name"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateName(name, nameParameterName, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = serverPlatformURLRoot + capabilityURLTemplatePrefix + "/by-name?startFrom={2}&pageSize={3}"; + + NameRequestBody requestBody = new NameRequestBody(); + + requestBody.setEffectiveTime(effectiveTime); + requestBody.setName(name); + requestBody.setNamePropertyName(nameParameterName); + + SoftwareServerCapabilityListResponse restResult = restClient.callSoftwareServerCapabilityListPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + startFrom, + validatedPageSize); + + return restResult.getElementList(); + } + + + /** + * Retrieve the software server capability metadata element with the supplied unique identifier. + * + * @param userId calling user + * @param guid 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) + */ + @Override + public SoftwareServerCapabilityElement getSoftwareServerCapabilityByGUID(String userId, + String guid) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getSoftwareServerCapabilityByGUID"; + final String guidParameterName = "guid"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(guid, guidParameterName, methodName); + + final String urlTemplate = serverPlatformURLRoot + capabilityURLTemplatePrefix + "/{2}"; + + SoftwareServerCapabilityResponse restResult = restClient.callSoftwareServerCapabilityGetRESTCall(methodName, + urlTemplate, + serverName, + userId, + guid); + + return restResult.getElement(); + } + + + /* + * A software server capability works with assets + */ + + /** + * Create a new metadata relationship to represent the use of an asset by a software server capability. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the caller + * @param infrastructureManagerName unique name of software server capability representing the caller + * @param infrastructureManagerIsHome should the software server capability be marked as owned by the infrastructure manager so others can not update? + * @param capabilityGUID unique identifier of a software server capability + * @param assetGUID unique identifier of an asset + * @param properties properties about the ServerAssetUse relationship + * + * @return unique identifier of the new ServerAssetUse relationship + * + * @throws InvalidParameterException one of the parameters is invalid + * @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 createServerAssetUse(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + boolean infrastructureManagerIsHome, + String capabilityGUID, + String assetGUID, + ServerAssetUseProperties properties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "createServerAssetUse"; + final String capabilityGUIDParameterName = "capabilityGUID"; + final String assetGUIDParameterName = "assetGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(capabilityGUID, capabilityGUIDParameterName, methodName); + invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameterName, methodName); + + final String urlTemplate = serverPlatformURLRoot + assetUsesURLTemplatePrefix + "/software-server-capabilities/{2}/assets/{3}?infrastructureManagerIsHome={4}"; + + ServerAssetUseRequestBody requestBody = new ServerAssetUseRequestBody(); + + requestBody.setExternalSourceGUID(infrastructureManagerGUID); + requestBody.setExternalSourceName(infrastructureManagerName); + requestBody.setProperties(properties); + + GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + capabilityGUID, + assetGUID, + infrastructureManagerIsHome); + + return restResult.getGUID(); + } + + + /** + * Update the metadata relationship to represent the use of an asset by a software server capability. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the caller + * @param infrastructureManagerName unique name of software server capability representing the caller + * @param serverAssetUseGUID unique identifier of the relationship between a software server capability and an asset + * @param isMergeUpdate are unspecified properties unchanged (true) or removed? + * @param properties new properties for the ServerAssetUse relationship + * + * @throws InvalidParameterException one of the parameters is invalid + * @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 updateServerAssetUse(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + String serverAssetUseGUID, + boolean isMergeUpdate, + ServerAssetUseProperties properties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "updateServerAssetUse"; + final String elementGUIDParameterName = "serverAssetUseGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(serverAssetUseGUID, elementGUIDParameterName, methodName); + + final String urlTemplate = serverPlatformURLRoot + assetUsesURLTemplatePrefix + "/{2}?isMergeUpdate={3}"; + + ServerAssetUseRequestBody requestBody = new ServerAssetUseRequestBody(); + + requestBody.setExternalSourceGUID(infrastructureManagerGUID); + requestBody.setExternalSourceName(infrastructureManagerName); + requestBody.setProperties(properties); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + serverAssetUseGUID, + isMergeUpdate); + } + + + /** + * Remove the metadata relationship to represent the use of an asset by a software server capability. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the caller + * @param infrastructureManagerName unique name of software server capability representing the caller + * @param serverAssetUseGUID unique identifier of the relationship between a software server capability and an asset + * + * @throws InvalidParameterException one of the parameters is invalid + * @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 removeServerAssetUse(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + String serverAssetUseGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "removeServerAssetUse"; + final String elementGUIDParameterName = "serverAssetUseGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(serverAssetUseGUID, elementGUIDParameterName, methodName); + + final String urlTemplate = serverPlatformURLRoot + assetUsesURLTemplatePrefix + "/{2}/delete"; + + MetadataSourceRequestBody requestBody = new MetadataSourceRequestBody(); + + requestBody.setExternalSourceGUID(infrastructureManagerGUID); + requestBody.setExternalSourceName(infrastructureManagerName); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + serverAssetUseGUID); + } + + + /** + * Return the list of server asset use relationships associated with a software server capability. + * + * @param userId calling user + * @param capabilityGUID unique identifier of the software server capability to query + * @param useType value to search for. Null means all use types. + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching relationships + * + * @throws InvalidParameterException one of the parameters is invalid + * @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 getServerAssetUsesForCapability(String userId, + String capabilityGUID, + ServerAssetUseType useType, + Date effectiveTime, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getServerAssetUsesForCapability"; + final String elementGUIDParameterName = "capabilityGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(capabilityGUID, elementGUIDParameterName, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = serverPlatformURLRoot + assetUsesURLTemplatePrefix + "/software-server-capabilities/{2}?startFrom={3}&pageSize={4}"; + + UseTypeRequestBody requestBody = new UseTypeRequestBody(); + + requestBody.setEffectiveTime(effectiveTime); + requestBody.setUseType(useType); + + ServerAssetUseListResponse restResult = restClient.callServerAssetUseListPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + capabilityGUID, + startFrom, + validatedPageSize); + + return restResult.getElements(); + } + + + /** + * Return the list of software server capabilities that make use of a specific asset. + * + * @param userId calling user + * @param assetGUID unique identifier of the asset to query + * @param useType Optionally restrict the search to a specific user type. Null means all use types. + * @param effectiveTime effective time for the query + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching relationships + * + * @throws InvalidParameterException one of the parameters is invalid + * @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 getCapabilityUsesForAsset(String userId, + String assetGUID, + ServerAssetUseType useType, + Date effectiveTime, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getCapabilityUsesForAsset"; + final String elementGUIDParameterName = "assetGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(assetGUID, elementGUIDParameterName, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = serverPlatformURLRoot + assetUsesURLTemplatePrefix + "/assets/{2}?startFrom={3}&pageSize={4}"; + + UseTypeRequestBody requestBody = new UseTypeRequestBody(); + + requestBody.setEffectiveTime(effectiveTime); + requestBody.setUseType(useType); + + ServerAssetUseListResponse restResult = restClient.callServerAssetUseListPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + assetGUID, + startFrom, + validatedPageSize); + + return restResult.getElements(); + } + + + /** + * Retrieve the list of relationships between a specific software server capability and a specific asset. + * + * @param userId calling user + * @param capabilityGUID unique identifier of a software server capability + * @param assetGUID unique identifier of an asset + * @param effectiveTime effective time for the query + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching relationships + * + * @throws InvalidParameterException one of the parameters is invalid + * @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 getServerAssetUsesForElements(String userId, + String capabilityGUID, + String assetGUID, + Date effectiveTime, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getServerAssetUsesForElements"; + final String capabilityGUIDParameterName = "capabilityGUID"; + final String assetGUIDParameterName = "assetGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(capabilityGUID, capabilityGUIDParameterName, methodName); + invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameterName, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = serverPlatformURLRoot + assetUsesURLTemplatePrefix + "/software-server-capabilities/{2}/assets/{3}/by-elements?startFrom={4}&pageSize={5}"; + + EffectiveTimeRequestBody requestBody = new EffectiveTimeRequestBody(); + + requestBody.setEffectiveTime(effectiveTime); + + ServerAssetUseListResponse restResult = restClient.callServerAssetUseListPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + capabilityGUID, + assetGUID, + startFrom, + validatedPageSize); + + return restResult.getElements(); + } + + + /** + * Retrieve the server asset use type relationship with the supplied unique identifier. + * + * @param userId calling user + * @param guid unique identifier of the requested metadata element + * + * @return requested relationship + * + * @throws InvalidParameterException one of the parameters is invalid + * @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 ServerAssetUseElement getServerAssetUseByGUID(String userId, + String guid) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getServerAssetUseByGUID"; + final String elementGUIDParameterName = "guid"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(guid, elementGUIDParameterName, methodName); + + final String urlTemplate = serverPlatformURLRoot + assetUsesURLTemplatePrefix + "/{2}"; + + ServerAssetUseResponse restResult = restClient.callServerAssetUseGetRESTCall(methodName, + urlTemplate, + serverName, + userId, + guid); + + return restResult.getElement(); + } +} diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-client/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/client/HostManagerClient.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-client/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/client/HostManagerClient.java new file mode 100644 index 00000000000..ec633be2fd3 --- /dev/null +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-client/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/client/HostManagerClient.java @@ -0,0 +1,932 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.itinfrastructure.client; + +import org.odpi.openmetadata.accessservices.itinfrastructure.api.HostManagerInterface; +import org.odpi.openmetadata.accessservices.itinfrastructure.client.rest.ITInfrastructureRESTClient; +import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.HostElement; +import org.odpi.openmetadata.accessservices.itinfrastructure.properties.HostProperties; +import org.odpi.openmetadata.accessservices.itinfrastructure.properties.TemplateProperties; +import org.odpi.openmetadata.accessservices.itinfrastructure.rest.HostListResponse; +import org.odpi.openmetadata.accessservices.itinfrastructure.rest.HostRequestBody; +import org.odpi.openmetadata.accessservices.itinfrastructure.rest.HostResponse; +import org.odpi.openmetadata.accessservices.itinfrastructure.rest.MetadataSourceRequestBody; +import org.odpi.openmetadata.accessservices.itinfrastructure.rest.TemplateRequestBody; +import org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler; +import org.odpi.openmetadata.commonservices.ffdc.rest.EffectiveTimeRequestBody; +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.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.Date; +import java.util.List; + +/** + * HostManagerClient supports the APIs to maintain hosts and their related objects. + */ +public class HostManagerClient implements HostManagerInterface +{ + private static final String hostURLTemplatePrefix = "/servers/{0}/open-metadata/access-services/it-infrastructure/users/{1}/hosts"; + + private String serverName; /* Initialized in constructor */ + private String serverPlatformURLRoot; /* Initialized in constructor */ + + private InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); + private ITInfrastructureRESTClient restClient; /* Initialized in constructor */ + + private NullRequestBody nullRequestBody = new NullRequestBody(); + + + /** + * 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 HostManagerClient(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 ITInfrastructureRESTClient(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 HostManagerClient(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 ITInfrastructureRESTClient(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 HostManagerClient(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 ITInfrastructureRESTClient(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 HostManagerClient(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 ITInfrastructureRESTClient(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 HostManagerClient(String serverName, + String serverPlatformURLRoot, + ITInfrastructureRESTClient 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; + } + + + + /* ===================================================================================================================== + * The host describes the computer or container that provides the operating system for the platforms. + */ + + + + /** + * Create a new metadata element to represent a host. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the infrastructure manager + * @param infrastructureManagerName unique name of software server capability representing the infrastructure manager + * @param infrastructureManagerIsHome should the host be marked as owned by the infrastructure manager so others can not update? + * @param hostProperties 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) + */ + @Override + public String createHost(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + boolean infrastructureManagerIsHome, + HostProperties hostProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "createHost"; + final String propertiesParameterName = "hostProperties"; + final String qualifiedNameParameterName = "qualifiedName"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateObject(hostProperties, propertiesParameterName, methodName); + invalidParameterHandler.validateName(hostProperties.getQualifiedName(), qualifiedNameParameterName, methodName); + + final String urlTemplate = serverPlatformURLRoot + hostURLTemplatePrefix + "?infrastructureManagerIsHome={2}"; + + HostRequestBody requestBody = new HostRequestBody(hostProperties); + + requestBody.setExternalSourceGUID(infrastructureManagerGUID); + requestBody.setExternalSourceName(infrastructureManagerName); + + GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + infrastructureManagerIsHome); + + return restResult.getGUID(); + } + + + /** + * Create a new metadata element to represent a host using an existing metadata element as a template. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the infrastructure manager + * @param infrastructureManagerName unique name of software server capability representing the infrastructure manager + * @param infrastructureManagerIsHome should the host be marked as owned by the infrastructure manager so others can not update? + * @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) + */ + @Override + public String createHostFromTemplate(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + boolean infrastructureManagerIsHome, + String templateGUID, + TemplateProperties templateProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "createHostFromTemplate"; + 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); + + final String urlTemplate = serverPlatformURLRoot + hostURLTemplatePrefix + "/from-template/{2}?infrastructureManagerIsHome={3}"; + + TemplateRequestBody requestBody = new TemplateRequestBody(templateProperties); + + requestBody.setExternalSourceGUID(infrastructureManagerGUID); + requestBody.setExternalSourceName(infrastructureManagerName); + + GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + templateGUID, + infrastructureManagerIsHome); + + return restResult.getGUID(); + } + + + /** + * Update the metadata element representing a host. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the infrastructure manager + * @param infrastructureManagerName unique name of software server capability representing the infrastructure manager + * @param hostGUID unique identifier of the metadata element to update + * @param isMergeUpdate are unspecified properties unchanged (true) or removed? + * @param hostProperties 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) + */ + @Override + public void updateHost(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + String hostGUID, + boolean isMergeUpdate, + HostProperties hostProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "updateHost"; + final String elementGUIDParameterName = "hostGUID"; + final String propertiesParameterName = "hostProperties"; + final String qualifiedNameParameterName = "qualifiedName"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(hostGUID, elementGUIDParameterName, methodName); + invalidParameterHandler.validateObject(hostProperties, propertiesParameterName, methodName); + invalidParameterHandler.validateName(hostProperties.getQualifiedName(), qualifiedNameParameterName, methodName); + + final String urlTemplate = serverPlatformURLRoot + hostURLTemplatePrefix + "/{2}?isMergeUpdate={3}"; + + HostRequestBody requestBody = new HostRequestBody(hostProperties); + + requestBody.setExternalSourceGUID(infrastructureManagerGUID); + requestBody.setExternalSourceName(infrastructureManagerName); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + hostGUID, + isMergeUpdate); + } + + + + /** + * Create a relationship between a host and a hosted host. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the infrastructure manager + * @param infrastructureManagerName unique name of software server capability representing the infrastructure manager + * @param hostGUID unique identifier of the host + * @param hostedHostGUID unique identifier of the hosted host + * + * @throws InvalidParameterException one of the parameters is invalid + * @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 setupHostedHost(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + String hostGUID, + String hostedHostGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "setupHostedHost"; + final String hostGUIDParameterName = "hostGUID"; + final String hostedHostGUIDParameterName = "hostedHostGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(hostGUID, hostGUIDParameterName, methodName); + invalidParameterHandler.validateGUID(hostedHostGUID, hostedHostGUIDParameterName, methodName); + + final String urlTemplate = serverPlatformURLRoot + hostURLTemplatePrefix + "/{2}/hosted-hosts/{3}"; + + MetadataSourceRequestBody requestBody = new MetadataSourceRequestBody(); + + requestBody.setExternalSourceGUID(infrastructureManagerGUID); + requestBody.setExternalSourceName(infrastructureManagerName); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + hostGUID, + hostedHostGUID); + } + + + /** + * Remove a relationship between a host and a hosted host. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the infrastructure manager + * @param infrastructureManagerName unique name of software server capability representing the infrastructure manager + * @param hostGUID unique identifier of the host + * @param hostedHostGUID unique identifier of the hosted host + * + * @throws InvalidParameterException one of the parameters is invalid + * @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 clearHostedHost(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + String hostGUID, + String hostedHostGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "clearHostedHost"; + final String hostGUIDParameterName = "hostGUID"; + final String hostedHostGUIDParameterName = "hostedHostGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(hostGUID, hostGUIDParameterName, methodName); + invalidParameterHandler.validateGUID(hostedHostGUID, hostedHostGUIDParameterName, methodName); + + final String urlTemplate = serverPlatformURLRoot + hostURLTemplatePrefix + "/{2}/hosted-hosts/{3}/delete"; + + MetadataSourceRequestBody requestBody = new MetadataSourceRequestBody(); + + requestBody.setExternalSourceGUID(infrastructureManagerGUID); + requestBody.setExternalSourceName(infrastructureManagerName); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + hostGUID, + hostedHostGUID); + } + + + /** + * Create a relationship between a host and an cluster member host. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the infrastructure manager + * @param infrastructureManagerName unique name of software server capability representing the infrastructure manager + * @param hostGUID unique identifier of the host + * @param clusterMemberGUID unique identifier of the cluster member host + * + * @throws InvalidParameterException one of the parameters is invalid + * @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 setupClusterMember(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + String hostGUID, + String clusterMemberGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "setupClusterMember"; + final String hostGUIDParameterName = "hostGUID"; + final String clusterMemberGUIDParameterName = "clusterMemberGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(hostGUID, hostGUIDParameterName, methodName); + invalidParameterHandler.validateGUID(clusterMemberGUID, clusterMemberGUIDParameterName, methodName); + + final String urlTemplate = serverPlatformURLRoot + hostURLTemplatePrefix + "/{2}/cluster-members/{3}"; + + MetadataSourceRequestBody requestBody = new MetadataSourceRequestBody(); + + requestBody.setExternalSourceGUID(infrastructureManagerGUID); + requestBody.setExternalSourceName(infrastructureManagerName); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + hostGUID, + clusterMemberGUID); + } + + + /** + * Remove a relationship between a host and an cluster member host. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the infrastructure manager + * @param infrastructureManagerName unique name of software server capability representing the infrastructure manager + * @param hostGUID unique identifier of the host + * @param clusterMemberGUID unique identifier of the cluster member host + * + * @throws InvalidParameterException one of the parameters is invalid + * @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 clearClusterMember(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + String hostGUID, + String clusterMemberGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "clearClusterMember"; + final String hostGUIDParameterName = "hostGUID"; + final String clusterMemberGUIDParameterName = "clusterMemberGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(hostGUID, hostGUIDParameterName, methodName); + invalidParameterHandler.validateGUID(clusterMemberGUID, clusterMemberGUIDParameterName, methodName); + + final String urlTemplate = serverPlatformURLRoot + hostURLTemplatePrefix + "/{2}/cluster-members/{3}/delete"; + + MetadataSourceRequestBody requestBody = new MetadataSourceRequestBody(); + + requestBody.setExternalSourceGUID(infrastructureManagerGUID); + requestBody.setExternalSourceName(infrastructureManagerName); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + hostGUID, + clusterMemberGUID); + } + + + + /** + * Update the zones for the host asset so that it becomes visible to consumers. + * (The zones are set to the list of zones in the publishedZones option configured for each + * instance of the IT Infrastructure OMAS). + * + * @param userId calling user + * @param hostGUID unique identifier of the metadata element to publish + * + * @throws InvalidParameterException one of the parameters is invalid + * @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 publishHost(String userId, + String hostGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "publishHost"; + final String elementGUIDParameterName = "hostGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(hostGUID, elementGUIDParameterName, methodName); + + final String urlTemplate = serverPlatformURLRoot + hostURLTemplatePrefix + "/{2}/publish"; + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + nullRequestBody, + serverName, + userId, + hostGUID); + } + + + /** + * Update the zones for the host asset so that it is no longer visible to consumers. + * (The zones are set to the list of zones in the defaultZones option configured for each + * instance of the IT Infrastructure OMAS. This is the setting when the host is first created). + * + * @param userId calling user + * @param hostGUID unique identifier of the metadata element to withdraw + * + * @throws InvalidParameterException one of the parameters is invalid + * @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 withdrawHost(String userId, + String hostGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "withdrawHost"; + final String elementGUIDParameterName = "hostGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(hostGUID, elementGUIDParameterName, methodName); + + final String urlTemplate = serverPlatformURLRoot + hostURLTemplatePrefix + "/{2}/withdraw"; + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + nullRequestBody, + serverName, + userId, + hostGUID); + } + + + /** + * Remove the metadata element representing a host. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the infrastructure manager + * @param infrastructureManagerName unique name of software server capability representing the infrastructure manager + * @param hostGUID 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 removeHost(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + String hostGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "removeHost"; + final String elementGUIDParameterName = "hostGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(hostGUID, elementGUIDParameterName, methodName); + + final String urlTemplate = serverPlatformURLRoot + hostURLTemplatePrefix + "/{2}/delete"; + + MetadataSourceRequestBody requestBody = new MetadataSourceRequestBody(); + + requestBody.setExternalSourceGUID(infrastructureManagerGUID); + requestBody.setExternalSourceName(infrastructureManagerName); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + hostGUID); + } + + + + /** + * Retrieve the list of host 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 effectiveTime effective time for the query + * @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 findHosts(String userId, + String searchString, + Date effectiveTime, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "findHosts"; + final String searchStringParameterName = "searchString"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateSearchString(searchString, searchStringParameterName, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = serverPlatformURLRoot + hostURLTemplatePrefix + "/by-search-string?startFrom={2}&pageSize={3}"; + + SearchStringRequestBody requestBody = new SearchStringRequestBody(); + + requestBody.setEffectiveTime(effectiveTime); + requestBody.setSearchString(searchString); + requestBody.setSearchStringParameterName(searchStringParameterName); + + HostListResponse restResult = restClient.callHostListPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + startFrom, + validatedPageSize); + + return restResult.getElementList(); + } + + + /** + * Retrieve the list of host 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 effectiveTime effective time for the query + * @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 getHostsByName(String userId, + String name, + Date effectiveTime, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getHostsByName"; + final String nameParameterName = "name"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateName(name, nameParameterName, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = serverPlatformURLRoot + hostURLTemplatePrefix + "?startFrom={2}&pageSize={3}"; + + NameRequestBody requestBody = new NameRequestBody(); + + requestBody.setEffectiveTime(effectiveTime); + requestBody.setName(name); + requestBody.setNamePropertyName(nameParameterName); + + HostListResponse restResult = restClient.callHostListPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + startFrom, + validatedPageSize); + + return restResult.getElementList(); + } + + + /** + * Retrieve the list of hosts created by this caller. + * + * @param userId calling user + * @param infrastructureManagerGUID unique identifier of software server capability representing the infrastructure manager + * @param infrastructureManagerName unique name of software server capability representing the infrastructure manager + * @param effectiveTime effective time for the query + * @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 getHostsForInfrastructureManager(String userId, + String infrastructureManagerGUID, + String infrastructureManagerName, + Date effectiveTime, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getHostsForInfrastructureManager"; + final String infrastructureManagerGUIDParameterName = "infrastructureManagerGUID"; + final String infrastructureManagerNameParameterName = "infrastructureManagerName"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(infrastructureManagerGUID, infrastructureManagerGUIDParameterName, methodName); + invalidParameterHandler.validateName(infrastructureManagerName, infrastructureManagerNameParameterName, methodName); + + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = serverPlatformURLRoot + hostURLTemplatePrefix + "/infrastructureManagers/{2}/{3}/hosts?startFrom={4}&pageSize={5}"; + + EffectiveTimeRequestBody requestBody = new EffectiveTimeRequestBody(); + + requestBody.setEffectiveTime(effectiveTime); + + HostListResponse restResult = restClient.callHostListPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + infrastructureManagerGUID, + infrastructureManagerName, + startFrom, + validatedPageSize); + + return restResult.getElementList(); + } + + + /** + * Retrieve the host metadata element with the supplied unique identifier. + * + * @param userId calling user + * @param guid 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) + */ + @Override + public HostElement getHostByGUID(String userId, + String guid) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getHostByGUID"; + final String guidParameterName = "guid"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(guid, guidParameterName, methodName); + + final String urlTemplate = serverPlatformURLRoot + hostURLTemplatePrefix + "/{2}"; + + HostResponse restResult = restClient.callHostGetRESTCall(methodName, + urlTemplate, + serverName, + userId, + guid); + + return restResult.getElement(); + } + + + /** + * Return the list of hosts hosted by another host. + * + * @param userId calling user + * @param supportingHostGUID unique identifier of the host to query + * @param effectiveTime effective time for the query + * @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 getHostedHosts(String userId, + String supportingHostGUID, + Date effectiveTime, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getHostedHosts"; + + invalidParameterHandler.validateUserId(userId, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = serverPlatformURLRoot + hostURLTemplatePrefix + "/{2}/hosted-hosts?startFrom={3}&pageSize={4}"; + + EffectiveTimeRequestBody requestBody = new EffectiveTimeRequestBody(); + + requestBody.setEffectiveTime(effectiveTime); + + HostListResponse restResult = restClient.callHostListPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + supportingHostGUID, + startFrom, + validatedPageSize); + + return restResult.getElementList(); + } + + + /** + * Return the list of cluster members associated with a host. + * + * @param userId calling user + * @param hostGUID unique identifier of the host to query + * @param effectiveTime effective time for the query + * @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 getClusterMembersForHost(String userId, + String hostGUID, + Date effectiveTime, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getClusterMembersForHost"; + + invalidParameterHandler.validateUserId(userId, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = serverPlatformURLRoot + hostURLTemplatePrefix + "/{2}/cluster-members?startFrom={3}&pageSize={4}"; + + EffectiveTimeRequestBody requestBody = new EffectiveTimeRequestBody(); + + requestBody.setEffectiveTime(effectiveTime); + + HostListResponse restResult = restClient.callHostListPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + hostGUID, + startFrom, + validatedPageSize); + + return restResult.getElementList(); + } +} diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-client/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/client/ITProfileManagerClient.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-client/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/client/ITProfileManagerClient.java index 0a2fea65ab9..ee105271182 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-client/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/client/ITProfileManagerClient.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-client/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/client/ITProfileManagerClient.java @@ -11,13 +11,13 @@ import org.odpi.openmetadata.accessservices.itinfrastructure.properties.ProfileIdentityProperties; import org.odpi.openmetadata.accessservices.itinfrastructure.properties.UserIdentityProperties; import org.odpi.openmetadata.accessservices.itinfrastructure.rest.EffectiveDatesRequestBody; -import org.odpi.openmetadata.accessservices.itinfrastructure.rest.EffectiveTimeRequestBody; +import org.odpi.openmetadata.accessservices.itinfrastructure.rest.EffectiveTimeMetadataSourceRequestBody; import org.odpi.openmetadata.accessservices.itinfrastructure.rest.ITProfileListResponse; import org.odpi.openmetadata.accessservices.itinfrastructure.rest.ITProfileRequestBody; import org.odpi.openmetadata.accessservices.itinfrastructure.rest.ITProfileResponse; import org.odpi.openmetadata.accessservices.itinfrastructure.rest.ContactMethodRequestBody; import org.odpi.openmetadata.accessservices.itinfrastructure.rest.MetadataSourceRequestBody; -import org.odpi.openmetadata.accessservices.itinfrastructure.api.ITProfileManagementInterface; +import org.odpi.openmetadata.accessservices.itinfrastructure.api.ITProfileManagerInterface; import org.odpi.openmetadata.accessservices.itinfrastructure.rest.ProfileIdentityRequestBody; import org.odpi.openmetadata.accessservices.itinfrastructure.rest.UserIdentityListResponse; import org.odpi.openmetadata.accessservices.itinfrastructure.rest.UserIdentityRequestBody; @@ -39,7 +39,7 @@ * OrganizationManagement is the client used by the Organization Integrator OMIS that is responsible with synchronizing organizational * structures, profiles rules and users with open metadata. */ -public class ITProfileManagerClient implements ITProfileManagementInterface +public class ITProfileManagerClient implements ITProfileManagerInterface { private String serverName; /* Initialized in constructor */ private String serverPlatformURLRoot; /* Initialized in constructor */ @@ -522,7 +522,7 @@ public void unlinkITInfrastructureFromProfile(String userId, final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/assets/{2}/profiles/{3}/unlink"; - EffectiveTimeRequestBody requestBody = new EffectiveTimeRequestBody(); + EffectiveTimeMetadataSourceRequestBody requestBody = new EffectiveTimeMetadataSourceRequestBody(); requestBody.setExternalSourceGUID(externalSourceGUID); requestBody.setExternalSourceName(externalSourceName); diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-client/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/client/rest/ITInfrastructureRESTClient.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-client/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/client/rest/ITInfrastructureRESTClient.java index a2dd530ad0e..39405dfde4f 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-client/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/client/rest/ITInfrastructureRESTClient.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-client/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/client/rest/ITInfrastructureRESTClient.java @@ -491,4 +491,451 @@ public UserIdentityListResponse callUserIdentityListPostRESTCall(String metho return restResult; } + + /** + * Issue a GET REST call that returns a SoftwareServerCapabilityElement 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 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 SoftwareServerCapabilityResponse callSoftwareServerCapabilityGetRESTCall(String methodName, + String urlTemplate, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + SoftwareServerCapabilityResponse restResult = this.callGetRESTCall(methodName, SoftwareServerCapabilityResponse.class, urlTemplate, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + + /** + * Issue a GET REST call that returns a list of SoftwareServerCapabilityElements 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 params a list of parameters that are slotted into the url template + * @return response objects + * @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 SoftwareServerCapabilityListResponse callSoftwareServerCapabilityListGetRESTCall(String methodName, + String urlTemplate, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + SoftwareServerCapabilityListResponse restResult = this.callGetRESTCall(methodName, SoftwareServerCapabilityListResponse.class, urlTemplate, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + + /** + * Issue a POST REST call that returns a list of SoftwareServerCapabilityElements 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 requestBody request body for the request + * @param params a list of parameters that are slotted into the url template + * @return response objects + * @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 SoftwareServerCapabilityListResponse callSoftwareServerCapabilityListPostRESTCall(String methodName, + String urlTemplate, + Object requestBody, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + SoftwareServerCapabilityListResponse restResult = this.callPostRESTCall(methodName, SoftwareServerCapabilityListResponse.class, urlTemplate, requestBody, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + + + /** + * Issue a GET REST call that returns a SoftwareServerElement 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 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 SoftwareServerResponse callSoftwareServerGetRESTCall(String methodName, + String urlTemplate, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + SoftwareServerResponse restResult = this.callGetRESTCall(methodName, SoftwareServerResponse.class, urlTemplate, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + + /** + * Issue a GET REST call that returns a list of SoftwareServerElements 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 params a list of parameters that are slotted into the url template + * @return response objects + * @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 SoftwareServerListResponse callSoftwareServerListGetRESTCall(String methodName, + String urlTemplate, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + SoftwareServerListResponse restResult = this.callGetRESTCall(methodName, SoftwareServerListResponse.class, urlTemplate, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + + /** + * Issue a POST REST call that returns a list of SoftwareServerElements 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 requestBody request body for the request + * @param params a list of parameters that are slotted into the url template + * @return response objects + * @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 SoftwareServerListResponse callSoftwareServerListPostRESTCall(String methodName, + String urlTemplate, + Object requestBody, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + SoftwareServerListResponse restResult = this.callPostRESTCall(methodName, SoftwareServerListResponse.class, urlTemplate, requestBody, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + + /** + * Issue a GET REST call that returns a SoftwareServerPlatformElement 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 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 SoftwareServerPlatformResponse callSoftwareServerPlatformGetRESTCall(String methodName, + String urlTemplate, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + SoftwareServerPlatformResponse restResult = this.callGetRESTCall(methodName, SoftwareServerPlatformResponse.class, urlTemplate, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + + /** + * Issue a GET REST call that returns a list of SoftwareServerPlatformElements 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 params a list of parameters that are slotted into the url template + * @return response objects + * @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 SoftwareServerPlatformListResponse callSoftwareServerPlatformListGetRESTCall(String methodName, + String urlTemplate, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + SoftwareServerPlatformListResponse restResult = this.callGetRESTCall(methodName, SoftwareServerPlatformListResponse.class, urlTemplate, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + + /** + * Issue a POST REST call that returns a list of SoftwareServerPlatformElements 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 requestBody request body for the request + * @param params a list of parameters that are slotted into the url template + * @return response objects + * @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 SoftwareServerPlatformListResponse callSoftwareServerPlatformListPostRESTCall(String methodName, + String urlTemplate, + Object requestBody, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + SoftwareServerPlatformListResponse restResult = this.callPostRESTCall(methodName, SoftwareServerPlatformListResponse.class, urlTemplate, requestBody, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + + + /** + * Issue a GET REST call that returns a HostElement 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 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 HostResponse callHostGetRESTCall(String methodName, + String urlTemplate, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + HostResponse restResult = this.callGetRESTCall(methodName, HostResponse.class, urlTemplate, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + + /** + * Issue a GET REST call that returns a list of HostElements 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 params a list of parameters that are slotted into the url template + * @return response objects + * @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 HostListResponse callHostListGetRESTCall(String methodName, + String urlTemplate, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + HostListResponse restResult = this.callGetRESTCall(methodName, HostListResponse.class, urlTemplate, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + + /** + * Issue a POST REST call that returns a list of SoftwareServerPlatformElements 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 requestBody request body for the request + * @param params a list of parameters that are slotted into the url template + * @return response objects + * @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 HostListResponse callHostListPostRESTCall(String methodName, + String urlTemplate, + Object requestBody, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + HostListResponse restResult = this.callPostRESTCall(methodName, HostListResponse.class, urlTemplate, requestBody, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + + /** + * Issue a GET REST call that returns a ServerAssetUseElement 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 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 ServerAssetUseResponse callServerAssetUseGetRESTCall(String methodName, + String urlTemplate, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + ServerAssetUseResponse restResult = this.callGetRESTCall(methodName, ServerAssetUseResponse.class, urlTemplate, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + + /** + * Issue a GET REST call that returns a list of ServerAssetUseElements 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 params a list of parameters that are slotted into the url template + * @return response objects + * @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 ServerAssetUseListResponse callServerAssetUseListGetRESTCall(String methodName, + String urlTemplate, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + ServerAssetUseListResponse restResult = this.callGetRESTCall(methodName, ServerAssetUseListResponse.class, urlTemplate, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + + /** + * Issue a POST REST call that returns a list of ServerAssetUseElements 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 requestBody request body for the request + * @param params a list of parameters that are slotted into the url template + * @return response objects + * @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 ServerAssetUseListResponse callServerAssetUseListPostRESTCall(String methodName, + String urlTemplate, + Object requestBody, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + ServerAssetUseListResponse restResult = this.callPostRESTCall(methodName, ServerAssetUseListResponse.class, urlTemplate, requestBody, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + + /** + * Issue a POST REST call that returns a list of SupportedCapabilityElements 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 requestBody request body for the request + * @param params a list of parameters that are slotted into the url template + * @return response objects + * @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 SupportedCapabilityListResponse callSupportedCapabilityListPostRESTCall(String methodName, + String urlTemplate, + Object requestBody, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + SupportedCapabilityListResponse restResult = this.callPostRESTCall(methodName, SupportedCapabilityListResponse.class, urlTemplate, requestBody, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + + + /** + * Issue a POST REST call that returns a list of SupportedCapabilityElements 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 requestBody request body for the request + * @param params a list of parameters that are slotted into the url template + * @return response objects + * @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 PlatformDeploymentListResponse callPlatformDeploymentListPostRESTCall(String methodName, + String urlTemplate, + Object requestBody, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + PlatformDeploymentListResponse restResult = this.callPostRESTCall(methodName, PlatformDeploymentListResponse.class, urlTemplate, requestBody, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + } 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 new file mode 100644 index 00000000000..dcc03b9df31 --- /dev/null +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/AssetConverter.java @@ -0,0 +1,125 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.itinfrastructure.converters; + +import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.AssetElement; +import org.odpi.openmetadata.accessservices.itinfrastructure.properties.AssetProperties; +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; + + +/** + * AssetConverter provides common methods for transferring relevant properties from an Open Metadata Repository Services (OMRS) + * EntityDetail object into a bean that inherits from AssetProperties. + */ +public class AssetConverter extends ITInfrastructureOMASConverter +{ + /** + * Constructor + * + * @param repositoryHelper helper object to parse entity + * @param serviceName name of this component + * @param serverName local server name + */ + public AssetConverter(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 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 + { + 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 AssetElement) + { + AssetElement bean = (AssetElement) returnBean; + AssetProperties assetProperties = new AssetProperties(); + + if (entity != null) + { + bean.setElementHeader(super.getMetadataElementHeader(beanClass, entity, methodName)); + + /* + * The initial set of values come from the entity. + */ + InstanceProperties instanceProperties = new InstanceProperties(entity.getProperties()); + + assetProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); + assetProperties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); + assetProperties.setDisplayName(this.removeName(instanceProperties)); + assetProperties.setDescription(this.removeDescription(instanceProperties)); + + /* + * Any remaining properties are returned in the extended properties. They are + * assumed to be defined in a subtype. + */ + assetProperties.setTypeName(bean.getElementHeader().getType().getTypeName()); + assetProperties.setExtendedProperties(this.getRemainingExtendedProperties(instanceProperties)); + + + bean.setProperties(assetProperties); + } + 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 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 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/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 new file mode 100644 index 00000000000..35f6348a3db --- /dev/null +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/ElementStubConverter.java @@ -0,0 +1,150 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.itinfrastructure.converters; + + +import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.ElementStub; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityProxy; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper; + +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.List; + + +/** + * ElementStubConverter provides common methods for transferring relevant properties from an Open Metadata Repository Services (OMRS) + * EntityProxy object into an ElementStub bean. + */ +public class ElementStubConverter extends ITInfrastructureOMASConverter +{ + /** + * Constructor + * + * @param repositoryHelper helper object to parse entity + * @param serviceName name of this component + * @param serverName local server name + */ + public ElementStubConverter(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 have + * contain a combination of the properties from an entityProxy and that of a connected relationship. + * + * @param beanClass name of the class to create + * @param entityProxy entityProxy 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 + */ + @SuppressWarnings(value = "unchecked") + private B getNewBean(Class beanClass, + EntityProxy entityProxy, + 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 ElementStub) + { + returnBean = (B)super.getElementStub(beanClass, entityProxy, methodName); + + return returnBean; + } + + return null; + } + 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 have + * contain a combination of the properties from an relationship and that of a connected relationship. + * + * @param beanClass name of the class to create + * @param relationship relationship containing the properties + * @param useEnd1 should the + * @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, + Relationship relationship, + boolean useEnd1, + String methodName) throws PropertyServerException + { + if (relationship != null) + { + if (useEnd1) + { + return getNewBean(beanClass, relationship.getEntityOneProxy(), methodName); + } + else + { + return getNewBean(beanClass, relationship.getEntityTwoProxy(), methodName); + } + } + + return null; + } + + + /** + * Using the supplied instances, return list of new instances of the bean. + * + * @param beanClass name of the class to create + * @param relationships list of relationships containing the properties + * @param useEnd1 should the + * @param methodName calling method + * @return bean populated with properties from the instances supplied + * @throws PropertyServerException there is a problem instantiating the bean + */ + public List getNewBeans(Class beanClass, + List relationships, + boolean useEnd1, + String methodName) throws PropertyServerException + { + if (relationships != null) + { + List beans = new ArrayList<>(); + + for (Relationship relationship : relationships) + { + if (relationship != null) + { + B bean = getNewBean(beanClass, relationship, useEnd1, methodName); + + if (bean != null) + { + beans.add(bean); + } + } + } + + if (! beans.isEmpty()) + { + return beans; + } + } + + return null; + } +} diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/ITInfrastructureInstanceHandler.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/ITInfrastructureInstanceHandler.java index 7cc3b1ad340..94231640f30 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/ITInfrastructureInstanceHandler.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/ITInfrastructureInstanceHandler.java @@ -2,6 +2,7 @@ /* Copyright Contributors to the ODPi Egeria project. */ package org.odpi.openmetadata.accessservices.itinfrastructure.server; +import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.AssetElement; import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.ConnectionElement; import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.ConnectorTypeElement; import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.ContactMethodElement; @@ -11,6 +12,7 @@ import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.UserIdentityElement; import org.odpi.openmetadata.adminservices.configuration.registration.AccessServiceDescription; import org.odpi.openmetadata.commonservices.generichandlers.ActorProfileHandler; +import org.odpi.openmetadata.commonservices.generichandlers.AssetHandler; import org.odpi.openmetadata.commonservices.generichandlers.ConnectionHandler; import org.odpi.openmetadata.commonservices.generichandlers.ConnectorTypeHandler; import org.odpi.openmetadata.commonservices.generichandlers.ContactDetailsHandler; @@ -260,4 +262,37 @@ ContactDetailsHandler getContactDetailsHandler(String user 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 + */ + AssetHandler getAssetHandler(String userId, + String serverName, + String serviceOperationName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + + ITInfrastructureServicesInstance instance = (ITInfrastructureServicesInstance) super.getServerServiceInstance(userId, + serverName, + serviceOperationName); + + if (instance != null) + { + return instance.getAssetHandler(); + } + + return null; + } } diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/ITInfrastructureRESTServices.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/ITInfrastructureRESTServices.java index 1c7d3c5c24b..6089d7142d4 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/ITInfrastructureRESTServices.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/ITInfrastructureRESTServices.java @@ -3,43 +3,49 @@ package org.odpi.openmetadata.accessservices.itinfrastructure.server; +import org.odpi.openmetadata.accessservices.itinfrastructure.converters.ElementStubConverter; +import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.AssetElement; import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.ConnectionElement; import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.ConnectorTypeElement; +import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.ElementStub; import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.EndpointElement; +import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.ServerAssetUseElement; +import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.SoftwareServerCapabilityElement; import org.odpi.openmetadata.accessservices.itinfrastructure.properties.ConnectionProperties; import org.odpi.openmetadata.accessservices.itinfrastructure.properties.ConnectorTypeProperties; import org.odpi.openmetadata.accessservices.itinfrastructure.properties.EndpointProperties; -import org.odpi.openmetadata.accessservices.itinfrastructure.rest.AssetConnectionRequestBody; -import org.odpi.openmetadata.accessservices.itinfrastructure.rest.ConnectionRequestBody; -import org.odpi.openmetadata.accessservices.itinfrastructure.rest.ConnectionResponse; -import org.odpi.openmetadata.accessservices.itinfrastructure.rest.ConnectionsResponse; -import org.odpi.openmetadata.accessservices.itinfrastructure.rest.ConnectorTypeRequestBody; -import org.odpi.openmetadata.accessservices.itinfrastructure.rest.ConnectorTypeResponse; -import org.odpi.openmetadata.accessservices.itinfrastructure.rest.ConnectorTypesResponse; -import org.odpi.openmetadata.accessservices.itinfrastructure.rest.EmbeddedConnectionRequestBody; -import org.odpi.openmetadata.accessservices.itinfrastructure.rest.EndpointRequestBody; -import org.odpi.openmetadata.accessservices.itinfrastructure.rest.EndpointResponse; -import org.odpi.openmetadata.accessservices.itinfrastructure.rest.EndpointsResponse; -import org.odpi.openmetadata.accessservices.itinfrastructure.rest.MetadataSourceRequestBody; -import org.odpi.openmetadata.accessservices.itinfrastructure.rest.TemplateRequestBody; +import org.odpi.openmetadata.accessservices.itinfrastructure.properties.ServerAssetUseProperties; +import org.odpi.openmetadata.accessservices.itinfrastructure.properties.ServerAssetUseType; +import org.odpi.openmetadata.accessservices.itinfrastructure.properties.SoftwareServerCapabilityProperties; +import org.odpi.openmetadata.accessservices.itinfrastructure.rest.*; 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.EffectiveTimeRequestBody; 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.AssetHandler; import org.odpi.openmetadata.commonservices.generichandlers.ConnectionHandler; import org.odpi.openmetadata.commonservices.generichandlers.ConnectorTypeHandler; import org.odpi.openmetadata.commonservices.generichandlers.EndpointHandler; import org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIMapper; +import org.odpi.openmetadata.commonservices.generichandlers.SoftwareServerCapabilityHandler; 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.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 org.odpi.openmetadata.repositoryservices.ffdc.exception.TypeErrorException; import org.slf4j.LoggerFactory; + +import java.util.ArrayList; import java.util.Date; +import java.util.Iterator; import java.util.List; @@ -57,6 +63,7 @@ public class ITInfrastructureRESTServices private RESTExceptionHandler restExceptionHandler = new RESTExceptionHandler(); + /** * Default constructor */ @@ -1541,8 +1548,6 @@ public GUIDResponse createEndpoint(String serverName, if (endpointGUID != null) { handler.setVendorProperties(userId, endpointGUID, requestBody.getVendorProperties(), methodName); - - } if (infrastructureGUID != null) @@ -1845,7 +1850,8 @@ public EndpointsResponse findEndpoints(String serverName, pageSize, new Date(), methodName); - response.setElementList(endpoints); + + response.setElementList(setUpVendorProperties(userId, endpoints, handler, methodName)); } } catch (Exception error) @@ -1902,7 +1908,7 @@ public EndpointsResponse getEndpointsByName(String serverName, pageSize, new Date(), methodName); - response.setElementList(endpoints); + response.setElementList(setUpVendorProperties(userId, endpoints, handler, methodName)); } } catch (Exception error) @@ -2179,4 +2185,1338 @@ private ConnectorTypeElement setUpVendorProperties(String return element; } + + + + /* ===================================================================================================================== + * The software server capability links assets to the hosting server. + */ + + + /** + * Create a new metadata element to represent a software server capability. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param infrastructureManagerIsHome should the software server capability be marked as owned by the infrastructure manager so others can not update? + * @param requestBody 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 createSoftwareServerCapability(String serverName, + String userId, + boolean infrastructureManagerIsHome, + SoftwareServerCapabilityRequestBody requestBody) + { + final String methodName = "createSoftwareServerCapability"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + GUIDResponse response = new GUIDResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + SoftwareServerCapabilityHandler handler = instanceHandler.getSoftwareServerCapabilityHandler(userId, serverName, methodName); + + if (requestBody != null) + { + String capabilityGUID; + + if (infrastructureManagerIsHome) + { + capabilityGUID = handler.createSoftwareServerCapability(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + requestBody.getTypeName(), + requestBody.getClassificationName(), + requestBody.getQualifiedName(), + requestBody.getDisplayName(), + requestBody.getDescription(), + requestBody.getTypeDescription(), + requestBody.getVersion(), + requestBody.getPatchLevel(), + requestBody.getSource(), + requestBody.getAdditionalProperties(), + requestBody.getExtendedProperties(), + requestBody.getVendorProperties(), + requestBody.getEffectiveFrom(), + requestBody.getEffectiveTo(), + methodName); + } + else + { + capabilityGUID = handler.createSoftwareServerCapability(userId, + null, + null, + requestBody.getTypeName(), + requestBody.getClassificationName(), + requestBody.getQualifiedName(), + requestBody.getDisplayName(), + requestBody.getDescription(), + requestBody.getTypeDescription(), + requestBody.getVersion(), + requestBody.getPatchLevel(), + requestBody.getSource(), + requestBody.getAdditionalProperties(), + requestBody.getExtendedProperties(), + requestBody.getVendorProperties(), + requestBody.getEffectiveFrom(), + requestBody.getEffectiveTo(), + methodName); + } + + response.setGUID(capabilityGUID); + } + 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 software server capability using an existing metadata element as a template. + * + * @param serverName name of the service to route the request to. + * + * @param userId calling user + * @param infrastructureManagerIsHome should the software server capability be marked as owned by the infrastructure manager so others can not update? + * @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 + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public GUIDResponse createSoftwareServerCapabilityFromTemplate(String serverName, + String userId, + String templateGUID, + boolean infrastructureManagerIsHome, + TemplateRequestBody requestBody) + { + final String methodName = "createSoftwareServerCapabilityFromTemplate"; + final String templateGUIDParameterName = "templateGUID"; + final String qualifiedNameParameterName = "qualifiedName"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + GUIDResponse response = new GUIDResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + SoftwareServerCapabilityHandler handler = instanceHandler.getSoftwareServerCapabilityHandler(userId, serverName, methodName); + + if (requestBody != null) + { + String capabilityGUID; + + if (infrastructureManagerIsHome) + { + capabilityGUID = handler.createSoftwareServerCapabilityFromTemplate(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + templateGUID, + templateGUIDParameterName, + requestBody.getQualifiedName(), + qualifiedNameParameterName, + requestBody.getDisplayName(), + requestBody.getDescription(), + methodName); + } + else + { + capabilityGUID = handler.createSoftwareServerCapabilityFromTemplate(userId, + null, + null, + templateGUID, + templateGUIDParameterName, + requestBody.getQualifiedName(), + qualifiedNameParameterName, + requestBody.getDisplayName(), + requestBody.getDescription(), + methodName); + } + + response.setGUID(capabilityGUID); + } + 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 software server capability. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param capabilityGUID unique identifier of the metadata element to update + * @param isMergeUpdate are unspecified properties unchanged (true) or removed? + * @param requestBody 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 updateSoftwareServerCapability(String serverName, + String userId, + String capabilityGUID, + boolean isMergeUpdate, + SoftwareServerCapabilityRequestBody requestBody) + { + final String methodName = "updateSoftwareServerCapability"; + final String elementGUIDParameterName = "capabilityGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + SoftwareServerCapabilityHandler handler = instanceHandler.getSoftwareServerCapabilityHandler(userId, serverName, methodName); + + if (requestBody != null) + { + handler.updateSoftwareServerCapability(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + capabilityGUID, + elementGUIDParameterName, + requestBody.getQualifiedName(), + requestBody.getDisplayName(), + requestBody.getDescription(), + requestBody.getTypeDescription(), + requestBody.getVersion(), + requestBody.getPatchLevel(), + requestBody.getSource(), + requestBody.getAdditionalProperties(), + requestBody.getExtendedProperties(), + requestBody.getVendorProperties(), + isMergeUpdate, + requestBody.getEffectiveFrom(), + requestBody.getEffectiveTo(), + methodName); + + if ((!isMergeUpdate) || (requestBody.getVendorProperties() != null)) + { + handler.setVendorProperties(userId, + capabilityGUID, + requestBody.getVendorProperties(), + 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 software server capability. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param capabilityGUID unique identifier of the metadata element to remove + * @param requestBody unique identifier of software server capability representing the caller + * + * @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 removeSoftwareServerCapability(String serverName, + String userId, + String capabilityGUID, + MetadataSourceRequestBody requestBody) + { + final String methodName = "removeSoftwareServerCapability"; + final String elementGUIDParameterName = "capabilityGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + SoftwareServerCapabilityHandler handler = instanceHandler.getSoftwareServerCapabilityHandler(userId, serverName, methodName); + + if (requestBody != null) + { + handler.deleteBeanInRepository(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + capabilityGUID, + elementGUIDParameterName, + OpenMetadataAPIMapper.SOFTWARE_SERVER_CAPABILITY_TYPE_GUID, + OpenMetadataAPIMapper.SOFTWARE_SERVER_CAPABILITY_TYPE_NAME, + null, + null, + false, + false, + null, + 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 software server capability 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 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 SoftwareServerCapabilityListResponse findSoftwareServerCapabilities(String serverName, + String userId, + int startFrom, + int pageSize, + SearchStringRequestBody requestBody) + { + final String methodName = "findSoftwareServerCapabilities"; + final String searchStringParameterName = "searchString"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + SoftwareServerCapabilityListResponse response = new SoftwareServerCapabilityListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + if (requestBody != null) + { + SoftwareServerCapabilityHandler handler = instanceHandler.getSoftwareServerCapabilityHandler(userId, serverName, methodName); + + List capabilities = handler.findBeans(userId, + requestBody.getSearchString(), + searchStringParameterName, + OpenMetadataAPIMapper.SOFTWARE_SERVER_CAPABILITY_TYPE_GUID, + OpenMetadataAPIMapper.SOFTWARE_SERVER_CAPABILITY_TYPE_NAME, + null, + startFrom, + pageSize, + new Date(), + methodName); + + response.setElementList(setUpVendorProperties(userId, capabilities, handler, methodName)); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Retrieve the list of software server capability 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 + * @param requestBody values 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 SoftwareServerCapabilityListResponse getSoftwareServerCapabilitiesByName(String serverName, + String userId, + int startFrom, + int pageSize, + NameRequestBody requestBody) + { + final String methodName = "getSoftwareServerCapabilitiesByName"; + final String nameParameterName = "name"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + SoftwareServerCapabilityListResponse response = new SoftwareServerCapabilityListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + if (requestBody != null) + { + SoftwareServerCapabilityHandler handler = instanceHandler.getSoftwareServerCapabilityHandler(userId, serverName, methodName); + + List specificMatchPropertyNames = new ArrayList<>(); + specificMatchPropertyNames.add(OpenMetadataAPIMapper.QUALIFIED_NAME_PROPERTY_NAME); + specificMatchPropertyNames.add(OpenMetadataAPIMapper.NAME_PROPERTY_NAME); + specificMatchPropertyNames.add(OpenMetadataAPIMapper.DEPLOYED_IMPLEMENTATION_TYPE_PROPERTY_NAME); + + List capabilities = handler.getBeansByValue(userId, + requestBody.getName(), + nameParameterName, + OpenMetadataAPIMapper.SOFTWARE_SERVER_CAPABILITY_TYPE_GUID, + OpenMetadataAPIMapper.SOFTWARE_SERVER_CAPABILITY_TYPE_NAME, + specificMatchPropertyNames, + true, + null, + null, + false, + false, + null, + startFrom, + pageSize, + new Date(), + methodName); + + response.setElementList(setUpVendorProperties(userId, capabilities, handler, methodName)); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Retrieve the software server capability 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 + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public SoftwareServerCapabilityResponse getSoftwareServerCapabilityByGUID(String serverName, + String userId, + String guid) + { + final String methodName = "getSoftwareServerCapabilityByGUID"; + final String guidParameterName = "guid"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + SoftwareServerCapabilityResponse response = new SoftwareServerCapabilityResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + SoftwareServerCapabilityHandler handler = instanceHandler.getSoftwareServerCapabilityHandler(userId, serverName, methodName); + + SoftwareServerCapabilityElement capability = handler.getBeanFromRepository(userId, + guid, + guidParameterName, + OpenMetadataAPIMapper.SOFTWARE_SERVER_CAPABILITY_TYPE_NAME, + false, + false, + new Date(), + methodName); + + response.setElement(setUpVendorProperties(userId, capability, 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, + SoftwareServerCapabilityHandler handler, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + if (retrievedResults != null) + { + for (SoftwareServerCapabilityElement 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 SoftwareServerCapabilityElement setUpVendorProperties(String userId, + SoftwareServerCapabilityElement element, + SoftwareServerCapabilityHandler handler, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String elementGUIDParameterName = "element.getElementHeader().getGUID()"; + + if (element != null) + { + SoftwareServerCapabilityProperties properties = element.getProperties(); + + properties.setVendorProperties(handler.getVendorProperties(userId, + element.getElementHeader().getGUID(), + elementGUIDParameterName, + methodName)); + } + + return element; + } + + + /* + * A software server capability works with assets + */ + + /** + * Create a new metadata relationship to represent the use of an asset by a software server capability. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param infrastructureManagerIsHome should the software server capability be marked as owned by the infrastructure manager so others can not update? + * @param capabilityGUID unique identifier of a software server capability + * @param assetGUID unique identifier of an asset + * @param requestBody properties about the ServerAssetUse relationship + * + * @return unique identifier of the new ServerAssetUse relationship 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 createServerAssetUse(String serverName, + String userId, + String capabilityGUID, + String assetGUID, + boolean infrastructureManagerIsHome, + ServerAssetUseRequestBody requestBody) + { + final String methodName = "createServerAssetUse"; + final String capabilityGUIDParameterName = "capabilityGUID"; + final String assetGUIDParameterName = "assetGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + GUIDResponse response = new GUIDResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + SoftwareServerCapabilityHandler handler = instanceHandler.getSoftwareServerCapabilityHandler(userId, serverName, methodName); + + String guid; + + if (infrastructureManagerIsHome) + { + guid = handler.linkElementToElement(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + capabilityGUID, + capabilityGUIDParameterName, + OpenMetadataAPIMapper.SOFTWARE_SERVER_CAPABILITY_TYPE_NAME, + assetGUID, + assetGUIDParameterName, + OpenMetadataAPIMapper.ASSET_TYPE_NAME, + false, + false, + OpenMetadataAPIMapper.SERVER_ASSET_USE_TYPE_GUID, + OpenMetadataAPIMapper.SERVER_ASSET_USE_TYPE_NAME, + this.getServerAssetUseProperties(requestBody.getProperties(), + instanceHandler.getRepositoryHelper(userId, serverName, + methodName), + instanceHandler.getServiceName(), + methodName), + methodName); + } + else + { + guid = handler.linkElementToElement(userId, + null, + null, + capabilityGUID, + capabilityGUIDParameterName, + OpenMetadataAPIMapper.SOFTWARE_SERVER_CAPABILITY_TYPE_NAME, + assetGUID, + assetGUIDParameterName, + OpenMetadataAPIMapper.ASSET_TYPE_NAME, + false, + false, + OpenMetadataAPIMapper.SERVER_ASSET_USE_TYPE_GUID, + OpenMetadataAPIMapper.SERVER_ASSET_USE_TYPE_NAME, + this.getServerAssetUseProperties(requestBody.getProperties(), + instanceHandler.getRepositoryHelper(userId, serverName, + methodName), + instanceHandler.getServiceName(), + methodName), + methodName); + } + + response.setGUID(guid); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Set up the properties for the server asset use type relationship. + * + * @param properties properties from caller + * @param repositoryHelper repository helper + * @param serviceName this service name + * @param methodName calling method + * @return instance properties object + * @throws InvalidParameterException useType is invalid + */ + private InstanceProperties getServerAssetUseProperties(ServerAssetUseProperties properties, + OMRSRepositoryHelper repositoryHelper, + String serviceName, + String methodName) throws InvalidParameterException + { + InstanceProperties instanceProperties = null; + + if (properties != null) + { + instanceProperties = repositoryHelper.addStringPropertyToInstance(serviceName, + null, + OpenMetadataAPIMapper.DESCRIPTION_PROPERTY_NAME, + properties.getDescription(), + methodName); + + if (properties.getMaximumInstancesSet()) + { + instanceProperties = repositoryHelper.addIntPropertyToInstance(serviceName, + null, + OpenMetadataAPIMapper.MAXIMUM_INSTANCES_PROPERTY_NAME, + properties.getMaximumInstances(), + methodName); + } + + if (properties.getMinimumInstancesSet()) + { + instanceProperties = repositoryHelper.addIntPropertyToInstance(serviceName, + null, + OpenMetadataAPIMapper.MINIMUM_INSTANCES_PROPERTY_NAME, + properties.getMinimumInstances(), + methodName); + } + + if (properties.getUseType() != null) + { + try + { + instanceProperties = repositoryHelper.addEnumPropertyToInstance(serviceName, + instanceProperties, + OpenMetadataAPIMapper.USE_TYPE_PROPERTY_NAME, + OpenMetadataAPIMapper.SERVER_ASSET_USE_TYPE_TYPE_GUID, + OpenMetadataAPIMapper.SERVER_ASSET_USE_TYPE_TYPE_NAME, + properties.getUseType().getOpenTypeOrdinal(), + methodName); + } + catch (TypeErrorException error) + { + throw new InvalidParameterException(error, OpenMetadataAPIMapper.USE_TYPE_PROPERTY_NAME); + } + } + + if (instanceProperties != null) + { + instanceProperties.setEffectiveFromTime(properties.getEffectiveFrom()); + instanceProperties.setEffectiveToTime(properties.getEffectiveTo()); + } + } + + return instanceProperties; + } + + + /** + * Update the metadata relationship to represent the use of an asset by a software server capability. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param serverAssetUseGUID unique identifier of the relationship between a software server capability and an asset + * @param isMergeUpdate are unspecified properties unchanged (true) or removed? + * @param requestBody new properties for the ServerAssetUse relationship + * + * @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 updateServerAssetUse(String serverName, + String userId, + String serverAssetUseGUID, + boolean isMergeUpdate, + ServerAssetUseRequestBody requestBody) + { + final String methodName = "updateServerAssetUse"; + final String elementGUIDParameterName = "serverAssetUseGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + SoftwareServerCapabilityHandler handler = instanceHandler.getSoftwareServerCapabilityHandler(userId, serverName, methodName); + + handler.updateRelationshipProperties(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + serverAssetUseGUID, + elementGUIDParameterName, + OpenMetadataAPIMapper.SERVER_ASSET_USE_TYPE_NAME, + isMergeUpdate, + this.getServerAssetUseProperties(requestBody.getProperties(), + instanceHandler.getRepositoryHelper(userId, serverName, methodName), + instanceHandler.getServiceName(), + methodName), + methodName); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Remove the metadata relationship to represent the use of an asset by a software server capability. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param serverAssetUseGUID unique identifier of the relationship between a software server capability and an asset + * @param requestBody unique identifier of software server capability representing the caller + * + * @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 removeServerAssetUse(String serverName, + String userId, + String serverAssetUseGUID, + MetadataSourceRequestBody requestBody) + { + final String methodName = "removeServerAssetUse"; + final String elementGUIDParameterName = "serverAssetUseGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + SoftwareServerCapabilityHandler handler = instanceHandler.getSoftwareServerCapabilityHandler(userId, serverName, methodName); + + handler.deleteRelationship(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + serverAssetUseGUID, + elementGUIDParameterName, + OpenMetadataAPIMapper.SERVER_ASSET_USE_TYPE_NAME, + methodName); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + + /** + * Return the list of server asset use relationships associated with a software server capability. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param capabilityGUID unique identifier of the software server capability to query + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param requestBody values to search for. + * + * @return list of matching relationships 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 ServerAssetUseListResponse getServerAssetUsesForCapability(String serverName, + String userId, + String capabilityGUID, + int startFrom, + int pageSize, + UseTypeRequestBody requestBody) + { + final String methodName = "getServerAssetUsesForCapability"; + final String elementGUIDParameterName = "capabilityGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + ServerAssetUseListResponse response = new ServerAssetUseListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + SoftwareServerCapabilityHandler handler = instanceHandler.getSoftwareServerCapabilityHandler(userId, serverName, methodName); + AssetHandler assetHandler = instanceHandler.getAssetHandler(userId, serverName, methodName); + + List relationships = handler.getAttachmentLinks(userId, + capabilityGUID, + elementGUIDParameterName, + OpenMetadataAPIMapper.SOFTWARE_SERVER_CAPABILITY_TYPE_NAME, + OpenMetadataAPIMapper.SERVER_ASSET_USE_TYPE_GUID, + OpenMetadataAPIMapper.SERVER_ASSET_USE_TYPE_NAME, + OpenMetadataAPIMapper.ASSET_TYPE_NAME, + startFrom, + pageSize, + requestBody.getEffectiveTime(), + methodName); + + response.setElements(getServerAssetUseElements(userId, + relationships, + requestBody.getUseType(), + assetHandler, + handler.getRepositoryHelper(), + handler.getServiceName(), + serverName, + methodName)); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Return the list of software server capabilities that make use of a specific asset. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param assetGUID unique identifier of the asset to query + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param requestBody values to search for + * + * @return list of matching relationships 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 ServerAssetUseListResponse getCapabilityUsesForAsset(String serverName, + String userId, + String assetGUID, + int startFrom, + int pageSize, + UseTypeRequestBody requestBody) + { + final String methodName = "getCapabilityUsesForAsset"; + final String elementGUIDParameterName = "assetGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + ServerAssetUseListResponse response = new ServerAssetUseListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + SoftwareServerCapabilityHandler handler = instanceHandler.getSoftwareServerCapabilityHandler(userId, serverName, methodName); + AssetHandler assetHandler = instanceHandler.getAssetHandler(userId, serverName, methodName); + + List relationships = handler.getAttachmentLinks(userId, + assetGUID, + elementGUIDParameterName, + OpenMetadataAPIMapper.ASSET_TYPE_NAME, + OpenMetadataAPIMapper.SERVER_ASSET_USE_TYPE_GUID, + OpenMetadataAPIMapper.SERVER_ASSET_USE_TYPE_NAME, + OpenMetadataAPIMapper.SOFTWARE_SERVER_CAPABILITY_TYPE_NAME, + startFrom, + pageSize, + requestBody.getEffectiveTime(), + methodName); + + response.setElements(getServerAssetUseElements(userId, + relationships, + requestBody.getUseType(), + assetHandler, + handler.getRepositoryHelper(), + handler.getServiceName(), + serverName, + methodName)); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Retrieve the list of relationships between a specific software server capability and a specific asset. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param capabilityGUID unique identifier of a software server capability + * @param assetGUID unique identifier of an asset + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param requestBody effective time for the query + * + * @return list of matching relationships 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 ServerAssetUseListResponse getServerAssetUsesForElements(String serverName, + String userId, + String capabilityGUID, + String assetGUID, + int startFrom, + int pageSize, + EffectiveTimeRequestBody requestBody) + { + final String methodName = "getServerAssetUsesForElements"; + final String capabilityGUIDParameterName = "capabilityGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + ServerAssetUseListResponse response = new ServerAssetUseListResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + SoftwareServerCapabilityHandler handler = instanceHandler.getSoftwareServerCapabilityHandler(userId, serverName, methodName); + AssetHandler assetHandler = instanceHandler.getAssetHandler(userId, serverName, methodName); + + List relationships = handler.getAttachmentLinks(userId, + capabilityGUID, + capabilityGUIDParameterName, + OpenMetadataAPIMapper.SOFTWARE_SERVER_CAPABILITY_TYPE_NAME, + OpenMetadataAPIMapper.SERVER_ASSET_USE_TYPE_GUID, + OpenMetadataAPIMapper.SERVER_ASSET_USE_TYPE_NAME, + assetGUID, + OpenMetadataAPIMapper.ASSET_TYPE_NAME, + startFrom, + pageSize, + requestBody.getEffectiveTime(), + methodName); + + response.setElements(getServerAssetUseElements(userId, + relationships, + null, + assetHandler, + handler.getRepositoryHelper(), + handler.getServiceName(), + serverName, + methodName)); + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Retrieve the server asset use type relationship 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 requested relationship 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 ServerAssetUseResponse getServerAssetUseByGUID(String serverName, + String userId, + String guid) + { + final String methodName = "getServerAssetUseByGUID"; + final String elementGUIDParameterName = "guid"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + ServerAssetUseResponse response = new ServerAssetUseResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + SoftwareServerCapabilityHandler handler = instanceHandler.getSoftwareServerCapabilityHandler(userId, serverName, methodName); + AssetHandler assetHandler = instanceHandler.getAssetHandler(userId, serverName, methodName); + + Relationship relationship = handler.getAttachmentLink(userId, + guid, + elementGUIDParameterName, + OpenMetadataAPIMapper.SERVER_ASSET_USE_TYPE_NAME, + null, + methodName); + + if (relationship != null) + { + response.setElement(getServerAssetUseElement(userId, + relationship, + null, + assetHandler, + handler.getRepositoryHelper(), + handler.getServiceName(), + serverName, + methodName)); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + + + /** + * Build the server asset use elements from the retrieved relationships. + * + * @param userId calling user + * @param relationships results from the repositories + * @param useType useType to match on + * @param assetHandler handler used to retrieve the asset element + * @param repositoryHelper repository helper + * @param serviceName name of this service + * @param serverName name of called server + * @param methodName calling method + * + * @return list of elements + * + * @throws InvalidParameterException one of the parameters is null or invalid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + private List getServerAssetUseElements(String userId, + List relationships, + ServerAssetUseType useType, + AssetHandler assetHandler, + OMRSRepositoryHelper repositoryHelper, + String serviceName, + String serverName, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + List results = new ArrayList<>(); + + if (relationships != null) + + { + for (Relationship relationship : relationships) + { + if (relationship != null) + { + ServerAssetUseElement result = getServerAssetUseElement(userId, relationship, useType, assetHandler, repositoryHelper, serviceName, serverName, methodName); + + if (result != null) + { + results.add(result); + } + } + } + } + + if (! results.isEmpty()) + { + return results; + } + + return null; + } + + + /** + * Build the server asset use element from the retrieved relationship. + * + * @param userId calling user + * @param relationship result from the repositories + * @param useType useType to match on + * @param assetHandler handler used to retrieve the asset element + * @param repositoryHelper repository helper + * @param serviceName name of this service + * @param serverName name of called server + * @param methodName calling method + * + * @return element + * + * @throws InvalidParameterException one of the parameters is null or invalid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + private ServerAssetUseElement getServerAssetUseElement(String userId, + Relationship relationship, + ServerAssetUseType useType, + AssetHandler assetHandler, + OMRSRepositoryHelper repositoryHelper, + String serviceName, + String serverName, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String assetGUIDParameterName = "relationship.entityTwoProxy.guid"; + + boolean matchingUseType = false; + int ordinal = 0; + + InstanceProperties instanceProperties = relationship.getProperties(); + + if (useType == null) + { + matchingUseType = true; + } + else + { + ordinal = repositoryHelper.removeEnumPropertyOrdinal(serviceName, + OpenMetadataAPIMapper.USE_TYPE_PROPERTY_NAME, + instanceProperties, + methodName); + if (useType.getOpenTypeOrdinal() == ordinal) + { + matchingUseType = true; + } + } + + if (matchingUseType) + { + ServerAssetUseElement element = new ServerAssetUseElement(); + + element.setAsset(assetHandler.getBeanFromRepository(userId, + relationship.getEntityTwoProxy().getGUID(), + assetGUIDParameterName, + OpenMetadataAPIMapper.ASSET_TYPE_NAME, + false, + false, + new Date(), + methodName)); + + ElementStubConverter converter = new ElementStubConverter<>(repositoryHelper, serviceName, serverName); + element.setCapabilityStub(converter.getElementStub(ElementStub.class, + relationship.getEntityOneProxy(), + methodName)); + + + if (instanceProperties != null) + { + ServerAssetUseProperties properties = new ServerAssetUseProperties(); + + + Iterator propertyNames = instanceProperties.getPropertyNames(); + if (propertyNames != null) + { + while (propertyNames.hasNext()) + { + String propertyName = propertyNames.next(); + + if (OpenMetadataAPIMapper.MAXIMUM_INSTANCES_PROPERTY_NAME.equals(propertyName)) + { + properties.setMaximumInstancesSet(true); + + properties.setMaximumInstances(repositoryHelper.getIntProperty(serviceName, + OpenMetadataAPIMapper.MAXIMUM_INSTANCES_PROPERTY_NAME, + relationship.getProperties(), + methodName)); + } + else if (OpenMetadataAPIMapper.MINIMUM_INSTANCES_PROPERTY_NAME.equals(propertyName)) + { + properties.setMinimumInstancesSet(true); + + properties.setMinimumInstances(repositoryHelper.getIntProperty(serviceName, + OpenMetadataAPIMapper.MAXIMUM_INSTANCES_PROPERTY_NAME, + relationship.getProperties(), + methodName)); + } + else if (OpenMetadataAPIMapper.DESCRIPTION_PROPERTY_NAME.equals(propertyName)) + { + properties.setDescription(repositoryHelper.getStringProperty(serviceName, + OpenMetadataAPIMapper.DESCRIPTION_PROPERTY_NAME, + relationship.getProperties(), + methodName)); + } + else if (OpenMetadataAPIMapper.USE_TYPE_PROPERTY_NAME.equals(propertyName)) + { + for (ServerAssetUseType useTypeValue : ServerAssetUseType.values()) + { + if (useTypeValue.getOpenTypeOrdinal() == ordinal) + { + properties.setUseType(useTypeValue); + } + } + } + } + } + + element.setServerAssetUse(properties); + } + + return element; + } + + return null; + } } \ No newline at end of file diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/ITInfrastructureServicesInstance.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/ITInfrastructureServicesInstance.java index 7e3eb25de30..0c0c55d6601 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/ITInfrastructureServicesInstance.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/ITInfrastructureServicesInstance.java @@ -2,6 +2,7 @@ /* Copyright Contributors to the ODPi Egeria project. */ package org.odpi.openmetadata.accessservices.itinfrastructure.server; +import org.odpi.openmetadata.accessservices.itinfrastructure.converters.AssetConverter; import org.odpi.openmetadata.accessservices.itinfrastructure.converters.ConnectionConverter; import org.odpi.openmetadata.accessservices.itinfrastructure.converters.ConnectorTypeConverter; import org.odpi.openmetadata.accessservices.itinfrastructure.converters.ContactMethodConverter; @@ -10,6 +11,7 @@ import org.odpi.openmetadata.accessservices.itinfrastructure.converters.SoftwareServerCapabilityConverter; import org.odpi.openmetadata.accessservices.itinfrastructure.converters.UserIdentityConverter; import org.odpi.openmetadata.accessservices.itinfrastructure.ffdc.ITInfrastructureErrorCode; +import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.AssetElement; import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.ConnectionElement; import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.ConnectorTypeElement; import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.ContactMethodElement; @@ -19,6 +21,7 @@ import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.UserIdentityElement; import org.odpi.openmetadata.adminservices.configuration.registration.AccessServiceDescription; import org.odpi.openmetadata.commonservices.generichandlers.ActorProfileHandler; +import org.odpi.openmetadata.commonservices.generichandlers.AssetHandler; import org.odpi.openmetadata.commonservices.generichandlers.ConnectionHandler; import org.odpi.openmetadata.commonservices.generichandlers.ConnectorTypeHandler; import org.odpi.openmetadata.commonservices.generichandlers.ContactDetailsHandler; @@ -48,6 +51,7 @@ public class ITInfrastructureServicesInstance extends OMASServiceInstance private UserIdentityHandler userIdentityHandler; private ContactDetailsHandler contactDetailsHandler; private SoftwareServerCapabilityHandler softwareServerCapabilityHandler; + private AssetHandler assetHandler; /** @@ -176,6 +180,20 @@ public ITInfrastructureServicesInstance(OMRSRepositoryConnector repositoryConnec defaultZones, publishZones, auditLog); + + this.assetHandler = new AssetHandler<>(new AssetConverter<>(repositoryHelper, serviceName, serverName), + AssetElement.class, + serviceName, + serverName, + invalidParameterHandler, + repositoryHandler, + repositoryHelper, + localServerUserId, + securityVerifier, + supportedZones, + defaultZones, + publishZones, + auditLog); } else { @@ -286,6 +304,23 @@ ContactDetailsHandler getContactDetailsHandler() throws Pr } + + /** + * Return the handler for managing asset objects. + * + * @return handler object + * @throws PropertyServerException the instance has not been initialized successfully + */ + AssetHandler getAssetHandler() throws PropertyServerException + { + final String methodName = "getAssetHandler"; + + validateActiveRepository(methodName); + + return assetHandler; + } + + /** * Return the handler for managing SoftwareServerCapabilities objects. * diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-spring/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/spring/ITInfrastructureResource.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-spring/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/spring/ITInfrastructureResource.java index a29f8b8c4d4..f7755ebcc08 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-spring/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/spring/ITInfrastructureResource.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-spring/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/spring/ITInfrastructureResource.java @@ -4,20 +4,9 @@ import io.swagger.v3.oas.annotations.ExternalDocumentation; import io.swagger.v3.oas.annotations.tags.Tag; -import org.odpi.openmetadata.accessservices.itinfrastructure.rest.AssetConnectionRequestBody; -import org.odpi.openmetadata.accessservices.itinfrastructure.rest.ConnectionRequestBody; -import org.odpi.openmetadata.accessservices.itinfrastructure.rest.ConnectionResponse; -import org.odpi.openmetadata.accessservices.itinfrastructure.rest.ConnectionsResponse; -import org.odpi.openmetadata.accessservices.itinfrastructure.rest.ConnectorTypeRequestBody; -import org.odpi.openmetadata.accessservices.itinfrastructure.rest.ConnectorTypeResponse; -import org.odpi.openmetadata.accessservices.itinfrastructure.rest.ConnectorTypesResponse; -import org.odpi.openmetadata.accessservices.itinfrastructure.rest.EmbeddedConnectionRequestBody; -import org.odpi.openmetadata.accessservices.itinfrastructure.rest.EndpointRequestBody; -import org.odpi.openmetadata.accessservices.itinfrastructure.rest.EndpointResponse; -import org.odpi.openmetadata.accessservices.itinfrastructure.rest.EndpointsResponse; -import org.odpi.openmetadata.accessservices.itinfrastructure.rest.MetadataSourceRequestBody; -import org.odpi.openmetadata.accessservices.itinfrastructure.rest.TemplateRequestBody; +import org.odpi.openmetadata.accessservices.itinfrastructure.rest.*; import org.odpi.openmetadata.accessservices.itinfrastructure.server.ITInfrastructureRESTServices; +import org.odpi.openmetadata.commonservices.ffdc.rest.EffectiveTimeRequestBody; import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDResponse; import org.odpi.openmetadata.commonservices.ffdc.rest.NameRequestBody; import org.odpi.openmetadata.commonservices.ffdc.rest.SearchStringRequestBody; @@ -839,4 +828,376 @@ public EndpointResponse getEndpointByGUID(@PathVariable String serverName, return restAPI.getEndpointByGUID(serverName, userId, guid); } + + + + /* ===================================================================================================================== + * The software server capability links assets to the hosting server. + */ + + + /** + * Create a new metadata element to represent a software server capability. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param infrastructureManagerIsHome should the software server capability be marked as owned by the infrastructure manager so others can not update? + * @param requestBody 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 = "/software-server-capabilities") + + public GUIDResponse createSoftwareServerCapability(@PathVariable String serverName, + @PathVariable String userId, + @RequestParam boolean infrastructureManagerIsHome, + @RequestBody SoftwareServerCapabilityRequestBody requestBody) + { + return restAPI.createSoftwareServerCapability(serverName, userId, infrastructureManagerIsHome, requestBody); + } + + + /** + * Create a new metadata element to represent a software server capability using an existing metadata element as a template. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param infrastructureManagerIsHome should the software server capability be marked as owned by the infrastructure manager so others can not update? + * @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 + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @PostMapping(path = "/software-server-capabilities/from-template/{templateGUID}") + + public GUIDResponse createSoftwareServerCapabilityFromTemplate(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String templateGUID, + @RequestParam boolean infrastructureManagerIsHome, + @RequestBody TemplateRequestBody requestBody) + { + return restAPI.createSoftwareServerCapabilityFromTemplate(serverName, userId, templateGUID, infrastructureManagerIsHome, requestBody); + } + + + /** + * Update the metadata element representing a software server capability. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param capabilityGUID unique identifier of the metadata element to update + * @param isMergeUpdate are unspecified properties unchanged (true) or removed? + * @param requestBody 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 = "/software-server-capabilities/{capabilityGUID}") + + public VoidResponse updateSoftwareServerCapability(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String capabilityGUID, + @RequestParam boolean isMergeUpdate, + @RequestBody SoftwareServerCapabilityRequestBody requestBody) + { + return restAPI.updateSoftwareServerCapability(serverName, userId, capabilityGUID, isMergeUpdate, requestBody); + } + + + /** + * Remove the metadata element representing a software server capability. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param capabilityGUID unique identifier of the metadata element to remove + * @param requestBody unique identifier of software server capability representing the caller + * + * @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 = "/software-server-capabilities/{capabilityGUID}/delete") + + public VoidResponse removeSoftwareServerCapability(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String capabilityGUID, + @RequestBody MetadataSourceRequestBody requestBody) + { + return restAPI.removeSoftwareServerCapability(serverName, userId, capabilityGUID, requestBody); + } + + + /** + * Retrieve the list of software server capability 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 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 = "/software-server-capabilities/by-search-string") + + public SoftwareServerCapabilityListResponse findSoftwareServerCapabilities(@PathVariable String serverName, + @PathVariable String userId, + @RequestParam int startFrom, + @RequestParam int pageSize, + @RequestBody SearchStringRequestBody requestBody) + { + return restAPI.findSoftwareServerCapabilities(serverName, userId, startFrom, pageSize, requestBody); + } + + + /** + * Retrieve the list of software server capability 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 + * @param requestBody values 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 = "/software-server-capabilities/by-name") + + public SoftwareServerCapabilityListResponse getSoftwareServerCapabilitiesByName(@PathVariable String serverName, + @PathVariable String userId, + @RequestParam int startFrom, + @RequestParam int pageSize, + @RequestBody NameRequestBody requestBody) + { + return restAPI.getSoftwareServerCapabilitiesByName(serverName, userId, startFrom, pageSize, requestBody); + } + + + /** + * Retrieve the software server capability 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 + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + @GetMapping(path = "/software-server-capabilities/{guid}") + + public SoftwareServerCapabilityResponse getSoftwareServerCapabilityByGUID(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String guid) + { + return restAPI.getSoftwareServerCapabilityByGUID(serverName, userId, guid); + } + + + /* + * A software server capability works with assets + */ + + /** + * Create a new metadata relationship to represent the use of an asset by a software server capability. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param infrastructureManagerIsHome should the software server capability be marked as owned by the infrastructure manager so others can not update? + * @param capabilityGUID unique identifier of a software server capability + * @param assetGUID unique identifier of an asset + * @param requestBody properties about the ServerAssetUse relationship + * + * @return unique identifier of the new ServerAssetUse relationship 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 = "/server-asset-uses/software-server-capabilities/{capabilityGUID}/assets/{assetGUID}") + + public GUIDResponse createServerAssetUse(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String capabilityGUID, + @PathVariable String assetGUID, + @RequestParam boolean infrastructureManagerIsHome, + @RequestBody ServerAssetUseRequestBody requestBody) + { + return restAPI.createServerAssetUse(serverName, userId, capabilityGUID, assetGUID, infrastructureManagerIsHome, requestBody); + } + + + /** + * Update the metadata relationship to represent the use of an asset by a software server capability. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param serverAssetUseGUID unique identifier of the relationship between a software server capability and an asset + * @param isMergeUpdate are unspecified properties unchanged (true) or removed? + * @param requestBody new properties for the ServerAssetUse relationship + * + * @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 = "/server-asset-uses/{serverAssetUseGUID}") + + public VoidResponse updateServerAssetUse(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String serverAssetUseGUID, + @RequestParam boolean isMergeUpdate, + @RequestBody ServerAssetUseRequestBody requestBody) + { + return restAPI.updateServerAssetUse(serverName, userId, serverAssetUseGUID, isMergeUpdate, requestBody); + } + + + /** + * Remove the metadata relationship to represent the use of an asset by a software server capability. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param serverAssetUseGUID unique identifier of the relationship between a software server capability and an asset + * @param requestBody unique identifier of software server capability representing the caller + * + * @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 = "/server-asset-uses/{serverAssetUseGUID}/delete") + + public VoidResponse removeServerAssetUse(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String serverAssetUseGUID, + @RequestBody MetadataSourceRequestBody requestBody) + { + return restAPI.removeServerAssetUse(serverName, userId, serverAssetUseGUID, requestBody); + } + + + /** + * Return the list of server asset use relationships associated with a software server capability. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param capabilityGUID unique identifier of the software server capability to query + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param requestBody values to search for. + * + * @return list of matching relationships 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 = "/server-asset-uses/software-server-capabilities/{capabilityGUID}") + + public ServerAssetUseListResponse getServerAssetUsesForCapability(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String capabilityGUID, + @RequestParam int startFrom, + @RequestParam int pageSize, + @RequestBody UseTypeRequestBody requestBody) + { + return restAPI.getServerAssetUsesForCapability(serverName, userId, capabilityGUID, startFrom, pageSize, requestBody); + } + + + /** + * Return the list of software server capabilities that make use of a specific asset. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param assetGUID unique identifier of the asset to query + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param requestBody values to search for + * + * @return list of matching relationships 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 = "/server-asset-uses/assets/{assetGUID}") + + public ServerAssetUseListResponse getCapabilityUsesForAsset(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String assetGUID, + @RequestParam int startFrom, + @RequestParam int pageSize, + @RequestBody UseTypeRequestBody requestBody) + { + return restAPI.getCapabilityUsesForAsset(serverName, userId, assetGUID, startFrom, pageSize, requestBody); + } + + + /** + * Retrieve the list of relationships between a specific software server capability and a specific asset. + * + * @param serverName name of the service to route the request to. + * @param userId calling user + * @param capabilityGUID unique identifier of a software server capability + * @param assetGUID unique identifier of an asset + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param requestBody effective time for the query + * + * @return list of matching relationships 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 = "/server-asset-uses/software-server-capabilities/{capabilityGUID}/assets/{assetGUID}/by-elements") + + public ServerAssetUseListResponse getServerAssetUsesForElements(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String capabilityGUID, + @PathVariable String assetGUID, + @RequestParam int startFrom, + @RequestParam int pageSize, + @RequestBody EffectiveTimeRequestBody requestBody) + { + return restAPI.getServerAssetUsesForElements(serverName, userId, capabilityGUID, assetGUID, startFrom, pageSize, requestBody); + } + + + /** + * Retrieve the server asset use type relationship 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 requested relationship 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 = "/server-asset-uses/{guid}") + + public ServerAssetUseResponse getServerAssetUseByGUID(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String guid) + { + return restAPI.getServerAssetUseByGUID(serverName, userId, guid); + } } diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-spring/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/spring/ITProfileResource.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-spring/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/spring/ITProfileResource.java index 4d759f18243..fd3e80ae692 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-spring/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/spring/ITProfileResource.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-spring/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/spring/ITProfileResource.java @@ -8,8 +8,6 @@ import org.odpi.openmetadata.accessservices.itinfrastructure.rest.ITProfileRequestBody; import org.odpi.openmetadata.accessservices.itinfrastructure.rest.ITProfileResponse; import org.odpi.openmetadata.accessservices.itinfrastructure.rest.ContactMethodRequestBody; -import org.odpi.openmetadata.accessservices.itinfrastructure.rest.EffectiveDatesRequestBody; -import org.odpi.openmetadata.accessservices.itinfrastructure.rest.EffectiveTimeRequestBody; import org.odpi.openmetadata.accessservices.itinfrastructure.rest.MetadataSourceRequestBody; import org.odpi.openmetadata.accessservices.itinfrastructure.rest.UserIdentityListResponse; import org.odpi.openmetadata.accessservices.itinfrastructure.rest.UserIdentityRequestBody; @@ -29,7 +27,7 @@ /** * The ITProfileResource provides a Spring based server-side REST API - * that supports the ITProfileManagementInterface. It delegates each request to the + * that supports the ITProfileManagerInterface. It delegates each request to the * OrganizationRESTServices. This provides the server-side implementation of the IT Infrastructure Open Metadata * Assess Service (OMAS) which is used to manage information about IT profiles and their userIds. */ From 3576c09e4ec4a54ae2cb554e1340f79a3d81074a Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Mon, 13 Dec 2021 10:54:43 +0000 Subject: [PATCH 07/14] Use latest generic handler method Signed-off-by: Mandy Chessell --- .../securitymanager/server/SecurityManagerRESTServices.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 0274dad249c..8b9052f3403 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 @@ -154,7 +154,6 @@ public GUIDResponse createSecurityManagerInCatalog(String response.setGUID(handler.createSoftwareServerCapability(userId, requestBody.getExternalSourceGUID(), requestBody.getExternalSourceName(), - null, requestBody.getTypeName(), null, requestBody.getQualifiedName(), @@ -165,6 +164,7 @@ public GUIDResponse createSecurityManagerInCatalog(String requestBody.getPatchLevel(), requestBody.getSource(), requestBody.getAdditionalProperties(), + requestBody.getExtendedProperties(), requestBody.getVendorProperties(), null, null, From 08eed0df622bd9bf555422dbe9036f82415e2a20 Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Mon, 13 Dec 2021 10:55:46 +0000 Subject: [PATCH 08/14] Support efectivity dates Signed-off-by: Mandy Chessell --- .../ffdc/OMAGCommonAuditCode.java | 2 +- .../ffdc/rest/EffectiveTimeRequestBody.java | 13 ++----- .../ffdc/rest/NameRequestBody.java | 37 ++++++++++++++++--- .../ffdc/rest/SearchStringRequestBody.java | 36 +++++++++++++++--- 4 files changed, 68 insertions(+), 20 deletions(-) diff --git a/open-metadata-implementation/common-services/ffdc-services/src/main/java/org/odpi/openmetadata/commonservices/ffdc/OMAGCommonAuditCode.java b/open-metadata-implementation/common-services/ffdc-services/src/main/java/org/odpi/openmetadata/commonservices/ffdc/OMAGCommonAuditCode.java index 3900b982c5d..790a7eee021 100644 --- a/open-metadata-implementation/common-services/ffdc-services/src/main/java/org/odpi/openmetadata/commonservices/ffdc/OMAGCommonAuditCode.java +++ b/open-metadata-implementation/common-services/ffdc-services/src/main/java/org/odpi/openmetadata/commonservices/ffdc/OMAGCommonAuditCode.java @@ -29,7 +29,7 @@ public enum OMAGCommonAuditCode implements AuditLogMessageSet "This is probably a logic error. Review the stack trace to identify where the error " + "occurred and work to resolve the cause."), CLIENT_SIDE_REST_API_ERROR( "OMAG-COMMON-0002", - OMRSAuditLogRecordSeverity.EXCEPTION, + OMRSAuditLogRecordSeverity.ERROR, "A client-side exception was received from API call {0} to OMAG Server {1} at {2}. The error message was {3}", "The server has issued a call to the open metadata access service REST API in a remote server and has received an exception from the local client libraries.", "Look for errors in the local server's console to understand and correct the source of the error.") diff --git a/open-metadata-implementation/common-services/ffdc-services/src/main/java/org/odpi/openmetadata/commonservices/ffdc/rest/EffectiveTimeRequestBody.java b/open-metadata-implementation/common-services/ffdc-services/src/main/java/org/odpi/openmetadata/commonservices/ffdc/rest/EffectiveTimeRequestBody.java index 25a6b40c9a0..521d26ea23a 100644 --- a/open-metadata-implementation/common-services/ffdc-services/src/main/java/org/odpi/openmetadata/commonservices/ffdc/rest/EffectiveTimeRequestBody.java +++ b/open-metadata-implementation/common-services/ffdc-services/src/main/java/org/odpi/openmetadata/commonservices/ffdc/rest/EffectiveTimeRequestBody.java @@ -1,11 +1,12 @@ /* SPDX-License-Identifier: Apache 2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.itinfrastructure.rest; +package org.odpi.openmetadata.commonservices.ffdc.rest; 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.Objects; @@ -18,7 +19,7 @@ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown=true) -public class EffectiveTimeRequestBody extends MetadataSourceRequestBody +public class EffectiveTimeRequestBody implements Serializable { private static final long serialVersionUID = 1L; @@ -81,8 +82,6 @@ public String toString() { return "EffectiveTimeRequestBody{" + "effectiveTime=" + effectiveTime + - ", externalSourceGUID='" + getExternalSourceGUID() + '\'' + - ", externalSourceName='" + getExternalSourceName() + '\'' + '}'; } @@ -104,10 +103,6 @@ public boolean equals(Object objectToCompare) { return false; } - if (! super.equals(objectToCompare)) - { - return false; - } EffectiveTimeRequestBody that = (EffectiveTimeRequestBody) objectToCompare; return Objects.equals(effectiveTime, that.effectiveTime); } @@ -121,6 +116,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), effectiveTime); + return Objects.hash(effectiveTime); } } \ No newline at end of file diff --git a/open-metadata-implementation/common-services/ffdc-services/src/main/java/org/odpi/openmetadata/commonservices/ffdc/rest/NameRequestBody.java b/open-metadata-implementation/common-services/ffdc-services/src/main/java/org/odpi/openmetadata/commonservices/ffdc/rest/NameRequestBody.java index 89dea62cc36..ff94bf57419 100644 --- a/open-metadata-implementation/common-services/ffdc-services/src/main/java/org/odpi/openmetadata/commonservices/ffdc/rest/NameRequestBody.java +++ b/open-metadata-implementation/common-services/ffdc-services/src/main/java/org/odpi/openmetadata/commonservices/ffdc/rest/NameRequestBody.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import java.io.Serializable; +import java.util.Date; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; @@ -24,6 +25,7 @@ public class NameRequestBody implements Serializable { private static final long serialVersionUID = 1L; + private Date effectiveTime = null; private String name = null; private String nameParameterName = null; private String namePropertyName = null; @@ -47,6 +49,7 @@ public NameRequestBody(NameRequestBody template) { if (template != null) { + effectiveTime = template.getEffectiveTime(); name = template.getName(); nameParameterName = template.getNameParameterName(); namePropertyName = template.getNamePropertyName(); @@ -54,6 +57,28 @@ public NameRequestBody(NameRequestBody template) } + /** + * Return the date/time to use for the query. + * + * @return date object + */ + public Date getEffectiveTime() + { + return effectiveTime; + } + + + /** + * Set up the date/time to use for the query. + * + * @param effectiveTime date object + */ + public void setEffectiveTime(Date effectiveTime) + { + this.effectiveTime = effectiveTime; + } + + /** * Return the name for the query request. * @@ -129,7 +154,8 @@ public void setNamePropertyName(String namePropertyName) public String toString() { return "NameRequestBody{" + - "name='" + name + '\'' + + "effectiveTime=" + effectiveTime + + ", name='" + name + '\'' + ", nameParameterName='" + nameParameterName + '\'' + ", namePropertyName='" + namePropertyName + '\'' + '}'; @@ -154,9 +180,10 @@ public boolean equals(Object objectToCompare) return false; } NameRequestBody that = (NameRequestBody) objectToCompare; - return Objects.equals(getName(), that.getName()) && - Objects.equals(getNameParameterName(), that.getNameParameterName()) && - Objects.equals(getNamePropertyName(), that.getNamePropertyName()); + return Objects.equals(effectiveTime, that.effectiveTime) && + Objects.equals(name, that.name) && + Objects.equals(nameParameterName, that.nameParameterName) && + Objects.equals(namePropertyName, that.namePropertyName); } @@ -168,6 +195,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(getName(), getNameParameterName(), getNamePropertyName()); + return Objects.hash(effectiveTime, name, nameParameterName, namePropertyName); } } diff --git a/open-metadata-implementation/common-services/ffdc-services/src/main/java/org/odpi/openmetadata/commonservices/ffdc/rest/SearchStringRequestBody.java b/open-metadata-implementation/common-services/ffdc-services/src/main/java/org/odpi/openmetadata/commonservices/ffdc/rest/SearchStringRequestBody.java index c438b7316ee..ff0164165f4 100644 --- a/open-metadata-implementation/common-services/ffdc-services/src/main/java/org/odpi/openmetadata/commonservices/ffdc/rest/SearchStringRequestBody.java +++ b/open-metadata-implementation/common-services/ffdc-services/src/main/java/org/odpi/openmetadata/commonservices/ffdc/rest/SearchStringRequestBody.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import java.io.Serializable; +import java.util.Date; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; @@ -24,6 +25,7 @@ public class SearchStringRequestBody implements Serializable { private static final long serialVersionUID = 1L; + private Date effectiveTime = null; private String searchString = null; private String searchStringParameterName = null; @@ -46,12 +48,35 @@ public SearchStringRequestBody(SearchStringRequestBody template) { if (template != null) { + effectiveTime = template.getEffectiveTime(); searchString = template.getSearchString(); searchStringParameterName = template.getSearchStringParameterName(); } } + /** + * Return the date/time to use for the query. + * + * @return date object + */ + public Date getEffectiveTime() + { + return effectiveTime; + } + + + /** + * Set up the date/time to use for the query. + * + * @param effectiveTime date object + */ + public void setEffectiveTime(Date effectiveTime) + { + this.effectiveTime = effectiveTime; + } + + /** * Return the search request. * @@ -105,7 +130,8 @@ public void setSearchStringParameterName(String searchStringParameterName) public String toString() { return "SearchStringRequestBody{" + - "searchString='" + searchString + '\'' + + "effectiveTime=" + effectiveTime + + ", searchString='" + searchString + '\'' + ", searchStringParameterName='" + searchStringParameterName + '\'' + '}'; } @@ -129,12 +155,12 @@ public boolean equals(Object objectToCompare) return false; } SearchStringRequestBody that = (SearchStringRequestBody) objectToCompare; - return Objects.equals(getSearchString(), that.getSearchString()) && - Objects.equals(getSearchStringParameterName(), that.getSearchStringParameterName()); + return Objects.equals(effectiveTime, that.effectiveTime) && + Objects.equals(searchString, that.searchString) && + Objects.equals(searchStringParameterName, that.searchStringParameterName); } - /** * Create a hash code for this element type. * @@ -143,6 +169,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(getSearchString(), getSearchStringParameterName()); + return Objects.hash(effectiveTime, searchString, searchStringParameterName); } } From b8bcafbaba2b5be7a7c838ce6741870446ee49b6 Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Mon, 13 Dec 2021 10:56:17 +0000 Subject: [PATCH 09/14] Allow all GAs to create incident reports Signed-off-by: Mandy Chessell --- .../governanceaction/GovernanceContext.java | 38 ++++++++++++++++++ .../WatchdogGovernanceContext.java | 40 +------------------ 2 files changed, 39 insertions(+), 39 deletions(-) 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 241034cf431..f14d900b814 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 @@ -123,6 +123,44 @@ public OpenMetadataStore getOpenMetadataStore() } + /** + * Create an incident report to capture the situation detected by this governance action service. + * This incident report will be processed by other governance activities. + * + * @param qualifiedName unique identifier to give this new incident report + * @param domainIdentifier governance domain associated with this action (0=ALL) + * @param background description of the situation + * @param impactedResources details of the resources impacted by this situation + * @param previousIncidents links to previous incident reports covering this situation + * @param incidentClassifiers initial classifiers for the incident report + * @param additionalProperties additional arbitrary properties for the incident reports + * + * @return unique identifier of the resulting incident report + * + * @throws InvalidParameterException null or non-unique qualified name for the incident report + * @throws UserNotAuthorizedException this governance action service is not authorized to create a incident report + * @throws PropertyServerException there is a problem with the metadata store + */ + public String createIncidentReport(String qualifiedName, + int domainIdentifier, + String background, + List impactedResources, + List previousIncidents, + Map incidentClassifiers, + Map additionalProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return openMetadataStore.createIncidentReport(qualifiedName, + domainIdentifier, + background, + impactedResources, + previousIncidents, + incidentClassifiers, + additionalProperties); + } + + /** * Update the status of a specific action target. By default, these values are derived from * the values for the governance action service. However, if the governance action service has to process name diff --git a/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/WatchdogGovernanceContext.java b/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/WatchdogGovernanceContext.java index 90723a51131..c07b31dd7d3 100644 --- a/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/WatchdogGovernanceContext.java +++ b/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/WatchdogGovernanceContext.java @@ -42,7 +42,7 @@ public WatchdogGovernanceContext(String userId, Map requestParameters, List requestSourceElements, List actionTargetElements, - OpenMetadataClient openMetadataStore) + OpenMetadataClient openMetadataStore) { super(userId, governanceActionGUID, requestType, requestParameters, requestSourceElements, actionTargetElements, openMetadataStore); } @@ -164,44 +164,6 @@ public String initiateGovernanceActionProcess(String processQuali } - /** - * Create an incident report to capture the situation detected by this governance action service. - * This incident report will be processed by other governance activities. - * - * @param qualifiedName unique identifier to give this new incident report - * @param domainIdentifier governance domain associated with this action (0=ALL) - * @param background description of the situation - * @param impactedResources details of the resources impacted by this situation - * @param previousIncidents links to previous incident reports covering this situation - * @param incidentClassifiers initial classifiers for the incident report - * @param additionalProperties additional arbitrary properties for the incident reports - * - * @return unique identifier of the resulting incident report - * - * @throws InvalidParameterException null or non-unique qualified name for the incident report - * @throws UserNotAuthorizedException this governance action service is not authorized to create a incident report - * @throws PropertyServerException there is a problem with the metadata store - */ - public String createIncidentReport(String qualifiedName, - int domainIdentifier, - String background, - List impactedResources, - List previousIncidents, - Map incidentClassifiers, - Map additionalProperties) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException - { - return openMetadataStore.createIncidentReport(qualifiedName, - domainIdentifier, - background, - impactedResources, - previousIncidents, - incidentClassifiers, - additionalProperties); - } - - /** * Standard toString method. * From 3b622bbb8123018f785acc30d23503f6cc44739c Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Mon, 13 Dec 2021 10:57:30 +0000 Subject: [PATCH 10/14] Recover from missing metadata server Signed-off-by: Mandy Chessell --- .../IntegrationDaemonServicesAuditCode.java | 16 +++++++ .../IntegrationConnectorStatus.java | 11 ++--- .../handlers/IntegrationConnectorHandler.java | 43 +++++++++++++++++-- .../server/IntegrationDaemonRESTServices.java | 2 +- 4 files changed, 62 insertions(+), 10 deletions(-) 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 941d2b46bf0..2b6efe2eae1 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 @@ -252,6 +252,22 @@ public enum IntegrationDaemonServicesAuditCode implements AuditLogMessageSet "shutdown after the integration daemon has completed, there should still be an orderly shutdown of " + "the connector."), + INITIALIZE_ERROR("INTEGRATION-DAEMON-SERVICES-0036", + OMRSAuditLogRecordSeverity.ERROR, + "The integration service {0} method {1} has returned with a {2} exception containing message {3} when attempting to connect to the associated metadata server", + "The server will change the integration connector's status to Initialize Failed. It will retry the call to the metadata server during each refresh() call until the metadata server is contacted.", + "Check the status of the associated metadata server - it may need restarting. Alternatively, the integration " + + "connector may be configured with the wrong metadata server, in which case the integration connector's " + + "configuration needs updating and the integration daemon will need restarting. " + + "If neither of these are the cause of the problem, use the message from the exception and knowledge of the open metadata landscape to " + + "track down and resolve the cause of the error and then restart the connector."), + + CONFIG_ERROR("INTEGRATION-DAEMON-SERVICES-0037", + OMRSAuditLogRecordSeverity.ERROR, + "The integration service {0} method {1} has returned with a {2} exception containing message {3} when attempting to create and initialize a connector", + "The server will change the integration connector's status to Configuration Failed. It will ignore the connector during each refresh() call until the connector is restarted with workable configuration.", + "Check the configuration of the connector."), + DAEMON_THREAD_STARTING("INTEGRATION-DAEMON-SERVICES-0040", OMRSAuditLogRecordSeverity.STARTUP, "The integration daemon thread for integration daemon {0} has started", diff --git a/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-api/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/properties/IntegrationConnectorStatus.java b/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-api/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/properties/IntegrationConnectorStatus.java index a55a576869d..7f872b1c9bb 100644 --- a/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-api/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/properties/IntegrationConnectorStatus.java +++ b/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-api/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/properties/IntegrationConnectorStatus.java @@ -19,11 +19,12 @@ @JsonIgnoreProperties(ignoreUnknown=true) public enum IntegrationConnectorStatus implements Serializable { - INITIALIZED (0, "Initialized", "The connector is set up and waiting to start."), - RUNNING (1, "Running", "The connector is running."), - STOPPED (2, "Stopped", "The connector has been stopped (as server is shutting down."), - INITIALIZE_FAILED (3, "Initialize Failed", "The integration daemon is not able to initialize the connector because the metadata server is not available."), - FAILED (99, "Failed", "The connector threw an exception and will not be called until it is restarted."), + INITIALIZED (0, "Initialized", "The connector is set up and waiting to start."), + RUNNING (1, "Running", "The connector is running."), + STOPPED (2, "Stopped", "The connector has been stopped (as server is shutting down."), + INITIALIZE_FAILED (3, "Initialize Failed", "The integration daemon is not able to initialize the connector because the metadata server is not available."), + CONFIG_FAILED (4, "Configuration Failed", "The integration daemon is not able to initialize the connector because the class name or related configuration is invalid."), + FAILED (99, "Connector Failed", "The connector threw an exception and will not be called until it is restarted."), ; private static final long serialVersionUID = 1L; diff --git a/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-server/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/handlers/IntegrationConnectorHandler.java b/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-server/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/handlers/IntegrationConnectorHandler.java index 027477f11dd..4de8d8d5d04 100644 --- a/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-server/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/handlers/IntegrationConnectorHandler.java +++ b/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-server/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/handlers/IntegrationConnectorHandler.java @@ -246,12 +246,11 @@ synchronized void reinitializeConnector(String actionDescription) connectorClassName, IntegrationConnector.class.getCanonicalName())); - processConnectorException(actionDescription, operationName, error); + processConfigException(actionDescription, operationName, error); } catch (Exception error) { - - processConnectorException(actionDescription, operationName, error); + processConfigException(actionDescription, operationName, error); } @@ -283,7 +282,7 @@ synchronized void reinitializeConnector(String actionDescription) } catch (Exception error) { - processConnectorException(actionDescription, operationName, error); + processConfigException(actionDescription, operationName, error); } } @@ -537,6 +536,42 @@ private void resetConnectorHandler() } + /** + * This private method ensures consistent logging of connector issues. + * + * @param actionDescription external caller's activity + * @param operationName connector operation that failed + * @param error resulting exception + */ + private void processConfigException(String actionDescription, + String operationName, + Exception error) + { + updateStatus(IntegrationConnectorStatus.CONFIG_FAILED); + failingExceptionMessage = error.getMessage(); + + if (error instanceof OCFCheckedExceptionBase) + { + auditLog.logMessage(actionDescription, + IntegrationDaemonServicesAuditCode.CONFIG_ERROR.getMessageDefinition(integrationConnectorName, + operationName, + error.getClass().getName(), + error.getMessage())); + } + else + { + auditLog.logException(actionDescription, + IntegrationDaemonServicesAuditCode.CONFIG_ERROR.getMessageDefinition(integrationConnectorName, + operationName, + error.getClass().getName(), + error.getMessage()), + error); + } + } + + + + /** * This private method ensures consistent logging of connector issues. * 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 7b040ba461b..7144d4c7b69 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 @@ -171,7 +171,7 @@ public VoidResponse refreshAllServices(String serverName, { if (handler != null) { - handler.refreshService(userId); + handler.refreshService(null); } } } From c7a2722172fa513574009b77a79e8dea03f47746 Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Mon, 13 Dec 2021 10:58:15 +0000 Subject: [PATCH 11/14] Tidy up message Signed-off-by: Mandy Chessell --- .../openmetadata/repositoryservices/ffdc/OMRSAuditCode.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 daa5dfb9aff..a4fd6f9d1e2 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 @@ -916,7 +916,7 @@ public enum OMRSAuditCode implements AuditLogMessageSet SKIPPING_METADATA_COLLECTION("OMRS-AUDIT-0401", OMRSAuditLogRecordSeverity.ACTION, - "Skipping call to repository {0} since it is not responding correctly. Error received was {1} with message {2}The local server does not have a local repository and so a update to the type called {0} with a unique identifier of {1} that applies to version number of {2} from {3} is just cached for information", + "Skipping call to repository {0} since it is not responding correctly. Error received was {1} with message {2}", "The local server is processing a federated query to all members of the connected cohorts. However one of the members is not responding correctly and so it has been skipped from the call. The remote server is probably not running, or has been incorrectly configured.", "Validate the availability and configuration of the remote server. It may be a temporary failure due to an outage in the network or the server itself. However, if the remote server is not configured correctly, or has changed its metadata collection id, then this wil lbe a permanent error and this server will not be included in the federated query until it is fixed."), From d4ef55526c3f8559502aa27142b56dba33816958 Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Mon, 13 Dec 2021 10:58:56 +0000 Subject: [PATCH 12/14] Extend the Person entity to support LDAP Signed-off-by: Mandy Chessell --- .../opentypes/OpenMetadataTypesArchive.java | 91 +++++++++++++++++++ .../OpenMetadataTypesArchive1_2.java | 1 + 2 files changed, 92 insertions(+) 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 7c2d9dfea7d..281ef8d49a5 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 @@ -9,11 +9,14 @@ import org.odpi.openmetadata.repositoryservices.connectors.stores.archivestore.properties.OpenMetadataArchiveType; 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.TypeDefPatch; import org.odpi.openmetadata.repositoryservices.ffdc.OMRSErrorCode; import org.odpi.openmetadata.repositoryservices.ffdc.exception.OMRSLogicErrorException; +import java.util.ArrayList; import java.util.Date; +import java.util.List; /** * OpenMetadataTypesArchive builds an open metadata archive containing all of the standard open metadata types. @@ -155,11 +158,99 @@ public void getOriginalTypes() /* * Calls for new and changed types go here */ + extend0112Person(); update0130Projects(); update0140Communities(); } + + /** + * Extend Person using the field definitions from LDAP + */ + private void extend0112Person() + { + this.archiveBuilder.addTypeDefPatch(updatePersonEntity()); + } + + private TypeDefPatch updatePersonEntity() + { + /* + * 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 = "title"; + final String attribute1Description = "The courtesy title for the person."; + final String attribute1DescriptionGUID = null; + final String attribute2Name = "givenNames"; + final String attribute2Description = "The name strings that are the part of a person's name that is not their surname."; + final String attribute2DescriptionGUID = null; + final String attribute3Name = "surname"; + final String attribute3Description = "The family name of the person."; + final String attribute3DescriptionGUID = null; + final String attribute4Name = "employeeNumber"; + final String attribute4Description = "The unique identifier of the person used by their employer."; + final String attribute4DescriptionGUID = null; + final String attribute5Name = "employeeType"; + final String attribute5Description = "Code used by employer typically to describe the type of employment contract."; + final String attribute5DescriptionGUID = null; + final String attribute6Name = "preferredLanguage"; + final String attribute6Description = "Spoken or written language preferred by the person."; + final String attribute6DescriptionGUID = null; + final String attribute7Name = "initials"; + final String attribute7Description = "First letter of each of the person's given names."; + final String attribute7DescriptionGUID = 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.getStringTypeDefAttribute(attribute5Name, + attribute5Description, + attribute5DescriptionGUID); + properties.add(property); + property = archiveHelper.getStringTypeDefAttribute(attribute6Name, + attribute6Description, + attribute6DescriptionGUID); + properties.add(property); + property = archiveHelper.getStringTypeDefAttribute(attribute7Name, + attribute7Description, + attribute7DescriptionGUID); + properties.add(property); + + typeDefPatch.setPropertyDefinitions(properties); + + return typeDefPatch; + } + + + /** * Changing end 2 from ProjectManager to PersonRole to allow any role to manage projects. */ 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 8c0d58b88b1..cd5fc0ab387 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 @@ -3203,6 +3203,7 @@ private EnumDef getServerAssetUseTypeEnum() element1Description, element1DescriptionGUID); elementDefs.add(elementDef); + enumDef.setDefaultValue(elementDef); final int element2Ordinal = 1; final String element2Value = "Governs"; From 84db492bbf796385e1669bf844abf594400d618e Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Mon, 13 Dec 2021 13:16:20 +0000 Subject: [PATCH 13/14] Set up useType Signed-off-by: Mandy Chessell --- .../server/ITInfrastructureRESTServices.java | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/ITInfrastructureRESTServices.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/ITInfrastructureRESTServices.java index 6089d7142d4..f267a82a79f 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/ITInfrastructureRESTServices.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/ITInfrastructureRESTServices.java @@ -3395,7 +3395,7 @@ private List getServerAssetUseElements(String * * @param userId calling user * @param relationship result from the repositories - * @param useType useType to match on + * @param requestedUseType useType to match on * @param assetHandler handler used to retrieve the asset element * @param repositoryHelper repository helper * @param serviceName name of this service @@ -3410,7 +3410,7 @@ private List getServerAssetUseElements(String */ private ServerAssetUseElement getServerAssetUseElement(String userId, Relationship relationship, - ServerAssetUseType useType, + ServerAssetUseType requestedUseType, AssetHandler assetHandler, OMRSRepositoryHelper repositoryHelper, String serviceName, @@ -3422,21 +3422,21 @@ private ServerAssetUseElement getServerAssetUseElement(String final String assetGUIDParameterName = "relationship.entityTwoProxy.guid"; boolean matchingUseType = false; - int ordinal = 0; InstanceProperties instanceProperties = relationship.getProperties(); - if (useType == null) + int propertyUseTypeOrdinal = repositoryHelper.removeEnumPropertyOrdinal(serviceName, + OpenMetadataAPIMapper.USE_TYPE_PROPERTY_NAME, + instanceProperties, + methodName); + + if (requestedUseType == null) { matchingUseType = true; } else { - ordinal = repositoryHelper.removeEnumPropertyOrdinal(serviceName, - OpenMetadataAPIMapper.USE_TYPE_PROPERTY_NAME, - instanceProperties, - methodName); - if (useType.getOpenTypeOrdinal() == ordinal) + if (requestedUseType.getOpenTypeOrdinal() == propertyUseTypeOrdinal) { matchingUseType = true; } @@ -3500,9 +3500,10 @@ else if (OpenMetadataAPIMapper.DESCRIPTION_PROPERTY_NAME.equals(propertyName)) } else if (OpenMetadataAPIMapper.USE_TYPE_PROPERTY_NAME.equals(propertyName)) { + for (ServerAssetUseType useTypeValue : ServerAssetUseType.values()) { - if (useTypeValue.getOpenTypeOrdinal() == ordinal) + if (useTypeValue.getOpenTypeOrdinal() == propertyUseTypeOrdinal) { properties.setUseType(useTypeValue); } From 6948e8551cb29924ba07cd5c320ad9801a5e4739 Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Mon, 13 Dec 2021 18:01:07 +0000 Subject: [PATCH 14/14] Add final to enaums Signed-off-by: Mandy Chessell --- .../elements/ElementOriginCategory.java | 6 +- .../events/AssetConsumerEventType.java | 6 +- .../ffdc/AssetConsumerAuditCode.java | 2 +- .../ffdc/AssetConsumerErrorCode.java | 2 +- .../assetconsumer/properties/CommentType.java | 8 +- .../assetconsumer/properties/OwnerType.java | 6 +- .../assetconsumer/properties/StarRating.java | 8 +- .../events/AssetManagerEventType.java | 6 +- .../ffdc/AssetManagerAuditCode.java | 2 +- .../ffdc/AssetManagerErrorCode.java | 2 +- .../ElementOriginCategory.java | 6 +- .../properties/DataItemSortOrder.java | 8 +- .../properties/GlossaryTermActivityType.java | 8 +- .../GlossaryTermRelationshipStatus.java | 8 +- .../properties/GlossaryTermStatus.java | 8 +- .../properties/GovernanceActionStatus.java | 6 +- .../GovernanceDefinitionStatus.java | 6 +- .../assetmanager/properties/KeyPattern.java | 8 +- .../assetmanager/properties/PortType.java | 8 +- .../properties/ProcessContainmentType.java | 8 +- .../properties/ProcessStatus.java | 8 +- .../properties/ServerAssetUseType.java | 8 +- .../properties/SynchronizationDirection.java | 8 +- .../events/AssetOwnerEventType.java | 6 +- .../assetowner/ffdc/AssetOwnerAuditCode.java | 2 +- .../assetowner/ffdc/AssetOwnerErrorCode.java | 2 +- .../ElementOriginCategory.java | 6 +- .../properties/DataItemSortOrder.java | 8 +- .../assetowner/properties/OwnerType.java | 6 +- .../CommunityProfileOutboundEventType.java | 6 +- .../ffdc/CommunityProfileAuditCode.java | 2 +- .../ffdc/CommunityProfileErrorCode.java | 2 +- .../ElementOriginCategory.java | 6 +- .../properties/CollectionOrder.java | 8 +- .../properties/CollectionStatus.java | 6 +- .../properties/CommentType.java | 8 +- .../properties/CommunityMembershipType.java | 6 +- .../properties/ContactMethodType.java | 8 +- .../GovernanceDefinitionStatus.java | 6 +- .../properties/StarRating.java | 8 +- .../properties/ToDoStatus.java | 8 +- .../properties/WatchStatus.java | 6 +- .../events/DataManagerOutboundEventType.java | 6 +- .../ffdc/DataManagerAuditCode.java | 2 +- .../ffdc/DataManagerErrorCode.java | 2 +- .../ElementOriginCategory.java | 6 +- .../properties/APIParameterListType.java | 8 +- .../properties/DataItemSortOrder.java | 8 +- .../datamanager/properties/KeyPattern.java | 8 +- .../events/DataPrivacyEventType.java | 6 +- .../ffdc/DataPrivacyAuditCode.java | 2 +- .../ffdc/DataPrivacyErrorCode.java | 2 +- .../DigitalServiceDependencyDirection.java | 6 +- .../DigitalServiceImplementationStyle.java | 6 +- .../DigitalServiceResponsibility.java | 6 +- .../properties/DigitalServiceStatus.java | 6 +- .../properties/DigitalServiceVisibility.java | 6 +- .../ffdc/DataScienceAuditCode.java | 2 +- .../ffdc/DataScienceErrorCode.java | 2 +- .../ffdc/DesignModelAuditCode.java | 2 +- .../ffdc/DesignModelErrorCode.java | 2 +- .../devops/ffdc/DevOpsAuditCode.java | 2 +- .../devops/ffdc/DevOpsErrorCode.java | 2 +- .../events/DigitalArchitectureEventType.java | 6 +- .../ffdc/DigitalArchitectureAuditCode.java | 2 +- .../ffdc/DigitalArchitectureErrorCode.java | 2 +- .../ElementOriginCategory.java | 6 +- .../events/DigitalServiceEventType.java | 6 +- .../ffdc/DigitalServiceAuditCode.java | 2 +- .../ffdc/DigitalServiceErrorCode.java | 2 +- .../DigitalServiceDependencyDirection.java | 7 +- .../DigitalServiceImplementationStyle.java | 6 +- .../DigitalServiceResponsibility.java | 6 +- .../properties/DigitalServiceStatus.java | 6 +- .../properties/DigitalServiceVisibility.java | 6 +- .../events/DiscoveryEngineEventType.java | 6 +- .../ffdc/DiscoveryEngineAuditCode.java | 2 +- .../ffdc/DiscoveryEngineErrorCode.java | 2 +- .../events/GovernanceEngineEventType.java | 6 +- .../ffdc/GovernanceEngineAuditCode.java | 2 +- .../ffdc/GovernanceEngineErrorCode.java | 2 +- .../properties/ProcessStatus.java | 8 +- .../ffdc/GovernanceProgramAuditCode.java | 2 +- .../ffdc/GovernanceProgramErrorCode.java | 2 +- .../ElementOriginCategory.java | 6 +- .../properties/ContactMethodType.java | 8 +- .../GovernanceDefinitionStatus.java | 6 +- .../properties/GovernanceDomain.java | 6 +- .../ffdc/ITInfrastructureAuditCode.java | 2 +- .../ffdc/ITInfrastructureErrorCode.java | 2 +- .../ElementOriginCategory.java | 6 +- .../metadataelements/HostElement.java | 2 +- .../properties/AssetProperties.java | 20 ++ .../properties/ByteOrdering.java | 8 +- .../properties/ContactMethodType.java | 6 +- .../properties/HostProperties.java | 36 ++++ .../ITInfrastructureProperties.java | 24 +++ .../properties/OperationalStatus.java | 8 +- .../properties/ServerAssetUseType.java | 8 +- .../SoftwareServerPlatformProperties.java | 100 ++++++++++ .../properties/SoftwareServerProperties.java | 99 ++++++++++ .../rest/AssetListResponse.java | 149 +++++++++++++++ .../rest/AssetRequestBody.java | 173 ++++++++++++++++++ .../itinfrastructure/rest/AssetResponse.java | 137 ++++++++++++++ .../client/HostManagerClient.java | 44 +++-- .../ffdc/ProjectManagementAuditCode.java | 2 +- .../ffdc/ProjectManagementErrorCode.java | 2 +- .../events/SecurityManagerEventType.java | 6 +- .../ffdc/SecurityManagerAuditCode.java | 2 +- .../ffdc/SecurityManagerErrorCode.java | 2 +- .../ElementOriginCategory.java | 6 +- .../properties/ContactMethodType.java | 8 +- .../GovernanceDefinitionStatus.java | 6 +- .../api/events/SecurityOfficerEventType.java | 9 +- .../api/ffdc/SecurityOfficerAuditCode.java | 5 +- .../api/ffdc/SecurityOfficerErrorCode.java | 5 +- .../ffdc/SoftwareDeveloperAuditCode.java | 2 +- .../ffdc/SoftwareDeveloperErrorCode.java | 2 +- .../ffdc/StewardshipActionAuditCode.java | 2 +- .../ffdc/StewardshipActionErrorCode.java | 2 +- .../ElementOriginCategory.java | 6 +- .../properties/DataItemSortOrder.java | 8 +- 122 files changed, 1053 insertions(+), 309 deletions(-) create mode 100644 open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/AssetListResponse.java create mode 100644 open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/AssetRequestBody.java create mode 100644 open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/AssetResponse.java diff --git a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/elements/ElementOriginCategory.java b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/elements/ElementOriginCategory.java index 991ec98f115..547a03439b7 100644 --- a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/elements/ElementOriginCategory.java +++ b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/elements/ElementOriginCategory.java @@ -38,9 +38,9 @@ public enum ElementOriginCategory implements Serializable private static final long serialVersionUID = 1L; - private int originCode; - private String originName; - private String originDescription; + private final int originCode; + private final String originName; + private final String originDescription; /** diff --git a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/events/AssetConsumerEventType.java b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/events/AssetConsumerEventType.java index d9561b03fef..26df99b8459 100644 --- a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/events/AssetConsumerEventType.java +++ b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/events/AssetConsumerEventType.java @@ -27,9 +27,9 @@ public enum AssetConsumerEventType implements Serializable private static final long serialVersionUID = 1L; - private int eventTypeCode; - private String eventTypeName; - private String eventTypeDescription; + private final int eventTypeCode; + private final String eventTypeName; + private final String eventTypeDescription; /** diff --git a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/ffdc/AssetConsumerAuditCode.java b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/ffdc/AssetConsumerAuditCode.java index 29139bf0dc5..88281baad75 100644 --- a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/ffdc/AssetConsumerAuditCode.java +++ b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/ffdc/AssetConsumerAuditCode.java @@ -69,7 +69,7 @@ public enum AssetConsumerAuditCode implements AuditLogMessageSet private static final long serialVersionUID = 1L; - private AuditLogMessageDefinition messageDefinition; + private final AuditLogMessageDefinition messageDefinition; /** 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 b12683a5a29..3b8658e857b 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 @@ -88,7 +88,7 @@ public enum AssetConsumerErrorCode implements ExceptionMessageSet private static final long serialVersionUID = 1L; - private ExceptionMessageDefinition messageDefinition; + private final ExceptionMessageDefinition messageDefinition; /** diff --git a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/properties/CommentType.java b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/properties/CommentType.java index 8e94e2b6f8b..fa0af0a2892 100644 --- a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/properties/CommentType.java +++ b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/properties/CommentType.java @@ -32,11 +32,11 @@ public enum CommentType implements Serializable public static final String ENUM_TYPE_GUID = "06d5032e-192a-4f77-ade1-a4b97926e867"; public static final String ENUM_TYPE_NAME = "CommentType"; - private int openTypeOrdinal; + private final int openTypeOrdinal; - 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/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/properties/OwnerType.java b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/properties/OwnerType.java index d0f4c8ae6e9..27d4f627434 100644 --- a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/properties/OwnerType.java +++ b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/properties/OwnerType.java @@ -35,9 +35,9 @@ public enum OwnerType implements Serializable private int openTypeOrdinal; - private int ordinal; - private String name; - private String description; + private final int ordinal; + private final String name; + private final String description; private static final long serialVersionUID = 1L; diff --git a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/properties/StarRating.java b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/properties/StarRating.java index f4496423eca..8dc40421182 100644 --- a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/properties/StarRating.java +++ b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/properties/StarRating.java @@ -30,11 +30,11 @@ public enum StarRating implements Serializable public static final String ENUM_TYPE_GUID = "77fea3ef-6ec1-4223-8408-38567e9d3c93"; public static final String ENUM_TYPE_NAME = "StarRating"; - private int openTypeOrdinal; + private final int openTypeOrdinal; - private int ordinal; - private String name; - private String description; + private final int ordinal; + private final String name; + private final String description; private static final long serialVersionUID = 1L; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/events/AssetManagerEventType.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/events/AssetManagerEventType.java index 8955633443d..99432f7e1c2 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/events/AssetManagerEventType.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/events/AssetManagerEventType.java @@ -35,9 +35,9 @@ public enum AssetManagerEventType implements Serializable private static final long serialVersionUID = 1L; - private int eventTypeCode; - private String eventTypeName; - private String eventTypeDescription; + private final int eventTypeCode; + private final String eventTypeName; + private final String eventTypeDescription; /** diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/ffdc/AssetManagerAuditCode.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/ffdc/AssetManagerAuditCode.java index d5c97d0569d..3a0eea896dd 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/ffdc/AssetManagerAuditCode.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/ffdc/AssetManagerAuditCode.java @@ -111,7 +111,7 @@ public enum AssetManagerAuditCode implements AuditLogMessageSet private static final long serialVersionUID = 1L; - private AuditLogMessageDefinition messageDefinition; + private final AuditLogMessageDefinition messageDefinition; /** diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/ffdc/AssetManagerErrorCode.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/ffdc/AssetManagerErrorCode.java index f51b01e5938..add966a8ee9 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/ffdc/AssetManagerErrorCode.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/ffdc/AssetManagerErrorCode.java @@ -72,7 +72,7 @@ public enum AssetManagerErrorCode implements ExceptionMessageSet private static final long serialVersionUID = 1L; - private ExceptionMessageDefinition messageDefinition; + private final ExceptionMessageDefinition messageDefinition; /** diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/metadataelements/ElementOriginCategory.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/metadataelements/ElementOriginCategory.java index 94b2c1cb9f1..89d8cd40b38 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/metadataelements/ElementOriginCategory.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/metadataelements/ElementOriginCategory.java @@ -38,9 +38,9 @@ public enum ElementOriginCategory implements Serializable private static final long serialVersionUID = 1L; - private int originCode; - private String originName; - private String originDescription; + private final int originCode; + private final String originName; + private final String originDescription; /** diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/DataItemSortOrder.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/DataItemSortOrder.java index bafd594d4b6..65356154920 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/DataItemSortOrder.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/DataItemSortOrder.java @@ -33,10 +33,10 @@ public enum DataItemSortOrder implements Serializable public static final String ENUM_TYPE_NAME = "DataItemSortOrder"; - private int ordinal; - private int openTypeOrdinal; - private String name; - private String description; + private final int ordinal; + private final int openTypeOrdinal; + private final String name; + private final String description; private static final long serialVersionUID = 1L; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryTermActivityType.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryTermActivityType.java index 3fce8557f43..cda5f775abe 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryTermActivityType.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryTermActivityType.java @@ -29,11 +29,11 @@ public enum GlossaryTermActivityType implements Serializable public static final String ENUM_TYPE_GUID = "af7e403d-9865-4ebb-8c1a-1fd57b4f4bca"; public static final String ENUM_TYPE_NAME = "ActivityType"; - private int openTypeOrdinal; + private final int openTypeOrdinal; - private int ordinal; - private String name; - private String description; + private final int ordinal; + private final String name; + private final String description; private static final long serialVersionUID = 1L; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryTermRelationshipStatus.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryTermRelationshipStatus.java index c13789f648b..5b6dd465af4 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryTermRelationshipStatus.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryTermRelationshipStatus.java @@ -28,11 +28,11 @@ public enum GlossaryTermRelationshipStatus implements Serializable public static final String ENUM_TYPE_GUID = "42282652-7d60-435e-ad3e-7cfe5291bcc7"; public static final String ENUM_TYPE_NAME = "TermRelationshipStatus"; - private int openTypeOrdinal; + private final int openTypeOrdinal; - private int ordinal; - private String name; - private String description; + private final int ordinal; + private final String name; + private final String description; private static final long serialVersionUID = 1L; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryTermStatus.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryTermStatus.java index 69831dd30d4..be9a7f55e99 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryTermStatus.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryTermStatus.java @@ -36,10 +36,10 @@ public enum GlossaryTermStatus implements Serializable ACTIVE (4,15, "Active", "The term is approved and in use."); - private int ordinal; - private int openTypeOrdinal; - private String name; - private String description; + private final int ordinal; + private final int openTypeOrdinal; + private final String name; + private final String description; private static final long serialVersionUID = 1L; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceActionStatus.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceActionStatus.java index f17fe8b06ff..0b26bd0470a 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceActionStatus.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceActionStatus.java @@ -35,9 +35,9 @@ public enum GovernanceActionStatus implements Serializable private static final String ENUM_TYPE_GUID = "a6e698b0-a4f7-4a39-8c80-db0bb0f972e"; private static final String ENUM_TYPE_NAME = "GovernanceActionStatus"; - private String statusName; - private String statusDescription; - private int statusCode; + private final String statusName; + private final String statusDescription; + private final int statusCode; private int openTypeOrdinal; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceDefinitionStatus.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceDefinitionStatus.java index a530554f405..a68473cb226 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceDefinitionStatus.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceDefinitionStatus.java @@ -36,9 +36,9 @@ public enum GovernanceDefinitionStatus 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/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/KeyPattern.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/KeyPattern.java index fff030e6906..c25a01baf58 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/KeyPattern.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/KeyPattern.java @@ -34,10 +34,10 @@ public enum KeyPattern implements Serializable public static final String ENUM_TYPE_NAME = "KeyPattern"; - private int ordinal; - private int openTypeOrdinal; - private String name; - private String description; + private final int ordinal; + private final int openTypeOrdinal; + private final String name; + private final String description; private static final long serialVersionUID = 1L; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/PortType.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/PortType.java index d86f1cb2323..3192525ecce 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/PortType.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/PortType.java @@ -37,10 +37,10 @@ public enum PortType implements Serializable public static final String ENUM_TYPE_GUID = "b57Fbce7-42ac-71D1-D6a6-9f62Cb7C6dc3"; public static final String ENUM_TYPE_NAME = "PortType"; - private int ordinal; - private int openTypeOrdinal; - private String name; - private String description; + private final int ordinal; + private final int openTypeOrdinal; + private final String name; + private final String description; /** diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ProcessContainmentType.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ProcessContainmentType.java index 7406512033f..8490f79e445 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ProcessContainmentType.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ProcessContainmentType.java @@ -35,10 +35,10 @@ public enum ProcessContainmentType implements Serializable public static final String ENUM_TYPE_GUID = "1bb4b908-7983-4802-a2b5-91b095552ee9"; public static final String ENUM_TYPE_NAME = "ProcessContainmentType"; - private int ordinal; - private int openTypeOrdinal; - private String name; - private String description; + private final int ordinal; + private final int openTypeOrdinal; + private final String name; + private final String description; /** diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ProcessStatus.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ProcessStatus.java index 3cbae0499f4..bf11a5c65b5 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ProcessStatus.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ProcessStatus.java @@ -35,10 +35,10 @@ public enum ProcessStatus implements Serializable ACTIVE (4,15, "Active", "The process is approved and in use."); - private int ordinal; - private int openTypeOrdinal; - private String name; - private String description; + private final int ordinal; + private final int openTypeOrdinal; + private final String name; + private final String description; private static final long serialVersionUID = 1L; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ServerAssetUseType.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ServerAssetUseType.java index 583acb96a1e..c5af386bdea 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ServerAssetUseType.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ServerAssetUseType.java @@ -37,10 +37,10 @@ public enum ServerAssetUseType implements Serializable public static final String ENUM_TYPE_GUID = "09439481-9489-467c-9ae5-178a6e0b6b5a"; public static final String ENUM_TYPE_NAME = "ServerAssetUseType"; - private int ordinal; - private int openTypeOrdinal; - private String name; - private String description; + private final int ordinal; + private final int openTypeOrdinal; + private final String name; + private final String description; /** diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SynchronizationDirection.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SynchronizationDirection.java index 075e449558e..37036dc1d97 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SynchronizationDirection.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SynchronizationDirection.java @@ -38,10 +38,10 @@ public enum SynchronizationDirection implements Serializable ; - private int ordinal; - private int openTypeOrdinal; - private String name; - private String description; + private final int ordinal; + private final int openTypeOrdinal; + private final String name; + private final String description; private static final long serialVersionUID = 1L; diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/events/AssetOwnerEventType.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/events/AssetOwnerEventType.java index ae13886deed..217e24c4243 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/events/AssetOwnerEventType.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/events/AssetOwnerEventType.java @@ -27,9 +27,9 @@ public enum AssetOwnerEventType implements Serializable private static final long serialVersionUID = 1L; - private int eventTypeCode; - private String eventTypeName; - private String eventTypeDescription; + private final int eventTypeCode; + private final String eventTypeName; + private final String eventTypeDescription; /** diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/ffdc/AssetOwnerAuditCode.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/ffdc/AssetOwnerAuditCode.java index 4790caf7f4f..572ac84d84a 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/ffdc/AssetOwnerAuditCode.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/ffdc/AssetOwnerAuditCode.java @@ -56,7 +56,7 @@ public enum AssetOwnerAuditCode implements AuditLogMessageSet private static final long serialVersionUID = 1L; - private AuditLogMessageDefinition messageDefinition; + private final AuditLogMessageDefinition messageDefinition; /** 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 cca0da1f28d..72f7f03b4fa 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 @@ -192,7 +192,7 @@ public enum AssetOwnerErrorCode implements ExceptionMessageSet private static final long serialVersionUID = 1L; - private ExceptionMessageDefinition messageDefinition; + private final ExceptionMessageDefinition messageDefinition; /** diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/metadataelements/ElementOriginCategory.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/metadataelements/ElementOriginCategory.java index 011f63839ed..03b2f559cd1 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/metadataelements/ElementOriginCategory.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/metadataelements/ElementOriginCategory.java @@ -38,9 +38,9 @@ public enum ElementOriginCategory implements Serializable private static final long serialVersionUID = 1L; - private int originCode; - private String originName; - private String originDescription; + private final int originCode; + private final String originName; + private final String originDescription; /** diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/properties/DataItemSortOrder.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/properties/DataItemSortOrder.java index 5bf4f5d3d70..0f66a6daaef 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/properties/DataItemSortOrder.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/properties/DataItemSortOrder.java @@ -32,11 +32,11 @@ public enum DataItemSortOrder implements Serializable public static final String ENUM_TYPE_GUID = "aaa4df8f-1aca-4de8-9abd-1ef2aadba300"; public static final String ENUM_TYPE_NAME = "DataItemSortOrder"; - private int openTypeOrdinal; + private final int openTypeOrdinal; - private int ordinal; - private String name; - private String description; + private final int ordinal; + private final String name; + private final String description; private static final long serialVersionUID = 1L; diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/properties/OwnerType.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/properties/OwnerType.java index b1ee4f79425..afe5587d3aa 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/properties/OwnerType.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/properties/OwnerType.java @@ -35,9 +35,9 @@ public enum OwnerType implements Serializable private int openTypeOrdinal; - private int ordinal; - private String name; - private String description; + private final int ordinal; + private final String name; + private final String description; 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/events/CommunityProfileOutboundEventType.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/events/CommunityProfileOutboundEventType.java index 0edadbb70c8..6b2a0a73326 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/events/CommunityProfileOutboundEventType.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/events/CommunityProfileOutboundEventType.java @@ -38,9 +38,9 @@ public enum CommunityProfileOutboundEventType implements Serializable private static final long serialVersionUID = 1L; - private int eventTypeCode; - private String eventTypeName; - private String eventTypeDescription; + private final int eventTypeCode; + private final String eventTypeName; + private final String eventTypeDescription; /** diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/ffdc/CommunityProfileAuditCode.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/ffdc/CommunityProfileAuditCode.java index 1904dadd4f1..ba7cea77ce0 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/ffdc/CommunityProfileAuditCode.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/ffdc/CommunityProfileAuditCode.java @@ -126,7 +126,7 @@ public enum CommunityProfileAuditCode implements AuditLogMessageSet "This event indicates that one of the elements has changed."), ; - private AuditLogMessageDefinition messageDefinition; + private final AuditLogMessageDefinition messageDefinition; /** diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/ffdc/CommunityProfileErrorCode.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/ffdc/CommunityProfileErrorCode.java index b4a619ecdb3..d9bd0e82bf9 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/ffdc/CommunityProfileErrorCode.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/ffdc/CommunityProfileErrorCode.java @@ -71,7 +71,7 @@ public enum CommunityProfileErrorCode implements ExceptionMessageSet ; - private ExceptionMessageDefinition messageDefinition; + private final ExceptionMessageDefinition messageDefinition; /** diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/ElementOriginCategory.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/ElementOriginCategory.java index ab38c6a1054..0cce04e32bc 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/ElementOriginCategory.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/metadataelements/ElementOriginCategory.java @@ -38,9 +38,9 @@ public enum ElementOriginCategory implements Serializable private static final long serialVersionUID = 1L; - private int originCode; - private String originName; - private String originDescription; + private final int originCode; + private final String originName; + private final String originDescription; /** diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/CollectionOrder.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/CollectionOrder.java index c89da8ea456..c5326e00bb8 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/CollectionOrder.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/CollectionOrder.java @@ -40,11 +40,11 @@ public enum CollectionOrder implements Serializable public static final String ENUM_TYPE_GUID = "1d412439-4272-4a7e-a940-1065f889fc56"; public static final String ENUM_TYPE_NAME = "OrderBy"; - private int openTypeOrdinal; + private final int openTypeOrdinal; - 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/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 73e26fbb751..d10f03af08b 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 @@ -34,9 +34,9 @@ public enum CollectionStatus 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/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/CommentType.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/CommentType.java index ebc48f819ed..e80252049f0 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/CommentType.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/CommentType.java @@ -32,11 +32,11 @@ public enum CommentType implements Serializable public static final String ENUM_TYPE_GUID = "06d5032e-192a-4f77-ade1-a4b97926e867"; public static final String ENUM_TYPE_NAME = "CommentType"; - private int openTypeOrdinal; + private final int openTypeOrdinal; - 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/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/CommunityMembershipType.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/CommunityMembershipType.java index 83112c49104..c86bd8a18f1 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/CommunityMembershipType.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/CommunityMembershipType.java @@ -36,9 +36,9 @@ public enum CommunityMembershipType 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/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ContactMethodType.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ContactMethodType.java index d9577759426..00208eb4259 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ContactMethodType.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ContactMethodType.java @@ -39,11 +39,11 @@ public enum ContactMethodType implements Serializable public static final String ENUM_TYPE_GUID = "30e7d8cd-df01-46e8-9247-a24c5650910d"; public static final String ENUM_TYPE_NAME = "ContactMethodType"; - private int openTypeOrdinal; + private final int openTypeOrdinal; - 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/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/GovernanceDefinitionStatus.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/GovernanceDefinitionStatus.java index 84875a25969..5b2ae9b7b82 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/GovernanceDefinitionStatus.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/GovernanceDefinitionStatus.java @@ -36,9 +36,9 @@ public enum GovernanceDefinitionStatus 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/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/StarRating.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/StarRating.java index d0fb9e13d5f..d161e45e86b 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/StarRating.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/StarRating.java @@ -30,11 +30,11 @@ public enum StarRating implements Serializable public static final String ENUM_TYPE_GUID = "77fea3ef-6ec1-4223-8408-38567e9d3c93"; public static final String ENUM_TYPE_NAME = "StarRating"; - private int openTypeOrdinal; + private final int openTypeOrdinal; - private int ordinal; - private String name; - private String description; + private final int ordinal; + private final String name; + private final String description; 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/ToDoStatus.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ToDoStatus.java index 1df9cc5e673..c4ef0a8ff44 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ToDoStatus.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ToDoStatus.java @@ -37,11 +37,11 @@ public enum ToDoStatus implements Serializable public static final String ENUM_TYPE_GUID = "7197ea39-334d-403f-a70b-d40231092df7"; public static final String ENUM_TYPE_NAME = "ToDoStatus"; - private int openTypeOrdinal; + private final int openTypeOrdinal; - 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/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/WatchStatus.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/WatchStatus.java index 517be56d707..373d928b786 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/WatchStatus.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/WatchStatus.java @@ -31,9 +31,9 @@ public enum WatchStatus 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/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/events/DataManagerOutboundEventType.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/events/DataManagerOutboundEventType.java index 9c7886552ca..1b1bc9a6277 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/events/DataManagerOutboundEventType.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/events/DataManagerOutboundEventType.java @@ -39,9 +39,9 @@ public enum DataManagerOutboundEventType implements Serializable private static final long serialVersionUID = 1L; - private int eventTypeCode; - private String eventTypeName; - private String eventTypeDescription; + private final int eventTypeCode; + private final String eventTypeName; + private final String eventTypeDescription; /** diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/ffdc/DataManagerAuditCode.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/ffdc/DataManagerAuditCode.java index 5dfcbb366c5..60e897d4480 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/ffdc/DataManagerAuditCode.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/ffdc/DataManagerAuditCode.java @@ -131,7 +131,7 @@ public enum DataManagerAuditCode implements AuditLogMessageSet private static final long serialVersionUID = 1L; - private AuditLogMessageDefinition messageDefinition; + private final AuditLogMessageDefinition messageDefinition; /** diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/ffdc/DataManagerErrorCode.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/ffdc/DataManagerErrorCode.java index 58a411f5fdc..436f1ea9a1a 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/ffdc/DataManagerErrorCode.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/ffdc/DataManagerErrorCode.java @@ -75,7 +75,7 @@ public enum DataManagerErrorCode implements ExceptionMessageSet private static final long serialVersionUID = 1L; - private ExceptionMessageDefinition messageDefinition; + private final ExceptionMessageDefinition messageDefinition; /** diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/metadataelements/ElementOriginCategory.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/metadataelements/ElementOriginCategory.java index ee93333cefb..c8f2701a272 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/metadataelements/ElementOriginCategory.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/metadataelements/ElementOriginCategory.java @@ -38,9 +38,9 @@ public enum ElementOriginCategory implements Serializable private static final long serialVersionUID = 1L; - private int originCode; - private String originName; - private String originDescription; + private final int originCode; + private final String originName; + private final String originDescription; /** diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/APIParameterListType.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/APIParameterListType.java index 337c8e73949..46a47ad1552 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/APIParameterListType.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/APIParameterListType.java @@ -25,11 +25,11 @@ public enum APIParameterListType implements Serializable private static final long serialVersionUID = 1L; - private String openTypeRelationshipName; + private final String openTypeRelationshipName; - 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/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/DataItemSortOrder.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/DataItemSortOrder.java index 846c0e7d157..d3e6d8a5918 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/DataItemSortOrder.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/DataItemSortOrder.java @@ -32,11 +32,11 @@ public enum DataItemSortOrder implements Serializable public static final String ENUM_TYPE_GUID = "aaa4df8f-1aca-4de8-9abd-1ef2aadba300"; public static final String ENUM_TYPE_NAME = "DataItemSortOrder"; - private int openTypeOrdinal; + private final int openTypeOrdinal; - private int ordinal; - private String name; - private String description; + private final int ordinal; + private final String name; + private final String description; private static final long serialVersionUID = 1L; diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/KeyPattern.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/KeyPattern.java index 57bc8b49392..9a5ffd0309f 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/KeyPattern.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/KeyPattern.java @@ -33,11 +33,11 @@ public enum KeyPattern implements Serializable public static final String ENUM_TYPE_GUID = "8904df8f-1aca-4de8-9abd-1ef2aadba300"; public static final String ENUM_TYPE_NAME = "KeyPattern"; - private int openTypeOrdinal; + private final int openTypeOrdinal; - private int ordinal; - private String name; - private String description; + private final int ordinal; + private final String name; + private final String description; private static final long serialVersionUID = 1L; diff --git a/open-metadata-implementation/access-services/data-privacy/data-privacy-api/src/main/java/org/odpi/openmetadata/accessservices/dataprivacy/events/DataPrivacyEventType.java b/open-metadata-implementation/access-services/data-privacy/data-privacy-api/src/main/java/org/odpi/openmetadata/accessservices/dataprivacy/events/DataPrivacyEventType.java index 5fd200b8322..0cfbdef0364 100644 --- a/open-metadata-implementation/access-services/data-privacy/data-privacy-api/src/main/java/org/odpi/openmetadata/accessservices/dataprivacy/events/DataPrivacyEventType.java +++ b/open-metadata-implementation/access-services/data-privacy/data-privacy-api/src/main/java/org/odpi/openmetadata/accessservices/dataprivacy/events/DataPrivacyEventType.java @@ -27,9 +27,9 @@ public enum DataPrivacyEventType implements Serializable private static final long serialVersionUID = 1L; - private int eventTypeCode; - private String eventTypeName; - private String eventTypeDescription; + private final int eventTypeCode; + private final String eventTypeName; + private final String eventTypeDescription; /** diff --git a/open-metadata-implementation/access-services/data-privacy/data-privacy-api/src/main/java/org/odpi/openmetadata/accessservices/dataprivacy/ffdc/DataPrivacyAuditCode.java b/open-metadata-implementation/access-services/data-privacy/data-privacy-api/src/main/java/org/odpi/openmetadata/accessservices/dataprivacy/ffdc/DataPrivacyAuditCode.java index 2dd8e793d5a..fe73fc93be9 100644 --- a/open-metadata-implementation/access-services/data-privacy/data-privacy-api/src/main/java/org/odpi/openmetadata/accessservices/dataprivacy/ffdc/DataPrivacyAuditCode.java +++ b/open-metadata-implementation/access-services/data-privacy/data-privacy-api/src/main/java/org/odpi/openmetadata/accessservices/dataprivacy/ffdc/DataPrivacyAuditCode.java @@ -51,7 +51,7 @@ public enum DataPrivacyAuditCode implements AuditLogMessageSet private static final long serialVersionUID = 1L; - AuditLogMessageDefinition messageDefinition; + private final AuditLogMessageDefinition messageDefinition; /** * The constructor for DataPrivacyAuditCode expects to be passed one of the enumeration rows defined in diff --git a/open-metadata-implementation/access-services/data-privacy/data-privacy-api/src/main/java/org/odpi/openmetadata/accessservices/dataprivacy/ffdc/DataPrivacyErrorCode.java b/open-metadata-implementation/access-services/data-privacy/data-privacy-api/src/main/java/org/odpi/openmetadata/accessservices/dataprivacy/ffdc/DataPrivacyErrorCode.java index bf526c8f1a8..106e4e57177 100644 --- a/open-metadata-implementation/access-services/data-privacy/data-privacy-api/src/main/java/org/odpi/openmetadata/accessservices/dataprivacy/ffdc/DataPrivacyErrorCode.java +++ b/open-metadata-implementation/access-services/data-privacy/data-privacy-api/src/main/java/org/odpi/openmetadata/accessservices/dataprivacy/ffdc/DataPrivacyErrorCode.java @@ -37,7 +37,7 @@ public enum DataPrivacyErrorCode implements ExceptionMessageSet private static final long serialVersionUID = 1L; - private ExceptionMessageDefinition messageDefinition; + private final ExceptionMessageDefinition messageDefinition; /** * The constructor for DataPrivacyErrorCode expects to be passed one of the enumeration rows defined in diff --git a/open-metadata-implementation/access-services/data-privacy/data-privacy-api/src/main/java/org/odpi/openmetadata/accessservices/dataprivacy/properties/DigitalServiceDependencyDirection.java b/open-metadata-implementation/access-services/data-privacy/data-privacy-api/src/main/java/org/odpi/openmetadata/accessservices/dataprivacy/properties/DigitalServiceDependencyDirection.java index d2c62228ceb..e6b50b3551f 100644 --- a/open-metadata-implementation/access-services/data-privacy/data-privacy-api/src/main/java/org/odpi/openmetadata/accessservices/dataprivacy/properties/DigitalServiceDependencyDirection.java +++ b/open-metadata-implementation/access-services/data-privacy/data-privacy-api/src/main/java/org/odpi/openmetadata/accessservices/dataprivacy/properties/DigitalServiceDependencyDirection.java @@ -37,9 +37,9 @@ public enum DigitalServiceDependencyDirection 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/access-services/data-privacy/data-privacy-api/src/main/java/org/odpi/openmetadata/accessservices/dataprivacy/properties/DigitalServiceImplementationStyle.java b/open-metadata-implementation/access-services/data-privacy/data-privacy-api/src/main/java/org/odpi/openmetadata/accessservices/dataprivacy/properties/DigitalServiceImplementationStyle.java index d0d33e6d3e5..f82dc040f0c 100644 --- a/open-metadata-implementation/access-services/data-privacy/data-privacy-api/src/main/java/org/odpi/openmetadata/accessservices/dataprivacy/properties/DigitalServiceImplementationStyle.java +++ b/open-metadata-implementation/access-services/data-privacy/data-privacy-api/src/main/java/org/odpi/openmetadata/accessservices/dataprivacy/properties/DigitalServiceImplementationStyle.java @@ -77,9 +77,9 @@ public enum DigitalServiceImplementationStyle 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/access-services/data-privacy/data-privacy-api/src/main/java/org/odpi/openmetadata/accessservices/dataprivacy/properties/DigitalServiceResponsibility.java b/open-metadata-implementation/access-services/data-privacy/data-privacy-api/src/main/java/org/odpi/openmetadata/accessservices/dataprivacy/properties/DigitalServiceResponsibility.java index 38740bf6c9a..ed6c4954ad5 100644 --- a/open-metadata-implementation/access-services/data-privacy/data-privacy-api/src/main/java/org/odpi/openmetadata/accessservices/dataprivacy/properties/DigitalServiceResponsibility.java +++ b/open-metadata-implementation/access-services/data-privacy/data-privacy-api/src/main/java/org/odpi/openmetadata/accessservices/dataprivacy/properties/DigitalServiceResponsibility.java @@ -42,9 +42,9 @@ public enum DigitalServiceResponsibility 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/access-services/data-privacy/data-privacy-api/src/main/java/org/odpi/openmetadata/accessservices/dataprivacy/properties/DigitalServiceStatus.java b/open-metadata-implementation/access-services/data-privacy/data-privacy-api/src/main/java/org/odpi/openmetadata/accessservices/dataprivacy/properties/DigitalServiceStatus.java index e51ce6ba326..f3dd9d65a64 100644 --- a/open-metadata-implementation/access-services/data-privacy/data-privacy-api/src/main/java/org/odpi/openmetadata/accessservices/dataprivacy/properties/DigitalServiceStatus.java +++ b/open-metadata-implementation/access-services/data-privacy/data-privacy-api/src/main/java/org/odpi/openmetadata/accessservices/dataprivacy/properties/DigitalServiceStatus.java @@ -64,9 +64,9 @@ public enum DigitalServiceStatus 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/access-services/data-privacy/data-privacy-api/src/main/java/org/odpi/openmetadata/accessservices/dataprivacy/properties/DigitalServiceVisibility.java b/open-metadata-implementation/access-services/data-privacy/data-privacy-api/src/main/java/org/odpi/openmetadata/accessservices/dataprivacy/properties/DigitalServiceVisibility.java index 7bcd7eb8e33..d6bad91501c 100644 --- a/open-metadata-implementation/access-services/data-privacy/data-privacy-api/src/main/java/org/odpi/openmetadata/accessservices/dataprivacy/properties/DigitalServiceVisibility.java +++ b/open-metadata-implementation/access-services/data-privacy/data-privacy-api/src/main/java/org/odpi/openmetadata/accessservices/dataprivacy/properties/DigitalServiceVisibility.java @@ -47,9 +47,9 @@ public enum DigitalServiceVisibility 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/access-services/data-science/data-science-api/src/main/java/org/odpi/openmetadata/accessservices/datascience/ffdc/DataScienceAuditCode.java b/open-metadata-implementation/access-services/data-science/data-science-api/src/main/java/org/odpi/openmetadata/accessservices/datascience/ffdc/DataScienceAuditCode.java index 4fd685ab566..27b6d39037d 100644 --- a/open-metadata-implementation/access-services/data-science/data-science-api/src/main/java/org/odpi/openmetadata/accessservices/datascience/ffdc/DataScienceAuditCode.java +++ b/open-metadata-implementation/access-services/data-science/data-science-api/src/main/java/org/odpi/openmetadata/accessservices/datascience/ffdc/DataScienceAuditCode.java @@ -50,7 +50,7 @@ public enum DataScienceAuditCode implements AuditLogMessageSet ; - AuditLogMessageDefinition messageDefinition; + private final AuditLogMessageDefinition messageDefinition; /** diff --git a/open-metadata-implementation/access-services/data-science/data-science-api/src/main/java/org/odpi/openmetadata/accessservices/datascience/ffdc/DataScienceErrorCode.java b/open-metadata-implementation/access-services/data-science/data-science-api/src/main/java/org/odpi/openmetadata/accessservices/datascience/ffdc/DataScienceErrorCode.java index 037416f57de..1d6ccc9848b 100644 --- a/open-metadata-implementation/access-services/data-science/data-science-api/src/main/java/org/odpi/openmetadata/accessservices/datascience/ffdc/DataScienceErrorCode.java +++ b/open-metadata-implementation/access-services/data-science/data-science-api/src/main/java/org/odpi/openmetadata/accessservices/datascience/ffdc/DataScienceErrorCode.java @@ -36,7 +36,7 @@ public enum DataScienceErrorCode implements ExceptionMessageSet - private ExceptionMessageDefinition messageDefinition; + private final ExceptionMessageDefinition messageDefinition; /** * The constructor for DataScienceErrorCode expects to be passed one of the enumeration rows defined in diff --git a/open-metadata-implementation/access-services/design-model/design-model-api/src/main/java/org/odpi/openmetadata/accessservices/designmodel/ffdc/DesignModelAuditCode.java b/open-metadata-implementation/access-services/design-model/design-model-api/src/main/java/org/odpi/openmetadata/accessservices/designmodel/ffdc/DesignModelAuditCode.java index 94af7e69e0e..1c206cc8958 100644 --- a/open-metadata-implementation/access-services/design-model/design-model-api/src/main/java/org/odpi/openmetadata/accessservices/designmodel/ffdc/DesignModelAuditCode.java +++ b/open-metadata-implementation/access-services/design-model/design-model-api/src/main/java/org/odpi/openmetadata/accessservices/designmodel/ffdc/DesignModelAuditCode.java @@ -49,7 +49,7 @@ public enum DesignModelAuditCode implements AuditLogMessageSet ; - AuditLogMessageDefinition messageDefinition; + private final AuditLogMessageDefinition messageDefinition; /** diff --git a/open-metadata-implementation/access-services/design-model/design-model-api/src/main/java/org/odpi/openmetadata/accessservices/designmodel/ffdc/DesignModelErrorCode.java b/open-metadata-implementation/access-services/design-model/design-model-api/src/main/java/org/odpi/openmetadata/accessservices/designmodel/ffdc/DesignModelErrorCode.java index 56272b7d3ba..14ef57a914c 100644 --- a/open-metadata-implementation/access-services/design-model/design-model-api/src/main/java/org/odpi/openmetadata/accessservices/designmodel/ffdc/DesignModelErrorCode.java +++ b/open-metadata-implementation/access-services/design-model/design-model-api/src/main/java/org/odpi/openmetadata/accessservices/designmodel/ffdc/DesignModelErrorCode.java @@ -36,7 +36,7 @@ public enum DesignModelErrorCode implements ExceptionMessageSet - private ExceptionMessageDefinition messageDefinition; + private final ExceptionMessageDefinition messageDefinition; /** * The constructor for DesignModelErrorCode expects to be passed one of the enumeration rows defined in diff --git a/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/ffdc/DevOpsAuditCode.java b/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/ffdc/DevOpsAuditCode.java index 06cd7d3bec4..c5d37a0762b 100644 --- a/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/ffdc/DevOpsAuditCode.java +++ b/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/ffdc/DevOpsAuditCode.java @@ -50,7 +50,7 @@ public enum DevOpsAuditCode implements AuditLogMessageSet ; - AuditLogMessageDefinition messageDefinition; + private final AuditLogMessageDefinition messageDefinition; /** diff --git a/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/ffdc/DevOpsErrorCode.java b/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/ffdc/DevOpsErrorCode.java index 85960a4dc8d..1ba3d276113 100644 --- a/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/ffdc/DevOpsErrorCode.java +++ b/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/ffdc/DevOpsErrorCode.java @@ -36,7 +36,7 @@ public enum DevOpsErrorCode implements ExceptionMessageSet - private ExceptionMessageDefinition messageDefinition; + private final ExceptionMessageDefinition messageDefinition; /** * The constructor for DevOpsErrorCode expects to be passed one of the enumeration rows defined in diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/events/DigitalArchitectureEventType.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/events/DigitalArchitectureEventType.java index 09d583271ae..78122f506ce 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/events/DigitalArchitectureEventType.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/events/DigitalArchitectureEventType.java @@ -24,9 +24,9 @@ public enum DigitalArchitectureEventType implements Serializable private static final long serialVersionUID = 1L; - private int eventTypeCode; - private String eventTypeName; - private String eventTypeDescription; + private final int eventTypeCode; + private final String eventTypeName; + private final String eventTypeDescription; /** diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/ffdc/DigitalArchitectureAuditCode.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/ffdc/DigitalArchitectureAuditCode.java index 3fae8f8c169..65875cdad4e 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/ffdc/DigitalArchitectureAuditCode.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/ffdc/DigitalArchitectureAuditCode.java @@ -53,7 +53,7 @@ public enum DigitalArchitectureAuditCode implements AuditLogMessageSet ; - AuditLogMessageDefinition messageDefinition; + private final AuditLogMessageDefinition messageDefinition; /** diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/ffdc/DigitalArchitectureErrorCode.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/ffdc/DigitalArchitectureErrorCode.java index e0393b5b93c..6123759f00e 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/ffdc/DigitalArchitectureErrorCode.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/ffdc/DigitalArchitectureErrorCode.java @@ -36,7 +36,7 @@ public enum DigitalArchitectureErrorCode implements ExceptionMessageSet - private ExceptionMessageDefinition messageDefinition; + private final ExceptionMessageDefinition messageDefinition; /** * The constructor for DigitalArchitectureErrorCode expects to be passed one of the enumeration rows defined in diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/metadataelements/ElementOriginCategory.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/metadataelements/ElementOriginCategory.java index c61af2c670d..543cec112b7 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/metadataelements/ElementOriginCategory.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/metadataelements/ElementOriginCategory.java @@ -38,9 +38,9 @@ public enum ElementOriginCategory implements Serializable private static final long serialVersionUID = 1L; - private int originCode; - private String originName; - private String originDescription; + private final int originCode; + private final String originName; + private final String originDescription; /** diff --git a/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/events/DigitalServiceEventType.java b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/events/DigitalServiceEventType.java index 8f69319f741..d0befb6ba9b 100644 --- a/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/events/DigitalServiceEventType.java +++ b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/events/DigitalServiceEventType.java @@ -27,9 +27,9 @@ public enum DigitalServiceEventType implements Serializable private static final long serialVersionUID = 1L; - private int eventTypeCode; - private String eventTypeName; - private String eventTypeDescription; + private final int eventTypeCode; + private final String eventTypeName; + private final String eventTypeDescription; /** diff --git a/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/ffdc/DigitalServiceAuditCode.java b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/ffdc/DigitalServiceAuditCode.java index 3f16e0ec854..df1da668787 100644 --- a/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/ffdc/DigitalServiceAuditCode.java +++ b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/ffdc/DigitalServiceAuditCode.java @@ -51,7 +51,7 @@ public enum DigitalServiceAuditCode implements AuditLogMessageSet ; - AuditLogMessageDefinition messageDefinition; + private final AuditLogMessageDefinition messageDefinition; /** diff --git a/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/ffdc/DigitalServiceErrorCode.java b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/ffdc/DigitalServiceErrorCode.java index de36a1e4843..aca9ec34850 100644 --- a/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/ffdc/DigitalServiceErrorCode.java +++ b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/ffdc/DigitalServiceErrorCode.java @@ -36,7 +36,7 @@ public enum DigitalServiceErrorCode implements ExceptionMessageSet - private ExceptionMessageDefinition messageDefinition; + private final ExceptionMessageDefinition messageDefinition; /** * The constructor for DigitalServiceErrorCode expects to be passed one of the enumeration rows defined in diff --git a/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/DigitalServiceDependencyDirection.java b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/DigitalServiceDependencyDirection.java index 4a8af6f7800..5085ea5db0c 100644 --- a/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/DigitalServiceDependencyDirection.java +++ b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/DigitalServiceDependencyDirection.java @@ -36,9 +36,10 @@ public enum DigitalServiceDependencyDirection implements Serializable BOTH_DIRECTIONS (2, "Both Directions", "Both the dependent and depended on digital services."); 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/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/DigitalServiceImplementationStyle.java b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/DigitalServiceImplementationStyle.java index 45e7aa42819..64e5c7c74cc 100644 --- a/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/DigitalServiceImplementationStyle.java +++ b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/DigitalServiceImplementationStyle.java @@ -77,9 +77,9 @@ public enum DigitalServiceImplementationStyle 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/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/DigitalServiceResponsibility.java b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/DigitalServiceResponsibility.java index 90920ea2f7f..c72923470c7 100644 --- a/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/DigitalServiceResponsibility.java +++ b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/DigitalServiceResponsibility.java @@ -42,9 +42,9 @@ public enum DigitalServiceResponsibility 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/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/DigitalServiceStatus.java b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/DigitalServiceStatus.java index b489f65cdc5..1725611f4bd 100644 --- a/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/DigitalServiceStatus.java +++ b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/DigitalServiceStatus.java @@ -64,9 +64,9 @@ public enum DigitalServiceStatus 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/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/DigitalServiceVisibility.java b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/DigitalServiceVisibility.java index 9d191266862..89639c7e62a 100644 --- a/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/DigitalServiceVisibility.java +++ b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/DigitalServiceVisibility.java @@ -47,9 +47,9 @@ public enum DigitalServiceVisibility 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/access-services/discovery-engine/discovery-engine-api/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/events/DiscoveryEngineEventType.java b/open-metadata-implementation/access-services/discovery-engine/discovery-engine-api/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/events/DiscoveryEngineEventType.java index 8ad70073820..3ee0886088c 100644 --- a/open-metadata-implementation/access-services/discovery-engine/discovery-engine-api/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/events/DiscoveryEngineEventType.java +++ b/open-metadata-implementation/access-services/discovery-engine/discovery-engine-api/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/events/DiscoveryEngineEventType.java @@ -32,9 +32,9 @@ public enum DiscoveryEngineEventType implements Serializable private static final long serialVersionUID = 1L; - private int eventTypeCode; - private String eventTypeName; - private String eventTypeDescription; + private final int eventTypeCode; + private final String eventTypeName; + private final String eventTypeDescription; /** diff --git a/open-metadata-implementation/access-services/discovery-engine/discovery-engine-api/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/ffdc/DiscoveryEngineAuditCode.java b/open-metadata-implementation/access-services/discovery-engine/discovery-engine-api/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/ffdc/DiscoveryEngineAuditCode.java index cd6e42e9d1c..98f8491a67b 100644 --- a/open-metadata-implementation/access-services/discovery-engine/discovery-engine-api/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/ffdc/DiscoveryEngineAuditCode.java +++ b/open-metadata-implementation/access-services/discovery-engine/discovery-engine-api/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/ffdc/DiscoveryEngineAuditCode.java @@ -136,7 +136,7 @@ public enum DiscoveryEngineAuditCode implements AuditLogMessageSet "Review the message to ensure no action is required.") ; - AuditLogMessageDefinition messageDefinition; + private final AuditLogMessageDefinition messageDefinition; /** diff --git a/open-metadata-implementation/access-services/discovery-engine/discovery-engine-api/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/ffdc/DiscoveryEngineErrorCode.java b/open-metadata-implementation/access-services/discovery-engine/discovery-engine-api/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/ffdc/DiscoveryEngineErrorCode.java index 85bd2215698..ab7b885bbba 100644 --- a/open-metadata-implementation/access-services/discovery-engine/discovery-engine-api/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/ffdc/DiscoveryEngineErrorCode.java +++ b/open-metadata-implementation/access-services/discovery-engine/discovery-engine-api/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/ffdc/DiscoveryEngineErrorCode.java @@ -53,7 +53,7 @@ public enum DiscoveryEngineErrorCode implements ExceptionMessageSet ; - private ExceptionMessageDefinition messageDefinition; + private final ExceptionMessageDefinition messageDefinition; /** * The constructor for DiscoveryEngineErrorCode expects to be passed one of the enumeration rows defined in diff --git a/open-metadata-implementation/access-services/governance-engine/governance-engine-api/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/events/GovernanceEngineEventType.java b/open-metadata-implementation/access-services/governance-engine/governance-engine-api/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/events/GovernanceEngineEventType.java index 5a033f9d549..c6f16749691 100644 --- a/open-metadata-implementation/access-services/governance-engine/governance-engine-api/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/events/GovernanceEngineEventType.java +++ b/open-metadata-implementation/access-services/governance-engine/governance-engine-api/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/events/GovernanceEngineEventType.java @@ -43,9 +43,9 @@ public enum GovernanceEngineEventType implements Serializable private static final long serialVersionUID = 1L; - private int eventTypeCode; - private String eventTypeName; - private String eventTypeDescription; + private final int eventTypeCode; + private final String eventTypeName; + private final String eventTypeDescription; /** 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 f26fdca1288..a7b4b3a5455 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 @@ -190,7 +190,7 @@ public enum GovernanceEngineAuditCode implements AuditLogMessageSet ; - private AuditLogMessageDefinition messageDefinition; + private final AuditLogMessageDefinition messageDefinition; /** * The constructor for GovernanceEngineAuditCode expects to be passed one of the enumeration rows defined in diff --git a/open-metadata-implementation/access-services/governance-engine/governance-engine-api/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/ffdc/GovernanceEngineErrorCode.java b/open-metadata-implementation/access-services/governance-engine/governance-engine-api/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/ffdc/GovernanceEngineErrorCode.java index 71287d46691..65e9eeab95a 100644 --- a/open-metadata-implementation/access-services/governance-engine/governance-engine-api/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/ffdc/GovernanceEngineErrorCode.java +++ b/open-metadata-implementation/access-services/governance-engine/governance-engine-api/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/ffdc/GovernanceEngineErrorCode.java @@ -54,7 +54,7 @@ public enum GovernanceEngineErrorCode implements ExceptionMessageSet - private ExceptionMessageDefinition messageDefinition; + private final ExceptionMessageDefinition messageDefinition; /** * The constructor for GovernanceEngineErrorCode expects to be passed one of the enumeration rows defined in diff --git a/open-metadata-implementation/access-services/governance-engine/governance-engine-api/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/properties/ProcessStatus.java b/open-metadata-implementation/access-services/governance-engine/governance-engine-api/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/properties/ProcessStatus.java index 7f59048276f..afe5f75ceeb 100644 --- a/open-metadata-implementation/access-services/governance-engine/governance-engine-api/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/properties/ProcessStatus.java +++ b/open-metadata-implementation/access-services/governance-engine/governance-engine-api/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/properties/ProcessStatus.java @@ -35,10 +35,10 @@ public enum ProcessStatus implements Serializable ACTIVE (4,15, "Active", "The process is approved and in use."); - private int ordinal; - private int openTypeOrdinal; - private String name; - private String description; + private final int ordinal; + private final int openTypeOrdinal; + private final String name; + private final String description; private static final long serialVersionUID = 1L; diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/ffdc/GovernanceProgramAuditCode.java b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/ffdc/GovernanceProgramAuditCode.java index 205328b4c66..8d473af08db 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/ffdc/GovernanceProgramAuditCode.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/ffdc/GovernanceProgramAuditCode.java @@ -50,7 +50,7 @@ public enum GovernanceProgramAuditCode implements AuditLogMessageSet ; - AuditLogMessageDefinition messageDefinition; + private final AuditLogMessageDefinition messageDefinition; /** 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 e5f678e2c7b..61f8de2a23e 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 @@ -96,7 +96,7 @@ public enum GovernanceProgramErrorCode implements ExceptionMessageSet - private ExceptionMessageDefinition messageDefinition; + private final ExceptionMessageDefinition messageDefinition; /** * The constructor for GovernanceProgramErrorCode expects to be passed one of the enumeration rows defined in diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/metadataelements/ElementOriginCategory.java b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/metadataelements/ElementOriginCategory.java index aa456d406be..a338697deb8 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/metadataelements/ElementOriginCategory.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/metadataelements/ElementOriginCategory.java @@ -38,9 +38,9 @@ public enum ElementOriginCategory implements Serializable private static final long serialVersionUID = 1L; - private int originCode; - private String originName; - private String originDescription; + private final int originCode; + private final String originName; + private final String originDescription; /** diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/ContactMethodType.java b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/ContactMethodType.java index d05fd635fc3..e2fafef5656 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/ContactMethodType.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/ContactMethodType.java @@ -39,11 +39,11 @@ public enum ContactMethodType implements Serializable public static final String ENUM_TYPE_GUID = "30e7d8cd-df01-46e8-9247-a24c5650910d"; public static final String ENUM_TYPE_NAME = "ContactMethodType"; - private int openTypeOrdinal; + private final int openTypeOrdinal; - 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/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/GovernanceDefinitionStatus.java b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/GovernanceDefinitionStatus.java index 223afe1925a..4eea82d56df 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/GovernanceDefinitionStatus.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/GovernanceDefinitionStatus.java @@ -36,9 +36,9 @@ public enum GovernanceDefinitionStatus 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/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/GovernanceDomain.java b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/GovernanceDomain.java index 55579be7827..0dd8dff74f8 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/GovernanceDomain.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/GovernanceDomain.java @@ -46,9 +46,9 @@ public enum GovernanceDomain 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/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/ffdc/ITInfrastructureAuditCode.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/ffdc/ITInfrastructureAuditCode.java index 839f10f78e6..a6efdc85a94 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/ffdc/ITInfrastructureAuditCode.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/ffdc/ITInfrastructureAuditCode.java @@ -50,7 +50,7 @@ public enum ITInfrastructureAuditCode implements AuditLogMessageSet ; - AuditLogMessageDefinition messageDefinition; + private final AuditLogMessageDefinition messageDefinition; /** diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/ffdc/ITInfrastructureErrorCode.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/ffdc/ITInfrastructureErrorCode.java index b3ebeaf6561..4c2b1b85195 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/ffdc/ITInfrastructureErrorCode.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/ffdc/ITInfrastructureErrorCode.java @@ -36,7 +36,7 @@ public enum ITInfrastructureErrorCode implements ExceptionMessageSet - private ExceptionMessageDefinition messageDefinition; + private final ExceptionMessageDefinition messageDefinition; /** * The constructor for ITInfrastructureErrorCode expects to be passed one of the enumeration rows defined in diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/metadataelements/ElementOriginCategory.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/metadataelements/ElementOriginCategory.java index b3b70982458..a4318816eb5 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/metadataelements/ElementOriginCategory.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/metadataelements/ElementOriginCategory.java @@ -38,9 +38,9 @@ public enum ElementOriginCategory implements Serializable private static final long serialVersionUID = 1L; - private int originCode; - private String originName; - private String originDescription; + private final int originCode; + private final String originName; + private final String originDescription; /** diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/metadataelements/HostElement.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/metadataelements/HostElement.java index a0b7ce3d23c..d3d72e5427a 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/metadataelements/HostElement.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/metadataelements/HostElement.java @@ -25,7 +25,7 @@ public class HostElement implements MetadataElement, Serializable private static final long serialVersionUID = 1L; private HostProperties properties = null; - private ElementHeader elementHeader = null; + private ElementHeader elementHeader = null; /** diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/AssetProperties.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/AssetProperties.java index c4b7cdabb63..90e8da4c0d3 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/AssetProperties.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/AssetProperties.java @@ -56,6 +56,26 @@ public AssetProperties(AssetProperties template) } + /** + * Convert this object into an AssetProperties object. This involves packing the properties introduced at this level + * into the extended properties. + * + * @param subTypeName subtype name + * @return asset properties + */ + public AssetProperties cloneToAsset(String subTypeName) + { + AssetProperties clone = new AssetProperties(this); + + if (super.getTypeName() == null) + { + super.setTypeName(subTypeName); + } + + return clone; + } + + /** * Returns the stored display name property for the asset. * If no display name is available then null is returned. diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/ByteOrdering.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/ByteOrdering.java index cbe6923be2f..bed64fdd133 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/ByteOrdering.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/ByteOrdering.java @@ -25,11 +25,11 @@ public enum ByteOrdering implements Serializable public static final String ENUM_TYPE_GUID = "e5612c3a-49bd-4148-8f67-cfdf145d5fd8"; public static final String ENUM_TYPE_NAME = "Endianness"; - private int openTypeOrdinal; + private final int openTypeOrdinal; - private int ordinal; - private String name; - private String description; + private final int ordinal; + private final String name; + private final String description; private static final long serialVersionUID = 1L; diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/ContactMethodType.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/ContactMethodType.java index 8353c7a071d..e89b1a6d675 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/ContactMethodType.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/ContactMethodType.java @@ -41,9 +41,9 @@ public enum ContactMethodType implements Serializable private int openTypeOrdinal; - 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/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/HostProperties.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/HostProperties.java index c55622ccfc6..6ce8a678cfc 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/HostProperties.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/HostProperties.java @@ -40,6 +40,42 @@ public HostProperties(HostProperties template) } + /** + * Copy/clone constructor. Note, this is a deep copy + * + * @param template object to copy + */ + public HostProperties(AssetProperties template) + { + super(template); + } + + + /** + * Convert this object into an AssetProperties object. This involves packing the properties introduced at this level + * into the extended properties. + * + * @return asset properties + */ + public AssetProperties cloneToAsset() + { + return super.cloneToAsset("Host"); + } + + + /** + * Convert this object into an AssetProperties object. This involves packing the properties introduced at this level + * into the extended properties. + * + * @param subTypeName subtype name + * @return asset properties + */ + public AssetProperties cloneToAsset(String subTypeName) + { + return super.cloneToAsset(subTypeName); + } + + /** * Standard toString method. * diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/ITInfrastructureProperties.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/ITInfrastructureProperties.java index 6e377cfa6c7..0052fab99a1 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/ITInfrastructureProperties.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/ITInfrastructureProperties.java @@ -53,6 +53,30 @@ public ITInfrastructureProperties(ITInfrastructureProperties template) } + /** + * Copy/clone constructor. Note, this is a deep copy + * + * @param template object to copy + */ + public ITInfrastructureProperties(AssetProperties template) + { + super(template); + } + + + /** + * Convert this object into an AssetProperties object. This involves packing the properties introduced at this level + * into the extended properties. + * + * @param subTypeName subtype name + * @return asset properties + */ + public AssetProperties cloneToAsset(String subTypeName) + { + return super.cloneToAsset(subTypeName); + } + + /** * Standard toString method. * diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/OperationalStatus.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/OperationalStatus.java index 4096fac072e..18c8bdbd03a 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/OperationalStatus.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/OperationalStatus.java @@ -25,11 +25,11 @@ public enum OperationalStatus implements Serializable public static final String ENUM_TYPE_GUID = "24e1e33e-9250-4a6c-8b07-05c7adec3a1d"; public static final String ENUM_TYPE_NAME = "OperationalStatus"; - private int openTypeOrdinal; + private final int openTypeOrdinal; - private int ordinal; - private String name; - private String description; + private final int ordinal; + private final String name; + private final String description; private static final long serialVersionUID = 1L; diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/ServerAssetUseType.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/ServerAssetUseType.java index 64594d95768..f22804a9972 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/ServerAssetUseType.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/ServerAssetUseType.java @@ -30,10 +30,10 @@ public enum ServerAssetUseType implements Serializable public static final String ENUM_TYPE_NAME = "ServerAssetUseType"; - private int ordinal; - private int openTypeOrdinal; - private String name; - private String description; + private final int ordinal; + private final int openTypeOrdinal; + private final String name; + private final String description; private static final long serialVersionUID = 1L; diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/SoftwareServerPlatformProperties.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/SoftwareServerPlatformProperties.java index 968ea252762..6aa836b75c9 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/SoftwareServerPlatformProperties.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/SoftwareServerPlatformProperties.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; +import java.util.Map; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; @@ -23,6 +24,11 @@ public class SoftwareServerPlatformProperties extends ITInfrastructureProperties { private static final long serialVersionUID = 1L; + private static final String deployedImplementationTypeProperty = "deployedImplementationType"; + private static final String versionProperty = "platformVersion"; + private static final String sourceProperty = "source"; + private static final String userIdProperty = "userId"; + private String platformType = null; private String platformVersion = null; private String platformSource = null; @@ -56,6 +62,100 @@ public SoftwareServerPlatformProperties(SoftwareServerPlatformProperties templat } + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public SoftwareServerPlatformProperties(AssetProperties template) + { + super(template); + + if (template != null) + { + Map assetExtendedProperties = template.getExtendedProperties(); + + if (assetExtendedProperties != null) + { + if (assetExtendedProperties.get(deployedImplementationTypeProperty) != null) + { + platformType = assetExtendedProperties.get(deployedImplementationTypeProperty).toString(); + assetExtendedProperties.remove(deployedImplementationTypeProperty); + } + + if (assetExtendedProperties.get(versionProperty) != null) + { + platformVersion = assetExtendedProperties.get(versionProperty).toString(); + assetExtendedProperties.remove(versionProperty); + } + + if (assetExtendedProperties.get(sourceProperty) != null) + { + platformSource = assetExtendedProperties.get(sourceProperty).toString(); + assetExtendedProperties.remove(sourceProperty); + } + + if (assetExtendedProperties.get(userIdProperty) != null) + { + platformUserId = assetExtendedProperties.get(userIdProperty).toString(); + assetExtendedProperties.remove(userIdProperty); + } + + super.setExtendedProperties(assetExtendedProperties); + } + } + } + + + /** + * Convert this object into an AssetProperties object. This involves packing the additional properties introduced at this level + * into the extended properties. + * + * @return asset properties + */ + public AssetProperties cloneToAsset() + { + return this.cloneToAsset("SoftwareServerPlatform"); + } + + + /** + * Convert this object into an AssetProperties object. This involves packing the properties introduced at this level + * into the extended properties. + * + * @param subTypeName subtype name + * @return asset properties + */ + public AssetProperties cloneToAsset(String subTypeName) + { + AssetProperties assetProperties = super.cloneToAsset(subTypeName); + + Map assetExtendedProperties = assetProperties.getExtendedProperties(); + + if (platformType != null) + { + assetExtendedProperties.put(deployedImplementationTypeProperty, platformType); + } + if (platformVersion != null) + { + assetExtendedProperties.put(platformVersion, versionProperty); + } + if (platformSource != null) + { + assetExtendedProperties.put(sourceProperty, platformSource); + } + if (platformUserId != null) + { + assetExtendedProperties.put(userIdProperty, platformUserId); + } + + assetProperties.setExtendedProperties(assetExtendedProperties); + + return assetProperties; + } + + /** * Return the type description for the server's type. * diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/SoftwareServerProperties.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/SoftwareServerProperties.java index 6b9e7ede1ec..d4cc330d8d2 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/SoftwareServerProperties.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/SoftwareServerProperties.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.*; +import java.util.Map; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; @@ -20,6 +21,11 @@ public class SoftwareServerProperties extends ITInfrastructureProperties { private static final long serialVersionUID = 1L; + private static final String deployedImplementationTypeProperty = "deployedImplementationType"; + private static final String versionProperty = "serverVersion"; + private static final String sourceProperty = "source"; + private static final String userIdProperty = "userId"; + private String softwareServerType = null; private String softwareServerVersion = null; private String softwareServerSource = null; @@ -53,6 +59,99 @@ public SoftwareServerProperties(SoftwareServerProperties template) } + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public SoftwareServerProperties(AssetProperties template) + { + super(template); + + if (template != null) + { + Map assetExtendedProperties = template.getExtendedProperties(); + + if (assetExtendedProperties != null) + { + if (assetExtendedProperties.get(deployedImplementationTypeProperty) != null) + { + softwareServerType = assetExtendedProperties.get(deployedImplementationTypeProperty).toString(); + assetExtendedProperties.remove(deployedImplementationTypeProperty); + } + + if (assetExtendedProperties.get(versionProperty) != null) + { + softwareServerVersion = assetExtendedProperties.get(versionProperty).toString(); + assetExtendedProperties.remove(versionProperty); + } + + if (assetExtendedProperties.get(sourceProperty) != null) + { + softwareServerSource = assetExtendedProperties.get(sourceProperty).toString(); + assetExtendedProperties.remove(sourceProperty); + } + + if (assetExtendedProperties.get(userIdProperty) != null) + { + softwareServerUserId = assetExtendedProperties.get(userIdProperty).toString(); + assetExtendedProperties.remove(userIdProperty); + } + + super.setExtendedProperties(assetExtendedProperties); + } + } + } + + + /** + * Convert this object into an AssetProperties object. This involves packing the additional properties introduced at this level + * into the extended properties. + * + * @return asset properties + */ + public AssetProperties cloneToAsset() + { + return this.cloneToAsset("SoftwareServer"); + } + + + /** + * Convert this object into an AssetProperties object. This involves packing the properties introduced at this level + * into the extended properties. + * + * @param subTypeName subtype name + * @return asset properties + */ + public AssetProperties cloneToAsset(String subTypeName) + { + AssetProperties assetProperties = super.cloneToAsset(subTypeName); + + Map assetExtendedProperties = assetProperties.getExtendedProperties(); + + if (softwareServerType != null) + { + assetExtendedProperties.put(deployedImplementationTypeProperty, softwareServerType); + } + if (softwareServerVersion != null) + { + assetExtendedProperties.put(versionProperty, softwareServerVersion); + } + if (softwareServerSource != null) + { + assetExtendedProperties.put(sourceProperty, softwareServerSource); + } + if (softwareServerUserId != null) + { + assetExtendedProperties.put(userIdProperty, softwareServerUserId); + } + + assetProperties.setExtendedProperties(assetExtendedProperties); + + return assetProperties; + } + + /** * Return the type description for the server's type. * diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/AssetListResponse.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/AssetListResponse.java new file mode 100644 index 00000000000..dee98e8c5dd --- /dev/null +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/AssetListResponse.java @@ -0,0 +1,149 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.itinfrastructure.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.AssetElement; + +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; + +/** + * AssetListResponse is a response object for passing back a a list of hosts + * 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 AssetListResponse extends ITInfrastructureOMASAPIResponse +{ + private static final long serialVersionUID = 1L; + + private List elementList = null; + + + /** + * Default constructor + */ + public AssetListResponse() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public AssetListResponse(AssetListResponse 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 "AssetListResponse{" + + "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; + } + AssetListResponse that = (AssetListResponse) 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/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/AssetRequestBody.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/AssetRequestBody.java new file mode 100644 index 00000000000..9e2e8f1686b --- /dev/null +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/AssetRequestBody.java @@ -0,0 +1,173 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.itinfrastructure.rest; + + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.itinfrastructure.properties.AssetProperties; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + + +/** + * AssetRequestBody describes the properties of the asset for creation and update. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class AssetRequestBody extends AssetProperties +{ + private static final long serialVersionUID = 1L; + + private String externalSourceGUID = null; + private String externalSourceName = null; + + + /** + * Default constructor + */ + public AssetRequestBody() + { + super(); + } + + + /** + * Copy/clone constructor. + * + * @param template object to copy + */ + public AssetRequestBody(AssetRequestBody template) + { + super(template); + + if (template != null) + { + externalSourceGUID = template.getExternalSourceGUID(); + externalSourceName = template.getExternalSourceName(); + } + } + + + /** + * Copy/clone constructor. + * + * @param template object to copy + */ + public AssetRequestBody(AssetProperties 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 "AssetRequestBody{" + + "externalSourceGUID='" + externalSourceGUID + '\'' + + ", externalSourceName='" + externalSourceName + '\'' + + ", displayName='" + getDisplayName() + '\'' + + ", description='" + getDescription() + '\'' + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", qualifiedName='" + getQualifiedName() + '\'' + + ", additionalProperties=" + getAdditionalProperties() + + ", 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; + } + AssetRequestBody that = (AssetRequestBody) 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); + } +} diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/AssetResponse.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/AssetResponse.java new file mode 100644 index 00000000000..8b3bca7190a --- /dev/null +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/rest/AssetResponse.java @@ -0,0 +1,137 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.itinfrastructure.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.AssetElement; + +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; + +/** + * AssetResponse is a response object for passing back a single asset + * element 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 AssetResponse extends ITInfrastructureOMASAPIResponse +{ + private static final long serialVersionUID = 1L; + + private AssetElement element = null; + + + /** + * Default constructor + */ + public AssetResponse() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public AssetResponse(AssetResponse template) + { + super(template); + + if (template != null) + { + element = template.getElement(); + } + } + + + /** + * Return the metadata element. + * + * @return result object + */ + public AssetElement getElement() + { + return element; + } + + + /** + * Set up the metadata element to return. + * + * @param element result object + */ + public void setElement(AssetElement element) + { + this.element = element; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "AssetResponse{" + + "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; + } + AssetResponse that = (AssetResponse) 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/it-infrastructure/it-infrastructure-client/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/client/HostManagerClient.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-client/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/client/HostManagerClient.java index ec633be2fd3..f2d4ad9ce6e 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-client/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/client/HostManagerClient.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-client/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/client/HostManagerClient.java @@ -5,8 +5,10 @@ import org.odpi.openmetadata.accessservices.itinfrastructure.api.HostManagerInterface; import org.odpi.openmetadata.accessservices.itinfrastructure.client.rest.ITInfrastructureRESTClient; import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.HostElement; +import org.odpi.openmetadata.accessservices.itinfrastructure.properties.AssetProperties; import org.odpi.openmetadata.accessservices.itinfrastructure.properties.HostProperties; import org.odpi.openmetadata.accessservices.itinfrastructure.properties.TemplateProperties; +import org.odpi.openmetadata.accessservices.itinfrastructure.rest.AssetRequestBody; import org.odpi.openmetadata.accessservices.itinfrastructure.rest.HostListResponse; import org.odpi.openmetadata.accessservices.itinfrastructure.rest.HostRequestBody; import org.odpi.openmetadata.accessservices.itinfrastructure.rest.HostResponse; @@ -31,7 +33,7 @@ */ public class HostManagerClient implements HostManagerInterface { - private static final String hostURLTemplatePrefix = "/servers/{0}/open-metadata/access-services/it-infrastructure/users/{1}/hosts"; + private static final String assetURLTemplatePrefix = "/servers/{0}/open-metadata/access-services/it-infrastructure/users/{1}/assets"; private String serverName; /* Initialized in constructor */ private String serverPlatformURLRoot; /* Initialized in constructor */ @@ -212,9 +214,11 @@ public String createHost(String userId, invalidParameterHandler.validateObject(hostProperties, propertiesParameterName, methodName); invalidParameterHandler.validateName(hostProperties.getQualifiedName(), qualifiedNameParameterName, methodName); - final String urlTemplate = serverPlatformURLRoot + hostURLTemplatePrefix + "?infrastructureManagerIsHome={2}"; + final String urlTemplate = serverPlatformURLRoot + assetURLTemplatePrefix + "?infrastructureManagerIsHome={2}"; - HostRequestBody requestBody = new HostRequestBody(hostProperties); + AssetProperties assetProperties = hostProperties.cloneToAsset(); + + AssetRequestBody requestBody = new AssetRequestBody(assetProperties); requestBody.setExternalSourceGUID(infrastructureManagerGUID); requestBody.setExternalSourceName(infrastructureManagerName); @@ -266,7 +270,7 @@ public String createHostFromTemplate(String userId, invalidParameterHandler.validateObject(templateProperties, propertiesParameterName, methodName); invalidParameterHandler.validateName(templateProperties.getQualifiedName(), qualifiedNameParameterName, methodName); - final String urlTemplate = serverPlatformURLRoot + hostURLTemplatePrefix + "/from-template/{2}?infrastructureManagerIsHome={3}"; + final String urlTemplate = serverPlatformURLRoot + assetURLTemplatePrefix + "/from-template/{2}?infrastructureManagerIsHome={3}"; TemplateRequestBody requestBody = new TemplateRequestBody(templateProperties); @@ -319,9 +323,11 @@ public void updateHost(String userId, invalidParameterHandler.validateObject(hostProperties, propertiesParameterName, methodName); invalidParameterHandler.validateName(hostProperties.getQualifiedName(), qualifiedNameParameterName, methodName); - final String urlTemplate = serverPlatformURLRoot + hostURLTemplatePrefix + "/{2}?isMergeUpdate={3}"; + final String urlTemplate = serverPlatformURLRoot + assetURLTemplatePrefix + "/{2}?isMergeUpdate={3}"; + + AssetProperties assetProperties = hostProperties.cloneToAsset(); - HostRequestBody requestBody = new HostRequestBody(hostProperties); + AssetRequestBody requestBody = new AssetRequestBody(assetProperties); requestBody.setExternalSourceGUID(infrastructureManagerGUID); requestBody.setExternalSourceName(infrastructureManagerName); @@ -367,7 +373,7 @@ public void setupHostedHost(String userId, invalidParameterHandler.validateGUID(hostGUID, hostGUIDParameterName, methodName); invalidParameterHandler.validateGUID(hostedHostGUID, hostedHostGUIDParameterName, methodName); - final String urlTemplate = serverPlatformURLRoot + hostURLTemplatePrefix + "/{2}/hosted-hosts/{3}"; + final String urlTemplate = serverPlatformURLRoot + assetURLTemplatePrefix + "/{2}/hosted-hosts/{3}"; MetadataSourceRequestBody requestBody = new MetadataSourceRequestBody(); @@ -414,7 +420,7 @@ public void clearHostedHost(String userId, invalidParameterHandler.validateGUID(hostGUID, hostGUIDParameterName, methodName); invalidParameterHandler.validateGUID(hostedHostGUID, hostedHostGUIDParameterName, methodName); - final String urlTemplate = serverPlatformURLRoot + hostURLTemplatePrefix + "/{2}/hosted-hosts/{3}/delete"; + final String urlTemplate = serverPlatformURLRoot + assetURLTemplatePrefix + "/{2}/hosted-hosts/{3}/delete"; MetadataSourceRequestBody requestBody = new MetadataSourceRequestBody(); @@ -461,7 +467,7 @@ public void setupClusterMember(String userId, invalidParameterHandler.validateGUID(hostGUID, hostGUIDParameterName, methodName); invalidParameterHandler.validateGUID(clusterMemberGUID, clusterMemberGUIDParameterName, methodName); - final String urlTemplate = serverPlatformURLRoot + hostURLTemplatePrefix + "/{2}/cluster-members/{3}"; + final String urlTemplate = serverPlatformURLRoot + assetURLTemplatePrefix + "/{2}/cluster-members/{3}"; MetadataSourceRequestBody requestBody = new MetadataSourceRequestBody(); @@ -508,7 +514,7 @@ public void clearClusterMember(String userId, invalidParameterHandler.validateGUID(hostGUID, hostGUIDParameterName, methodName); invalidParameterHandler.validateGUID(clusterMemberGUID, clusterMemberGUIDParameterName, methodName); - final String urlTemplate = serverPlatformURLRoot + hostURLTemplatePrefix + "/{2}/cluster-members/{3}/delete"; + final String urlTemplate = serverPlatformURLRoot + assetURLTemplatePrefix + "/{2}/cluster-members/{3}/delete"; MetadataSourceRequestBody requestBody = new MetadataSourceRequestBody(); @@ -550,7 +556,7 @@ public void publishHost(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(hostGUID, elementGUIDParameterName, methodName); - final String urlTemplate = serverPlatformURLRoot + hostURLTemplatePrefix + "/{2}/publish"; + final String urlTemplate = serverPlatformURLRoot + assetURLTemplatePrefix + "/{2}/publish"; restClient.callVoidPostRESTCall(methodName, urlTemplate, @@ -585,7 +591,7 @@ public void withdrawHost(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(hostGUID, elementGUIDParameterName, methodName); - final String urlTemplate = serverPlatformURLRoot + hostURLTemplatePrefix + "/{2}/withdraw"; + final String urlTemplate = serverPlatformURLRoot + assetURLTemplatePrefix + "/{2}/withdraw"; restClient.callVoidPostRESTCall(methodName, urlTemplate, @@ -622,7 +628,7 @@ public void removeHost(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(hostGUID, elementGUIDParameterName, methodName); - final String urlTemplate = serverPlatformURLRoot + hostURLTemplatePrefix + "/{2}/delete"; + final String urlTemplate = serverPlatformURLRoot + assetURLTemplatePrefix + "/{2}/delete"; MetadataSourceRequestBody requestBody = new MetadataSourceRequestBody(); @@ -671,7 +677,7 @@ public List findHosts(String userId, invalidParameterHandler.validateSearchString(searchString, searchStringParameterName, methodName); int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); - final String urlTemplate = serverPlatformURLRoot + hostURLTemplatePrefix + "/by-search-string?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + assetURLTemplatePrefix + "/by-search-string?startFrom={2}&pageSize={3}"; SearchStringRequestBody requestBody = new SearchStringRequestBody(); @@ -723,7 +729,7 @@ public List getHostsByName(String userId, invalidParameterHandler.validateName(name, nameParameterName, methodName); int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); - final String urlTemplate = serverPlatformURLRoot + hostURLTemplatePrefix + "?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + assetURLTemplatePrefix + "?startFrom={2}&pageSize={3}"; NameRequestBody requestBody = new NameRequestBody(); @@ -779,7 +785,7 @@ public List getHostsForInfrastructureManager(String userId, int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); - final String urlTemplate = serverPlatformURLRoot + hostURLTemplatePrefix + "/infrastructureManagers/{2}/{3}/hosts?startFrom={4}&pageSize={5}"; + final String urlTemplate = serverPlatformURLRoot + assetURLTemplatePrefix + "/infrastructureManagers/{2}/{3}/hosts?startFrom={4}&pageSize={5}"; EffectiveTimeRequestBody requestBody = new EffectiveTimeRequestBody(); @@ -823,7 +829,7 @@ public HostElement getHostByGUID(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(guid, guidParameterName, methodName); - final String urlTemplate = serverPlatformURLRoot + hostURLTemplatePrefix + "/{2}"; + final String urlTemplate = serverPlatformURLRoot + assetURLTemplatePrefix + "/{2}"; HostResponse restResult = restClient.callHostGetRESTCall(methodName, urlTemplate, @@ -864,7 +870,7 @@ public List getHostedHosts(String userId, invalidParameterHandler.validateUserId(userId, methodName); int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); - final String urlTemplate = serverPlatformURLRoot + hostURLTemplatePrefix + "/{2}/hosted-hosts?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + assetURLTemplatePrefix + "/{2}/hosted-hosts?startFrom={3}&pageSize={4}"; EffectiveTimeRequestBody requestBody = new EffectiveTimeRequestBody(); @@ -912,7 +918,7 @@ public List getClusterMembersForHost(String userId, invalidParameterHandler.validateUserId(userId, methodName); int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); - final String urlTemplate = serverPlatformURLRoot + hostURLTemplatePrefix + "/{2}/cluster-members?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + assetURLTemplatePrefix + "/{2}/cluster-members?startFrom={3}&pageSize={4}"; EffectiveTimeRequestBody requestBody = new EffectiveTimeRequestBody(); diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/ffdc/ProjectManagementAuditCode.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/ffdc/ProjectManagementAuditCode.java index c3714b128ca..5a1a3295f91 100644 --- a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/ffdc/ProjectManagementAuditCode.java +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/ffdc/ProjectManagementAuditCode.java @@ -52,7 +52,7 @@ public enum ProjectManagementAuditCode implements AuditLogMessageSet private static final long serialVersionUID = 1L; - AuditLogMessageDefinition messageDefinition; + private final AuditLogMessageDefinition messageDefinition; /** diff --git a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/ffdc/ProjectManagementErrorCode.java b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/ffdc/ProjectManagementErrorCode.java index c7d3d4b4421..e383b8efac9 100644 --- a/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/ffdc/ProjectManagementErrorCode.java +++ b/open-metadata-implementation/access-services/project-management/project-management-api/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/ffdc/ProjectManagementErrorCode.java @@ -37,7 +37,7 @@ public enum ProjectManagementErrorCode implements ExceptionMessageSet private static final long serialVersionUID = 1L; - private ExceptionMessageDefinition messageDefinition; + private final ExceptionMessageDefinition messageDefinition; /** * The constructor for ProjectManagementErrorCode expects to be passed one of the enumeration rows defined in diff --git a/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/events/SecurityManagerEventType.java b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/events/SecurityManagerEventType.java index a22ce6e8b9a..5c8bfc60d61 100644 --- a/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/events/SecurityManagerEventType.java +++ b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/events/SecurityManagerEventType.java @@ -39,9 +39,9 @@ public enum SecurityManagerEventType implements Serializable private static final long serialVersionUID = 1L; - private int eventTypeCode; - private String eventTypeName; - private String eventTypeDescription; + private final int eventTypeCode; + private final String eventTypeName; + private final String eventTypeDescription; /** diff --git a/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/ffdc/SecurityManagerAuditCode.java b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/ffdc/SecurityManagerAuditCode.java index 7176f116660..823d7231f1c 100644 --- a/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/ffdc/SecurityManagerAuditCode.java +++ b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/ffdc/SecurityManagerAuditCode.java @@ -111,7 +111,7 @@ public enum SecurityManagerAuditCode implements AuditLogMessageSet private static final long serialVersionUID = 1L; - private AuditLogMessageDefinition messageDefinition; + private final AuditLogMessageDefinition messageDefinition; /** diff --git a/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/ffdc/SecurityManagerErrorCode.java b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/ffdc/SecurityManagerErrorCode.java index 02ec95fd9cb..52fa41e2ee6 100644 --- a/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/ffdc/SecurityManagerErrorCode.java +++ b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/ffdc/SecurityManagerErrorCode.java @@ -75,7 +75,7 @@ public enum SecurityManagerErrorCode implements ExceptionMessageSet private static final long serialVersionUID = 1L; - private ExceptionMessageDefinition messageDefinition; + private final ExceptionMessageDefinition messageDefinition; /** diff --git a/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/metadataelements/ElementOriginCategory.java b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/metadataelements/ElementOriginCategory.java index abd5cd3aa75..25b87d1b294 100644 --- a/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/metadataelements/ElementOriginCategory.java +++ b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/metadataelements/ElementOriginCategory.java @@ -38,9 +38,9 @@ public enum ElementOriginCategory implements Serializable private static final long serialVersionUID = 1L; - private int originCode; - private String originName; - private String originDescription; + private final int originCode; + private final String originName; + private final String originDescription; /** diff --git a/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/ContactMethodType.java b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/ContactMethodType.java index 3775498a3f1..842b61c151f 100644 --- a/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/ContactMethodType.java +++ b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/ContactMethodType.java @@ -39,11 +39,11 @@ public enum ContactMethodType implements Serializable public static final String ENUM_TYPE_GUID = "30e7d8cd-df01-46e8-9247-a24c5650910d"; public static final String ENUM_TYPE_NAME = "ContactMethodType"; - private int openTypeOrdinal; + private final int openTypeOrdinal; - 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/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/GovernanceDefinitionStatus.java b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/GovernanceDefinitionStatus.java index 366a7359445..dc98fd09f04 100644 --- a/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/GovernanceDefinitionStatus.java +++ b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/GovernanceDefinitionStatus.java @@ -36,9 +36,9 @@ public enum GovernanceDefinitionStatus 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/access-services/security-officer/security-officer-api/src/main/java/org/odpi/openmetadata/accessservices/securityofficer/api/events/SecurityOfficerEventType.java b/open-metadata-implementation/access-services/security-officer/security-officer-api/src/main/java/org/odpi/openmetadata/accessservices/securityofficer/api/events/SecurityOfficerEventType.java index c4428dec713..f9031943745 100644 --- a/open-metadata-implementation/access-services/security-officer/security-officer-api/src/main/java/org/odpi/openmetadata/accessservices/securityofficer/api/events/SecurityOfficerEventType.java +++ b/open-metadata-implementation/access-services/security-officer/security-officer-api/src/main/java/org/odpi/openmetadata/accessservices/securityofficer/api/events/SecurityOfficerEventType.java @@ -7,7 +7,8 @@ import java.io.Serializable; -public enum SecurityOfficerEventType implements Serializable { +public enum SecurityOfficerEventType implements Serializable +{ NEW_SECURITY_ASSIGNMENT(0, "NewSecurityAssignment", "A Security Tags assigment should be processed."), UPDATED_SECURITY_ASSIGNMENT(1, "UpdatedSecurityAssigment", "A Security Tags assignment has been updated for schema element."), @@ -20,9 +21,9 @@ public enum SecurityOfficerEventType implements Serializable { private static final long serialVersionUID = 1L; - private int eventTypeCode; - private String eventTypeName; - private String eventTypeDescription; + private final int eventTypeCode; + private final String eventTypeName; + private final String eventTypeDescription; /** * Default Constructor - sets up the specific values for this instance of the enum. diff --git a/open-metadata-implementation/access-services/security-officer/security-officer-api/src/main/java/org/odpi/openmetadata/accessservices/securityofficer/api/ffdc/SecurityOfficerAuditCode.java b/open-metadata-implementation/access-services/security-officer/security-officer-api/src/main/java/org/odpi/openmetadata/accessservices/securityofficer/api/ffdc/SecurityOfficerAuditCode.java index 199c2476713..b1b1e02870e 100644 --- a/open-metadata-implementation/access-services/security-officer/security-officer-api/src/main/java/org/odpi/openmetadata/accessservices/securityofficer/api/ffdc/SecurityOfficerAuditCode.java +++ b/open-metadata-implementation/access-services/security-officer/security-officer-api/src/main/java/org/odpi/openmetadata/accessservices/securityofficer/api/ffdc/SecurityOfficerAuditCode.java @@ -7,10 +7,7 @@ import org.odpi.openmetadata.frameworks.auditlog.messagesets.AuditLogMessageDefinition; import org.odpi.openmetadata.frameworks.auditlog.messagesets.AuditLogMessageSet; import org.odpi.openmetadata.repositoryservices.auditlog.OMRSAuditLogRecordSeverity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import java.text.MessageFormat; public enum SecurityOfficerAuditCode implements AuditLogMessageSet { @@ -96,7 +93,7 @@ public enum SecurityOfficerAuditCode implements AuditLogMessageSet - private AuditLogMessageDefinition messageDefinition; + private final AuditLogMessageDefinition messageDefinition; /** * The constructor for SecurityOfficerAuditCode expects to be passed one of the enumeration rows defined in diff --git a/open-metadata-implementation/access-services/security-officer/security-officer-api/src/main/java/org/odpi/openmetadata/accessservices/securityofficer/api/ffdc/SecurityOfficerErrorCode.java b/open-metadata-implementation/access-services/security-officer/security-officer-api/src/main/java/org/odpi/openmetadata/accessservices/securityofficer/api/ffdc/SecurityOfficerErrorCode.java index 0df20d5bb24..689ca158954 100644 --- a/open-metadata-implementation/access-services/security-officer/security-officer-api/src/main/java/org/odpi/openmetadata/accessservices/securityofficer/api/ffdc/SecurityOfficerErrorCode.java +++ b/open-metadata-implementation/access-services/security-officer/security-officer-api/src/main/java/org/odpi/openmetadata/accessservices/securityofficer/api/ffdc/SecurityOfficerErrorCode.java @@ -7,7 +7,8 @@ import org.odpi.openmetadata.frameworks.auditlog.messagesets.ExceptionMessageDefinition; import org.odpi.openmetadata.frameworks.auditlog.messagesets.ExceptionMessageSet; -public enum SecurityOfficerErrorCode implements ExceptionMessageSet { +public enum SecurityOfficerErrorCode implements ExceptionMessageSet +{ OMRS_NOT_INITIALIZED(404, "OMAS-SECURITY-OFFICER-404-001 ", "The open metadata repository services are not initialized for server {0}", @@ -68,7 +69,7 @@ public enum SecurityOfficerErrorCode implements ExceptionMessageSet { - private ExceptionMessageDefinition messageDefinition; + private final ExceptionMessageDefinition messageDefinition; /** * The constructor for SecurityOfficerErrorCode expects to be passed one of the enumeration rows defined in diff --git a/open-metadata-implementation/access-services/software-developer/software-developer-api/src/main/java/org/odpi/openmetadata/accessservices/softwaredeveloper/ffdc/SoftwareDeveloperAuditCode.java b/open-metadata-implementation/access-services/software-developer/software-developer-api/src/main/java/org/odpi/openmetadata/accessservices/softwaredeveloper/ffdc/SoftwareDeveloperAuditCode.java index 4804f597323..a57c673cbf5 100644 --- a/open-metadata-implementation/access-services/software-developer/software-developer-api/src/main/java/org/odpi/openmetadata/accessservices/softwaredeveloper/ffdc/SoftwareDeveloperAuditCode.java +++ b/open-metadata-implementation/access-services/software-developer/software-developer-api/src/main/java/org/odpi/openmetadata/accessservices/softwaredeveloper/ffdc/SoftwareDeveloperAuditCode.java @@ -51,7 +51,7 @@ public enum SoftwareDeveloperAuditCode implements AuditLogMessageSet ; - AuditLogMessageDefinition messageDefinition; + private final AuditLogMessageDefinition messageDefinition; /** diff --git a/open-metadata-implementation/access-services/software-developer/software-developer-api/src/main/java/org/odpi/openmetadata/accessservices/softwaredeveloper/ffdc/SoftwareDeveloperErrorCode.java b/open-metadata-implementation/access-services/software-developer/software-developer-api/src/main/java/org/odpi/openmetadata/accessservices/softwaredeveloper/ffdc/SoftwareDeveloperErrorCode.java index b31e9ff3530..151f6074dc7 100644 --- a/open-metadata-implementation/access-services/software-developer/software-developer-api/src/main/java/org/odpi/openmetadata/accessservices/softwaredeveloper/ffdc/SoftwareDeveloperErrorCode.java +++ b/open-metadata-implementation/access-services/software-developer/software-developer-api/src/main/java/org/odpi/openmetadata/accessservices/softwaredeveloper/ffdc/SoftwareDeveloperErrorCode.java @@ -36,7 +36,7 @@ public enum SoftwareDeveloperErrorCode implements ExceptionMessageSet - private ExceptionMessageDefinition messageDefinition; + private final ExceptionMessageDefinition messageDefinition; /** * The constructor for SoftwareDeveloperErrorCode expects to be passed one of the enumeration rows defined in diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/ffdc/StewardshipActionAuditCode.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/ffdc/StewardshipActionAuditCode.java index 03557f4b254..3631afba3bf 100644 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/ffdc/StewardshipActionAuditCode.java +++ b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/ffdc/StewardshipActionAuditCode.java @@ -50,7 +50,7 @@ public enum StewardshipActionAuditCode implements AuditLogMessageSet ; - AuditLogMessageDefinition messageDefinition; + private final AuditLogMessageDefinition messageDefinition; /** diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/ffdc/StewardshipActionErrorCode.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/ffdc/StewardshipActionErrorCode.java index 173a053343e..809071b89b1 100644 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/ffdc/StewardshipActionErrorCode.java +++ b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/ffdc/StewardshipActionErrorCode.java @@ -36,7 +36,7 @@ public enum StewardshipActionErrorCode implements ExceptionMessageSet - private ExceptionMessageDefinition messageDefinition; + private final ExceptionMessageDefinition messageDefinition; /** * The constructor for StewardshipActionErrorCode expects to be passed one of the enumeration rows defined in diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/metadataelements/ElementOriginCategory.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/metadataelements/ElementOriginCategory.java index 0a4022d5d47..89503c70fce 100644 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/metadataelements/ElementOriginCategory.java +++ b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/metadataelements/ElementOriginCategory.java @@ -38,9 +38,9 @@ public enum ElementOriginCategory implements Serializable private static final long serialVersionUID = 1L; - private int originCode; - private String originName; - private String originDescription; + private final int originCode; + private final String originName; + private final String originDescription; /** diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/DataItemSortOrder.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/DataItemSortOrder.java index f6bf1553d20..e27dadd7ea8 100644 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/DataItemSortOrder.java +++ b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/DataItemSortOrder.java @@ -32,11 +32,11 @@ public enum DataItemSortOrder implements Serializable public static final String ENUM_TYPE_GUID = "aaa4df8f-1aca-4de8-9abd-1ef2aadba300"; public static final String ENUM_TYPE_NAME = "DataItemSortOrder"; - private int openTypeOrdinal; + private final int openTypeOrdinal; - private int ordinal; - private String name; - private String description; + private final int ordinal; + private final String name; + private final String description; private static final long serialVersionUID = 1L;