public class JaloConnection
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.util.Properties |
ANONYMOUS_LOGIN_PROPERTIES |
static java.lang.String |
DEFAULT_SESSION_CLASS |
static java.lang.String |
LOGHMCCHANGES |
static java.lang.String |
SESSION_CLASS |
| Constructor and Description |
|---|
JaloConnection()
Deprecated.
since ages
|
JaloConnection(Tenant tenant)
Used by
AbstractTenant.doStartUp()exclusively - do not call directly! |
| Modifier and Type | Method and Description |
|---|---|
void |
checkAndAddToSessionCache(JaloSession session)
Deprecated.
since 5.5.1 session management was changed and this method has no effect
|
int |
cleanExpiredSessions()
Deprecated.
since 5.5.1 session management was changed and this method has no effect
|
int |
cleanExpiredSessions(boolean force)
Deprecated.
since 5.5.1 session management was changed and this method always returns -1
|
JaloSession |
createAnonymousCustomerSession()
Creates a session to the hybris platform system using a anonymous account.
|
JaloSession |
createAnonymousCustomerSession(java.lang.Class sessionClass)
Creates a session to the hybris platform system using a anonymous account.
|
JaloSession |
createAnonymousCustomerSession(java.util.Map initialAttributes) |
JaloSession |
createSession(java.util.Map loginProperties)
Creates a session with the given login information.
|
JaloSession |
createSession(java.util.Map loginProperties,
java.lang.Class sessionClass)
Creates a session with the given login information.
|
JaloSession |
createSession(java.util.Map loginProperties,
java.lang.Class sessionClass,
java.util.Map initialAttributes)
Creates a session with the given login information.
|
JaloSession |
createSession(java.lang.String user,
java.lang.String pwd)
creates a session with the given username/pwd
|
JaloSession |
createSession(User user)
Creates a new session using a already known user.
|
boolean |
equals(java.lang.Object object)
Test for equality.
|
protected java.util.Collection |
filterRemovedItems(java.lang.Object attributeValue) |
AccessManager |
getAccessManager()
Returns the
AccessManager and sets it into instance property accessManager, preventing it from
mutation while creating via BeanFactory#getBean(String) or via AccessManager constructor. |
java.util.Collection<JaloSession> |
getAllSessions()
Deprecated.
since 5.5.1 session management was changed and this method always returns empty collection
|
C2LManager |
getC2LManager()
Returns the
C2LManager and sets it into instance property c2lManager, preventing it from mutation
while creating via BeanFactory#getBean(String) or via C2LManager constructor. |
protected java.util.Collection<ChangedItemAttributes> |
getCreatedItemAttributes(Item item,
java.util.Map<java.lang.String,java.lang.Object> values) |
EnumerationManager |
getEnumerationManager()
Returns the
EnumerationManager and sets it into instance property enumerationManager, preventing
it from mutation while creating via BeanFactory#getBean(String) or via EnumerationManager
constructor. |
java.util.Collection<JaloSession> |
getExpiredSessions()
Deprecated.
since 5.5.1 session management was changed and this method always returns empty collection
|
ExtensionManager |
getExtensionManager()
Returns the
ExtensionManager and sets it into instance property extensionManager, preventing it
from mutation while creating via BeanFactory#getBean(String) or via ExtensionManager constructor. |
FlexibleSearch |
getFlexibleSearch()
Returns the
FlexibleSearch and sets it into instance property flexibleSearch, preventing it from
mutation while creating via BeanFactory#getBean(String) or via FlexibleSearch constructor. |
static JaloConnection |
getInstance() |
java.util.List<JaloSessionListener> |
getJaloSessionListeners() |
java.util.Collection<JaloSessionListener> |
getJaloSessionListenersIncludingManagers() |
LinkManager |
getLinkManager()
Returns the
LinkManager and sets it into instance property linkManager, preventing it from
mutation while creating via BeanFactory#getBean(String) or via LinkManager constructor. |
java.util.List<Manager> |
getManagers() |
MediaManager |
getMediaManager()
Returns the
MediaManager and sets it into instance property mediaManager, preventing it from
mutation while creating via BeanFactory#getBean(String) or via MediaManager constructor. |
MetaInformationManager |
getMetaInformationManager()
Returns the
MetaInformationManager and sets it into instance property metaInformationManager,
preventing it from mutation while creating via BeanFactory#getBean(String) or via
MetaInformationManager constructor. |
protected java.util.Collection<ChangedItemAttributes> |
getModifiedItemAttributes(Item item,
java.util.Map<java.lang.String,java.lang.Object> previousValues,
java.util.Map<java.lang.String,java.lang.Object> newValues) |
NumberSeriesManager |
getNumberSeriesManager()
Returns the
NumberSeriesManager and sets it into instance property numberSeriesManager,
preventing it from mutation while creating via BeanFactory#getBean(String) or via
NumberSeriesManager constructor. |
OrderManager |
getOrderManager()
Returns the
OrderManager and sets it into instance property orderManager, preventing it from
mutation while creating via BeanFactory#getBean(String) or via OrderManager constructor. |
PasswordEncoder |
getPasswordEncoder(java.lang.String encoding) |
PasswordEncoderFactory |
getPasswordEncoderFactory()
Returns the
PasswordEncoderFactory and sets it into instance property passwordEncoderFactory,
preventing it from mutation while creating via BeanFactory#getBean(String) or via
PasswordEncoderFactoryImpl constructor. |
ProductManager |
getProductManager()
Returns the
ProductManager and sets it into instance property productManager, preventing it from
mutation while creating via BeanFactory#getBean(String) or via ProductManager constructor. |
protected java.util.Collection<ChangedItemAttributes> |
getRemovedItemAttributes(Item item) |
protected java.util.Collection<SavedValues> |
getSavedValues(SessionContext ctx,
Item item,
int start,
int count) |
JaloSession |
getSession(java.lang.String sessionID)
Deprecated.
since 5.5.1 session management was changed and this method always returns current session or null
|
java.lang.String |
getSystemName()
Returns the SystemName.
|
Tenant |
getTenant() |
TypeManager |
getTypeManager()
Returns the
TypeManager and sets it into instance property typeManager, preventing it from
mutation while creating via BeanFactory#getBean(String) or via TypeManager constructor. |
UserManager |
getUserManager()
Returns the
UserManager and sets it into instance property userManager, preventing it from
mutation while creating via BeanFactory#getBean(String) or via UserManager constructor. |
protected java.lang.Class |
guessSessionClass(java.util.Map props) |
int |
hashCode()
Object is singleton, so default hash code can be used.
|
protected boolean |
isLoggingEnabled(Item toLog) |
java.lang.Boolean |
isLogHMCChanges(SessionContext ctx,
ComposedType item) |
boolean |
isSystemInitialized()
this method tells if you may open a connection.
|
SavedValues |
logItemCreation(Item item,
java.util.Map values)
Deprecated.
since ages - use
logItemCreation(PK, Map) |
SavedValues |
logItemCreation(PK itemPk,
java.util.Map values)
Creates a new
SavedValues marking a item creation. |
SavedValues |
logItemModification(Item item,
java.util.Map<java.lang.String,java.lang.Object> values,
java.util.Map<java.lang.String,java.lang.Object> previousValues,
boolean detectRemovedValues)
Deprecated.
since ages - use
logItemModification(PK, Map, Map, boolean) instead |
SavedValues |
logItemModification(PK itemPk,
java.util.Map<java.lang.String,java.lang.Object> values,
java.util.Map<java.lang.String,java.lang.Object> previousValues,
boolean detectRemovedValues)
Creates a new
SavedValues marking a item modification. |
SavedValues |
logItemRemoval(Item item,
boolean saveAttributes)
Deprecated.
since ages - use
logItemRemoval(PK, boolean) instead |
SavedValues |
logItemRemoval(PK itemPk,
boolean saveAttributes)
Creates a new
SavedValues marking a item removal. |
void |
registerJaloSessionListener(JaloSessionListener jaloSessionListener)
register a JaloSessionListener
|
void |
setTenant(Tenant tenant)
Deprecated.
since 5.0 , You should not mutate the
JaloConnection's tenant. |
java.lang.String |
toString()
Returns a String representation of this Connection.
|
void |
unregisterJaloSessionListener(JaloSessionListener jaloSessionListener)
unregister a JaloSessionListener
|
public static final java.lang.String SESSION_CLASS
public static final java.lang.String DEFAULT_SESSION_CLASS
public static final java.lang.String LOGHMCCHANGES
public static final java.util.Properties ANONYMOUS_LOGIN_PROPERTIES
public JaloConnection(Tenant tenant)
AbstractTenant.doStartUp()exclusively - do not call directly!@Deprecated public JaloConnection()
public static JaloConnection getInstance()
@Deprecated public void setTenant(Tenant tenant)
JaloConnection's tenant.public Tenant getTenant()
public void registerJaloSessionListener(JaloSessionListener jaloSessionListener)
public void unregisterJaloSessionListener(JaloSessionListener jaloSessionListener)
public java.util.List<JaloSessionListener> getJaloSessionListeners()
@Deprecated public int cleanExpiredSessions()
@Deprecated public int cleanExpiredSessions(boolean force)
force - if true cleanup will happen immediately. each method call of cleanExpiredSessions will go through the
complete session list to identify old sessions, this can take some time. if set to false, the cleaning
will only occur every 'session.timeout.checkinterval' settingprotected java.lang.Class guessSessionClass(java.util.Map props)
public JaloSession createAnonymousCustomerSession() throws JaloSecurityException
If the system does not allow anonymous login, a JaloSecurityException is thrown.
JaloSecurityException - if there was a security problem creating the session (e.g. there is no anonymous user allowed to login)public JaloSession createAnonymousCustomerSession(java.util.Map initialAttributes) throws JaloSecurityException
JaloSecurityExceptionpublic JaloSession createAnonymousCustomerSession(java.lang.Class sessionClass) throws JaloSecurityException
If the system does not allow anonymous login, a JaloSecurityException is thrown.
sessionClass - the jalo class of the new session, if null JaloSession will be takenJaloSecurityException - if there was a security problem creating the session (e.g. there is no anonymous user allowed to login)public JaloSession createSession(java.util.Map loginProperties) throws JaloSecurityException, JaloInvalidParameterException
The login properties are given as a Map with the following key mappings:
user.principal: contains the principal, the Login of the user. This key is required, there is no
default.
user.credentials: contains the password of the user. this field is required, there is no default.
null as a password is not permitted.
session.type: the 'type' of the session. Valid types are: customer or
employee. The user principal must be a user of the type provided in session.type. This
key is required, there is no default.
Properties prop = new Properties(); prop.setProperty(JaloSession.LoginProperties.LOGIN, "frank"); prop.setProperty(JaloSession.LoginProperties.PASSWORD, "blurb"); prop.setProperty(JaloSession.LoginProperties.SESSION_TYPE, JaloSession.LoginProperties.SessionTypes.CUSTOMER);if the provided login properties are wrong, a JaloSecurityException is thrown.
loginProperties - JaloInvalidParameterExceptionJaloSecurityExceptionJaloSession.transfer(Map)public JaloSession createSession(java.util.Map loginProperties, java.lang.Class sessionClass) throws JaloSecurityException, JaloInvalidParameterException
The login properties are given as a Map with the following key mappings:
user.principal: contains the principal, the Login of the user. This key is required, there is no
default.
user.credentials: contains the password of the user. this field is required, there is no default.
null as a password is not permitted.
session.type: the 'type' of the session. Valid types are: customer or
employee. The user principal must be a user of the type provided in session.type. This
key is required, there is no default.
Properties prop = new Properties(); prop.setProperty(JaloSession.LoginProperties.LOGIN, "frank"); prop.setProperty(JaloSession.LoginProperties.PASSWORD, "blurb"); prop.setProperty(JaloSession.LoginProperties.SESSION_TYPE, JaloSession.LoginProperties.SessionTypes.CUSTOMER);if the provided login properties are wrong, a JaloSecurityException is thrown.
loginProperties - sessionClass - the jalo class of the new session, if null JaloSession is takenJaloInvalidParameterException - in case login, password or session type is missingJaloSecurityException - in case of a login failure or the system is not initializedJaloSession.transfer(Map)public JaloSession createSession(java.util.Map loginProperties, java.lang.Class sessionClass, java.util.Map initialAttributes) throws JaloSecurityException, JaloInvalidParameterException
The login properties are given as a Map with the following key mappings:
user.principal: contains the principal, the Login of the user. This key is required, there is no
default.
user.credentials: contains the password of the user. this field is required, there is no default.
null as a password is not permitted.
session.type: the 'type' of the session. Valid types are: customer or
employee. The user principal must be a user of the type provided in session.type. This
key is required, there is no default.
Properties prop = new Properties(); prop.setProperty(JaloSession.LoginProperties.LOGIN, "frank"); prop.setProperty(JaloSession.LoginProperties.PASSWORD, "blurb"); prop.setProperty(JaloSession.LoginProperties.SESSION_TYPE, JaloSession.LoginProperties.SessionTypes.CUSTOMER);if the provided login properties are wrong, a JaloSecurityException is thrown.
loginProperties - sessionClass - the jalo class of the new session, if null JaloSession is takeninitialAttributes - initial attributes for the sessionJaloInvalidParameterException - in case login, password or session type is missingJaloSecurityException - in case of a login failure or the system is not initializedJaloSession.transfer(Map)public JaloSession createSession(java.lang.String user, java.lang.String pwd) throws JaloSecurityException
user - the usernamepwd - the passwordJaloSecurityException - if the given combination was wrongpublic JaloSession createSession(User user) throws JaloSecurityException
user - the user to create a new session forJaloSecurityException@Deprecated public java.util.Collection<JaloSession> getAllSessions()
Attention: It will NOT return all sessions made to the server this connection is connected to.
@Deprecated public JaloSession getSession(java.lang.String sessionID)
When advanced property "hybris.improvedsessionhandling" is set to true JaloSession is not added to cache
on creation. Extensions that use getSession(String) should manually add session to cache
after creation using checkAndAddToSessionCache(JaloSession). It really means that if before
mentioned property is set to true, the method getSession(String) will only return session,
which have been manually registered.
sessionID - session ID of the session to be foundnull if no session with such ID exists@Deprecated public java.util.Collection<JaloSession> getExpiredSessions()
@Deprecated public void checkAndAddToSessionCache(JaloSession session)
JaloSession passed as parameter already exists in sessionCache. If not adds this
JaloSession to the sessionCache. JaloSession that is not in sessionCache will never timeout. The purpose
of this method is to add (or replace when already exists) JaloSession to sessionCache. PLA-8390session - jaloSessionpublic java.lang.String getSystemName()
The System name is just a description of the system.
public boolean isSystemInitialized()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object object)
Because JaloConnection is a singleton, this will return true compared with itself, false otherwise
equals in class java.lang.Objectobject - the object to comparepublic int hashCode()
hashCode in class java.lang.Objectequals(Object)public UserManager getUserManager()
UserManager and sets it into instance property userManager, preventing it from
mutation while creating via BeanFactory#getBean(String) or via UserManager constructor. Assures
that returned instance hasn't been changed (or even set to null) in meantime - therefore access is thread safe.public ProductManager getProductManager()
ProductManager and sets it into instance property productManager, preventing it from
mutation while creating via BeanFactory#getBean(String) or via ProductManager constructor. Assures
that returned instance hasn't been changed (or even set to null) in meantime - therefore access is thread safe.public NumberSeriesManager getNumberSeriesManager()
NumberSeriesManager and sets it into instance property numberSeriesManager,
preventing it from mutation while creating via BeanFactory#getBean(String) or via
NumberSeriesManager constructor. Assures that returned instance hasn't been changed (or even set to null)
in meantime - therefore access is thread safe.public FlexibleSearch getFlexibleSearch()
FlexibleSearch and sets it into instance property flexibleSearch, preventing it from
mutation while creating via BeanFactory#getBean(String) or via FlexibleSearch constructor. Assures
that returned instance hasn't been changed (or even set to null) in meantime - therefore access is thread safe.public C2LManager getC2LManager()
C2LManager and sets it into instance property c2lManager, preventing it from mutation
while creating via BeanFactory#getBean(String) or via C2LManager constructor. Assures that
returned instance hasn't been changed (or even set to null) in meantime - therefore access is thread safe.public MetaInformationManager getMetaInformationManager()
MetaInformationManager and sets it into instance property metaInformationManager,
preventing it from mutation while creating via BeanFactory#getBean(String) or via
MetaInformationManager constructor. Assures that returned instance hasn't been changed (or even set to
null) in meantime - therefore access is thread safe.public MediaManager getMediaManager()
MediaManager and sets it into instance property mediaManager, preventing it from
mutation while creating via BeanFactory#getBean(String) or via MediaManager constructor. Assures
that returned instance hasn't been changed (or even set to null) in meantime - therefore access is thread safe.public OrderManager getOrderManager()
OrderManager and sets it into instance property orderManager, preventing it from
mutation while creating via BeanFactory#getBean(String) or via OrderManager constructor. Assures
that returned instance hasn't been changed (or even set to null) in meantime - therefore access is thread safe.public PasswordEncoder getPasswordEncoder(java.lang.String encoding) throws PasswordEncoderNotFoundException
PasswordEncoderNotFoundExceptionpublic PasswordEncoderFactory getPasswordEncoderFactory()
PasswordEncoderFactory and sets it into instance property passwordEncoderFactory,
preventing it from mutation while creating via BeanFactory#getBean(String) or via
PasswordEncoderFactoryImpl constructor. Assures that returned instance hasn't been changed (or even set to
null) in meantime - therefore access is thread safe.public LinkManager getLinkManager()
LinkManager and sets it into instance property linkManager, preventing it from
mutation while creating via BeanFactory#getBean(String) or via LinkManager constructor. Assures
that returned instance hasn't been changed (or even set to null) in meantime - therefore access is thread safe.public ExtensionManager getExtensionManager()
ExtensionManager and sets it into instance property extensionManager, preventing it
from mutation while creating via BeanFactory#getBean(String) or via ExtensionManager constructor.
Assures that returned instance hasn't been changed (or even set to null) in meantime - therefore access is thread
safe.public TypeManager getTypeManager()
TypeManager and sets it into instance property typeManager, preventing it from
mutation while creating via BeanFactory#getBean(String) or via TypeManager constructor. Assures
that returned instance hasn't been changed (or even set to null) in meantime - therefore access is thread safe.public EnumerationManager getEnumerationManager()
EnumerationManager and sets it into instance property enumerationManager, preventing
it from mutation while creating via BeanFactory#getBean(String) or via EnumerationManager
constructor. Assures that returned instance hasn't been changed (or even set to null) in meantime - therefore
access is thread safe.public AccessManager getAccessManager()
AccessManager and sets it into instance property accessManager, preventing it from
mutation while creating via BeanFactory#getBean(String) or via AccessManager constructor. Assures
that returned instance hasn't been changed (or even set to null) in meantime - therefore access is thread safe.public java.util.Collection<JaloSessionListener> getJaloSessionListenersIncludingManagers()
public java.util.List<Manager> getManagers()
public SavedValues logItemRemoval(PK itemPk, boolean saveAttributes)
SavedValues marking a item removal.itemPk - the removed itemsaveAttributes - TODO@Deprecated public SavedValues logItemRemoval(Item item, boolean saveAttributes)
logItemRemoval(PK, boolean) insteadSavedValues marking a item removal.item - the removed itemsaveAttributes - TODOprotected java.util.Collection<ChangedItemAttributes> getRemovedItemAttributes(Item item)
protected java.util.Collection<ChangedItemAttributes> getModifiedItemAttributes(Item item, java.util.Map<java.lang.String,java.lang.Object> previousValues, java.util.Map<java.lang.String,java.lang.Object> newValues)
protected boolean isLoggingEnabled(Item toLog)
protected java.util.Collection<SavedValues> getSavedValues(SessionContext ctx, Item item, int start, int count)
public java.lang.Boolean isLogHMCChanges(SessionContext ctx, ComposedType item)
public SavedValues logItemModification(PK itemPk, java.util.Map<java.lang.String,java.lang.Object> values, java.util.Map<java.lang.String,java.lang.Object> previousValues, boolean detectRemovedValues)
SavedValues marking a item modification.itemPk - the created itemvalues - its modified valuespreviousValues - its previous valuesdetectRemovedValues - TODO@Deprecated public SavedValues logItemModification(Item item, java.util.Map<java.lang.String,java.lang.Object> values, java.util.Map<java.lang.String,java.lang.Object> previousValues, boolean detectRemovedValues)
logItemModification(PK, Map, Map, boolean) insteadSavedValues marking a item modification.item - the created itemvalues - its modified valuespreviousValues - its previous valuesdetectRemovedValues - TODOprotected java.util.Collection filterRemovedItems(java.lang.Object attributeValue)
attributeValue - @Deprecated public SavedValues logItemCreation(Item item, java.util.Map values)
logItemCreation(PK, Map)SavedValues marking a item creation.item - the created itemvalues - its creation valuespublic SavedValues logItemCreation(PK itemPk, java.util.Map values)
SavedValues marking a item creation.itemPk - the created item PKvalues - its creation valuesprotected java.util.Collection<ChangedItemAttributes> getCreatedItemAttributes(Item item, java.util.Map<java.lang.String,java.lang.Object> values)
Copyright © 2018 SAP SE. All Rights Reserved.