/** * {@inheritDoc} */ public void unregister(long platformIdent) throws BusinessException { registrationService.unregisterPlatformIdent(platformIdent); }
/** * Refreshes the version. */ public void refreshVersion() { if (onlineStatus == OnlineStatus.ONLINE) { try { version = serverStatusService.getVersion(); } catch (Exception e) { version = VersionService.UNKNOWN_VERSION; } } else { version = VersionService.UNKNOWN_VERSION; } }
/** * Loads the {@link JmxSensorValueData} objects which were created between the given * {@link Date} objects. * * @param from * the start date * @param to * the end date * @return list of {@link JmxSensorValueData} objects */ @SuppressWarnings("unchecked") private List<JmxSensorValueData> loadJmxData(Date from, Date to) { return (List<JmxSensorValueData>) globalDataAccessService.getDataObjectsFromToDate(template, from, to); }
/** * {@inheritDoc} * */ @SuppressWarnings("unchecked") @Override public void execute(IStorageService storageService) throws BusinessException { if (isLabelTypeBasedAction()) { List<?> returnList = storageService.getLabelSuggestions(this.getLabelType()); List<AbstractStorageLabel<?>> labels = (List<AbstractStorageLabel<?>>) returnList; storageService.removeLabelsFromCmr(labels, this.isRemoveFromStorageAlso()); storageService.removeLabelType(this.getLabelType()); } else if (isLabelBasedAction()) { Collection<AbstractStorageLabel<?>> labels = this.getLabelList(); storageService.removeLabelsFromCmr(labels, this.isRemoveFromStorageAlso()); } }
/** * Loads all invocation sequences which are related to the set trace. * * @return a {@link List} containing {@link InvocationSequenceData} */ private List<InvocationSequenceData> loadInvocationSequences() { if (invocationService == null) { return Collections.emptyList(); } return new ArrayList<>(invocationService.getInvocationSequenceDetail(traceId)); }
/** * {@inheritDoc} */ @Override public void execute(IStorageService storageService) { if (isLabelTypeBasedAction()) { storageService.saveLabelType(this.getLabelType()); } else if (isLabelBasedAction()) { for (AbstractStorageLabel<?> label : this.getLabelList()) { storageService.saveLabelToCmr(label); } } }
/** * Returns if the server is online by checking the {@link IServerStatusService}. * * @return Returns if the server is online by checking the {@link IServerStatusService}. */ private boolean isOnline() { try { ServerStatus status = serverStatusService.getServerStatus(); if (ServerStatus.SERVER_ONLINE == status) { checkKey(status.getRegistrationIdsValidationKey()); return true; } return false; } catch (Exception e) { return false; } }
/** * Refreshes the recording state. */ public void refreshRecordingState() { if (onlineStatus == OnlineStatus.ONLINE) { try { RecordingState state = getStorageService().getRecordingState(); recordingState = state; } catch (Exception e) { recordingState = RecordingState.OFF; } } else { recordingState = RecordingState.OFF; } }
/** * Writes current {@link BusinessContextDefinition} data of the corresponding CMR to storage. * * @throws IOException * thrown if storing business context fails */ protected void writeBusinessContextData() throws IOException { Collection<BusinessTransactionData> businessTransactions = businessContextService.getBusinessTransactions(); super.writeNonDefaultDataObject(businessTransactions, StorageFileType.BUSINESS_CONTEXT_FILE.getDefaultFileName() + StorageFileType.BUSINESS_CONTEXT_FILE.getExtension()); }
/** * Returns CMR status information. * <p> * <i> Example URL: /cmr/status</i> * * @return Returns CMR status information. */ @RequestMapping(method = GET, value = "status") @ResponseBody public CmrStatusData getStatusData() { return cmrManagementService.getCmrStatusData(); }
/** * Loads all spans which are related to the set trace. * * @return a {@link List} containing {@link Span}s */ private List<Span> loadSpans() { if (spanService == null) { return Collections.emptyList(); } return new ArrayList<>(spanService.getSpans(traceId)); }
/** * Returns all storages. * <p> * <i> Example URL: /storage</i> * * @return List of all storages. */ @RequestMapping(method = GET, value = "") @ResponseBody public List<StorageData> getAllStorages() { List<StorageData> storages = storageService.getExistingStorages(); return storages; }
/** * {@inheritDoc} */ @SuppressWarnings("rawtypes") @Override public void write(Kryo kryo, Output output, Enum serverStatus) { super.write(kryo, output, serverStatus); if (serverStatus instanceof ServerStatus) { output.writeString(((ServerStatus) serverStatus).getRegistrationIdsValidationKey()); } }
/** * {@inheritDoc} */ @Override public void doRefresh() { ClassLoadingInformationData classLoadingData = (ClassLoadingInformationData) dataAccessService.getLastDataObject(classLoadingObj); CpuInformationData cpuData = (CpuInformationData) dataAccessService.getLastDataObject(cpuObj); CompilationInformationData compilationData = (CompilationInformationData) dataAccessService.getLastDataObject(compilationObj); MemoryInformationData memoryData = (MemoryInformationData) dataAccessService.getLastDataObject(memoryObj); RuntimeInformationData runtimeData = (RuntimeInformationData) dataAccessService.getLastDataObject(runtimeObj); ThreadInformationData threadData = (ThreadInformationData) dataAccessService.getLastDataObject(threadObj); updateLabels(classLoadingData, cpuData, compilationData, memoryData, runtimeData, threadData); }
/** * Reloads the data from the service. */ private void loadDataFromService() { List<ExceptionSensorData> exData = null; // if fromDate and toDate are set, then we retrieve only the data for // this time interval if ((null != fromDate) && (null != toDate)) { exData = dataAccessService.getUngroupedExceptionOverview(template, limit, fromDate, toDate, resultComparator); } else { exData = dataAccessService.getUngroupedExceptionOverview(template, limit, resultComparator); } exceptionSensorData.clear(); if (null != exData) { exceptionSensorData.addAll(exData); } }
/** * Returns information of all open alerts. * <p> * <i> Example URL: /alerts/open</i> * </p> * * @return a list of {@link Alert} with all open alerts. */ @RequestMapping(method = GET, value = "open") @ResponseBody public List<Alert> getOpenAlerts() { return alertService.getOpenAlerts(); }
/** * Returns information of all closed alerts. * <p> * <i> Example URL: /alerts/closed</i> * </p> * * @return a list of {@link Alert} with all closed alerts. */ @RequestMapping(method = GET, value = "closed") @ResponseBody public List<Alert> getClosedAlerts() { return alertService.getClosedAlerts(); }
/** * Returns information of all existing alerts. * <p> * <i> Example URL: /alerts</i> * </p> * * @return a list of {@link Alert} with all existing alerts. */ @RequestMapping(method = GET, value = "") @ResponseBody public List<Alert> getAll() { return alertService.getAlerts(); }
/** * Caches result set on the CMR for the given storage under given hash. * * @param cmrRepositoryDefinition * {@link CmrRepositoryDefinition} to cache results on. * @param storageData * {@link StorageData} * @param results * Results to cache * @param hash * Hash to use */ private void cacheQueryResultOnCmr(CmrRepositoryDefinition cmrRepositoryDefinition, StorageData storageData, List<E> results, int hash) { try { cmrRepositoryDefinition.getStorageService().cacheStorageData(storageData, results, hash); } catch (BusinessException e) { // NOPMD NOCHK // ignore also if caching fails } }
/** * {@inheritDoc} */ @Override public void doRefresh() { final ThreadInformationData data = (ThreadInformationData) dataAccessService.getLastDataObject(threadObj); if (null != data) { SafeExecutor.asyncExec(new Runnable() { @Override public void run() { // updates the labels int count = data.getCount(); liveThreadCount.setText(NumberFormatter.formatInteger(data.getTotalThreadCount() / count)); daemonThreadCount.setText(NumberFormatter.formatInteger(data.getTotalDaemonThreadCount() / count)); totalStartedThreadCount.setText(NumberFormatter.formatLong(data.getTotalTotalStartedThreadCount() / count)); peakThreadCount.setText(NumberFormatter.formatInteger(data.getTotalPeakThreadCount() / count)); } }, liveThreadCount, daemonThreadCount, totalStartedThreadCount, peakThreadCount); } }