当前位置: 首页>>代码示例>>Java>>正文


Java Reading.setPushed方法代码示例

本文整理汇总了Java中org.edgexfoundry.domain.core.Reading.setPushed方法的典型用法代码示例。如果您正苦于以下问题:Java Reading.setPushed方法的具体用法?Java Reading.setPushed怎么用?Java Reading.setPushed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.edgexfoundry.domain.core.Reading的用法示例。


在下文中一共展示了Reading.setPushed方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getTestEvent

import org.edgexfoundry.domain.core.Reading; //导入方法依赖的package包/类
private Event getTestEvent() {
  List<Reading> readings = null;
  readings = new ArrayList<Reading>();
  Reading reading = new Reading();
  reading.setName("test_valueAlias");
  reading.setValue("test_value");
  reading.setCreated(0);
  reading.setDevice(EdgeOpcUaCommon.DEFAULT_ENDPOINT.getValue());
  reading.setModified(0);
  reading.setId("id1");
  reading.setOrigin(new Timestamp(System.currentTimeMillis()).getTime());
  reading.setPushed(new Timestamp(System.currentTimeMillis()).getTime());

  readings.add(reading);

  Event event = new Event(EdgeOpcUaCommon.DEFAULT_ENDPOINT.getValue(), readings);
  event.setCreated(0);
  event.setModified(0);
  event.setId("id1");
  event.markPushed(new Timestamp(System.currentTimeMillis()).getTime());
  event.setOrigin(new Timestamp(System.currentTimeMillis()).getTime());
  return event;
}
 
开发者ID:mgjeong,项目名称:device-opcua-java,代码行数:24,代码来源:EZMQAdapterTest.java

示例2: testDeleteValueDescriptorWithAssociatedReading

import org.edgexfoundry.domain.core.Reading; //导入方法依赖的package包/类
@Test(expected = DataValidationException.class)
public void testDeleteValueDescriptorWithAssociatedReading() {
  Reading reading = new Reading(TEST_NAME, "somevalue");
  reading.setOrigin(TEST_ORIGIN);
  reading.setPushed(TEST_PUSHED);
  readingRepos.save(reading);
  controller.delete(testValDescId);
}
 
开发者ID:edgexfoundry,项目名称:core-data,代码行数:9,代码来源:ValueDescriptorControllerTest.java

示例3: testUpdateValueDescriptorWithAssociatedReading

import org.edgexfoundry.domain.core.Reading; //导入方法依赖的package包/类
@Test(expected = DataValidationException.class)
public void testUpdateValueDescriptorWithAssociatedReading() {
  Reading reading = new Reading(TEST_NAME, "somevalue");
  reading.setOrigin(TEST_ORIGIN);
  reading.setPushed(TEST_PUSHED);
  readingRepos.save(reading);
  ValueDescriptor valueDescriptor2 = new ValueDescriptor();
  valueDescriptor2.setName("foo");
  valueDescriptor2.setId(testValDescId);
  controller.update(valueDescriptor2);
}
 
开发者ID:edgexfoundry,项目名称:core-data,代码行数:12,代码来源:ValueDescriptorControllerTest.java

示例4: setup

import org.edgexfoundry.domain.core.Reading; //导入方法依赖的package包/类
/**
 * Create and save an instance of the Reading before each test Note: the before method tests the
 * save operation of the Repository
 */
@Before
public void setup() {
  Reading reading = new Reading(TEST_NAME, TEST_VALUE);
  reading.setOrigin(TEST_ORIGIN);
  reading.setPushed(TEST_PUSHED);
  reading.setDevice(EventData.TEST_DEVICE_ID);
  readingRepos.save(reading);
  testReadingId = reading.getId();
  assertNotNull("Saved Reading does not have an id", testReadingId);
}
 
开发者ID:edgexfoundry,项目名称:core-data,代码行数:15,代码来源:ReadingRepositoryTest.java

示例5: setUp

import org.edgexfoundry.domain.core.Reading; //导入方法依赖的package包/类
@Before
public void setUp() {
  r = new Reading(TEST_NAME, TEST_VALUE);
  r2 = new Reading(TEST_NAME, TEST_VALUE);
  r.setPushed(TEST_PUSHED);
  r2.setPushed(TEST_PUSHED);
}
 
开发者ID:edgexfoundry,项目名称:core-domain,代码行数:8,代码来源:ReadingTest.java

示例6: getEvent

import org.edgexfoundry.domain.core.Reading; //导入方法依赖的package包/类
/**
 * get Event Object. Name is set as provider key called ValueAlias. And Device is set as
 * endpointUri of opcua server. And others will be set as default value.
 * 
 * @fn Event getEvent(EdgeMessage data)
 */
private Event getEvent(EdgeMessage data) {
  if (null == data) {
    return null;
  }

  List<Reading> readings = null;
  readings = new ArrayList<Reading>();
  Reading reading = new Reading();
  reading.setName(data.getResponses().get(0).getEdgeNodeInfo().getValueAlias());
  reading.setValue(data.getResponses().get(0).getMessage().getValue().toString());
  reading.setCreated(0);
  reading.setDevice(data.getEdgeEndpointInfo().getEndpointUri());
  reading.setModified(0);
  reading.setId("id1");
  reading.setOrigin(new Timestamp(System.currentTimeMillis()).getTime());
  reading.setPushed(new Timestamp(System.currentTimeMillis()).getTime());

  readings.add(reading);

  Event event = new Event(data.getEdgeEndpointInfo().getEndpointUri(), readings);
  event.setCreated(0);
  event.setModified(0);
  event.setId("id1");
  event.markPushed(new Timestamp(System.currentTimeMillis()).getTime());
  event.setOrigin(new Timestamp(System.currentTimeMillis()).getTime());

  return event;
}
 
开发者ID:mgjeong,项目名称:device-opcua-java,代码行数:35,代码来源:EZMQAdapter.java


注:本文中的org.edgexfoundry.domain.core.Reading.setPushed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。