Skip to content

Commit

Permalink
Merge pull request #8212 from mandy-chessell/oak2024
Browse files Browse the repository at this point in the history
New certificates and new asset searches (attempt 2)
  • Loading branch information
mandy-chessell authored Jun 5, 2024
2 parents abe210e + d538c04 commit a701425
Show file tree
Hide file tree
Showing 90 changed files with 3,825 additions and 2,187 deletions.
Binary file modified EgeriaClient.p12
Binary file not shown.
Binary file modified keystore.p12
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ distributions {
fileMode = 0755
}
into('assembly/opt/http-client-collections') {
// Describe the sample-clients layout
// Describe the HTTP clients
from { "$rootProject.projectDir/open-metadata-distribution/omag-server-platform/docs/http-client-collections" }
fileMode = 0755
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@


import org.odpi.openmetadata.frameworks.connectors.properties.beans.Asset;
import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementBase;

import java.util.List;
import java.util.Objects;

/**
* AssetGraph is used to return an asset along with all of its anchored elements and the relationships
Expand All @@ -29,17 +29,117 @@ public AssetGraph()
/**
* Copy/clone constructor. Note, this is a deep copy
*
* @param template template values for asset summary
* @param template template values for asset
*/
public AssetGraph(Asset template)
{
super(template);
}


/**
* Copy/clone constructor. Note, this is a deep copy
*
* @param template template values for asset graph
*/
public AssetGraph(AssetGraph template)
{
super(template);

if (template != null)
{

anchoredElements = template.getAnchoredElements();
relationships = template.getRelationships();
}
}


/**
* Return the list of elements that are anchored to the asset.
*
* @return anchored elements
*/
public List<MetadataElement> getAnchoredElements()
{
return anchoredElements;
}


/**
* Set up the list of elements that are anchored to the asset.
*
* @param anchoredElements anchored elements
*/
public void setAnchoredElements(List<MetadataElement> anchoredElements)
{
this.anchoredElements = anchoredElements;
}


/**
* Return the relationships that connector the anchored elements to the asset, to each other,
* and to other open metadata elements.
*
* @return relationships
*/
public List<MetadataRelationship> getRelationships()
{
return relationships;
}


/**
* Set up the relationships that connector the anchored elements to the asset, to each other,
* and to other open metadata elements.
*
* @param relationships relationships
*/
public void setRelationships(List<MetadataRelationship> relationships)
{
this.relationships = relationships;
}


/**
* Standard toString method.
*
* @return print out of variables in a JSON-style
*/
@Override
public String toString()
{
return "AssetGraph{" +
"anchoredElements=" + anchoredElements +
", relationships=" + relationships +
"} " + super.toString();
}


/**
* Compare the values of the supplied object with those stored in the current object.
*
* @param objectToCompare supplied object
* @return boolean result of comparison
*/
@Override
public boolean equals(Object objectToCompare)
{
if (this == objectToCompare) return true;
if (objectToCompare == null || getClass() != objectToCompare.getClass()) return false;
if (!super.equals(objectToCompare)) return false;
AssetGraph that = (AssetGraph) objectToCompare;
return Objects.equals(anchoredElements, that.anchoredElements) && Objects.equals(relationships, that.relationships);
}


/**
* Return hash code based on properties.
*
* @return int
*/
@Override
public int hashCode()
{
return Objects.hash(super.hashCode(), anchoredElements, relationships);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@


import org.odpi.openmetadata.frameworks.connectors.properties.beans.Asset;
import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementBase;

import java.util.List;
import java.util.Objects;

/**
* AssetSearchMatches is used to return an asset whose has anchored elements returned from a search.
* The matching element are the OCF beans for the matching elements.
*/
public class AssetSearchMatches extends Asset
{
List<ElementBase> matchingElements = null;
List<MetadataElement> matchingElements = null;

/**
* Default constructor
Expand All @@ -31,29 +31,88 @@ public AssetSearchMatches()
* @param template template values for asset summary
*/
public AssetSearchMatches(Asset template)
{
super(template);
}


/**
* Copy/clone constructor. Note, this is a deep copy
*
* @param template template values for asset summary
*/
public AssetSearchMatches(AssetSearchMatches template)
{
super(template);

if (template != null)
{

matchingElements = template.getMatchingElements();
}
}


/**
* Return the list of anchored elements that match the search criteria.
*
* @return
* @return list
*/
public List<ElementBase> getMatchingElements()
public List<MetadataElement> getMatchingElements()
{
return matchingElements;
}

public void setMatchingElements(List<ElementBase> matchingElements)

/**
* Set up the list of anchored elements that match the search criteria.
*
* @param matchingElements list
*/
public void setMatchingElements(List<MetadataElement> matchingElements)
{
this.matchingElements = matchingElements;
}


/**
* JSON-style toString
*
* @return return string containing the property names and values
*/
@Override
public String toString()
{
return "AssetSearchMatches{" +
"matchingElements=" + matchingElements +
"} " + super.toString();
}


/**
* 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;
AssetSearchMatches that = (AssetSearchMatches) objectToCompare;
return Objects.equals(matchingElements, that.matchingElements);
}


/**
* Return hash code for this object
*
* @return int hash code
*/
@Override
public int hashCode()
{
return Objects.hash(super.hashCode(), matchingElements);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementBase;
import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementHeader;

import java.util.HashMap;
Expand All @@ -25,6 +26,14 @@ public class MetadataElement extends ElementHeader
{
private Map<String, Object> properties = null;

/**
* Default constructor used by subclasses
*/
public MetadataElement()
{
}


/**
* Copy/clone constructor
*
Expand Down Expand Up @@ -52,8 +61,6 @@ public MetadataElement(ElementHeader template)
}




/**
* Set up the properties for the element.
* If no stored properties are present then null is returned.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ public class MetadataRelationship extends ElementHeader
private ElementStub end1 = null;
private ElementStub end2 = null;

/**
* Default constructor
*/
public MetadataRelationship()
{
}


/**
* Copy/clone constructor
*
Expand All @@ -43,6 +51,8 @@ public MetadataRelationship(MetadataRelationship template)
if (template != null)
{
properties = template.getProperties();
end1 = template.getEnd1();
end2 = template.getEnd2();
}
}

Expand All @@ -58,8 +68,6 @@ public MetadataRelationship(ElementHeader template)
}




/**
* Set up the properties for the element.
* If no stored properties are present then null is returned.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
@JsonSubTypes({
@JsonSubTypes.Type(value = TagResponse.class, name = "TagResponse"),
@JsonSubTypes.Type(value = PagedResponse.class, name = "PagedResponse"),
@JsonSubTypes.Type(value = GlossaryTermResponse.class, name = "GlossaryTermResponse")
@JsonSubTypes.Type(value = AssetGraphResponse.class, name = "AssetGraphResponse"),
@JsonSubTypes.Type(value = AssetSearchMatchesListResponse.class, name = "AssetSearchMatchesListResponse")
})
public abstract class AssetConsumerOMASAPIResponse extends FFDCResponseBase
{
Expand Down
Loading

0 comments on commit a701425

Please sign in to comment.