private boolean isThreadInterrupted(String details) { if (Thread.currentThread().isInterrupted()) { logger.info(String.format("[%d] SDC thread interrupted %s.", timeStamp, details)); return true; } return false; } }
private void getMetadataServiceRef() { BundleContext bctx = FrameworkUtil.getBundle(MetadataService.class).getBundleContext(); // Get MetadataService reference ServiceReference sref = bctx.getServiceReference(MetadataService.class.getName()); if (sref != null) { logger.info("MetadataService from bundlecontext"); metadataService = (MetadataService) bctx.getService(sref); } else { logger.info("MetadataService error from bundlecontext"); logger.warn("Cannot find service reference for org.onap.appc.metadata.MetadataService"); } }
@Override public void start(BundleContext ctx) throws Exception { InstarClientNode instarClientNode = new InstarClientNode(); log.info("Registering service " + instarClientNode.getClass().getName()); registrations.add(ctx.registerService(instarClientNode.getClass().getName(), instarClientNode, null)); log.info("Registering service sccessful for " + instarClientNode.getClass().getName()); }
private void logArtifact(PropertyDefinition artifact) { ObjectMapper mapper = new ObjectMapper(new YAMLFactory()); String stringArtifact = null; try { stringArtifact = mapper.writeValueAsString(artifact); Log.info("Received PropertyDefinition:\n" + stringArtifact); } catch (JsonProcessingException e) { Log.error("Exception while logging artifact:", e); } } }
@Override public void start(BundleContext ctx) throws Exception { AAIResourceNode aaiResourceNode = new AAIResourceNode(); log.info("Registering service-- " + aaiResourceNode.getClass().getName()); registrations.add(ctx.registerService(aaiResourceNode.getClass().getName(), aaiResourceNode, null)); }
@Override public void deleteByConfigResource(ConfigResource configResourceInput) throws SvcLogicException { StringBuilder selectArtifactBuffer = new StringBuilder(); List<Object> listOfArguments = new ArrayList<>(); selectArtifactBuffer.append("DELETE FROM CONFIG_RESOURCE WHERE config_resource_id = ? "); listOfArguments.add(configResourceInput.getConfigResourceId()); String queryString = selectArtifactBuffer.toString(); this.jdbcTemplate.update(queryString, listOfArguments.toArray()); logger.info("config resource ({}) deleted successfully ", configResourceInput); }
private List<ResourceAssignmentData> getResourceAssignmentdata(String configResourceId) { List<Object> listOfArguments = new ArrayList<>(); String queryString = "SELECT * FROM CONFIG_RESOURCE_ASSIGNMENT_DATA WHERE config_resource_id = ? "; logger.info("getResourceAssignmentdata queryString ({}), query inputs ({})", queryString, configResourceId); listOfArguments.add(configResourceId); return this.jdbcTemplate.query(queryString, listOfArguments.toArray(), new ResourceAssignmentDataMapper()); }
/** * Calls to API layer for sending timeout exception. */ @Override public void onTimeOut() { LOG.info("timeout for request with correlation-id " + corrID); ((ICoreAsyncResponseHandler)businessCallback).onException(new TimeoutException("timeout for request with correlation-id " + corrID)); } }
public ComponentNodeServiceImpl(BundleContext blueprintBundleContext, ConfigResourceService configResourceService, ConfigRestAdaptorService configRestAdaptorService) { logger.info("{} Constructor Initiated", "ComponentNodeServiceImpl"); this.bcontext = blueprintBundleContext; this.configResourceService = configResourceService; this.configModelService = new ConfigModelServiceImpl(configRestAdaptorService); }
@Override public void start(BundleContext ctx) throws Exception { ConfigResourceNode configResourceNode = new ConfigResourceNode(); log.info("Registering service-- " + configResourceNode.getClass().getName()); registrations.add(ctx.registerService(configResourceNode.getClass().getName(), configResourceNode, null)); }
@Override /** * contextDestroyed() loads unpublished end points * @param arg0 */ public void contextDestroyed(ServletContextEvent arg0) { log.info("CambriaServletContextListener contextDestroyed"); loader.unPublishEndPoints(); }
public static void auditInfo(Instant beginTimeStamp, Instant endTimeStamp, String code, String responseDescription, String className, EELFResolvableErrorEnum resourceId, String... arguments) { populateAuditLogContext(beginTimeStamp, endTimeStamp, code, responseDescription, className); auditLogger.info(resourceId, arguments); cleanAuditErrorContext(); }
/** * Method called when the blueprint container is created. */ public void init() { // initialize data broker this.serviceRegistration = this.rpcProviderRegistry.addRpcImplementation(InterfacesServiceService.class, new InterfacesServiceProviderImpl()); log.info("DataCollectorProvider Session Initiated"); } /**
@Override public void postStatus(String partition, String event) { LOG.debug(String.format("Posting Message [%s]", event)); if (producer == null) { LOG.info("Getting Producer..."); producer = getProducer(); } producer.post(partition, event); }
public SvcLogicContext readResource(String query, String prefix, String resourceType) throws AaiServiceInternalException, SvcLogicException { SvcLogicContext resourceContext = new SvcLogicContext(); SvcLogicResource.QueryStatus response = aaiClient.query(resourceType, false, null, query, prefix, null, resourceContext); log.info("AAIResponse: " + response.toString()); if (!SvcLogicResource.QueryStatus.SUCCESS.equals(response)) { throw new AaiServiceInternalException("Error Retrieving " + resourceType + " from A&AI"); } return resourceContext; }
private void addTemplateProperty(Map<String, Object> templateProperties, Parameter pdParameter) { Log.info("Adding parameter " + pdParameter.getName() + " in node templates"); String responseKeys = buildResponseKeyExpression(pdParameter.getResponseKeys()); String requestKeys = buildRequestKeyExpression(pdParameter.getRequestKeys()); String ruleType = buildRuleType(pdParameter.getRuleType()); String source = buildSourceSystem(pdParameter.getSource()); String properties = ruleType + " " + responseKeys + " " + source + " " + requestKeys; templateProperties.put(pdParameter.getName(), properties); }
private void addTemplateProperty(Map<String,Object> templateProperties, Parameter pdParameter) { Log.info("Adding parameter "+ pdParameter.getName() + " in node templates"); String responseKeys = buildResponseKeyExpression(pdParameter.getResponseKeys()); String requestKeys = buildRequestKeyExpression(pdParameter.getRequestKeys()); String ruleType = buildRuleType(pdParameter.getRuleType()); String source = buildSourceSystem(pdParameter.getSource()); String properties = ruleType + " " + responseKeys + " " + source + " " + requestKeys; templateProperties.put(pdParameter.getName(),properties); }
private RequestInfoBuilder buildRequestInformation(GenerateSequenceInput input) { log.info("Initializing action, actionLevel and payload for RequestInfo"); return new RequestInfoBuilder() .action(input.getRequestInfo().getAction().name()) .actionLevel(input.getRequestInfo().getActionLevel().getName().toLowerCase()) .payload(input.getRequestInfo().getPayload()); }
public static void logAuditMessage(Instant beginTimeStamp, Instant endTimeStamp, String code, String responseDescription, String className) { populateAuditLogContext(beginTimeStamp, endTimeStamp, code, responseDescription, className); auditLogger.info(EELFResourceManager.format(Msg.APPC_AUDIT_MSG, MDC.get(MDC_SERVICE_NAME), MDC.get(LoggingConstants.MDCKeys.TARGET_VIRTUAL_ENTITY), MDC.get(LoggingConstants.MDCKeys.PARTNER_NAME), MDC.get(MDC_KEY_REQUEST_ID), MDC.get(LoggingConstants.MDCKeys.BEGIN_TIMESTAMP), MDC.get(LoggingConstants.MDCKeys.END_TIMESTAMP), MDC.get(LoggingConstants.MDCKeys.RESPONSE_CODE))); cleanAuditErrorContext(); }