當前位置: 首頁>>代碼示例>>Java>>正文


Java AbstractProcess類代碼示例

本文整理匯總了Java中net.opengis.sensorml.v20.AbstractProcess的典型用法代碼示例。如果您正苦於以下問題:Java AbstractProcess類的具體用法?Java AbstractProcess怎麽用?Java AbstractProcess使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


AbstractProcess類屬於net.opengis.sensorml.v20包,在下文中一共展示了AbstractProcess類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: generateSensorML

import net.opengis.sensorml.v20.AbstractProcess; //導入依賴的package包/類
/**
 * Retrieves SensorML object for the given procedure unique ID
 * @param uri
 * @return
 */
protected AbstractProcess generateSensorML(String uri, TimeExtent timeExtent) throws ServiceException
{
    try
    {
        ISOSDataProviderFactory factory = getDataProviderFactoryBySensorID(uri);
        double time = Double.NaN;
        if (timeExtent != null)
            time = timeExtent.getBaseTime();
        return factory.generateSensorMLDescription(time);            
    }
    catch (Exception e)
    {
        throw new ServiceException("Error while retrieving SensorML description for sensor " + uri, e);
    }
}
 
開發者ID:sensiasoft,項目名稱:sensorhub,代碼行數:21,代碼來源:SOSService.java

示例2: getSensorDescription

import net.opengis.sensorml.v20.AbstractProcess; //導入依賴的package包/類
public AbstractProcess getSensorDescription(String sensorUID) throws SensorHubException
{

    try
    {
        DescribeSensorRequest req = new DescribeSensorRequest();
        req.setGetServer(grRequest.getGetServer());
        req.setVersion(grRequest.getVersion());
        req.setProcedureID(sensorUID);            
        
        InputStream is = sosUtils.sendGetRequest(req).getInputStream();
        DOMHelper dom = new DOMHelper(new BufferedInputStream(is), false);
        OWSExceptionReader.checkException(dom, dom.getBaseElement());
        Element smlElt = dom.getElement("description/SensorDescription/data/*");
        AbstractProcess smlDesc = new SMLUtils(SMLUtils.V2_0).readProcess(dom, smlElt);
        log.debug("Retrieved sensor description for sensor {}", sensorUID);
        
        return smlDesc;
    }
    catch (Exception e)
    {
        throw new SensorHubException("Cannot fetch SensorML description for sensor " + sensorUID);
    }
}
 
開發者ID:sensiasoft,項目名稱:sensorhub,代碼行數:25,代碼來源:SOSClient.java

示例3: updateSensorDescription

import net.opengis.sensorml.v20.AbstractProcess; //導入依賴的package包/類
public void updateSensorDescription(AbstractProcess systemDesc, boolean recordHistory) throws SensorException
{
    sensorDescription = systemDesc;
    
    // generate output hashcodes to compare with insert result templates
    structureToOutputMap.clear();
    IOPropertyList outputList = sensorDescription.getOutputList();
    for (int i = 0; i  < outputList.size(); i++)
    {
        DataStructureHash hashObj = new DataStructureHash(outputList.getComponent(i), null);
        structureToOutputMap.put(hashObj, outputList.getProperty(i).getName());
    }
    
    long unixTime = System.currentTimeMillis();
    lastUpdatedSensorDescription = unixTime;
    eventHandler.publishEvent(new SensorEvent(unixTime, this, SensorEvent.Type.SENSOR_CHANGED));
}
 
開發者ID:sensiasoft,項目名稱:sensorhub,代碼行數:18,代碼來源:SOSVirtualSensor.java

示例4: removeDataSourceDescriptionHistory

import net.opengis.sensorml.v20.AbstractProcess; //導入依賴的package包/類
@Override
public void removeDataSourceDescriptionHistory(double startTime, double endTime)
{
    Storage db = getStorage();
    
    Iterator<AbstractProcess> it = descriptionTimeIndex.iterator(new Key(startTime), new Key(endTime), Index.ASCENT_ORDER);
    while (it.hasNext())
    {
        AbstractProcess sml = it.next();
        
        // get end of validity of process description
        double endValidity = Double.NaN; 
        AbstractTimeGeometricPrimitive validTime = sml.getValidTimeList().get(0);
        if (validTime instanceof TimePeriod)
            endValidity = ((TimePeriod) validTime).getEndPosition().getDecimalValue();
        
        // check that end of validity is also within time range
        // if end of validity is now, endValidity will be NaN
        // if this is the last description returned, don't remove it if end of validity is now
        if (endValidity <= endTime || (Double.isNaN(endValidity) && it.hasNext()))
        {
            it.remove();
            db.deallocate(sml);
        }
    }
}
 
開發者ID:sensiasoft,項目名稱:sensorhub,代碼行數:27,代碼來源:BasicStorageRoot.java

示例5: ensureProducerInfo

import net.opengis.sensorml.v20.AbstractProcess; //導入依賴的package包/類
protected void ensureProducerInfo(String producerID)
{
    if (storage instanceof IMultiSourceStorage)
    {
        if (((IMultiSourceStorage<?>)storage).getProducerIDs().contains(producerID))
            return;
    
        IDataProducerModule<?> dataSource = dataSourceRef.get();
        if (dataSource != null && dataSource instanceof IMultiSourceDataProducer)
        {
            // create producer data store
            IBasicStorage dataStore = ((IMultiSourceStorage<IBasicStorage>)storage).addDataStore(producerID);
            
            // save producer SensorML description if any
            AbstractProcess sml = ((IMultiSourceDataProducer) dataSource).getCurrentDescription(producerID);
            if (sml != null)
                dataStore.storeDataSourceDescription(sml);
            
            // create one data store for each sensor output
            for (IStreamingDataInterface output: getSelectedOutputs(dataSource))
                dataStore.addRecordStore(output.getName(), output.getRecordDescription(), output.getRecommendedEncoding());
        }
    }
}
 
開發者ID:sensiasoft,項目名稱:sensorhub,代碼行數:25,代碼來源:GenericStreamStorage.java

示例6: getDataSourceDescriptionAtTime

import net.opengis.sensorml.v20.AbstractProcess; //導入依賴的package包/類
@Override
public AbstractProcess getDataSourceDescriptionAtTime(double time)
{
    for (AbstractProcess sml: dataSourceDescriptions)
    {
        AbstractTimeGeometricPrimitive validTime = sml.getValidTimeList().get(0);
        
        if (validTime instanceof TimeInstant)
        {
            if (time == ((TimeInstant)validTime).getTimePosition().getDecimalValue())
                return sml;
        }
        else if (validTime instanceof TimePeriod)
        {
            if (time >= ((TimePeriod)validTime).getBeginPosition().getDecimalValue() &&
                time <= ((TimePeriod)validTime).getEndPosition().getDecimalValue())
                return sml;
        }
    }
    
    return null;
}
 
開發者ID:sensiasoft,項目名稱:sensorhub,代碼行數:23,代碼來源:InMemoryBasicStorage.java

示例7: getConfiguredInstance

import net.opengis.sensorml.v20.AbstractProcess; //導入依賴的package包/類
/**
 * Generates a configured instance by copying I/Os definition from parent instance 
 * (if typeOf property is present), and applying configuration settings.
 * @param process process with typeOf and configuration settings
 * @param mergeMetadata if true, parent metadata will also be copied to the new instance
 * @return new process instance with configuration values set
 * @throws SMLException if configuration is invalid or cannot be applied
 */
public static AbstractProcess getConfiguredInstance(AbstractProcess process, boolean mergeMetadata) throws SMLException
{
    AbstractProcess baseProcess = null;
    
    // retrieve parent instance by resolving typeOf reference
    String typeOfUrl = process.getTypeOf().getHref();
    if (typeOfUrl != null)
    {
        // TODO load base process
        
        // merge metadata
        
        // apply config
        Settings settings = (Settings)process.getConfiguration();
        applyConfig(baseProcess, settings);
    }
            
    return baseProcess;
}
 
開發者ID:sensiasoft,項目名稱:lib-sensorml,代碼行數:28,代碼來源:SMLHelper.java

示例8: readAbstractProcess

import net.opengis.sensorml.v20.AbstractProcess; //導入依賴的package包/類
/**
 * Dispatcher method for reading elements derived from AbstractProcess
 */
public AbstractProcess readAbstractProcess(XMLStreamReader reader) throws XMLStreamException
{
    String localName = reader.getName().getLocalPart();
    
    if ("SimpleProcess".equals(localName))
        return readSimpleProcess(reader);
    else if ("PhysicalSystem".equals(localName))
        return readPhysicalSystem(reader);
    else if ("PhysicalComponent".equals(localName))
        return readPhysicalComponent(reader);
    else if ("AggregateProcess".equals(localName))
        return readAggregateProcess(reader);
    
    throw new XMLStreamException(ERROR_INVALID_ELT + reader.getName() + errorLocationString(reader));
}
 
開發者ID:sensiasoft,項目名稱:lib-sensorml,代碼行數:19,代碼來源:XMLStreamBindings.java

示例9: readWriteCompareProcessXml

import net.opengis.sensorml.v20.AbstractProcess; //導入依賴的package包/類
protected void readWriteCompareProcessXml(String path) throws Exception
{
    SMLUtils smlUtils = new SMLUtils(SMLUtils.V2_0);
            
    // read from file
    InputStream is = getClass().getResourceAsStream(path);
    AbstractProcess smlObj = smlUtils.readProcess(is);
    is.close();
    
    // write back to stdout and buffer
    System.out.println();
    ByteArrayOutputStream os = new ByteArrayOutputStream();
    smlUtils.writeProcess(os, smlObj, false);
    smlUtils.writeProcess(System.out, smlObj, true);
    
    // compare with original
    InputSource src1 = new InputSource(getClass().getResourceAsStream(path));
    InputSource src2 = new InputSource(new ByteArrayInputStream(os.toByteArray()));
    assertXMLEqual(src1, src2);
}
 
開發者ID:sensiasoft,項目名稱:lib-sensorml,代碼行數:21,代碼來源:TestSMLStaxBindingsV20.java

示例10: testGetSensorDesc

import net.opengis.sensorml.v20.AbstractProcess; //導入依賴的package包/類
@Test
public void testGetSensorDesc() throws Exception
{
    System.out.println();
    AbstractProcess smlDesc = driver.getCurrentDescription();
    new SMLUtils(SWEUtils.V2_0).writeProcess(System.out, smlDesc, true);
}
 
開發者ID:sensiasoft,項目名稱:sensorhub,代碼行數:8,代碼來源:TestNmeaGpsDriverDio.java

示例11: generateSensorMLDescription

import net.opengis.sensorml.v20.AbstractProcess; //導入依賴的package包/類
@Override
public AbstractProcess generateSensorMLDescription(double time)
{
    if (Double.isNaN(time))
        return storage.getLatestDataSourceDescription();
    else
        return storage.getDataSourceDescriptionAtTime(time);
}
 
開發者ID:sensiasoft,項目名稱:sensorhub,代碼行數:9,代碼來源:StorageDataProviderFactory.java

示例12: checkSensorML

import net.opengis.sensorml.v20.AbstractProcess; //導入依賴的package包/類
protected void checkSensorML(AbstractProcess smlProcess, OWSExceptionReport report) throws Exception
{
    String sensorUID = smlProcess.getUniqueIdentifier();
    
    if (sensorUID == null || sensorUID.length() == 0)
        throw new SOSException(SOSException.invalid_param_code, "procedureDescription", null, INVALID_SML_MSG + "Missing unique ID");
    
    if (sensorUID.length() < 10)
        report.add(new SOSException(SOSException.invalid_param_code, "procedureDescription", sensorUID, INVALID_SML_MSG + "Procedure unique ID is too short"));
    
    if (procedureToOfferingMap.containsKey(smlProcess.getIdentifier()))
        report.add(new SOSException(SOSException.invalid_param_code, "procedureDescription", sensorUID, INVALID_SML_MSG + "A procedure with unique ID " + sensorUID + " is already registered on this server"));
}
 
開發者ID:sensiasoft,項目名稱:sensorhub,代碼行數:14,代碼來源:SOSService.java

示例13: getCurrentDescription

import net.opengis.sensorml.v20.AbstractProcess; //導入依賴的package包/類
@Override
public AbstractProcess getCurrentDescription(String entityID)
{
    SMLHelper fac = new SMLHelper();
    PhysicalComponent sensor = fac.newPhysicalComponent();
    sensor.setUniqueIdentifier(entityID);
    sensor.setName("Networked sensor " + entityID.substring(entityID.lastIndexOf(':')+1));
    return sensor;
}
 
開發者ID:sensiasoft,項目名稱:sensorhub,代碼行數:10,代碼來源:FakeSensorWithFoi.java

示例14: getLatestDataSourceDescription

import net.opengis.sensorml.v20.AbstractProcess; //導入依賴的package包/類
@Override
public AbstractProcess getLatestDataSourceDescription()
{
    Iterator<AbstractProcess> it = descriptionTimeIndex.iterator(KEY_SML_START_ALL_TIME, KEY_SML_END_ALL_TIME, Index.DESCENT_ORDER);
    if (it.hasNext())
        return it.next();
    return null;
}
 
開發者ID:sensiasoft,項目名稱:sensorhub,代碼行數:9,代碼來源:BasicStorageRoot.java

示例15: getDataSourceDescriptionAtTime

import net.opengis.sensorml.v20.AbstractProcess; //導入依賴的package包/類
@Override
public AbstractProcess getDataSourceDescriptionAtTime(double time)
{
    Iterator<AbstractProcess> it = descriptionTimeIndex.iterator(KEY_SML_START_ALL_TIME, new Key(time), Index.DESCENT_ORDER);
    if (it.hasNext())
        return it.next();
    return null;
}
 
開發者ID:sensiasoft,項目名稱:sensorhub,代碼行數:9,代碼來源:BasicStorageRoot.java


注:本文中的net.opengis.sensorml.v20.AbstractProcess類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。