Skip to content

Commit 5c80e9e

Browse files
Merge pull request #8904 from mandy-chessell/oak2025
Add classification history and null metadata collection ids
2 parents f5c4d8d + 26df540 commit 5c80e9e

File tree

71 files changed

+3530
-423
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+3530
-423
lines changed

application.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ platform.placeholder.variables=\
7777
startup.user=platform
7878
# Comma separated names of servers to be started. The server names should be unquoted.
7979
startup.server.list=active-metadata-store,engine-host,integration-daemon,view-server,simple-metadata-store
80+
#startup.server.list=active-metadata-store,simple-metadata-store,metadata-access-point,engine-host,integration-daemon,view-server
8081
#startup.server.list=qs-metadata-store,qs-engine-host,qs-integration-daemon,qs-view-server
8182

8283
################################################

open-metadata-implementation/access-services/gaf-metadata-management/gaf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/gaf/client/OpenGovernanceClientBase.java

Lines changed: 0 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -407,93 +407,6 @@ public List<EngineActionElement> getActiveEngineActions(String userId,
407407
return restResult.getElements();
408408
}
409409

410-
411-
/**
412-
* Retrieve the list of engine action metadata elements that contain the search string.
413-
* The search string is treated as a regular expression.
414-
*
415-
* @param userId calling user
416-
* @param searchString string to find in the properties
417-
*
418-
* @return list of matching metadata elements
419-
*
420-
* @throws InvalidParameterException one of the parameters is invalid
421-
* @throws UserNotAuthorizedException the user is not authorized to issue this request
422-
* @throws PropertyServerException there is a problem reported in the open metadata server(s)
423-
*/
424-
@Override
425-
public List<EngineActionElement> findEngineActions(String userId,
426-
String searchString,
427-
SearchOptions searchOptions) throws InvalidParameterException,
428-
UserNotAuthorizedException,
429-
PropertyServerException
430-
{
431-
final String methodName = "findEngineActions";
432-
final String searchStringParameterName = "searchString";
433-
final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/{1}/open-governance-service/users/{2}/engine-actions/by-search-string";
434-
435-
invalidParameterHandler.validateUserId(userId, methodName);
436-
invalidParameterHandler.validateSearchString(searchString, searchStringParameterName, methodName);
437-
438-
SearchStringRequestBody requestBody = new SearchStringRequestBody(searchOptions);
439-
440-
requestBody.setSearchString(searchString);
441-
requestBody.setSearchStringParameterName(searchStringParameterName);
442-
443-
EngineActionElementsResponse restResult = restClient.callEngineActionsPostRESTCall(methodName,
444-
urlTemplate,
445-
requestBody,
446-
serverName,
447-
serviceURLMarker,
448-
userId);
449-
450-
return restResult.getElements();
451-
}
452-
453-
454-
/**
455-
* Retrieve the list of engine action metadata elements with a matching qualified or display name.
456-
* There are no wildcards supported on this request.
457-
*
458-
* @param userId calling user
459-
* @param name name to search for
460-
* @param queryOptions additional options to control the results of the query
461-
*
462-
* @return list of matching metadata elements
463-
*
464-
* @throws InvalidParameterException one of the parameters is invalid
465-
* @throws UserNotAuthorizedException the user is not authorized to issue this request
466-
* @throws PropertyServerException there is a problem reported in the open metadata server(s)
467-
*/
468-
@Override
469-
public List<EngineActionElement> getEngineActionsByName(String userId,
470-
String name,
471-
QueryOptions queryOptions) throws InvalidParameterException,
472-
UserNotAuthorizedException,
473-
PropertyServerException
474-
{
475-
final String methodName = "getEngineActionsByName";
476-
final String nameParameterName = "name";
477-
final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/{1}/open-governance-service/users/{2}/engine-actions/by-name";
478-
479-
invalidParameterHandler.validateUserId(userId, methodName);
480-
invalidParameterHandler.validateName(name, nameParameterName, methodName);
481-
482-
NameRequestBody requestBody = new NameRequestBody(queryOptions);
483-
484-
requestBody.setName(name);
485-
requestBody.setNameParameterName(nameParameterName);
486-
487-
EngineActionElementsResponse restResult = restClient.callEngineActionsPostRESTCall(methodName,
488-
urlTemplate,
489-
requestBody,
490-
serverName,
491-
serviceURLMarker,
492-
userId);
493-
494-
return restResult.getElements();
495-
}
496-
497410

498411
/**
499412
* Link elements as peer duplicates. Create a simple relationship between two elements.

open-metadata-implementation/access-services/gaf-metadata-management/gaf-metadata-server/src/main/java/org/odpi/openmetadata/frameworkservices/gaf/server/OpenGovernanceRESTServices.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import org.odpi.openmetadata.frameworks.openmetadata.ffdc.InvalidParameterException;
2121
import org.odpi.openmetadata.frameworks.openmetadata.ffdc.PropertyServerException;
2222
import org.odpi.openmetadata.frameworks.openmetadata.ffdc.UserNotAuthorizedException;
23-
import org.odpi.openmetadata.frameworks.openmetadata.mermaid.SpecificationMermaidGraphBuilder;
2423
import org.odpi.openmetadata.frameworks.openmetadata.properties.OpenMetadataElement;
2524
import org.odpi.openmetadata.frameworks.openmetadata.properties.OpenMetadataElementStub;
2625
import org.odpi.openmetadata.frameworks.openmetadata.types.OpenMetadataProperty;

open-metadata-implementation/access-services/gaf-metadata-management/gaf-metadata-spring/src/main/java/org/odpi/openmetadata/frameworkservices/gaf/server/spring/OpenGovernanceResource.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,11 @@
66
import io.swagger.v3.oas.annotations.Operation;
77
import io.swagger.v3.oas.annotations.tags.Tag;
88
import org.odpi.openmetadata.commonservices.ffdc.rest.*;
9-
import org.odpi.openmetadata.frameworks.opengovernance.properties.GovernanceActionProcessStepProperties;
10-
import org.odpi.openmetadata.frameworks.opengovernance.properties.GovernanceActionTypeProperties;
119
import org.odpi.openmetadata.frameworkservices.gaf.rest.*;
1210
import org.odpi.openmetadata.frameworkservices.gaf.server.OpenGovernanceRESTServices;
1311
import org.odpi.openmetadata.frameworkservices.omf.rest.ConsolidatedDuplicatesRequestBody;
1412
import org.odpi.openmetadata.frameworkservices.omf.rest.PeerDuplicatesRequestBody;
15-
import org.springframework.web.bind.annotation.GetMapping;
16-
import org.springframework.web.bind.annotation.PathVariable;
17-
import org.springframework.web.bind.annotation.PostMapping;
18-
import org.springframework.web.bind.annotation.RequestBody;
19-
import org.springframework.web.bind.annotation.RequestMapping;
20-
import org.springframework.web.bind.annotation.RequestParam;
21-
import org.springframework.web.bind.annotation.RestController;
13+
import org.springframework.web.bind.annotation.*;
2214

2315
/**
2416
* OpenGovernanceResource supports the REST APIs for common governance functions.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
/* SPDX-License-Identifier: Apache-2.0 */
2+
/* Copyright Contributors to the ODPi Egeria project. */
3+
4+
package org.odpi.openmetadata.frameworkservices.omf.rest;
5+
6+
import com.fasterxml.jackson.annotation.JsonAutoDetect;
7+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
8+
import com.fasterxml.jackson.annotation.JsonInclude;
9+
import org.odpi.openmetadata.frameworks.openmetadata.properties.AttachedClassification;
10+
11+
import java.util.List;
12+
import java.util.Objects;
13+
14+
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE;
15+
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY;
16+
17+
/**
18+
* The response object for passing back a list of omf AttachedClassifications
19+
* or an exception if the request failed.
20+
*/
21+
@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE)
22+
@JsonInclude(JsonInclude.Include.NON_NULL)
23+
@JsonIgnoreProperties(ignoreUnknown=true)
24+
public class AttachedClassificationsResponse extends OMAGOMFAPIResponse
25+
{
26+
private List<AttachedClassification> classifications = null;
27+
28+
29+
/**
30+
* Default constructor
31+
*/
32+
public AttachedClassificationsResponse()
33+
{
34+
}
35+
36+
37+
/**
38+
* Copy/clone constructor
39+
*
40+
* @param template object to copy
41+
*/
42+
public AttachedClassificationsResponse(AttachedClassificationsResponse template)
43+
{
44+
super(template);
45+
46+
if (template != null)
47+
{
48+
classifications = template.getClassifications();
49+
}
50+
}
51+
52+
53+
/**
54+
* Return the list of metadata elements.
55+
*
56+
* @return result object
57+
*/
58+
public List<AttachedClassification> getClassifications()
59+
{
60+
return classifications;
61+
}
62+
63+
64+
/**
65+
* Set up the metadata element to return.
66+
*
67+
* @param classifications result object
68+
*/
69+
public void setClassifications(List<AttachedClassification> classifications)
70+
{
71+
this.classifications = classifications;
72+
}
73+
74+
75+
/**
76+
* JSON-style toString
77+
*
78+
* @return return string containing the property names and values
79+
*/
80+
@Override
81+
public String toString()
82+
{
83+
return "AttachedClassificationsResponse{" +
84+
"classifications=" + classifications +
85+
"} " + super.toString();
86+
}
87+
88+
89+
/**
90+
* Return comparison result based on the content of the properties.
91+
*
92+
* @param objectToCompare test object
93+
* @return result of comparison
94+
*/
95+
@Override
96+
public boolean equals(Object objectToCompare)
97+
{
98+
if (this == objectToCompare)
99+
{
100+
return true;
101+
}
102+
if (objectToCompare == null || getClass() != objectToCompare.getClass())
103+
{
104+
return false;
105+
}
106+
if (!super.equals(objectToCompare))
107+
{
108+
return false;
109+
}
110+
AttachedClassificationsResponse that = (AttachedClassificationsResponse) objectToCompare;
111+
return Objects.equals(classifications, that.classifications);
112+
}
113+
114+
115+
/**
116+
* Return hash code for this object
117+
*
118+
* @return int hash code
119+
*/
120+
@Override
121+
public int hashCode()
122+
{
123+
return Objects.hash(super.hashCode(), classifications);
124+
}
125+
}

open-metadata-implementation/access-services/omf-metadata-management/omf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/omf/client/OpenMetadataClientBase.java

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,7 @@ public RelatedMetadataElement getRelatedMetadataElement(String userId,
10151015
* @param elementGUID unique identifier for the metadata element
10161016
* @param queryOptions multiple options to control the query
10171017
*
1018-
* @return a list of elements matching the supplied criteria; null means no matching elements in the metadata store.
1018+
* @return a list of classifications matching the supplied criteria; null means no matching elements in the metadata store.
10191019
* @throws InvalidParameterException one of the search parameters are is invalid
10201020
* @throws UserNotAuthorizedException the userId is not permitted to perform this operation.
10211021
* @throws PropertyServerException there is a problem accessing the metadata store
@@ -1045,6 +1045,47 @@ public List<OpenMetadataElement> getMetadataElementHistory(String
10451045
}
10461046

10471047

1048+
1049+
/**
1050+
* Return each of the versions of a metadata element's classification.
1051+
*
1052+
* @param userId caller's userId
1053+
* @param elementGUID unique identifier for the metadata element
1054+
* @param classificationName name of the classification to retrieve
1055+
* @param queryOptions multiple options to control the query
1056+
*
1057+
* @return a list of elements matching the supplied criteria; null means no matching elements in the metadata store.
1058+
* @throws InvalidParameterException one of the search parameters are is invalid
1059+
* @throws UserNotAuthorizedException the userId is not permitted to perform this operation.
1060+
* @throws PropertyServerException there is a problem accessing the metadata store
1061+
*/
1062+
@Override
1063+
public List<AttachedClassification> getClassificationHistory(String userId,
1064+
String elementGUID,
1065+
String classificationName,
1066+
HistoricalQueryOptions queryOptions) throws InvalidParameterException,
1067+
UserNotAuthorizedException,
1068+
PropertyServerException
1069+
{
1070+
final String methodName = "getClassificationHistory";
1071+
final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/open-metadata-store/users/{1}/metadata-elements/{2}/classifications/{3}/history";
1072+
1073+
invalidParameterHandler.validateUserId(userId, methodName);
1074+
1075+
HistoryRequestBody requestBody = new HistoryRequestBody(queryOptions);
1076+
1077+
AttachedClassificationsResponse restResult = restClient.callAttachedClassificationsPostRESTCall(methodName,
1078+
urlTemplate,
1079+
requestBody,
1080+
serverName,
1081+
userId,
1082+
elementGUID,
1083+
classificationName);
1084+
1085+
return restResult.getClassifications();
1086+
}
1087+
1088+
10481089
/**
10491090
* Retrieve the relationships linking to the supplied elements.
10501091
*

open-metadata-implementation/access-services/omf-metadata-management/omf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/omf/client/rest/OMFRESTClient.java

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,37 @@ public OpenMetadataElementsResponse callOpenMetadataElementsPostRESTCall(String
321321
}
322322

323323

324+
/**
325+
* Issue a POST REST call that returns a AttachedClassificationsResponse object.
326+
*
327+
* @param methodName name of the method being called.
328+
* @param urlTemplate template of the URL for the REST API call, with place-holders for the parameters.
329+
* @param requestBody object that passes additional parameters
330+
* @param params a list of parameters that are slotted into the url template.
331+
*
332+
* @return response object
333+
* @throws InvalidParameterException one of the parameters is invalid.
334+
* @throws UserNotAuthorizedException the user is not authorized to make this request.
335+
* @throws PropertyServerException the repository is not available or not working properly.
336+
*/
337+
public AttachedClassificationsResponse callAttachedClassificationsPostRESTCall(String methodName,
338+
String urlTemplate,
339+
Object requestBody,
340+
Object... params) throws InvalidParameterException,
341+
UserNotAuthorizedException,
342+
PropertyServerException
343+
{
344+
AttachedClassificationsResponse restResult = this.callPostRESTCall(methodName,
345+
AttachedClassificationsResponse.class,
346+
urlTemplate,
347+
requestBody,
348+
params);
349+
350+
exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult);
351+
return restResult;
352+
}
353+
354+
324355
/**
325356
* Issue a POST REST call that returns a OpenMetadataElementResponse object.
326357
*

0 commit comments

Comments
 (0)