Class SubjectAreaUtils
- java.lang.Object
-
- org.odpi.openmetadata.accessservices.subjectarea.utilities.SubjectAreaUtils
-
public class SubjectAreaUtils extends Object
Subject Area OMAS utilities.
-
-
Constructor Summary
Constructors Constructor Description SubjectAreaUtils()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidcheckStatusNotDeleted(Status status, SubjectAreaErrorCode errorCode)static StatusconvertInstanceStatusToStatus(InstanceStatus instanceStatus)static InstanceStatusconvertStatusToInstanceStatus(Status status)static SystemAttributescreateSystemAttributes(InstanceHeader instanceHeader)create SystemAttributes instance from an insance header objectstatic InstanceTypecreateTemplateFromTypeDef(TypeDef typeDef)static CategorySummaryextractCategorySummaryFromCategory(Category category, Relationship relationship)Convert a Category to a CategorySummarystatic GlossarySummaryextractGlossarySummaryFromGlossary(Glossary glossary, Relationship relationship)Extract Glossary Summarystatic StringgetGlossaryGuidFromAnchor(Relationship relationship)Get glossary guid from anchorsSubjectAreaOMASAPIResponse<IconSummary>getIconSummarySet(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 voidpopulateSystemAttributesForInstanceAuditHeader(SystemAttributes systemAttributes, InstanceAuditHeader instanceAuditHeader)static voidsetDatePropertyInInstanceProperties(InstanceProperties instanceProperties, Date date, String propertyName)set the Date value into the InstancePropertiesstatic voidsetIntegerPropertyInInstanceProperties(InstanceProperties instanceProperties, Integer integerValue, String propertyName)Set the Integer value into the InstanceProperties.static voidsetStringPropertyInInstanceProperties(InstanceProperties instanceProperties, String stringValue, String propertyName)Set the String value into the InstanceProperties.
-
-
-
Method Detail
-
createTemplateFromTypeDef
public static InstanceType createTemplateFromTypeDef(TypeDef typeDef)
-
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
public static String getGlossaryGuidFromAnchor(Relationship relationship)
Get glossary guid from anchors- Parameters:
relationship- -TermAnchororCategoryAnchor- Returns:
- glossaryGuid
-
checkStatusNotDeleted
public static void checkStatusNotDeleted(Status status, SubjectAreaErrorCode errorCode) throws InvalidParameterException
- Throws:
InvalidParameterException
-
convertInstanceStatusToStatus
public static Status convertInstanceStatusToStatus(InstanceStatus instanceStatus)
-
convertStatusToInstanceStatus
public static InstanceStatus convertStatusToInstanceStatus(Status status)
-
createSystemAttributes
public static SystemAttributes createSystemAttributes(InstanceHeader instanceHeader)
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
public SubjectAreaOMASAPIResponse<IconSummary> getIconSummarySet(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. 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.
-
-