Package de.dlr.proseo.archivemgr.rest
Klasse ProductArchiveManager
java.lang.Object
de.dlr.proseo.archivemgr.rest.ProductArchiveManager
Service methods required to create, modify and delete product archives in the
prosEO database, and to query the database about such archives
- Autor:
- Denys Chaykovskiy
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibung(Package privat) ProductArchiveManagerConfiguration
The product archive manager configuration -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungboolean
archiveExistsByCode
(String code) Checks if archive exists, filtered by codeboolean
Checks if archive exists, filtered by idcountArchives
(Long id, String code, String name, String archiveType) Count the product archives matching the specified name and archive typecreateArchive
(RestProductArchive restArchive) Creation of the product archivejavax.persistence.Query
Create database query to count or get objectsvoid
Delete a product archive by IDgetArchiveByCode
(String code) Gets a product archive, searched by codegetArchiveById
(Long id) Find the product archive with the given IDgetArchives
(Long id, String code, String name, String archiveType, Integer recordFrom, Integer recordTo) Get product archives by name and archive typegetArchivesByCode
(String code) List of all product archives archives filtered by codemodifyArchive
(Long id, RestProductArchive restArchive) Update the product archive with the given ID with the attribute values of the given Json object.
-
Felddetails
-
config
The product archive manager configuration
-
-
Konstruktordetails
-
ProductArchiveManager
public ProductArchiveManager()
-
-
Methodendetails
-
createArchive
public RestProductArchive createArchive(RestProductArchive restArchive) throws IllegalArgumentException Creation of the product archive- Parameter:
restArchive
- Rest Product Archive- Gibt zurück:
- created Rest Product Archive
- Löst aus:
IllegalArgumentException
- if mandatory parameters missed or wrong
-
archiveExistsByCode
Checks if archive exists, filtered by code- Parameter:
code
- code of the archive- Gibt zurück:
- true if exists
-
archiveExistsById
Checks if archive exists, filtered by id- Parameter:
id
- id of the archive- Gibt zurück:
- true if exists
-
getArchiveByCode
Gets a product archive, searched by code- Parameter:
code
- the code of the product archive- Gibt zurück:
- product archive
- Löst aus:
IllegalArgumentException
- if no product archive matching the given code could be found
-
getArchivesByCode
List of all product archives archives filtered by code- Parameter:
code
- the code of the product archive- Gibt zurück:
- a list of product archives, if code == null, returns all archives
- Löst aus:
javax.persistence.NoResultException
- if no product archives matching the given search criteria could be found
-
getArchiveById
public RestProductArchive getArchiveById(Long id) throws IllegalArgumentException, javax.persistence.NoResultException Find the product archive with the given ID- Parameter:
id
- the ID to look for- Gibt zurück:
- a Json object corresponding to the product archive found
- Löst aus:
IllegalArgumentException
- if no product archive ID was givenjavax.persistence.NoResultException
- if no product archive with the given ID exists
-
createArchivesQuery
public javax.persistence.Query createArchivesQuery(Long id, String code, String name, String archiveType, Boolean count) Create database query to count or get objects- Parameter:
code
- the archive codename
- the archive namearchiveType
- the archive typecount
- if true create query for count of objects- Gibt zurück:
- a database query
-
getArchives
public List<RestProductArchive> getArchives(Long id, String code, String name, String archiveType, Integer recordFrom, Integer recordTo) throws javax.persistence.NoResultException Get product archives by name and archive type- Parameter:
code
- the archive codename
- the archive namearchiveType
- the archive typerecordFrom
- first record of filtered and ordered result to returnrecordTo
- last record of filtered and ordered result to return- Gibt zurück:
- a list of Json objects representing product archives satisfying the search criteria
- Löst aus:
javax.persistence.NoResultException
- if no product archives matching the given search criteria could be found
-
countArchives
Count the product archives matching the specified name and archive type- Parameter:
name
- the product archive namearchiveType
- the product archive type- Gibt zurück:
- the number of product archives found as string
-
modifyArchive
Update the product archive with the given ID with the attribute values of the given Json object. Unchanged values must be provided, too, or they will be changed to null.- Parameter:
id
- the ID of the product archive to updaterestArchive
- a Json object containing the modified (and unmodified) attributes- Gibt zurück:
- a Json object corresponding to the product archive after modification (with ID and version for all contained objects)
- Löst aus:
javax.persistence.EntityNotFoundException
- if no product with the given ID existsIllegalArgumentException
- if any of the input data was invalidConcurrentModificationException
- if the facility has been modified since retrieval by the client
-
deleteArchiveById
public void deleteArchiveById(Long id) throws javax.persistence.EntityNotFoundException, IllegalArgumentException, RuntimeException Delete a product archive by ID- Parameter:
id
- the ID of the product archive to delete- Löst aus:
javax.persistence.EntityNotFoundException
- if the product archive to delete does not exist in the databaseIllegalArgumentException
- if the product archive to delete still has stored productsRuntimeException
- if the deletion was not performed as expected
-