/** * {@inheritDoc} */ @Override @Transactional @MethodLog public long registerJmxSensorTypeIdent(long platformId, String fullyQualifiedClassName) { JmxSensorTypeIdent jmxSensorTypeIdent = new JmxSensorTypeIdent(); jmxSensorTypeIdent.setFullyQualifiedClassName(fullyQualifiedClassName); try { List<Long> jmxSensorTypeIdents = jmxSensorTypeIdentDao.findIdByExample(platformId, jmxSensorTypeIdent); if (1 == jmxSensorTypeIdents.size()) { return jmxSensorTypeIdents.get(0).longValue(); } else { PlatformIdent platformIdent = new PlatformIdent(); platformIdent.setId(platformId); jmxSensorTypeIdent.setPlatformIdent(platformIdent); jmxSensorTypeIdentDao.saveOrUpdate(jmxSensorTypeIdent); return jmxSensorTypeIdent.getId(); } } finally { platformIdentCache.markDirty(platformId); } }