@Override protected Integer getId(final OnmsServiceType service) { return service.getId(); }
@Override protected Integer getId(final OnmsServiceType service) { return service.getId(); }
public Key(Integer nodeId, OnmsServiceType serviceType, InetAddress ipAddress) { this (String.valueOf(Objects.requireNonNull(nodeId)), String.valueOf(Objects.requireNonNull(serviceType).getId()), Objects.requireNonNull(ipAddress).toString()); }
public Key(Integer nodeId, OnmsServiceType serviceType, InetAddress ipAddress) { this (String.valueOf(Objects.requireNonNull(nodeId)), String.valueOf(Objects.requireNonNull(serviceType).getId()), Objects.requireNonNull(ipAddress).toString()); }
/** * <p>toString</p> * * @return a {@link java.lang.String} object. */ @Override public String toString() { return MoreObjects.toStringHelper(this) .add("id", getId()) .add("name", getName()) .toString(); }
/** {@inheritDoc} */ @Override public synchronized int getServiceId(String serviceName) throws DataAccessException { Assert.notNull(serviceName, "The serviceName argument must not be null"); if (m_serviceMap.containsKey(serviceName)) { return m_serviceMap.get(serviceName).intValue(); } else { LOG.debug("Could not find entry for '{}' in service name cache. Looking up in database.", serviceName); OnmsServiceType serviceType = m_serviceTypeDao.findByName(serviceName); if (serviceType == null) { LOG.debug("Did not find entry for '{}' in database.", serviceName); return -1; } LOG.debug("Found entry for '{}' (ID {}) in database. Adding to service name cache.", serviceName, serviceType.getId()); m_serviceMap.put(serviceType.getName(), serviceType.getId()); return serviceType.getId(); } }
/** * <p>dataSourceSync</p> */ @Override public synchronized void dataSourceSync() { m_serviceMap.clear(); for (OnmsServiceType serviceType : m_serviceTypeDao.findAll()) { m_serviceMap.put(serviceType.getName(), serviceType.getId()); } }
/** * <p>getServiceId</p> * * @return a {@link java.lang.Integer} object. */ @Transient @JsonIgnore public Integer getServiceId() { return getServiceType().getId(); }
private ApplicationStatusEntity.Key createKey(ApplicationVertex vertex) { return new ApplicationStatusEntity.Key(String.valueOf(vertex.getNodeID()), String.valueOf(vertex.getServiceType().getId()), vertex.getIpAddress()); }
private ApplicationStatusEntity.Key createKey(ApplicationVertex vertex) { return new ApplicationStatusEntity.Key(String.valueOf(vertex.getNodeID()), String.valueOf(vertex.getServiceType().getId()), vertex.getIpAddress()); }
private ApplicationStatusEntity.Key createKey(ApplicationVertex vertex) { return new ApplicationStatusEntity.Key(String.valueOf(vertex.getNodeID()), String.valueOf(vertex.getServiceType().getId()), vertex.getIpAddress()); }
@Override public ServiceTypeDTO serviceTypeToServiceTypeDTO(OnmsServiceType serviceType) { if ( serviceType == null ) { return null; } ServiceTypeDTO serviceTypeDTO = new ServiceTypeDTO(); serviceTypeDTO.setId( serviceType.getId() ); serviceTypeDTO.setName( serviceType.getName() ); return serviceTypeDTO; }
@Override public void visitMonitoredService(OnmsMonitoredService monSvc) { OnmsServiceType dbType = monSvc.getServiceType(); if (dbType.getId() == null) { dbType = createServiceTypeIfNecessary(dbType.getName()); } monSvc.setServiceType(dbType); } }
private void updateSubObjects(final OnmsMonitoredService svc) { final OnmsServiceType serviceType = svc.getServiceType(); final OnmsServiceType existingServiceType = getServiceTypeDao().findByName(serviceType.getName()); if (existingServiceType != null && existingServiceType.getId() != serviceType.getId()) { svc.setServiceType(existingServiceType); } getServiceTypeDao().saveOrUpdate(svc.getServiceType()); }
@Override public ServiceTypeDTO serviceTypeToServiceTypeDTO(OnmsServiceType serviceType) { if ( serviceType == null ) { return null; } ServiceTypeDTO serviceTypeDTO = new ServiceTypeDTO(); serviceTypeDTO.setId( serviceType.getId() ); serviceTypeDTO.setName( serviceType.getName() ); return serviceTypeDTO; }
private void updateSubObjects(final OnmsMonitoredService svc) { final OnmsServiceType serviceType = svc.getServiceType(); final OnmsServiceType existingServiceType = getServiceTypeDao().findByName(serviceType.getName()); if (existingServiceType != null && existingServiceType.getId() != serviceType.getId()) { svc.setServiceType(existingServiceType); } getServiceTypeDao().saveOrUpdate(svc.getServiceType()); }
@Override public void visitMonitoredService(OnmsMonitoredService monSvc) { OnmsServiceType dbType = monSvc.getServiceType(); if (dbType.getId() == null) { dbType = createServiceTypeIfNecessary(dbType.getName()); } monSvc.setServiceType(dbType); } }