Package org.openmetadata.service.jdbi3
Class UserRepository
- java.lang.Object
-
- org.openmetadata.service.jdbi3.EntityRepository<User>
-
- org.openmetadata.service.jdbi3.UserRepository
-
public class UserRepository extends EntityRepository<User>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classUserRepository.UserCsvclassUserRepository.UserUpdaterHandles entity updated from PUT and POST operation.-
Nested classes/interfaces inherited from class org.openmetadata.service.jdbi3.EntityRepository
EntityRepository.EntityUpdater, EntityRepository.Operation
-
-
Field Summary
Fields Modifier and Type Field Description static StringAUTH_MECHANISM_FIELD-
Fields inherited from class org.openmetadata.service.jdbi3.EntityRepository
allowedFields, CACHE_WITH_ID, CACHE_WITH_NAME, dao, daoCollection, entityType, putFields, quoteFqn, supportsExtension, supportsFollower, supportsOwner, supportsSoftDelete, supportsTags, supportsVotes
-
-
Constructor Summary
Constructors Constructor Description UserRepository(CollectionDAO dao)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckEmailAlreadyExists(String emailId)UserclearFields(User user, EntityUtil.Fields fields)Set the requested fields in an entity.StringexportToCsv(String importingTeam, String user)Override this method to support downloading CSV functionalityUsergetByEmail(javax.ws.rs.core.UriInfo uriInfo, String email, EntityUtil.Fields fields)UsergetByName(javax.ws.rs.core.UriInfo uriInfo, String name, EntityUtil.Fields fields)EntityUtil.FieldsgetFieldsWithUserAuth(String fields)List<EntityReference>getGroupTeams(javax.ws.rs.core.UriInfo uriInfo, String userName)List<EntityReference>getTeams(User user)UserRepository.UserUpdatergetUpdater(User original, User updated, EntityRepository.Operation operation)CsvImportResultimportFromCsv(String importingTeam, String csv, boolean dryRun, String user)Load CSV provided for bulk uploadvoidinitializeUsers(OpenMetadataApplicationConfig config)booleanisTeamJoinable(String teamId)voidprepare(User user)Ensures that the default roles are added for POST, PUT and PATCH operations.voidrestorePatchAttributes(User original, User updated)PATCH operations can't overwrite certain fields, such as entity ID, fullyQualifiedNames etc.UsersetFields(User user, EntityUtil.Fields fields)Set the requested fields in an entity.voidsetFullyQualifiedName(User user)Set fullyQualifiedName of an entityvoidstoreEntity(User user, boolean update)An entity is stored in the backend database as JSON document.voidstoreRelationships(User user)This method is called to store all the relationships of an entity.voidvalidateTeamAddition(UUID userId, UUID teamId)voidvalidateTeams(User user)-
Methods inherited from class org.openmetadata.service.jdbi3.EntityRepository
addDerivedTags, addFollower, addRelationship, addRelationship, addRelationship, applyTags, applyTags, bulkAddToRelationship, checkSystemEntityDeletion, cleanup, clearFieldsInternal, create, createInternal, createOrUpdate, createOrUpdateInternal, delete, deleteByName, deleteExtensionAtTimestamp, deleteExtensionBeforeTimestamp, deleteFollower, deleteFrom, deleteInternal, deleteInternalByName, deleteRelationship, deleteTo, ensureSingleRelationship, find, findBoth, findByName, findByNameOrNull, findFrom, findFromRecords, findTo, findToRecords, get, get, getAllowedFieldsCopy, getAllTags, getByName, getChildren, getCommonFields, getContainer, getCustomPropertyFQN, getCustomPropertyFQNPrefix, getEntitiesFromSeedData, getEntitiesFromSeedData, getEntitiesFromSeedData, getExtension, getExtensionAtTimestamp, getExtensionAtTimestampWithOperation, getFields, getFields, getFollowers, getFromEntityRef, getHref, getIngestionPipelines, getLatestExtensionFromTimeseries, getOwner, getOwner, getParent, getReference, getReferenceByName, getResultList, getResultList, getResultsFromAndToTimestamps, getResultsFromAndToTimestamps, getReviewers, getTags, getTags, getToEntityRef, getVersion, getVotes, initializeEntity, initSeedDataFromResources, listAfter, listAfterWithSkipFailure, listAll, listBefore, listVersions, patch, populateOwner, postCreate, postDelete, postUpdate, preDelete, prepareInternal, removeExtension, restoreEntity, setFieldsInternal, setInheritedFields, store, storeExtension, storeOwner, storeRelationshipsInternal, storeTimeSeries, storeTimeSeriesWithOperation, update, update, updateOwner, updateVote, validateOwner, validateRoles, validateUsers, withHref
-
-
-
-
Field Detail
-
AUTH_MECHANISM_FIELD
public static final String AUTH_MECHANISM_FIELD
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
UserRepository
public UserRepository(CollectionDAO dao)
-
-
Method Detail
-
setFullyQualifiedName
public void setFullyQualifiedName(User user)
Description copied from class:EntityRepositorySet fullyQualifiedName of an entity- Overrides:
setFullyQualifiedNamein classEntityRepository<User>
-
getFieldsWithUserAuth
public final EntityUtil.Fields getFieldsWithUserAuth(String fields)
-
getByName
public User getByName(javax.ws.rs.core.UriInfo uriInfo, String name, EntityUtil.Fields fields)
- Overrides:
getByNamein classEntityRepository<User>
-
getByEmail
public User getByEmail(javax.ws.rs.core.UriInfo uriInfo, String email, EntityUtil.Fields fields)
-
prepare
public void prepare(User user)
Ensures that the default roles are added for POST, PUT and PATCH operations.- Specified by:
preparein classEntityRepository<User>- See Also:
for an example implementation
-
restorePatchAttributes
public void restorePatchAttributes(User original, User updated)
Description copied from class:EntityRepositoryPATCH operations can't overwrite certain fields, such as entity ID, fullyQualifiedNames etc. Instead of throwing an error, we take lenient approach of ignoring the user error and restore those attributes based on what is already stored in the original entity.- Overrides:
restorePatchAttributesin classEntityRepository<User>
-
storeEntity
public void storeEntity(User user, boolean update)
Description copied from class:EntityRepositoryAn entity is stored in the backend database as JSON document. The JSON includes some attributes of the entity and does not include attributes such as href. The relationship fields of an entity is never stored in the JSON document. It is always reconstructed based on relationship edges from the backend database.
As an example, when table entity is stored, the attributes such as href and the relationships such as owner, database, and tags are set to null. These attributes are restored back after the JSON document is stored to be sent as response.- Specified by:
storeEntityin classEntityRepository<User>- See Also:
for an example implementation
-
storeRelationships
public void storeRelationships(User user)
Description copied from class:EntityRepositoryThis method is called to store all the relationships of an entity. It is expected that all relationships are already validated and completely setup before this method is called and no validation of relationships is required.- Specified by:
storeRelationshipsin classEntityRepository<User>- See Also:
for an example implementation
-
getUpdater
public UserRepository.UserUpdater getUpdater(User original, User updated, EntityRepository.Operation operation)
- Overrides:
getUpdaterin classEntityRepository<User>
-
setFields
public User setFields(User user, EntityUtil.Fields fields)
Description copied from class:EntityRepositorySet the requested fields in an entity. This is used for requesting specific fields in the object during GET operations. It is also used during PUT and PATCH operations to set up fields that can be updated.- Specified by:
setFieldsin classEntityRepository<User>
-
clearFields
public User clearFields(User user, EntityUtil.Fields fields)
Description copied from class:EntityRepositorySet the requested fields in an entity. This is used for requesting specific fields in the object during GET operations. It is also used during PUT and PATCH operations to set up fields that can be updated.- Specified by:
clearFieldsin classEntityRepository<User>
-
exportToCsv
public String exportToCsv(String importingTeam, String user) throws IOException
Description copied from class:EntityRepositoryOverride this method to support downloading CSV functionality- Overrides:
exportToCsvin classEntityRepository<User>- Throws:
IOException
-
importFromCsv
public CsvImportResult importFromCsv(String importingTeam, String csv, boolean dryRun, String user) throws IOException
Description copied from class:EntityRepositoryLoad CSV provided for bulk upload- Overrides:
importFromCsvin classEntityRepository<User>- Throws:
IOException
-
isTeamJoinable
public boolean isTeamJoinable(String teamId)
-
validateTeams
public void validateTeams(User user)
-
checkEmailAlreadyExists
public boolean checkEmailAlreadyExists(String emailId)
-
initializeUsers
public void initializeUsers(OpenMetadataApplicationConfig config)
-
getGroupTeams
public List<EntityReference> getGroupTeams(javax.ws.rs.core.UriInfo uriInfo, String userName)
-
getTeams
public List<EntityReference> getTeams(User user)
-
-