Package org.wsdmdemo.service.weatherStation.callbacks

Source Code of org.wsdmdemo.service.weatherStation.callbacks.VisibilityCallback

package org.wsdmdemo.service.weatherStation.callbacks;

import org.apache.ws.resource.properties.ResourceProperty;
import org.apache.ws.resource.properties.ResourcePropertyCallback;
import org.apache.ws.resource.properties.impl.CallbackFailedException;
import org.wsdmdemo.service.InteropConstants;
import org.wsdmdemo.service.weatherStation.VisibilityMetricType;

import java.util.Calendar;


/**
* @author Sal Campana
*/
public class VisibilityCallback implements ResourcePropertyCallback
{
    private double m_lastTemp = InteropConstants.DEFAULT_VISIBILITY;

    public ResourceProperty refreshProperty(ResourceProperty resourceProperty) throws CallbackFailedException
    {
        Calendar resetAt = Calendar.getInstance();
        VisibilityMetricType prop_visibility = (VisibilityMetricType) resourceProperty.get(0);
        prop_visibility.setResetAt(resetAt);
        prop_visibility.setDoubleValue(CallbackUtils.getNextRandomValue(m_lastTemp, InteropConstants.MAX_VISIBILITY, InteropConstants.MIN_VISIBILITY));
        return resourceProperty;
    }
}
TOP

Related Classes of org.wsdmdemo.service.weatherStation.callbacks.VisibilityCallback

TOP
Copyright © 2018 www.massapi.com. 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.