/**
 * Licensed to the Rhiot under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.rhiot.component.gps.gpsd;

import org.apache.camel.Exchange;
import org.apache.camel.impl.DefaultProducer;

import java.util.Date;

public class GpsdProducer  extends DefaultProducer {

    public GpsdProducer(GpsdEndpoint endpoint) {
        super(endpoint);
    }

    @Override
    public void process(Exchange exchange) throws Exception {
        exchange.getIn().setBody(new ClientGpsCoordinates(new Date(), 1, 1));
    }

    @Override
    public GpsdEndpoint getEndpoint() {
        return (GpsdEndpoint) super.getEndpoint();
    }

}

@@ -807,16 +807,154 @@
 .gpsd;%0A%0A
+import de.taimos.gpsd4java.backend.GPSdEndpoint;%0Aimport de.taimos.gpsd4java.types.PollObject;%0Aimport de.taimos.gpsd4java.types.TPVObject;%0A
 import o
@@ -979,16 +979,16 @@
 change;%0A
-
 import o
@@ -1076,17 +1076,16 @@
 roducer 
- 
 extends 
@@ -1272,77 +1272,573 @@
     
-exchange.getIn().setBody(new ClientGpsCoordinates(new Date(), 1, 1));
+GPSdEndpoint gpsd4javaEndpoint = getEndpoint().getGpsd4javaEndpoint();%0A        %0A        PollObject pollObject = gpsd4javaEndpoint.poll();%0A        %0A        if (pollObject != null && pollObject.getFixes().size() %3E 0 && pollObject.getFixes().get(0) instanceof TPVObject) %7B%0A            TPVObject tpv = pollObject.getFixes().get(0);%0A            exchange.getIn().setBody(new ClientGpsCoordinates(new Date(new Double(tpv.getTimestamp()).longValue()), tpv.getLatitude(), tpv.getLongitude()));%0A            exchange.getIn().setHeader(GpsdConstants.TPV_HEADER, tpv);%0A        %7D
 %0A   

Add producer to the camel-gpsd component (#227)