
com.thesett.catalogue.model.CatalogueManagerService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of catalogue-model Show documentation
Show all versions of catalogue-model Show documentation
A catalogue which is confugurable at the knowledge level to catalogue and organise any type of data and to provide structured access to it, free text querying of it and automatic data warehousing of events relating to it.
/*
* Copyright The Sett Ltd, 2005 to 2014.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.thesett.catalogue.model;
import java.util.List;
import java.util.Map;
import org.hibernate.criterion.Criterion;
import com.thesett.aima.attribute.impl.HierarchyType;
import com.thesett.aima.state.Attribute;
import com.thesett.aima.state.ComponentType;
/**
* The catalogue manager service provides CRUD operations on entities and their inter-relationships. It also provides
* methods to search the catalogue by free text search, or partially or fully instantiated entity instances.
*
* The retrieve operation takes the type of the entity to be retrieved. From this the implementation can figure out
* what fields need to be retrieved and from what data source.
*
* The browse operations are worth mentioning. They take a mapping of property names and attribute values to be
* matched. The use of a map allows multiple properties to be specified in a single call. The values to be matched are
* specified as attributes and the query to fetch elements matching the specified values is built from this. It is
* possible to use attributes that specify ranges of values, to retrieve entities matching the range. The browse method
* {@link #browse(EntityType, java.util.Map, String)} takes the type of entity to be retrieved, and restricts its
* results to just that entity type, the other browse method {@link #browse(java.util.Map, String)} does not restrict to
* a type, so can retrieve multiple types of entity in a single query.
*
*
CRC Card
* Responsibilities
* Provide the catalogue that this service manages.
* Perform CRUD operations on entities in the catalogue.
* Perform catalogue queries by partial attribute specification.
* Perform catalouge queries by external id.
* Perform free text catalogue searches.
* Generate long-lived external ids.
*
*
* @author Rupert Smith
*/
public interface CatalogueManagerService
{
/**
* Gets the catalogue instance.
*
* @return The catalogue.
*/
Catalogue getCatalogue();
/**
* Creates a new persistent hierarchy bean.
*
* @param hierarchy The hierarchy bean to create.
*/
void createHierarchyInstance(HierarchyInstance hierarchy);
/**
* Permanently deletes a hierarchy instance, specified by its internal id.
*
* @param type The type of the instance to delete.
* @param id The id of the instance to delete.
*/
void deleteHierarchyInstance(HierarchyType type, InternalId id);
/**
* Given an instance of a hierarchy, queries the database to see if that instance exists in it, and optionally if
* any child instances of it exist too. The resulting hierarchy instances are all returned in a list.
*
* @param hierarchy The hierarchy instance to query against.
* @param queryChildren true to also query against children of the instance.
*
* @return A list matching hierarchy instances, or an empty list if none are found.
*/
List© 2015 - 2025 Weber Informatics LLC | Privacy Policy