Ejemplo n.º 1
0
 @SuppressWarnings("unchecked")
 private void updateDataSource(final DataSourceVO<?> vo) {
   DataSourceVO<?> old = getDataSource(vo.getId());
   _updateDataSource(vo);
   AuditEventType.raiseChangedEvent(
       AuditEventType.TYPE_DATA_SOURCE, old, (ChangeComparable<DataSourceVO<?>>) vo);
 }
Ejemplo n.º 2
0
  public void deleteDataSource(final int dataSourceId) {
    DataSourceVO<?> vo = getDataSource(dataSourceId);
    final ExtendedJdbcTemplate ejt2 = ejt;

    new DataPointDao().deleteDataPoints(dataSourceId);

    if (vo != null) {
      getTransactionTemplate()
          .execute(
              new TransactionCallbackWithoutResult() {
                @Override
                protected void doInTransactionWithoutResult(TransactionStatus status) {
                  ejt2.update(
                      "delete from eventHandlers where eventTypeName=? and eventTypeRef1=?",
                      new Object[] {EventType.EventTypeNames.DATA_SOURCE, dataSourceId});
                  ejt2.update(
                      "delete from dataSourceUsers where dataSourceId=?",
                      new Object[] {dataSourceId});
                  ejt2.update("delete from dataSources where id=?", new Object[] {dataSourceId});
                }
              });

      AuditEventType.raiseDeletedEvent(AuditEventType.TYPE_DATA_SOURCE, vo);
    }
  }
Ejemplo n.º 3
0
  private void insertDataSource(final DataSourceVO<?> vo) {
    vo.setId(
        doInsert(
            "insert into dataSources (xid, name, dataSourceType, data) values (?,?,?,?)",
            new Object[] {
              vo.getXid(),
              vo.getName(),
              vo.getDefinition().getDataSourceTypeName(),
              SerializationHelper.writeObject(vo)
            },
            new int[] {Types.VARCHAR, Types.VARCHAR, Types.VARCHAR, Types.BLOB}));

    AuditEventType.raiseAddedEvent(AuditEventType.TYPE_DATA_SOURCE, vo);
  }
Ejemplo n.º 4
0
  @Override
  public void addPropertyChanges(List<TranslatableMessage> list, DataPointVO from) {
    AuditEventType.maybeAddPropertyChangeMessage(list, "common.xid", from.xid, xid);
    AuditEventType.maybeAddPropertyChangeMessage(list, "dsEdit.points.name", from.name, name);
    AuditEventType.maybeAddPropertyChangeMessage(list, "common.enabled", from.enabled, enabled);
    AuditEventType.maybeAddExportCodeChangeMessage(
        list, "pointEdit.logging.type", LOGGING_TYPE_CODES, from.loggingType, loggingType);
    AuditEventType.maybeAddPeriodChangeMessage(
        list,
        "pointEdit.logging.period",
        from.intervalLoggingPeriodType,
        from.intervalLoggingPeriod,
        intervalLoggingPeriodType,
        intervalLoggingPeriod);
    AuditEventType.maybeAddExportCodeChangeMessage(
        list,
        "pointEdit.logging.valueType",
        INTERVAL_LOGGING_TYPE_CODES,
        from.intervalLoggingType,
        intervalLoggingType);
    AuditEventType.maybeAddPropertyChangeMessage(
        list, "pointEdit.logging.tolerance", from.tolerance, tolerance);
    AuditEventType.maybeAddPropertyChangeMessage(
        list, "pointEdit.logging.purgeOverride", from.purgeOverride, purgeOverride);
    AuditEventType.maybeAddPeriodChangeMessage(
        list, "pointEdit.logging.purge", from.purgeType, from.purgePeriod, purgeType, purgePeriod);
    AuditEventType.maybeAddPropertyChangeMessage(
        list, "pointEdit.logging.defaultCache", from.defaultCacheSize, defaultCacheSize);
    AuditEventType.maybeAddPropertyChangeMessage(
        list, "pointEdit.logging.discard", from.discardExtremeValues, discardExtremeValues);
    AuditEventType.maybeAddPropertyChangeMessage(
        list, "pointEdit.logging.discardLow", from.discardLowLimit, discardLowLimit);
    AuditEventType.maybeAddPropertyChangeMessage(
        list, "pointEdit.logging.discardHigh", from.discardHighLimit, discardHighLimit);
    AuditEventType.maybeAddPropertyChangeMessage(
        list, "pointEdit.props.engineeringUnits", from.engineeringUnits, engineeringUnits);
    AuditEventType.maybeAddPropertyChangeMessage(
        list, "pointEdit.props.chartColour", from.chartColour, chartColour);
    AuditEventType.maybeAddExportCodeChangeMessage(
        list, "pointEdit.plotType", PLOT_TYPE_CODES, from.plotType, plotType);

    pointLocator.addPropertyChanges(list, from.pointLocator);
  }
Ejemplo n.º 5
0
  @Override
  public void addProperties(List<TranslatableMessage> list) {
    AuditEventType.addPropertyMessage(list, "common.xid", xid);
    AuditEventType.addPropertyMessage(list, "dsEdit.points.name", name);
    AuditEventType.addPropertyMessage(list, "common.enabled", enabled);
    AuditEventType.addExportCodeMessage(
        list, "pointEdit.logging.type", LOGGING_TYPE_CODES, loggingType);
    AuditEventType.addPeriodMessage(
        list, "pointEdit.logging.period", intervalLoggingPeriodType, intervalLoggingPeriod);
    AuditEventType.addExportCodeMessage(
        list, "pointEdit.logging.valueType", INTERVAL_LOGGING_TYPE_CODES, intervalLoggingType);
    AuditEventType.addPropertyMessage(list, "pointEdit.logging.tolerance", tolerance);
    AuditEventType.addPropertyMessage(list, "pointEdit.logging.purgeOverride", purgeOverride);
    AuditEventType.addPeriodMessage(list, "pointEdit.logging.purge", purgeType, purgePeriod);
    AuditEventType.addPropertyMessage(list, "pointEdit.logging.defaultCache", defaultCacheSize);
    AuditEventType.addPropertyMessage(list, "pointEdit.logging.discard", discardExtremeValues);
    AuditEventType.addPropertyMessage(list, "pointEdit.logging.discardLow", discardLowLimit);
    AuditEventType.addPropertyMessage(list, "pointEdit.props.engineeringUnits", engineeringUnits);
    AuditEventType.addPropertyMessage(list, "pointEdit.props.chartColour", chartColour);
    AuditEventType.addExportCodeMessage(list, "pointEdit.plotType", PLOT_TYPE_CODES, plotType);

    pointLocator.addProperties(list);
  }