Class SubjectAreaUtils
java.lang.Object
org.odpi.openmetadata.accessservices.subjectarea.utilities.SubjectAreaUtils
Subject Area OMAS utilities.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
checkStatusNotDeleted
(Status status, SubjectAreaErrorCode errorCode) static Status
convertInstanceStatusToStatus
(InstanceStatus instanceStatus) static InstanceStatus
convertStatusToInstanceStatus
(Status status) static SystemAttributes
createSystemAttributes
(InstanceHeader instanceHeader) create SystemAttributes instance from an insance header objectstatic InstanceType
createTemplateFromTypeDef
(TypeDef typeDef) static CategorySummary
extractCategorySummaryFromCategory
(Category category, Relationship relationship) Convert a Category to a CategorySummarystatic GlossarySummary
extractGlossarySummaryFromGlossary
(Glossary glossary, Relationship relationship) Extract Glossary Summarystatic String
getGlossaryGuidFromAnchor
(Relationship relationship) Get glossary guid from anchorsgetIconSummarySet
(String userId, String guid) Set icon summaries from related media relationships by issuing a call to omrs using the related media guid - which is at one end of the relationship.static void
populateSystemAttributesForInstanceAuditHeader
(SystemAttributes systemAttributes, InstanceAuditHeader instanceAuditHeader) static void
setDatePropertyInInstanceProperties
(InstanceProperties instanceProperties, Date date, String propertyName) set the Date value into the InstancePropertiesstatic void
setIntegerPropertyInInstanceProperties
(InstanceProperties instanceProperties, Integer integerValue, String propertyName) Set the Integer value into the InstanceProperties.static void
setStatusPropertyInInstanceProperties
(InstanceProperties instanceProperties, TermRelationshipStatus status, String propertyName) Set status values into instance properties.static void
setStringPropertyInInstanceProperties
(InstanceProperties instanceProperties, String stringValue, String propertyName) Set the String value into the InstanceProperties.
-
Constructor Details
-
SubjectAreaUtils
public SubjectAreaUtils()
-
-
Method Details
-
createTemplateFromTypeDef
-
extractCategorySummaryFromCategory
public static CategorySummary extractCategorySummaryFromCategory(Category category, Relationship relationship) Convert a Category to a CategorySummary- Parameters:
category
- to convertrelationship
-Relationship
- Returns:
- CategorySummary
-
extractGlossarySummaryFromGlossary
public static GlossarySummary extractGlossarySummaryFromGlossary(Glossary glossary, Relationship relationship) Extract Glossary Summary- Parameters:
glossary
- the glossary that is to be summarisedrelationship
- the relationship to the glossary, which feeds part of the node summary- Returns:
- Glossary Summary or null
-
getGlossaryGuidFromAnchor
Get glossary guid from anchors- Parameters:
relationship
- -TermAnchor
orCategoryAnchor
- Returns:
- glossaryGuid
-
checkStatusNotDeleted
public static void checkStatusNotDeleted(Status status, SubjectAreaErrorCode errorCode) throws InvalidParameterException - Throws:
InvalidParameterException
-
convertInstanceStatusToStatus
-
convertStatusToInstanceStatus
-
createSystemAttributes
create SystemAttributes instance from an insance header object- Parameters:
instanceHeader
- omrs instance header- Returns:
- SystemAttributes
-
populateSystemAttributesForInstanceAuditHeader
public static void populateSystemAttributesForInstanceAuditHeader(SystemAttributes systemAttributes, InstanceAuditHeader instanceAuditHeader) -
setStringPropertyInInstanceProperties
public static void setStringPropertyInInstanceProperties(InstanceProperties instanceProperties, String stringValue, String propertyName) Set the String value into the InstanceProperties.- Parameters:
instanceProperties
- supplied instancepropertiesstringValue
- string valuepropertyName
- property name.
-
setIntegerPropertyInInstanceProperties
public static void setIntegerPropertyInInstanceProperties(InstanceProperties instanceProperties, Integer integerValue, String propertyName) Set the Integer value into the InstanceProperties.- Parameters:
instanceProperties
- supplied instancepropertiesintegerValue
- integer valuepropertyName
- property name.
-
setDatePropertyInInstanceProperties
public static void setDatePropertyInInstanceProperties(InstanceProperties instanceProperties, Date date, String propertyName) set the Date value into the InstanceProperties- Parameters:
instanceProperties
- supplied instancepropertiesdate
- Datew valuepropertyName
- property name
-
getIconSummarySet
Set icon summaries from related media relationships by issuing a call to omrs using the related media guid - which is at one end of the relationship. Note that we should only return the icons that are effective - by checking the effective From and To dates against the current time- Parameters:
userId
- userid under which to issue to the get of the related mediaguid
- to get associated icons from- Returns:
- response with Set of IconSummary objects or an Exception response.
-
setStatusPropertyInInstanceProperties
public static void setStatusPropertyInInstanceProperties(InstanceProperties instanceProperties, TermRelationshipStatus status, String propertyName) Set status values into instance properties.- Parameters:
instanceProperties
- supplied instancepropertiesstatus
- Status valuepropertyName
- property name
-