Package de.hybris.platform.jalo.user
Class Customer
java.lang.Object
- All Implemented Interfaces:
Serializable,Comparable
- Direct Known Subclasses:
GeneratedB2BCustomer
The hybris Platform customer item.
Since 3.1-u6 the automatic generation of customer id is removed for getting better performance at customer creation. Nevertheless, if you want to have an automated customer id generation you can add the following code to your own customer type:
protected Item createItem(final SessionContext ctx, final ComposedType type, final ItemAttributeMap allAttributes)
throws JaloBusinessException
{
if (allAttributes.get(Customer.CUSTOMERID) == null)
{
allAttributes.put(Customer.CUSTOMERID, UserManager.getInstance().generateCustomerID());
}
return super.createItem(ctx, type, allAttributes);
}
In case you do not have an own customer type add the following code to your manager class:
public void beforeItemCreation(final SessionContext ctx, final ComposedType type, final ItemAttributeMap attributes)
throws JaloBusinessException
{
if (TypeManager.getInstance().getComposedType(Customer.class).isAssignableFrom(type))
{
if (attributes.get(Customer.CUSTOMERID) == null)
{
attributes.put(Customer.CUSTOMERID, UserManager.getInstance().generateCustomerID());
}
}
super.beforeItemCreation(ctx, type, attributes);
}
Also see PLA-6951.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class de.hybris.platform.jalo.GenericItem
GenericItem.GenericItemImplNested classes/interfaces inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
LocalizableItem.LocalizableItemImplNested classes/interfaces inherited from class de.hybris.platform.jalo.ExtensibleItem
ExtensibleItem.ExtensibleItemImplNested classes/interfaces inherited from class de.hybris.platform.jalo.Item
Item.AttributeFilter, Item.AttributeMode, Item.CachedGetter, Item.CachedSetter, Item.ItemAttributeMap, Item.ItemConstraint, Item.ItemImpl, Item.JaloCachedComputationException -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringConfiguration constant forlogin.anonymous.always.disabled/which allows changing the (default) disabling of the anonymous account.Fields inherited from class de.hybris.platform.jalo.user.GeneratedCustomer
CUSTOMERID, DEFAULT_INITIAL_ATTRIBUTESFields inherited from class de.hybris.platform.jalo.user.User
CURRENT_DATE, CURRENT_TIME, DEFAULT_PAYMENT_ADDRESS, DEFAULT_SHIPPING_ADDRESS, LAST_LOGIN, LOGIN_DISABLED, PASSWORD, PASSWORD_ANSWER, PASSWORD_QUESTION, PAYMENT_MODES, SESSION_CURRENCY, SESSION_LANGUAGE, USER_AUDIT_ENABLED, USER_DEACTIVATION_BLOCK_FOR_ALL_ADMINSFields inherited from class de.hybris.platform.jalo.user.GeneratedUser
ADDRESSES, ADDRESSESHANDLER, CARTS, CARTSHANDLER, CONTACTINFOS, CONTACTINFOSHANDLER, DEACTIVATIONDATE, DEFAULTPAYMENTADDRESS, DEFAULTSHIPMENTADDRESS, ENCODEDPASSWORD, HMCLOGINDISABLED, LASTLOGIN, LOGINDISABLED, ORDERS, ORDERSHANDLER, PASSWORDANSWER, PASSWORDENCODING, PASSWORDQUESTION, PAYMENTINFOS, PAYMENTINFOSHANDLER, QUOTES, QUOTESHANDLER, RANDOMTOKEN, RETENTIONSTATE, SESSIONCURRENCY, SESSIONLANGUAGE, USERPROFILEFields inherited from class de.hybris.platform.jalo.security.Principal
ALLGROUPS, ALLSEARCHRESTRICTIONS, DISPLAYNAME, PRINCIPAL_GROUP_RELATION_NAMEFields inherited from class de.hybris.platform.jalo.security.GeneratedPrincipal
DESCRIPTION, GROUPS, NAME, PRINCIPALGROUPRELATION_MARKMODIFIED, PRINCIPALGROUPRELATION_SRC_ORDERED, PRINCIPALGROUPRELATION_TGT_ORDERED, SEARCHRESTRICTIONS, SEARCHRESTRICTIONSHANDLER, UIDFields inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
LANGUAGE_FALLBACK_ENABLEDFields inherited from class de.hybris.platform.jalo.Item
_CREATION_TIME_INTERNAL, _MODIFIED_TIME_INTERNAL, accessorLog, CREATION_TIME, DISABLE_ATTRIBUTE_CHECK, DISABLE_ITEMCHECK_BEFORE_REMOVABLE, EVEN, FEATURE_ACCESSMAP_QUALIFIER, HJMPTS, INITIAL_CREATION_FLAG, isJaloOnly, MODIFIED_TIME, NEGATIVE, NOT_FOUND, OWNER, PK, POSITIVE, SAVE_FROM_SERVICE_LAYER, staticTransientObjects, TYPEFields inherited from class de.hybris.platform.util.BridgeAbstraction
impl, tenant -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckPassword(SessionContext ctx, String plainPassword) Deprecated.booleancheckPassword(LoginToken token) Deprecated.since ages - useAuthenticationService.checkCredentials(String, String)booleanisAdmin()Deprecated.since ages - useUserService.isAdmin(UserModel)protected booleanDeprecated.since ages - This logic is now moved toJaloSession.isAnonymousAndAnonymousLoginIsDisabled(String)Deprecated.since ages - Method doesn't check for anonymous login or if it is disabled before getting the attribute value anymore.protected booleanDeprecated.since ages - This logic is now moved toJaloSession.isNotAnonymousOrAnonymousLoginIsAllowed(String)static voidDeprecated.since ages - this is done automatically on loading hybris platform implementationvoidsetLoginDisabled(SessionContext ctx, Boolean disabled) Overwritten to log a warning as long aslogin.anonymous.always.disabledis set to true.Methods inherited from class de.hybris.platform.jalo.user.GeneratedCustomer
getCustomerID, getCustomerID, getDefaultAttributeModes, setCustomerID, setCustomerIDMethods inherited from class de.hybris.platform.jalo.user.User
auditUserPasswordChange, checkPassword, checkPasswordPolicies, checkRemovable, checkSystemPrincipal, createAddress, createAddress, createAddress, createAddress, createAddress, createAddress, createAddress, createAddress, createItem, createPaymentInfo, createPaymentInfo, getAllAddresses, getAllDisplayName, getCart, getCurrentDate, getCurrentDate, getCurrentDateOldStyle, getCurrentTime, getCurrentTime, getDefaultDeliveryAddress, getDefaultDeliveryAddress, getDefaultShippingAddress, getDefaultShippingAddress, getDisplayName, getEncoder, getLogin, getLogin, getPassword, getPassword, getPasswordChangeListener, getRealEncoding, isAdminEmployee, isAnonymousCustomer, saveCurrentCart, saveCurrentCart, setDeactivationDate, setDefaultDeliveryAddress, setDefaultDeliveryAddress, setDefaultShippingAddress, setDefaultShippingAddress, setEncodedPassword, setEncodedPassword, setEncodedPassword, setEncodedPassword, setLogin, setLogin, setPassword, setPassword, setPassword, setPassword, setUidMethods inherited from class de.hybris.platform.jalo.user.GeneratedUser
addToAddresses, addToAddresses, addToCarts, addToCarts, addToContactInfos, addToContactInfos, addToOrders, addToOrders, addToPaymentInfos, addToPaymentInfos, addToQuotes, addToQuotes, getAddresses, getAddresses, getCarts, getCarts, getContactInfos, getContactInfos, getDeactivationDate, getDeactivationDate, getDefaultPaymentAddress, getDefaultPaymentAddress, getDefaultShipmentAddress, getDefaultShipmentAddress, getEncodedPassword, getEncodedPassword, getLastLogin, getLastLogin, getOrders, getOrders, getPasswordAnswer, getPasswordAnswer, getPasswordEncoding, getPasswordEncoding, getPasswordQuestion, getPasswordQuestion, getPaymentInfos, getPaymentInfos, getQuotes, getQuotes, getRandomToken, getRandomToken, getRetentionState, getRetentionState, getSessionCurrency, getSessionCurrency, getSessionLanguage, getSessionLanguage, getUserprofile, getUserprofile, isHmcLoginDisabled, isHmcLoginDisabled, isHmcLoginDisabledAsPrimitive, isHmcLoginDisabledAsPrimitive, isLoginDisabled, isLoginDisabledAsPrimitive, isLoginDisabledAsPrimitive, removeFromAddresses, removeFromAddresses, removeFromCarts, removeFromCarts, removeFromContactInfos, removeFromContactInfos, removeFromOrders, removeFromOrders, removeFromPaymentInfos, removeFromPaymentInfos, removeFromQuotes, removeFromQuotes, setAddresses, setAddresses, setCarts, setCarts, setContactInfos, setContactInfos, setDeactivationDate, setDefaultPaymentAddress, setDefaultPaymentAddress, setDefaultShipmentAddress, setDefaultShipmentAddress, setHmcLoginDisabled, setHmcLoginDisabled, setHmcLoginDisabled, setHmcLoginDisabled, setLastLogin, setLastLogin, setLoginDisabled, setLoginDisabled, setLoginDisabled, setOrders, setOrders, setPasswordAnswer, setPasswordAnswer, setPasswordEncoding, setPasswordEncoding, setPasswordQuestion, setPasswordQuestion, setPaymentInfos, setPaymentInfos, setQuotes, setQuotes, setRandomToken, setRandomToken, setRetentionState, setRetentionState, setSessionCurrency, setSessionCurrency, setSessionLanguage, setSessionLanguage, setUserprofile, setUserprofileMethods inherited from class de.hybris.platform.jalo.security.Principal
addGlobalNegativePermission, addGlobalPermission, addGlobalPermissions, addGlobalPositivePermission, addToGroup, checkConsistencyUid, checkGlobalPermission, checkOwnGlobalPermission, clearGlobalPermission, clearGlobalPermissions, getAllDisplayName, getAllGlobalNegativePermissions, getAllGlobalPositivePermissions, getAllGroups, getAllGroups, getAllSearchRestrictions, getAllSearchRestrictions, getDisplayName, getGlobalNegativePermissions, getGlobalPermissions, getGlobalPositivePermissions, getGroups, getItemPermissionsMap, getUid, getUID, isMemberOf, isMemberOf, remove, removeFromGroup, setGroups, setItemPermissionsByMap, setUID, toStringMethods inherited from class de.hybris.platform.jalo.security.GeneratedPrincipal
addToGroups, addToGroups, getDescription, getDescription, getGroups, getGroupsCount, getGroupsCount, getName, getName, getSearchRestrictions, getSearchRestrictions, getUid, isMarkModifiedDisabled, removeFromGroups, removeFromGroups, setDescription, setDescription, setGroups, setName, setName, setUidMethods inherited from class de.hybris.platform.jalo.GenericItem
getImplementation, getInitialProperties, getNonInitialAttributes, getRelatedItems, getRelatedItems, setRelatedItemsMethods inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
getAllLocalizedProperties, getAllLocalizedProperties, getAllLocalizedProperties, getAllLocalizedProperties, getAllValuesSessionContext, getLocalizedProperty, getLocalizedProperty, getLocalizedPropertyInternal, getLocalizedPropertyNames, getLocalizedPropertyNames, hasLanguage, isEmptyValue, isFallbackEnabled, removeLocalizedProperty, removeLocalizedProperty, setAllLocalizedProperties, setAllLocalizedProperties, setLocalizedProperty, setLocalizedPropertyMethods inherited from class de.hybris.platform.jalo.ExtensibleItem
createNonClassAccessor, getAllProperties, getAllProperties, getProperty, getProperty, getPropertyNames, getPropertyNames, removeProperty, removeProperty, setAllProperties, setAllProperties, setProperty, setPropertyMethods inherited from class de.hybris.platform.jalo.Item
addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addNegativePermission, addPermission, addPositivePermission, assureExtensionsLoaded, changeTypeAfterCreation, checkConstraint, checkItemPermission, checkMandatoryAttribute, checkMandatoryAttribute, checkPermission, checkPermission, clearPermission, compareTo, ctx, doAfterRemove, doBeforeRemove, equals, getAccessorFor, getAllAttributes, getAllAttributes, getAllAttributes, getAllAttributes, getAllAttributesInternal, getAllLinkedItems, getAndCheckCacheBoundItem, getAttribute, getAttribute, getCacheBoundItem, getComposedType, getComposedTypePK, getCreationTime, getCurrentlyRemovingCount, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItemsCount, getLinkedItemsCount, getLinkedItemsCount, getModificationTime, getNegativePermissions, getOwner, getPartOfRemovedSessionMarker, getPermissionMap, getPermissions, getPersistenceVersion, getPK, getPositivePermissions, getRestrictedPrincipals, getSession, getSyncObject, getTenant, getTransientObject, getTransientObjectMap, hashCode, hasRegisteredClassAccessorFor, internal_registerClassAccessorFor, internal_registerNonClassAccessorFor, invalidateLocalCaches, isAlive, isCacheBound, isCurrentlyRemoving, isCurrentlyRemoving, isEmptyRelationValue, isInCreate, isInstanceOf, isItemCheckBeforeRemoveableDisabled, isRelationLocalizationFallbackEnabled, newInstance, notifyExtensionsAfterItemCreation, notifyExtensionsBeforeItemCreation, notifyItemRemoval, notifyManagerAboutItemRemoval, readResolve, registerAccessFor, registerAccessFor, registerJaloInvalidationListeners, remove, removeItemCollection, removeItemCollection, removeLinkedItems, removeLinkedItems, removeLinkedItems, removeLinkedItems, removeLinks, removePartOfItems, removePartOfItems, setAllAttributes, setAllAttributes, setAllAttributesInternal, setAllLinkedItems, setAllLinkedItems, setAllLinkedItems, setAllLinkedItems, setAttribute, setAttribute, setAttributeFromString, setAttributeFromString, setCacheBound, setComposedType, setCreationTime, setImplementation, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setModificationTime, setNonInitialAttributes, setOwner, setPermissionsByMap, setTransientObject, setUseTA, suppressRelation, useTA, writeReplaceMethods inherited from class de.hybris.platform.util.BridgeAbstraction
setTenant
-
Field Details
-
LOGIN_ANONYMOUS_ALWAYS_DISABLED
Configuration constant forlogin.anonymous.always.disabled/which allows changing the (default) disabling of the anonymous account.- See Also:
-
-
Constructor Details
-
Customer
public Customer()
-
-
Method Details
-
registerAsJaloObject
Deprecated.since ages - this is done automatically on loading hybris platform implementationInternal. -
checkPassword
Deprecated.since ages - useAuthenticationService.checkCredentials(String, String)Overwritten to always returnfalsein case this is the anonymous account and anonymous login has been disable via configuration ( which is the default setting).- Overrides:
checkPasswordin classUser
-
checkPassword
@Deprecated(since="ages", forRemoval=false) public boolean checkPassword(SessionContext ctx, String plainPassword) Deprecated.since ages - useAuthenticationService.checkCredentials(String, String)Overwritten to always returnfalsein case this is the anonymous account and anonymous login has been disable via configuration ( which is the default setting).- Overrides:
checkPasswordin classUser
-
isAdmin
Deprecated.since ages - useUserService.isAdmin(UserModel)Description copied from class:UserChecks whether this user has admin status. This is true if the user is the admin user or is (even recursive) member of the admin group. -
isLoginDisabled
Deprecated.since ages - Method doesn't check for anonymous login or if it is disabled before getting the attribute value anymore. SeeJaloSession.performLogin(String, String, Map)Overwritten to always treat the anonymous account locked as long as thelogin.anonymous.always.disabledconfiguration property is set totrue(which is also the default value).- Overrides:
isLoginDisabledin classGeneratedUser- Returns:
- the loginDisabled - Determines whether user is allowed to login to system.
-
setLoginDisabled
Overwritten to log a warning as long aslogin.anonymous.always.disabledis set to true.- Overrides:
setLoginDisabledin classUserdisabled- the loginDisabled - Determines whether user is allowed to login to system.
-
isAnonymousAndAnonymousLoginIsDisabled
@Deprecated(since="ages", forRemoval=false) protected boolean isAnonymousAndAnonymousLoginIsDisabled()Deprecated.since ages - This logic is now moved toJaloSession.isAnonymousAndAnonymousLoginIsDisabled(String)Tells whether this is the anonymous account and anonymous login is disallowed ( using thelogin.anonymous.always.disabledconfiguration parameter ). -
isNotAnonymousOrAnonymousLoginIsAllowed
@Deprecated(since="ages", forRemoval=false) protected boolean isNotAnonymousOrAnonymousLoginIsAllowed()Deprecated.since ages - This logic is now moved toJaloSession.isNotAnonymousOrAnonymousLoginIsAllowed(String)Tells whether this is not anonymous account or anonymous login is allowed by settinglogin.anonymous.always.disabledconfiguration parameter tofalse.- See Also:
-
AuthenticationService.checkCredentials(String, String)