@Override public Patch load(String id) { return persistenceService.load(id, Patch.class); }
@Override public SFDCConfiguration loadConfiguration() { if (persistenceService == null) { return null; } SFDCConfiguration sfdcConfiguration = persistenceService.load("sfdcConfiguration", SFDCConfiguration.class); return sfdcConfiguration; }
@Override public RuleStatistics getRuleStatistics(String ruleId) { if (allRuleStatistics.containsKey(ruleId)) { return allRuleStatistics.get(ruleId); } return persistenceService.load(ruleId, RuleStatistics.class); }
public Session loadSession(String sessionId, Date dateHint) { Session s = persistenceService.load(sessionId, dateHint, Session.class); if (s == null && dateHint != null) { GregorianCalendar gc = new GregorianCalendar(); gc.setTime(dateHint); if (gc.get(Calendar.DAY_OF_MONTH) == 1) { gc.add(Calendar.DAY_OF_MONTH, -1); s = persistenceService.load(sessionId, gc.getTime(), Session.class); } } return s; }
public Session loadSession(String sessionId, Date dateHint) { Session s = persistenceService.load(sessionId, dateHint, Session.class); if (s == null && dateHint != null) { GregorianCalendar gc = new GregorianCalendar(); gc.setTime(dateHint); if (gc.get(Calendar.DAY_OF_MONTH) == 1) { gc.add(Calendar.DAY_OF_MONTH, -1); s = persistenceService.load(sessionId, gc.getTime(), Session.class); } } return s; }
public ActionType getActionType(String id) { ActionType type = actionTypeById.get(id); if (type == null || type.getVersion() == null) { type = persistenceService.load(id, ActionType.class); if (type != null) { actionTypeById.put(id, type); } } return type; }
public ActionType getActionType(String id) { ActionType type = actionTypeById.get(id); if (type == null || type.getVersion() == null) { type = persistenceService.load(id, ActionType.class); if (type != null) { actionTypeById.put(id, type); } } return type; }
public Persona savePersona(Persona profile) { if (persistenceService.load(profile.getItemId(), Persona.class) == null) { Session session = new PersonaSession(UUID.randomUUID().toString(), profile, new Date()); persistenceService.save(profile); persistenceService.save(session); } else { persistenceService.save(profile); } return persistenceService.load(profile.getItemId(), Persona.class); }
public Campaign getCampaign(String id) { Campaign campaign = persistenceService.load(id, Campaign.class); if (campaign != null) { ParserHelper.resolveConditionType(definitionsService, campaign.getEntryCondition()); } return campaign; }
public Segment getSegmentDefinition(String segmentId) { Segment definition = persistenceService.load(segmentId, Segment.class); if (definition != null) { ParserHelper.resolveConditionType(definitionsService, definition.getCondition()); } return definition; }
public Persona savePersona(Persona profile) { if (persistenceService.load(profile.getItemId(), Persona.class) == null) { Session session = new PersonaSession(UUID.randomUUID().toString(), profile, new Date()); persistenceService.save(profile); persistenceService.save(session); } else { persistenceService.save(profile); } return persistenceService.load(profile.getItemId(), Persona.class); }
public Campaign getCampaign(String id) { Campaign campaign = persistenceService.load(id, Campaign.class); if (campaign != null) { ParserHelper.resolveConditionType(definitionsService, campaign.getEntryCondition()); } return campaign; }
public Scoring getScoringDefinition(String scoringId) { Scoring definition = persistenceService.load(scoringId, Scoring.class); if (definition != null) { for (ScoringElement element : definition.getElements()) { ParserHelper.resolveConditionType(definitionsService, element.getCondition()); } } return definition; }
public PersonaWithSessions loadPersonaWithSessions(String personaId) { Persona persona = persistenceService.load(personaId, Persona.class); if (persona == null) { return null; } List<PersonaSession> sessions = persistenceService.query("profileId", persona.getItemId(), "timeStamp:desc", PersonaSession.class); return new PersonaWithSessions(persona, sessions); }
public PersonaWithSessions loadPersonaWithSessions(String personaId) { Persona persona = persistenceService.load(personaId, Persona.class); if (persona == null) { return null; } List<PersonaSession> sessions = persistenceService.query("profileId", persona.getItemId(), "timeStamp:desc", PersonaSession.class); return new PersonaWithSessions(persona, sessions); }
public Scoring getScoringDefinition(String scoringId) { Scoring definition = persistenceService.load(scoringId, Scoring.class); if (definition != null) { for (ScoringElement element : definition.getElements()) { ParserHelper.resolveConditionType(definitionsService, element.getCondition()); } } return definition; }
public Goal getGoal(String goalId) { Goal goal = persistenceService.load(goalId, Goal.class); if (goal != null) { ParserHelper.resolveConditionType(definitionsService, goal.getStartEvent()); ParserHelper.resolveConditionType(definitionsService, goal.getTargetEvent()); } return goal; }
public Goal getGoal(String goalId) { Goal goal = persistenceService.load(goalId, Goal.class); if (goal != null) { ParserHelper.resolveConditionType(definitionsService, goal.getStartEvent()); ParserHelper.resolveConditionType(definitionsService, goal.getTargetEvent()); } return goal; }
public Rule getRule(String ruleId) { Rule rule = persistenceService.load(ruleId, Rule.class); if (rule != null) { if (rule.getCondition() != null) { ParserHelper.resolveConditionType(definitionsService, rule.getCondition()); } if (rule.getActions() != null) { ParserHelper.resolveActionTypes(definitionsService, rule.getActions()); } } return rule; }
public Rule getRule(String ruleId) { Rule rule = persistenceService.load(ruleId, Rule.class); if (rule != null) { if (rule.getCondition() != null) { ParserHelper.resolveConditionType(definitionsService, rule.getCondition()); } if (rule.getActions() != null) { ParserHelper.resolveActionTypes(definitionsService, rule.getActions()); } } return rule; }