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
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungboolean
archiveExistsByCode
(String code) Checks if archive exists, filtered by codeboolean
Checks if archive exists, filtered by idcreateArchive
(RestProductArchive restArchive) Creation of the product archivevoid
Delete a product archive by IDgetArchiveByCode
(String code) Gets a product archive, searched by codegetArchiveById
(Long id) Find the product archive with the given IDgetArchivesByCode
(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.
-
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
-
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
-