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
ConstructorDescriptionAuthTenantPersistenceHandler
(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 String
getApplicationName
(com.fasterxml.jackson.databind.JsonNode entityJson) protected Instant
getChangeTimestamp
(com.fasterxml.jackson.databind.JsonNode persistenceMessage) com.fasterxml.jackson.databind.ObjectMapper
String[]
void
protected void
handleCreate
(com.fasterxml.jackson.databind.JsonNode entityJson, String applicationId) protected void
handleDelete
(String id) protected void
handleUpdate
(com.fasterxml.jackson.databind.JsonNode entityJson, Application application) void
protected boolean
isDelete
(com.fasterxml.jackson.databind.JsonNode entityJson) 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.boolean
isNodeNull
(com.fasterxml.jackson.databind.JsonNode jsonNode) boolean
isValidType
(String reportedType, String projectionType) protected IllegalArgumentException
void
processStateChange
(com.fasterxml.jackson.databind.JsonNode entityJson) protected void
updateApplication
(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, wait
Methods 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:
handle
in interfacecom.broadleafcommerce.common.messaging.PersistenceHandler
-
hook
- Specified by:
hook
in interfacecom.broadleafcommerce.common.messaging.PersistenceHandler
-
getObjectMapper
public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()- Specified by:
getObjectMapper
in interfacecom.broadleafcommerce.common.messaging.PersistenceHandler
-
processStateChange
public void processStateChange(com.fasterxml.jackson.databind.JsonNode entityJson) - Specified by:
processStateChange
in 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:
isValidType
in interfacecom.broadleafcommerce.common.messaging.PersistenceHandler
-
getChangeTimestamp
-
missingTimestampError
-
isNodeNull
public boolean isNodeNull(com.fasterxml.jackson.databind.JsonNode jsonNode) -
getSupportedSimpleTypeNames
- Specified by:
getSupportedSimpleTypeNames
in interfacecom.broadleafcommerce.common.messaging.PersistenceHandler
-