Package io.jans.orm.impl
Class BaseEntryManager<O extends PersistenceOperationService>
java.lang.Object
io.jans.orm.impl.BaseEntryManager<O>
- All Implemented Interfaces:
PersistenceEntryManager,jakarta.persistence.EntityManager
public abstract class BaseEntryManager<O extends PersistenceOperationService>
extends Object
implements PersistenceEntryManager
Abstract Entry Manager
- Author:
- Yuriy Movchan Date: 10.07.2010
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final classprotected static final classNested classes/interfaces inherited from interface io.jans.orm.PersistenceEntryManager
PersistenceEntryManager.PERSITENCE_TYPES -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intstatic final String[]protected io.jans.orm.search.filter.FilterProcessorprotected static final Comparator<String>protected static final Object[]protected static final String[]static final Stringprotected Oprotected PersistenceExtensionstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddAttributeDataFromLocalizedString(Object entry, Annotation ldapAttribute, String propertyName, List<AttributeData> attributes) protected io.jans.orm.search.filter.FilteraddObjectClassFilter(io.jans.orm.search.filter.Filter filter, String[] objectClasses) buildAttributesListForUpdate(Object entry, String[] objectClasses, List<PropertyAnnotation> propertiesAnnotations) protected booleancheckEntryClass(Class<?> entryClass, boolean isAllowSchemaEntry) protected List<AttributeDataModification>collectAttributeModifications(List<PropertyAnnotation> propertiesAnnotations, Map<String, AttributeData> attributesToPersistMap, Map<String, AttributeData> attributesFromLdapMap, boolean isSchemaUpdate, AttributeDataModification.AttributeModificationType schemaModificationType, boolean forceUpdate) protected <T> booleanboolean<T> boolean<T> booleanprotected <T> booleancontains(String baseDN, Class<T> entryClass, List<PropertyAnnotation> propertiesAnnotations, List<AttributeData> attributes, String[] objectClasses, String... ldapReturnAttributes) protected abstract <T> booleancontains(String baseDN, String[] objectClasses, Class<T> entryClass, List<PropertyAnnotation> propertiesAnnotations, io.jans.orm.search.filter.Filter filter, String[] ldapReturnAttributes) protected ObjectconvertJsonToValue(Class<?> parameterType, Object propertyValue) protected ObjectconvertValueToJson(Object propertyValue) <T> intcountEntries(Object entry) protected io.jans.orm.search.filter.Filter[]createAttributesFilter(List<AttributeData> attributes) protected <T> List<T>createEntities(Class<T> entryClass, List<PropertyAnnotation> propertiesAnnotations, Map<String, List<AttributeData>> entriesAttributes) protected <T> List<T>createEntities(Class<T> entryClass, List<PropertyAnnotation> propertiesAnnotations, Map<String, List<AttributeData>> entriesAttributes, boolean doSort) <T> List<T>createEntities(Class<T> entryClass, Map<String, List<AttributeData>> entriesAttributes) protected <T> io.jans.orm.search.filter.FiltercreateFilterByEntry(Object entry, Class<T> entryClass, List<AttributeData> attributes) protected abstract DatedecodeTime(String date) protected voiddumpAttributeDataModifications(String variableName, List<AttributeDataModification> attributeDataModifications) protected voiddumpAttributes(String variableName, List<AttributeData> attributesToPersist) protected abstract StringencodeTime(Date date) protected io.jans.orm.search.filter.FilterexcludeObjectClassFilters(io.jans.orm.search.filter.Filter genericFilter) <T> T<T> Tprotected abstract List<AttributeData>find(String dn, String[] objectClasses, Map<String, PropertyAnnotation> propertiesAnnotationsMap, String... attributes) <T> List<T>findEntries(Object entry) Search by sample<T> List<T>findEntries(Object entry, int count) <T> List<T>findEntries(String baseDN, Class<T> entryClass, io.jans.orm.search.filter.Filter filter) <T> List<T>findEntries(String baseDN, Class<T> entryClass, io.jans.orm.search.filter.Filter filter, int count) <T> List<T>findEntries(String baseDN, Class<T> entryClass, io.jans.orm.search.filter.Filter filter, SearchScope scope, String[] ldapReturnAttributes, int start, int count, int chunkSize) <T> List<T>findEntries(String baseDN, Class<T> entryClass, io.jans.orm.search.filter.Filter filter, String[] ldapReturnAttributes) <T> List<T>findEntries(String baseDN, Class<T> entryClass, io.jans.orm.search.filter.Filter filter, String[] ldapReturnAttributes, int count) protected AttributeDatagetAttributeDataFromLocalizedString(String ldapAttributeName, io.jans.orm.model.base.LocalizedString localizedString) getAttributeDataListFromCustomAttributesList(Object entry, io.jans.orm.annotation.AttributesList attributesList, String propertyName) protected <T> String[]getAttributes(Map<String, PropertyAnnotation> attributesMap) protected <T> String[]getAttributes(T entry, List<PropertyAnnotation> propertiesAnnotations, boolean isIgnoreAttributesList) getAttributesList(T entry, List<PropertyAnnotation> propertiesAnnotations, boolean isIgnoreAttributesList) protected List<AttributeData>getAttributesListForPersist(Object entry, List<PropertyAnnotation> propertiesAnnotations) protected <T> Map<String,PropertyAnnotation> getAttributesMap(T entry, List<PropertyAnnotation> propertiesAnnotations, boolean isIgnoreAttributesList) <T> AttributeTypegetAttributeType(String primaryKey, Class<T> entryClass, String propertyName) getCustomAttributesListFromAttributeDataList(Object entry, io.jans.orm.annotation.AttributesList attributesList, String propertyName, Collection<AttributeData> attributes) Class<?>getCustomAttributesListItemType(Object entry, io.jans.orm.annotation.AttributesList attributesList, String propertyName) protected String[]getCustomObjectClasses(Object entry, Class<?> entryClass) protected StringgetDNPropertyName(Class<?> entryClass) protected <T> ObjectgetDNValue(Object entry) protected <T> ObjectgetDNValue(Object entry, Class<T> entryClass) protected <T> List<PropertyAnnotation>getEntryClassAnnotations(Class<T> entryClass, String keyCategory, Class<?>[] annotationTypes) protected <T> List<PropertyAnnotation>getEntryCustomObjectClassAnnotations(Class<T> entryClass) protected <T> List<PropertyAnnotation>getEntryDnAnnotations(Class<T> entryClass) protected <T> List<PropertyAnnotation>getEntryExpirationAnnotations(Class<T> entryClass) <T> List<PropertyAnnotation>getEntryPropertyAnnotations(Class<T> entryClass) protected String[]getEntrySortByNames(Class<?> entryClass) protected String[]getEntrySortByProperties(Class<?> entryClass) protected PropertyAnnotationgetExpirationProperty(Class<?> entryClass) protected <T> IntegergetExpirationValue(Object entry, Class<T> entryClass, boolean merge) protected <T> GetterintgetHashCode(Object entry) protected abstract ObjectgetNativeDateAttributeValue(Date dateValue) protected ObjectgetNativeDateMultiAttributeValue(Date dateValue) String[]getObjectClasses(Object entry, Class<?> entryClass) getPersistenceMetadata(String primaryKey) protected <T> Setterprotected String[]getTypeObjectClasses(Class<?> entryClass) groupListByProperties(Class<T> entryClass, List<T> entries, boolean caseSensetive, String groupByProperties, String sumByProperties) groupListByProperties(Class<T> entryClass, List<T> entries, String groupByProperties, String sumByProperties) protected boolean<T> voidimportEntry(String dn, Class<T> entryClass, List<AttributeData> data) protected booleanisAttributeMultivalued(Object[] values) protected booleanisConfigurationEntry(Class<?> entryClass) protected booleanisEmptyAttributeValues(AttributeData attributeData) protected booleanisMultiValued(Class<?> parameterType) protected booleanisSchemaEntry(Class<?> entryClass) protected booleanprotected booleanprotected booleanisUseEntryForceUpdate(Class<?> entryClass) protected booleanprotected voidloadLocalizedString(Map<String, AttributeData> attributesMap, io.jans.orm.model.base.LocalizedString localizedString, Map<String, AttributeData> filteredAttrs) protected Voidmerge(Object entry, boolean isSchemaUpdate, boolean isConfigurationUpdate, AttributeDataModification.AttributeModificationType schemaModificationType) protected abstract voidmerge(String dn, String[] objectClasses, List<AttributeDataModification> attributeDataModifications, Integer expiration) voidprotected abstract voidprotected <T> Map<String,PropertyAnnotation> prepareEntryPropertiesTypes(Class<T> entryClass, List<PropertyAnnotation> propertiesAnnotations) protected <T> voidpreparePropertyAnnotationTypes(Class<T> entry, Map<String, PropertyAnnotation> propertiesAnnotationsMap) voidDeprecated.<T> voidabstract <T> voidremoveByDn(String dn, String[] objectClasses) voidremoveRecursively(String primaryKey) Deprecated.<T> voidremoveRecursively(String primaryKey, Class<T> entryClass) abstract <T> voidremoveRecursivelyFromDn(String primaryKey, String[] objectClasses) protected StringresolveBeanPropertyByAttribute(List<PropertyAnnotation> propertiesAnnotations, String attributeName) protected voidsetCustomObjectClasses(Object entry, Class<?> entryClass, String[] objectClasses) voidsetPersistenceExtension(PersistenceExtension persistenceExtension) protected <T> voidsortEntriesIfNeeded(Class<T> entryClass, List<T> entries) <T> voidsortListByProperties(Class<T> entryClass, List<T> entries, boolean caseSensetive, String... sortByProperties) protected <T> voidsortListByProperties(Class<T> entryClass, List<T> entries, String... sortByProperties) protected byte[][]toBinaryValues(String[] attributeValues) protected abstract <T> voidupdateMergeChanges(String baseDn, T entry, boolean isConfigurationUpdate, Class<?> entryClass, Map<String, AttributeData> attributesFromLdapMap, List<AttributeDataModification> attributeDataModifications, boolean forceUpdate) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.jans.orm.PersistenceEntryManager
addDeleteSubscriber, authenticate, authenticate, authenticate, clear, close, countEntries, countEntries, createEntityGraph, createEntityGraph, createNamedQuery, createNamedQuery, createNamedStoredProcedureQuery, createNativeQuery, createNativeQuery, createNativeQuery, createQuery, createQuery, createQuery, createQuery, createQuery, createStoredProcedureQuery, createStoredProcedureQuery, createStoredProcedureQuery, decodeTime, destroy, detach, encodeTime, exportEntry, exportEntry, find, find, find, findAggregatedEntries, findDistinctEntries, findEntries, findPagedEntries, flush, getCriteriaBuilder, getDelegate, getEntityGraph, getEntityGraphs, getEntityManagerFactory, getFlushMode, getLockMode, getMetamodel, getOperationService, getPersistenceEntryManager, getPersistenceType, getPersistenceType, getProperties, getReference, getTransaction, hasBranchesSupport, hasExpirationSupport, isJoinedToTransaction, isOpen, joinTransaction, lock, lock, merge, refresh, refresh, refresh, refresh, remove, remove, removeDeleteSubscriber, setFlushMode, setProperty, unwrap
-
Field Details
-
OBJECT_CLASS
- See Also:
-
USER_PASSWORD
- See Also:
-
EMPTY_STRING_ARRAY
-
NO_STRINGS
-
NO_OBJECTS
-
LINE_LENGHT_COMPARATOR
-
DEFAULT_PAGINATION_SIZE
protected static final int DEFAULT_PAGINATION_SIZE- See Also:
-
operationService
-
persistenceExtension
-
filterProcessor
protected io.jans.orm.search.filter.FilterProcessor filterProcessor
-
-
Constructor Details
-
BaseEntryManager
public BaseEntryManager()
-
-
Method Details
-
persist
- Specified by:
persistin interfacejakarta.persistence.EntityManager- Specified by:
persistin interfacePersistenceEntryManager
-
persist
protected abstract void persist(String dn, String[] objectClasses, List<AttributeData> attributes, Integer expiration) -
findEntries
- Specified by:
findEntriesin interfacePersistenceEntryManager
-
findEntries
Description copied from interface:PersistenceEntryManagerSearch by sample- Specified by:
findEntriesin interfacePersistenceEntryManager- Parameters:
entry- Sample- Returns:
- Result entries
-
findEntries
public <T> List<T> findEntries(String baseDN, Class<T> entryClass, io.jans.orm.search.filter.Filter filter) - Specified by:
findEntriesin interfacePersistenceEntryManager
-
findEntries
public <T> List<T> findEntries(String baseDN, Class<T> entryClass, io.jans.orm.search.filter.Filter filter, int count) - Specified by:
findEntriesin interfacePersistenceEntryManager
-
findEntries
public <T> List<T> findEntries(String baseDN, Class<T> entryClass, io.jans.orm.search.filter.Filter filter, String[] ldapReturnAttributes) - Specified by:
findEntriesin interfacePersistenceEntryManager
-
findEntries
public <T> List<T> findEntries(String baseDN, Class<T> entryClass, io.jans.orm.search.filter.Filter filter, String[] ldapReturnAttributes, int count) - Specified by:
findEntriesin interfacePersistenceEntryManager
-
findEntries
public <T> List<T> findEntries(String baseDN, Class<T> entryClass, io.jans.orm.search.filter.Filter filter, SearchScope scope, String[] ldapReturnAttributes, int start, int count, int chunkSize) - Specified by:
findEntriesin interfacePersistenceEntryManager
-
countEntries
- Specified by:
countEntriesin interfacePersistenceEntryManager
-
merge
protected Void merge(Object entry, boolean isSchemaUpdate, boolean isConfigurationUpdate, AttributeDataModification.AttributeModificationType schemaModificationType) -
buildAttributesListForUpdate
-
updateMergeChanges
protected abstract <T> void updateMergeChanges(String baseDn, T entry, boolean isConfigurationUpdate, Class<?> entryClass, Map<String, AttributeData> attributesFromLdapMap, List<AttributeDataModification> attributeDataModifications, boolean forceUpdate) -
collectAttributeModifications
protected List<AttributeDataModification> collectAttributeModifications(List<PropertyAnnotation> propertiesAnnotations, Map<String, AttributeData> attributesToPersistMap, Map<String, AttributeData> attributesFromLdapMap, boolean isSchemaUpdate, AttributeDataModification.AttributeModificationType schemaModificationType, boolean forceUpdate) -
isStoreFullEntry
protected boolean isStoreFullEntry() -
isEmptyAttributeValues
-
merge
protected abstract void merge(String dn, String[] objectClasses, List<AttributeDataModification> attributeDataModifications, Integer expiration) -
removeByDn
- Specified by:
removeByDnin interfacePersistenceEntryManager
-
remove
Deprecated.- Specified by:
removein interfacePersistenceEntryManager
-
remove
- Specified by:
removein interfacePersistenceEntryManager
-
removeRecursivelyFromDn
- Specified by:
removeRecursivelyFromDnin interfacePersistenceEntryManager
-
removeRecursively
Deprecated.- Specified by:
removeRecursivelyin interfacePersistenceEntryManager
-
removeRecursively
- Specified by:
removeRecursivelyin interfacePersistenceEntryManager
-
contains
- Specified by:
containsin interfacejakarta.persistence.EntityManager- Specified by:
containsin interfacePersistenceEntryManager
-
contains
-
contains
public <T> boolean contains(String baseDN, Class<T> entryClass, io.jans.orm.search.filter.Filter filter) - Specified by:
containsin interfacePersistenceEntryManager
-
contains
protected <T> boolean contains(String baseDN, Class<T> entryClass, List<PropertyAnnotation> propertiesAnnotations, List<AttributeData> attributes, String[] objectClasses, String... ldapReturnAttributes) -
contains
-
contains
- Specified by:
containsin interfacePersistenceEntryManager
-
find
- Specified by:
findin interfacejakarta.persistence.EntityManager
-
find
- Specified by:
findin interfacePersistenceEntryManager
-
getAttributes
protected <T> String[] getAttributes(T entry, List<PropertyAnnotation> propertiesAnnotations, boolean isIgnoreAttributesList) -
getAttributes
-
getAttributesList
protected <T> List<String> getAttributesList(T entry, List<PropertyAnnotation> propertiesAnnotations, boolean isIgnoreAttributesList) -
getAttributesMap
protected <T> Map<String,PropertyAnnotation> getAttributesMap(T entry, List<PropertyAnnotation> propertiesAnnotations, boolean isIgnoreAttributesList) -
prepareEntryPropertiesTypes
protected <T> Map<String,PropertyAnnotation> prepareEntryPropertiesTypes(Class<T> entryClass, List<PropertyAnnotation> propertiesAnnotations) -
preparePropertyAnnotationTypes
protected <T> void preparePropertyAnnotationTypes(Class<T> entry, Map<String, PropertyAnnotation> propertiesAnnotationsMap) -
find
protected abstract List<AttributeData> find(String dn, String[] objectClasses, Map<String, PropertyAnnotation> propertiesAnnotationsMap, String... attributes) -
checkEntryClass
-
isUseEntryForceUpdate
-
isSupportForceUpdate
protected boolean isSupportForceUpdate() -
isSchemaEntry
-
isConfigurationEntry
-
getEntrySortByProperties
-
getEntrySortByNames
-
getObjectClasses
- Specified by:
getObjectClassesin interfacePersistenceEntryManager
-
getTypeObjectClasses
-
getCustomObjectClasses
-
setCustomObjectClasses
-
getDNPropertyName
-
getExpirationProperty
-
createEntities
protected <T> List<T> createEntities(Class<T> entryClass, List<PropertyAnnotation> propertiesAnnotations, Map<String, List<AttributeData>> entriesAttributes) -
createEntities
protected <T> List<T> createEntities(Class<T> entryClass, List<PropertyAnnotation> propertiesAnnotations, Map<String, List<AttributeData>> entriesAttributes, boolean doSort) -
getCustomAttributesListItemType
public Class<?> getCustomAttributesListItemType(Object entry, io.jans.orm.annotation.AttributesList attributesList, String propertyName) - Specified by:
getCustomAttributesListItemTypein interfacePersistenceEntryManager
-
loadLocalizedString
protected void loadLocalizedString(Map<String, AttributeData> attributesMap, io.jans.orm.model.base.LocalizedString localizedString, Map<String, AttributeData> filteredAttrs) -
createEntities
public <T> List<T> createEntities(Class<T> entryClass, Map<String, List<AttributeData>> entriesAttributes) - Specified by:
createEntitiesin interfacePersistenceEntryManager
-
sortEntriesIfNeeded
-
importEntry
- Specified by:
importEntryin interfacePersistenceEntryManager
-
sortListByProperties
public <T> void sortListByProperties(Class<T> entryClass, List<T> entries, boolean caseSensetive, String... sortByProperties) - Specified by:
sortListByPropertiesin interfacePersistenceEntryManager
-
sortListByProperties
-
groupListByProperties
public <T> Map<T,List<T>> groupListByProperties(Class<T> entryClass, List<T> entries, boolean caseSensetive, String groupByProperties, String sumByProperties) - Specified by:
groupListByPropertiesin interfacePersistenceEntryManager
-
groupListByProperties
-
hasMapSupport
protected boolean hasMapSupport() -
getNativeDateAttributeValue
-
getNativeDateMultiAttributeValue
-
isAttributeMultivalued
-
convertValueToJson
-
getAttributesListForPersist
protected List<AttributeData> getAttributesListForPersist(Object entry, List<PropertyAnnotation> propertiesAnnotations) -
addAttributeDataFromLocalizedString
protected void addAttributeDataFromLocalizedString(Object entry, Annotation ldapAttribute, String propertyName, List<AttributeData> attributes) -
getAttributeDataFromLocalizedString
protected AttributeData getAttributeDataFromLocalizedString(String ldapAttributeName, io.jans.orm.model.base.LocalizedString localizedString) -
getAttributeDataListFromCustomAttributesList
public List<AttributeData> getAttributeDataListFromCustomAttributesList(Object entry, io.jans.orm.annotation.AttributesList attributesList, String propertyName) - Specified by:
getAttributeDataListFromCustomAttributesListin interfacePersistenceEntryManager
-
getCustomAttributesListFromAttributeDataList
public List<Object> getCustomAttributesListFromAttributeDataList(Object entry, io.jans.orm.annotation.AttributesList attributesList, String propertyName, Collection<AttributeData> attributes) - Specified by:
getCustomAttributesListFromAttributeDataListin interfacePersistenceEntryManager
-
getEntryPropertyAnnotations
- Specified by:
getEntryPropertyAnnotationsin interfacePersistenceEntryManager
-
getEntryDnAnnotations
-
getEntryExpirationAnnotations
-
getEntryCustomObjectClassAnnotations
-
getEntryClassAnnotations
protected <T> List<PropertyAnnotation> getEntryClassAnnotations(Class<T> entryClass, String keyCategory, Class<?>[] annotationTypes) -
getGetter
-
getSetter
-
convertJsonToValue
-
getDNValue
-
getDNValue
-
getExpirationValue
-
resolveBeanPropertyByAttribute
protected String resolveBeanPropertyByAttribute(List<PropertyAnnotation> propertiesAnnotations, String attributeName) -
getHashCode
- Specified by:
getHashCodein interfacePersistenceEntryManager
-
toBinaryValues
-
createFilterByEntry
protected <T> io.jans.orm.search.filter.Filter createFilterByEntry(Object entry, Class<T> entryClass, List<AttributeData> attributes) -
excludeObjectClassFilters
protected io.jans.orm.search.filter.Filter excludeObjectClassFilters(io.jans.orm.search.filter.Filter genericFilter) -
createAttributesFilter
-
addObjectClassFilter
protected io.jans.orm.search.filter.Filter addObjectClassFilter(io.jans.orm.search.filter.Filter filter, String[] objectClasses) -
isMultiValued
-
decodeTime
-
encodeTime
-
setPersistenceExtension
- Specified by:
setPersistenceExtensionin interfacePersistenceEntryManager
-
getAttributeType
public <T> AttributeType getAttributeType(String primaryKey, Class<T> entryClass, String propertyName) - Specified by:
getAttributeTypein interfacePersistenceEntryManager
-
dumpAttributes
-
dumpAttributeDataModifications
protected void dumpAttributeDataModifications(String variableName, List<AttributeDataModification> attributeDataModifications) -
isValidateAfterUpdate
protected boolean isValidateAfterUpdate() -
getPersistenceMetadata
- Specified by:
getPersistenceMetadatain interfacePersistenceEntryManager
-
getTableColumnsMap
- Specified by:
getTableColumnsMapin interfacePersistenceEntryManager
-