Package org.talend.schemas.esb.locator._2011._11

Examples of org.talend.schemas.esb.locator._2011._11.LookupEndpointResponse


        if (monitoringService == null) {
            initWsClient(context);
        }

        EventType serverStopEvent = createEventType(EventEnumType.SERVER_STOP);
        putEvent(serverStopEvent);

        LOG.info("Send SERVER_STOP event to SAM Server successful!");
    }
View Full Code Here


     *
     * @param type the EventEnumType
     * @return the event type
     */
    private EventType createEventType(EventEnumType type) {
        EventType eventType = new EventType();
        eventType.setTimestamp(Converter.convertDate(new Date()));
        eventType.setEventType(type);

        OriginatorType origType = new OriginatorType();
        origType.setProcessId(Converter.getPID());
        try {
            InetAddress inetAddress = InetAddress.getLocalHost();
            origType.setIp(inetAddress.getHostAddress());
            origType.setHostname(inetAddress.getHostName());
        } catch (UnknownHostException e) {
            origType.setHostname("Unknown hostname");
            origType.setIp("Unknown ip address");
        }
        eventType.setOriginator(origType);

        String path = System.getProperty("karaf.home");
        CustomInfoType ciType = new CustomInfoType();
        CustomInfoType.Item cItem = new CustomInfoType.Item();
        cItem.setKey("path");
        cItem.setValue(path);
        ciType.getItem().add(cItem);
        eventType.setCustomInfo(ciType);

        return eventType;
    }
View Full Code Here

        conduit.setClient(clientConfig);

        simpleJdbcTemplate.update("delete from EVENTS");

        List<EventType> events = new ArrayList<EventType>();
        EventType eventType = new EventType();
        eventType.setEventType(EventEnumType.REQ_OUT);
        URL messageContentFile = this.getClass().getResource("/testmessage.xml").toURI().toURL();
        eventType.setContent(new DataHandler(messageContentFile ));
       
        CustomInfoType ciType = new CustomInfoType();
        CustomInfoType.Item prop1 = new CustomInfoType.Item();
        prop1.setKey("mykey1");
        prop1.setValue("myValue1");
        ciType.getItem().add(prop1);
        CustomInfoType.Item prop2 = new CustomInfoType.Item();
        prop2.setKey("mykey2");
        prop2.setValue("myValue2");
        ciType.getItem().add(prop2);
        eventType.setCustomInfo(ciType);
       
        MessageInfoType mit = new MessageInfoType();
        mit.setFlowId("uuid");
        eventType.setMessageInfo(mit);
       
        events.add(eventType);
        String result = monitoringService.putEvents(events);
        Assert.assertEquals("success", result);
       
View Full Code Here

    /**
     * Test with empty eventType parts to check for Nullpointer exceptions
     */
    @Test
    public void testEmpty() {
        EventType eventType = new EventType();
        EventTypeMapper.map(eventType);
        eventType.setCustomInfo(new CustomInfoType());
        EventTypeMapper.map(eventType);
        eventType.setMessageInfo(new MessageInfoType());
        EventTypeMapper.map(eventType);
        eventType.setOriginator(new OriginatorType());
        EventTypeMapper.map(eventType);
    }
View Full Code Here

     */
    public void putEvents(List<Event> events) {
        Exception lastException;
        List<EventType> eventTypes = new ArrayList<EventType>();
        for (Event event : events) {
            EventType eventType = EventMapper.map(event);
            eventTypes.add(eventType);
        }

        int i = 0;
        lastException = null;
View Full Code Here

    private static void throwFault(String code, String message, Throwable t) throws PutEventsFault {
        if (LOG.isLoggable(Level.SEVERE)) {
            LOG.log(Level.SEVERE, "Throw Fault " + code + " " + message, t);
        }

        FaultType faultType = new FaultType();
        faultType.setFaultCode(code);
        faultType.setFaultMessage(message);

        StringWriter stringWriter = new StringWriter();
        PrintWriter printWriter = new PrintWriter(stringWriter);

        t.printStackTrace(printWriter);

        faultType.setStackTrace(stringWriter.toString());

        throw new PutEventsFault(message, faultType, t);
    }
View Full Code Here

        EventType eventType = new EventType();
        eventType.setTimestamp(Converter.convertDate(event.getTimestamp()));
        eventType.setEventType(convertEventType(event.getEventType()));
        OriginatorType origType = mapOriginator(event.getOriginator());
        eventType.setOriginator(origType);
        MessageInfoType miType = mapMessageInfo(event.getMessageInfo());
        eventType.setMessageInfo(miType);
        eventType.setCustomInfo(convertCustomInfo(event.getCustomInfo()));
        eventType.setContentCut(event.isContentCut());
        if (event.getContent() != null) {
            DataHandler datHandler = getDataHandlerForString(event);
View Full Code Here

     */
    private static MessageInfoType mapMessageInfo(MessageInfo messageInfo) {
        if (messageInfo == null) {
            return null;
        }
        MessageInfoType miType = new MessageInfoType();
        miType.setMessageId(messageInfo.getMessageId());
        miType.setFlowId(messageInfo.getFlowId());
        miType.setPorttype(convertString(messageInfo.getPortType()));
        miType.setOperationName(messageInfo.getOperationName());
        miType.setTransport(messageInfo.getTransportType());
        return miType;
    }
View Full Code Here

        prop2.setKey("mykey2");
        prop2.setValue("myValue2");
        ciType.getItem().add(prop2);
        eventType.setCustomInfo(ciType);
       
        MessageInfoType mit = new MessageInfoType();
        mit.setFlowId("uuid");
        eventType.setMessageInfo(mit);
       
        events.add(eventType);
        String result = monitoringService.putEvents(events);
        Assert.assertEquals("success", result);
View Full Code Here

    public void testEmpty() {
        EventType eventType = new EventType();
        EventTypeMapper.map(eventType);
        eventType.setCustomInfo(new CustomInfoType());
        EventTypeMapper.map(eventType);
        eventType.setMessageInfo(new MessageInfoType());
        EventTypeMapper.map(eventType);
        eventType.setOriginator(new OriginatorType());
        EventTypeMapper.map(eventType);
    }
View Full Code Here

TOP

Related Classes of org.talend.schemas.esb.locator._2011._11.LookupEndpointResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.