Package gov.niem.tools.api.db.namespace
Class NamespaceService
java.lang.Object
gov.niem.tools.api.db.base.BaseEntityService<Namespace>
gov.niem.tools.api.db.namespace.NamespaceService
Operations to support namespaces.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a new namespace in the database with the given namespace object and adds it to the given version object.Creates a new namespace in the database with the given fields and adds it to the given version.Creates a new namespace in the database with the given namespace object and adds it to the version with the given version fields.Creates a new namespace in the database with the given namespace fields and adds it to the version with the given version fields.Creates a new namespace in the database with the given namespace fields and adds it to the version with the given version fields.void
assertRequiredLocalFields
(Namespace namespace) Checks that all required fields are present.void
assertUnique
(Namespace namespace) Checks that the database does not already contain a namespace with the same identifying fields as the given namespace object.findAll()
Finds all namespaces in the database.findByKeys
(String stewardKey, String modelKey, String versionNumber) Finds all namespaces in the database in the version with the given fields.Finds a namespace in the database matching identifiers in the given namespace object.Finds a namespace in the database with the given prefix in the version matching the given version object.Finds a namespace in the database with the given prefix in the version with the given version fields.findOneOptional
(Version version, String prefix) Optionally finds a namespace in the database with the given prefix in the given version.findOneOptional
(String stewardKey, String modelKey, String versionNumber, String prefix) Optionally finds a namespace in the database with the given prefix in the version with the given version fields.Methods inherited from class gov.niem.tools.api.db.base.BaseEntityService
add, assertFieldNotNullAndNotEmpty, delete, edit, findOneOptional, getEntityClassName, getNotFoundException, loadId, merge, saveExisting, saveNew, throwNotFound, throwNotFound, throwNotFound, throwNotUnique, throwNotUnique, throwNotUnique
-
Constructor Details
-
NamespaceService
public NamespaceService()
-
-
Method Details
-
repository
- Specified by:
repository
in classBaseEntityService<Namespace>
-
add
Creates a new namespace in the database with the given fields and adds it to the given version.- Throws:
Exception
-
add
public Namespace add(String stewardKey, String modelKey, String versionNumber, String prefix, String name) throws Exception Creates a new namespace in the database with the given namespace fields and adds it to the version with the given version fields.- Throws:
Exception
-
add
public Namespace add(String stewardKey, String modelKey, String versionNumber, String prefix) throws Exception Creates a new namespace in the database with the given namespace fields and adds it to the version with the given version fields.- Throws:
Exception
-
add
public Namespace add(String stewardKey, String modelKey, String versionNumber, Namespace namespace) throws Exception Creates a new namespace in the database with the given namespace object and adds it to the version with the given version fields.- Throws:
Exception
-
add
Creates a new namespace in the database with the given namespace object and adds it to the given version object.- Throws:
Exception
-
findAll
Finds all namespaces in the database. -
findByKeys
public Set<Namespace> findByKeys(String stewardKey, String modelKey, String versionNumber) throws EntityNotFoundException Finds all namespaces in the database in the version with the given fields.- Throws:
EntityNotFoundException
-
findOneOptional
public Optional<Namespace> findOneOptional(Version version, String prefix) throws EntityNotFoundException Optionally finds a namespace in the database with the given prefix in the given version.- Throws:
EntityNotFoundException
-
findOneOptional
public Optional<Namespace> findOneOptional(String stewardKey, String modelKey, String versionNumber, String prefix) throws EntityNotFoundException Optionally finds a namespace in the database with the given prefix in the version with the given version fields.- Throws:
EntityNotFoundException
-
findOne
public Namespace findOne(String stewardKey, String modelKey, String versionNumber, String prefix) throws EntityNotFoundException Finds a namespace in the database with the given prefix in the version with the given version fields.- Throws:
EntityNotFoundException
-
findOne
Finds a namespace in the database with the given prefix in the version matching the given version object.- Throws:
EntityNotFoundException
-
findOne
Finds a namespace in the database matching identifiers in the given namespace object.- Specified by:
findOne
in classBaseEntityService<Namespace>
- Throws:
EntityNotFoundException
-
assertRequiredLocalFields
Checks that all required fields are present.- Specified by:
assertRequiredLocalFields
in classBaseEntityService<Namespace>
- Throws:
FieldNotFoundException
-
assertUnique
Checks that the database does not already contain a namespace with the same identifying fields as the given namespace object.- Specified by:
assertUnique
in classBaseEntityService<Namespace>
- Throws:
EntityNotUniqueException
-