Codota Logo
Tapahtuma.addValueChange
Code IndexAdd Codota to your IDE (free)

How to use
addValueChange
method
in
fi.vm.sade.log.model.Tapahtuma

Best Java code snippets using fi.vm.sade.log.model.Tapahtuma.addValueChange (Showing top 4 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
origin: fi.vm.sade.log/log-client

/**
 * Create update entry from maps.
 *
 * @param system
 * @param user
 * @param targetType
 * @param target
 * @param oldMap
 * @param newMap
 * @return
 */
public static Tapahtuma createUPDATEMaps(String system, String user, String targetType, String target, Map<String, String> oldMap, Map<String, String> newMap) {
  Tapahtuma t = createUPDATE(system, user, targetType, target);
  try {
    Collection<String> changedProperties = SimpleBeanSerializer.getDiffProperties(oldMap, newMap);
    for (String propertyName : changedProperties) {
      t.addValueChange(propertyName,
          oldMap != null ? oldMap.get(propertyName) : null,
          newMap != null ? newMap.get(propertyName) : null);
    }
  } catch (Throwable ex) {
    t.addValue("DIFF FAILED", ex.toString());
    ex.printStackTrace();
  }
  return t;
}
origin: fi.vm.sade.log/log-client

/**
 * Create UPDATE message, tries to generate field change information - best approximaption.
 *
 * @param system
 * @param user
 * @param targetType
 * @param target
 * @param oldObject
 * @param newObject
 * @return created event
 */
public static Tapahtuma createUPDATEBeans(String system, String user, String targetType, String target, Object oldObject, Object newObject) {
  Tapahtuma t = createUPDATE(system, user, targetType, target);
  try {
    Map<String, String> oldMap = SimpleBeanSerializer.getBeanAsMap(oldObject);
    Map<String, String> newMap = SimpleBeanSerializer.getBeanAsMap(newObject);
    Collection<String> changedProperties = SimpleBeanSerializer.getDiffProperties(oldMap, newMap);
    for (String propertyName : changedProperties) {
      t.addValueChange(propertyName, oldMap.get(propertyName), newMap.get(propertyName));
    }
  } catch (Throwable ex) {
    t.addValue("SERIALIZATION/DIFF FAILED", ex.toString());
  }
  return t;
}
origin: fi.vm.sade.haku/hakemus-api

/**
 * Logs event when a form phase is successfully saved
 * as application data in data store.
 */
@AfterReturning(pointcut = "execution(* fi.vm.sade.haku.oppija.hakemus.service.ApplicationService.submitApplication(..)) && args(applicationSystemId,..)",
    returning = "application")
public void logSubmitApplication(final String applicationSystemId, final Application application) {
  try {
    Tapahtuma t = new Tapahtuma();
    t.setTarget("Haku: " + applicationSystemId
        + ", käyttäjä: " + userSession.getUser().getUserName() + ", hakemus oid: " + application.getOid());
    t.setTimestamp(new Date());
    t.setUserActsForUser("" + userSession.getUser().getUserName());
    t.setType("Hakemus lähetetty");
    t.setUser("Hakemus Service");
    Map<String, String> answers = application.getVastauksetMerged();
    for (Map.Entry<String, String> answer : answers.entrySet()) {
      t.addValueChange(answer.getKey(), null, answer.getValue());
    }
    LOGGER.debug(t.toString());
    logger.log(t);
  } catch (Exception e) {
    LOGGER.warn("Could not log submit application event");
  }
}
origin: fi.vm.sade.haku/hakemus-api

public void logUpdateApplication(final Application application, final ApplicationPhase applicationPhase) {
  try {
    MapDifference<String, String> diffAnswers = ApplicationDiffUtil.diffAnswers(application, applicationPhase);
    AnswersDifference answersDifference = new AnswersDifference(diffAnswers);
    List<Difference> differences = answersDifference.getDifferences();
    Tapahtuma tapahtuma = new Tapahtuma();
    tapahtuma.setTarget("hakemus: " + application.getOid() + ", vaihe: " + applicationPhase.getPhaseId());
    tapahtuma.setTimestamp(new Date());
    tapahtuma.setUserActsForUser(userSession.getUser().getUserName());
    tapahtuma.setType("Hakemuksen muokkaus");
    tapahtuma.setUser(userSession.getUser().getUserName());
    for (Difference difference : differences) {
      tapahtuma.addValueChange(difference.getKey(), difference.getOldValue(), difference.getNewValue());
    }
    LOGGER.debug(tapahtuma.toString());
    logger.log(tapahtuma);
  } catch (Exception e) {
    LOGGER.warn("Could not log update application event");
  }
}
fi.vm.sade.log.modelTapahtumaaddValueChange

Javadoc

Use this method to record value changes for fields in "target" objects.

Popular methods of Tapahtuma

  • <init>
  • setTarget
  • setTimestamp
  • setType
  • setUser
  • setUserActsForUser
  • addValue
  • createEmpty
  • createREAD
    Create a READ auditlog event.
  • createUPDATE
    After this event has been created add appropriate value changes with "addValueChange(field, old, new
  • get
  • getHost
  • get,
  • getHost,
  • getSystem,
  • getTarget,
  • getTargetType,
  • getTimestamp,
  • getType,
  • getUser,
  • getUserActsForUser

Popular in Java

  • Finding current android device location
  • getSystemService (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • PrintWriter (java.io)
    Prints formatted representations of objects to a text-output stream. This class implements all of th
  • URI (java.net)
    Represents a Uniform Resource Identifier (URI) reference. Aside from some minor deviations noted bel
  • MessageFormat (java.text)
    MessageFormat provides a means to produce concatenated messages in language-neutral way. Use this to
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • JOptionPane (javax.swing)
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now