Package de.hybris.platform.jalo.user
Class Customer
- java.lang.Object
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable
- Direct Known Subclasses:
GeneratedB2BCustomer
public class Customer extends GeneratedCustomer
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:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.GenericItem
GenericItem.GenericItemImpl
-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
LocalizableItem.LocalizableItemImpl
-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.ExtensibleItem
ExtensibleItem.ExtensibleItemImpl
-
Nested 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
Fields Modifier and Type Field Description static java.lang.String
LOGIN_ANONYMOUS_ALWAYS_DISABLED
Configuration 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_ATTRIBUTES
-
Fields 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
-
Fields 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, RETENTIONSTATE, SESSIONCURRENCY, SESSIONLANGUAGE, USERPROFILE
-
Fields inherited from class de.hybris.platform.jalo.security.Principal
ALLGROUPS, ALLSEARCHRESTRICTIONS, DISPLAYNAME, PRINCIPAL_GROUP_RELATION_NAME
-
Fields inherited from class de.hybris.platform.jalo.security.GeneratedPrincipal
DESCRIPTION, GROUPS, NAME, PRINCIPALGROUPRELATION_MARKMODIFIED, PRINCIPALGROUPRELATION_SRC_ORDERED, PRINCIPALGROUPRELATION_TGT_ORDERED, SEARCHRESTRICTIONS, SEARCHRESTRICTIONSHANDLER, UID
-
Fields inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
LANGUAGE_FALLBACK_ENABLED
-
Fields 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, TYPE
-
Fields inherited from class de.hybris.platform.util.BridgeAbstraction
impl, tenant
-
-
Constructor Summary
Constructors Constructor Description Customer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
checkPassword(SessionContext ctx, java.lang.String plainPassword)
Deprecated.since ages - useAuthenticationService.checkCredentials(String, String)
boolean
checkPassword(LoginToken token)
Deprecated.since ages - useAuthenticationService.checkCredentials(String, String)
boolean
isAdmin()
Deprecated.since ages - useUserService.isAdmin(UserModel)
protected boolean
isAnonymousAndAnonymousLoginIsDisabled()
Deprecated.since ages - This logic is now moved toJaloSession.isAnonymousAndAnonymousLoginIsDisabled(String)
java.lang.Boolean
isLoginDisabled(SessionContext ctx)
Deprecated.since ages - Method doesn't check for anonymous login or if it is disabled before getting the attribute value anymore.protected boolean
isNotAnonymousOrAnonymousLoginIsAllowed()
Deprecated.since ages - This logic is now moved toJaloSession.isNotAnonymousOrAnonymousLoginIsAllowed(String)
static void
registerAsJaloObject()
Deprecated.since ages - this is done automatically on loading hybris platform implementationvoid
setLoginDisabled(SessionContext ctx, java.lang.Boolean disabled)
Overwritten to log a warning as long aslogin.anonymous.always.disabled
is set to true.-
Methods inherited from class de.hybris.platform.jalo.user.GeneratedCustomer
getCustomerID, getCustomerID, getDefaultAttributeModes, setCustomerID, setCustomerID
-
Methods 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, getRealEncoding, isAdminEmployee, isAnonymousCustomer, saveCurrentCart, saveCurrentCart, setDefaultDeliveryAddress, setDefaultDeliveryAddress, setDefaultShippingAddress, setDefaultShippingAddress, setEncodedPassword, setEncodedPassword, setEncodedPassword, setEncodedPassword, setLogin, setLogin, setPassword, setPassword, setPassword, setPassword, setUid
-
Methods 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, 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, 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, setRetentionState, setRetentionState, setSessionCurrency, setSessionCurrency, setSessionLanguage, setSessionLanguage, setUserprofile, setUserprofile
-
Methods 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, toString
-
Methods 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, setUid
-
Methods inherited from class de.hybris.platform.jalo.GenericItem
getImplementation, getInitialProperties, getNonInitialAttributes, getRelatedItems, setRelatedItems
-
Methods 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, setLocalizedProperty
-
Methods inherited from class de.hybris.platform.jalo.ExtensibleItem
createNonClassAccessor, getAllProperties, getAllProperties, getProperty, getProperty, getPropertyNames, getPropertyNames, removeProperty, removeProperty, setAllProperties, setAllProperties, setProperty, setProperty
-
Methods 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, 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, useTA, writeReplace
-
Methods inherited from class de.hybris.platform.util.BridgeAbstraction
setTenant
-
-
-
-
Field Detail
-
LOGIN_ANONYMOUS_ALWAYS_DISABLED
public static final java.lang.String LOGIN_ANONYMOUS_ALWAYS_DISABLED
Configuration constant forlogin.anonymous.always.disabled/
which allows changing the (default) disabling of the anonymous account.
- See Also:
- Constant Field Values
-
-
Method Detail
-
registerAsJaloObject
@Deprecated public static void registerAsJaloObject()
Deprecated.since ages - this is done automatically on loading hybris platform implementationInternal.
-
checkPassword
@Deprecated public boolean checkPassword(LoginToken token)
Deprecated.since ages - useAuthenticationService.checkCredentials(String, String)
Overwritten to always returnfalse
in case this is the anonymous account and anonymous login has been disable via configuration ( which is the default setting).- Overrides:
checkPassword
in classUser
-
checkPassword
@Deprecated public boolean checkPassword(SessionContext ctx, java.lang.String plainPassword)
Deprecated.since ages - useAuthenticationService.checkCredentials(String, String)
Overwritten to always returnfalse
in case this is the anonymous account and anonymous login has been disable via configuration ( which is the default setting).- Overrides:
checkPassword
in classUser
-
isAdmin
@Deprecated public boolean isAdmin()
Deprecated.since ages - useUserService.isAdmin(UserModel)
Description copied from class:User
Checks 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 public java.lang.Boolean isLoginDisabled(SessionContext ctx)
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.disabled
configuration property is set totrue
(which is also the default value).- Overrides:
isLoginDisabled
in classGeneratedUser
- Returns:
- the loginDisabled - Determines whether user is allowed to login to system.
-
setLoginDisabled
public void setLoginDisabled(SessionContext ctx, java.lang.Boolean disabled)
Overwritten to log a warning as long aslogin.anonymous.always.disabled
is set to true.- Overrides:
setLoginDisabled
in classUser
disabled
- the loginDisabled - Determines whether user is allowed to login to system.
-
isAnonymousAndAnonymousLoginIsDisabled
@Deprecated 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.disabled
configuration parameter ).
-
isNotAnonymousOrAnonymousLoginIsAllowed
@Deprecated 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.disabled
configuration parameter tofalse
.- See Also:
isAnonymousAndAnonymousLoginIsDisabled()
-
-