Class AuthTenantPersistenceHandler
java.lang.Object
com.broadleafcommerce.auth.tenant.message.AuthTenantPersistenceHandler
- All Implemented Interfaces:
com.broadleafcommerce.common.messaging.PersistenceHandler
public class AuthTenantPersistenceHandler
extends Object
implements com.broadleafcommerce.common.messaging.PersistenceHandler
Handler for the
AuthPersistenceConsumer channel that specializes in replicating persisted
Application domain information
into a subset of that information embodied in the Application domain.- Author:
- Jeff Fischer
-
Constructor Summary
ConstructorsConstructorDescriptionAuthTenantPersistenceHandler(ApplicationService<Application> applicationService, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory) Deprecated.As of 1.4.0.AuthTenantPersistenceHandler(ApplicationService<Application> applicationService, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, AuthServerCreationHandler authServerCreationHandler) AuthTenantPersistenceHandler(com.fasterxml.jackson.databind.ObjectMapper objectMapper, ApplicationService<Application> applicationService, com.broadleafcommerce.common.extension.TypeFactory typeFactory, AuthServerCreationHandler authServerCreationHandler) -
Method Summary
Modifier and TypeMethodDescriptionprotected StringgetApplicationName(com.fasterxml.jackson.databind.JsonNode entityJson) protected InstantgetChangeTimestamp(com.fasterxml.jackson.databind.JsonNode persistenceMessage) com.fasterxml.jackson.databind.ObjectMapperString[]voidprotected voidhandleCreate(com.fasterxml.jackson.databind.JsonNode entityJson, String applicationId) protected voidhandleDelete(String id) protected voidhandleUpdate(com.fasterxml.jackson.databind.JsonNode entityJson, Application application) voidprotected booleanisDelete(com.fasterxml.jackson.databind.JsonNode entityJson) protected booleanisNewChange(com.fasterxml.jackson.databind.JsonNode entityJson, Application application) Checks whether the incoming change is newer or equals than the local persisted application.booleanisNodeNull(com.fasterxml.jackson.databind.JsonNode jsonNode) booleanisValidType(String reportedType, String projectionType) protected IllegalArgumentExceptionvoidprocessStateChange(com.fasterxml.jackson.databind.JsonNode entityJson) protected voidupdateApplication(com.fasterxml.jackson.databind.JsonNode entityJson, Application application) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.broadleafcommerce.common.messaging.PersistenceHandler
validate
-
Constructor Details
-
AuthTenantPersistenceHandler
public AuthTenantPersistenceHandler(ApplicationService<Application> applicationService, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, @Nullable AuthServerCreationHandler authServerCreationHandler) -
AuthTenantPersistenceHandler
@Deprecated public AuthTenantPersistenceHandler(ApplicationService<Application> applicationService, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory) Deprecated. -
AuthTenantPersistenceHandler
public AuthTenantPersistenceHandler(com.fasterxml.jackson.databind.ObjectMapper objectMapper, ApplicationService<Application> applicationService, com.broadleafcommerce.common.extension.TypeFactory typeFactory, AuthServerCreationHandler authServerCreationHandler)
-
-
Method Details
-
handle
- Specified by:
handlein interfacecom.broadleafcommerce.common.messaging.PersistenceHandler
-
hook
- Specified by:
hookin interfacecom.broadleafcommerce.common.messaging.PersistenceHandler
-
getObjectMapper
public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()- Specified by:
getObjectMapperin interfacecom.broadleafcommerce.common.messaging.PersistenceHandler
-
processStateChange
public void processStateChange(com.fasterxml.jackson.databind.JsonNode entityJson) - Specified by:
processStateChangein interfacecom.broadleafcommerce.common.messaging.PersistenceHandler
-
isNewChange
protected boolean isNewChange(com.fasterxml.jackson.databind.JsonNode entityJson, Application application) Checks whether the incoming change is newer or equals than the local persisted application.- Parameters:
entityJson- the incoming changeapplication- local persisted application- Returns:
- true if incoming change is newer or equals to the local persisted application
-
handleUpdate
protected void handleUpdate(com.fasterxml.jackson.databind.JsonNode entityJson, Application application) -
handleCreate
protected void handleCreate(com.fasterxml.jackson.databind.JsonNode entityJson, String applicationId) -
getApplicationName
-
updateApplication
protected void updateApplication(com.fasterxml.jackson.databind.JsonNode entityJson, Application application) -
handleDelete
-
isDelete
protected boolean isDelete(com.fasterxml.jackson.databind.JsonNode entityJson) -
isValidType
- Specified by:
isValidTypein interfacecom.broadleafcommerce.common.messaging.PersistenceHandler
-
getChangeTimestamp
-
missingTimestampError
-
isNodeNull
public boolean isNodeNull(com.fasterxml.jackson.databind.JsonNode jsonNode) -
getSupportedSimpleTypeNames
- Specified by:
getSupportedSimpleTypeNamesin interfacecom.broadleafcommerce.common.messaging.PersistenceHandler
-