Interface ProfileService
-
- All Superinterfaces:
java.lang.AutoCloseable
,VitamAutoCloseable
- All Known Implementing Classes:
ProfileServiceImpl
public interface ProfileService extends VitamAutoCloseable
This service manages the creation, update, find, ... profiles
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RequestResponse<ProfileModel>
createProfiles(java.util.List<ProfileModel> profileModelList)
Create a collections of profile After passing the validation steps.javax.ws.rs.core.Response
downloadProfileFile(java.lang.String profileIdentifier)
download file corresponding to profileIdentifierProfileModel
findByIdentifier(java.lang.String identifier)
Find profile by identifierRequestResponseOK<ProfileModel>
findProfiles(com.fasterxml.jackson.databind.JsonNode queryDsl)
find Profile by QueryDslRequestResponse<ProfileModel>
importProfileFile(java.lang.String profileIdentifier, java.io.InputStream profileFile)
1.RequestResponse<ProfileModel>
updateProfile(ProfileModel profileModel, com.fasterxml.jackson.databind.JsonNode jsonDsl)
Update profileRequestResponse<ProfileModel>
updateProfile(java.lang.String identifier, com.fasterxml.jackson.databind.JsonNode jsonDsl)
Update profiles after passing validation steps : Field modified : - ActivationDate - DesactivationDate - LastUpdate - Status-
Methods inherited from interface fr.gouv.vitam.common.model.VitamAutoCloseable
close
-
-
-
-
Method Detail
-
createProfiles
RequestResponse<ProfileModel> createProfiles(java.util.List<ProfileModel> profileModelList) throws VitamException
Create a collections of profile After passing the validation steps. If all the profiles are valid, they are stored in the collection and indexed. The profiles are not valid in the following situations :- The collection contains 2 ore many profile having the same identifier
- One or more mandatory field is missing
- A field has an invalid format
- One or many profile already exist in the database
- Parameters:
profileModelList
- the list of profiles to be created- Returns:
- RequestResponseOK if success or VitamError
- Throws:
VitamException
- if in error occurs while validating contracts
-
importProfileFile
RequestResponse<ProfileModel> importProfileFile(java.lang.String profileIdentifier, java.io.InputStream profileFile) throws VitamException
1. Check that the document with given id exists else return VitamError 2. Check that the document is (xsd, rng, ...) valid format else return VitamError 3. If ok, save the file is the storage with the name (the given profile id) TODO 4. In case of rng, check if RG exists ?!- Parameters:
profileIdentifier
- the profile identifierprofileFile
- the profile file as an input stream- Returns:
- RequestResponseOK if success or VitamError
- Throws:
VitamException
- thrown if the profiles could not be imported
-
downloadProfileFile
javax.ws.rs.core.Response downloadProfileFile(java.lang.String profileIdentifier) throws ProfileNotFoundException, InvalidParseOperationException, ReferentialException
download file corresponding to profileIdentifier- Parameters:
profileIdentifier
- the profile identifier- Returns:
- Response
- Throws:
ProfileNotFoundException
- thrown if the profile could not be foundInvalidParseOperationException
- thrown if the query could not be executedReferentialException
- thrown if the query could not be executedVitamException
- thrown if another error is encountered
-
updateProfile
RequestResponse<ProfileModel> updateProfile(java.lang.String identifier, com.fasterxml.jackson.databind.JsonNode jsonDsl) throws VitamException
Update profiles after passing validation steps : Field modified :- - ActivationDate
- - DesactivationDate
- - LastUpdate
- - Status
- Parameters:
identifier
- identifier of the profile to updatejsonDsl
- the given profile dsl for update- Returns:
- RequestResponseOK if success or VitamError
- Throws:
VitamException
- if in error occurs while validating contracts
-
updateProfile
RequestResponse<ProfileModel> updateProfile(ProfileModel profileModel, com.fasterxml.jackson.databind.JsonNode jsonDsl) throws VitamException
Update profile- Parameters:
profileModel
- the updated ProfileModeljsonDsl
- the query as a json- Returns:
- a response as a RequestResponse
object - Throws:
VitamException
- thrown if the update could not be executed
-
findByIdentifier
ProfileModel findByIdentifier(java.lang.String identifier) throws ReferentialException, InvalidParseOperationException
Find profile by identifier- Parameters:
identifier
- the Profile identifier- Returns:
- ProfileModel
- Throws:
ReferentialException
- thrown if the query could not be executedInvalidParseOperationException
- thrown if the query could not be executed
-
findProfiles
RequestResponseOK<ProfileModel> findProfiles(com.fasterxml.jackson.databind.JsonNode queryDsl) throws ReferentialException, InvalidParseOperationException
find Profile by QueryDsl- Parameters:
queryDsl
- the query as a json to be executed- Returns:
- list of ProfileModel
- Throws:
ReferentialException
- thrown if the query could not be executedInvalidParseOperationException
- thrown if the query could not be executed
-
-