<commit_before>package com.sb.servicemix.wsrf.bc;

import gov.nih.nci.cagrid.common.Utils;
import gov.nih.nci.cabig.ctms.grid.ae.client.AdverseEventConsumerClient;
import gov.nih.nci.cabig.ctms.grid.ae.beans.AENotificationType;


import javax.jbi.messaging.MessageExchange;
import javax.jbi.messaging.DeliveryChannel;
import javax.jbi.messaging.NormalizedMessage;
import java.io.StringReader;
import java.io.FileInputStream;

import org.apache.servicemix.jbi.jaxp.SourceTransformer;
import org.apache.servicemix.jbi.jaxp.StringSource;
import org.globus.gsi.GlobusCredential;

/**
 * Created by IntelliJ IDEA.
 * User: kherm
 * Date: Jan 25, 2007
 * Time: 12:53:54 PM
 * To change this template use File | Settings | File Templates.
 */
public class CTMSAdverseEventProcessor implements MessageExchangeProcessor {


    public void process(MessageExchange exchange, DeliveryChannel channel, String epr) throws Exception {
        // If the MEP is an InOnly, RobustInOnly, you have to set the exchange to DONE status
        // else, you have to create an Out message and populate it


        NormalizedMessage in = exchange.getMessage("in");

        AENotificationType ae = (AENotificationType)
                Utils.deserializeObject(new StringReader(new SourceTransformer().contentToString(in)),AENotificationType.class);

        System.out.println("Adverse event received for Registration Grid ID " + ae.getRegistrationGridId());

        String deliveryStatus=null;
        try {
            String proxyFile = "proxy.txt";
            GlobusCredential cred = new GlobusCredential(new FileInputStream(proxyFile));
            AdverseEventConsumerClient client = new AdverseEventConsumerClient(epr, cred);
            client.register(ae);

            deliveryStatus = "delivered Adverse Event";
        } catch (Exception e) {
           deliveryStatus = "failed: " + e.getMessage();

        }<commit_msg>added jars for globus security<commit_after>package com.sb.servicemix.wsrf.bc;

import gov.nih.nci.cagrid.common.Utils;
import gov.nih.nci.cabig.ctms.grid.ae.client.AdverseEventConsumerClient;
import gov.nih.nci.cabig.ctms.grid.ae.beans.AENotificationType;


import javax.jbi.messaging.MessageExchange;
import javax.jbi.messaging.DeliveryChannel;
import javax.jbi.messaging.NormalizedMessage;
import java.io.StringReader;
import java.io.FileInputStream;

import org.apache.servicemix.jbi.jaxp.SourceTransformer;
import org.apache.servicemix.jbi.jaxp.StringSource;
import org.globus.gsi.GlobusCredential;

/**
 * Created by IntelliJ IDEA.
 * User: kherm
 * Date: Jan 25, 2007
 * Time: 12:53:54 PM
 * To change this template use File | Settings | File Templates.
 */
public class CTMSAdverseEventProcessor implements MessageExchangeProcessor {


    public void process(MessageExchange exchange, DeliveryChannel channel, String epr) throws Exception {
        // If the MEP is an InOnly, RobustInOnly, you have to set the exchange to DONE status
        // else, you have to create an Out message and populate it


        NormalizedMessage in = exchange.getMessage("in");

        AENotificationType ae = (AENotificationType)
                Utils.deserializeObject(new StringReader(new SourceTransformer().contentToString(in)),AENotificationType.class);

        System.out.println("Adverse event received for Registration Grid ID " + ae.getRegistrationGridId());

        String deliveryStatus=null;
        try {
            String proxyFile = "~/.globus/certificates/proxy.txt";
            GlobusCredential cred = new GlobusCredential(new FileInputStream(proxyFile));
            AdverseEventConsumerClient client = new AdverseEventConsumerClient(epr,cred);
            client.register(ae);

            deliveryStatus = "delivered Adverse Event";
        } catch (Exception e) {
           deliveryStatus = "failed: " + e.getMessage();

        }
{'fraction_non_alphanumeric': 0.09137975666580378, 'fraction_numerical': 0.006212787988609888, 'mean_word_length': 3.6554216867469878, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6039550', 'n_tokens_mistral': 1177, 'n_tokens_neox': 1117, 'n_words': 267}