Package com.enernoc.open.oadr2.model

Examples of com.enernoc.open.oadr2.model.Interval


                .withSchemaVersion( "2.0b" )
                .withOadrReportRequests( new OadrReportRequest()
                        .withReportRequestID( "request-1234" )
                        .withReportSpecifier( new ReportSpecifier()
                                .withReportSpecifierID( "1234" )
                                .withGranularity( new DurationPropType( new DurationValue( duration.toString() ) ) )
                                .withReportBackDuration( new DurationPropType( new DurationValue( duration.toString() ) ) )
                                .withSpecifierPayloads( new SpecifierPayload()
                                        .withRID( "report 1234" )
                                        .withReadingType( ReadingTypeEnumeratedType.DIRECT_READ.value() )
                                        .withItemBase( of.createPulseCount( new PulseCountType()
                                                .withItemDescription( "pulse count" )
View Full Code Here


                        new MarketContext("http://enernoc.com")))
                    .withCreatedDateTime(new DateTime(startDttm)))
                .withEiActivePeriod(new EiActivePeriod()
                    .withProperties(new Properties()
                        .withDtstart(new Dtstart(new DateTime(startDttm)))
                        .withDuration(new DurationPropType(new DurationValue("PT1M")))
                        .withTolerance( new Tolerance(new Tolerate(new DurationValue("PT5S"))))
                        .withXEiNotification(new DurationPropType(new DurationValue("PT5S")))
                    ))
                .withEiEventSignals( new EiEventSignals()
                    .withEiEventSignals( new EiEventSignal()
                        .withSignalID("hi there")
                        .withCurrentValue(new CurrentValue(new PayloadFloatType(1.0f)))
                        .withSignalName("simple")
                        .withSignalType(SignalTypeEnumeratedType.LEVEL)
                        .withIntervals( new Intervals()
                            .withIntervals( new Interval()
                              .withStreamPayloadBases( eiObjectFactory.createSignalPayload(
                                      new SignalPayload( eiObjectFactory.createPayloadFloat(
                                              new PayloadFloatType( 1.0f) ) ) ) )
                              .withDuration( new DurationPropType( new DurationValue( "PT1M" )) )
                              .withDtstart( new Dtstart(new DateTime( startDttm )) )
                            )
                        )
                    )
                )
View Full Code Here

                .withSchemaVersion( "2.0b" )
                .withOadrReportRequests( new OadrReportRequest()
                        .withReportRequestID( "request-1234" )
                        .withReportSpecifier( new ReportSpecifier()
                                .withReportSpecifierID( "1234" )
                                .withGranularity( new DurationPropType( new DurationValue( duration.toString() ) ) )
                                .withReportBackDuration( new DurationPropType( new DurationValue( duration.toString() ) ) )
                                .withSpecifierPayloads( new SpecifierPayload()
                                        .withRID( "report 1234" )
                                        .withReadingType( ReadingTypeEnumeratedType.DIRECT_READ.value() )
                                        .withItemBase( of.createPulseCount( new PulseCountType()
                                                .withItemDescription( "pulse count" )
View Full Code Here

                        new MarketContext("http://enernoc.com")))
                    .withCreatedDateTime(new DateTime(startDttm)))
                .withEiActivePeriod(new EiActivePeriod()
                    .withProperties(new Properties()
                        .withDtstart(new Dtstart(new DateTime(startDttm)))
                        .withDuration(new DurationPropType(new DurationValue("PT1M")))
                        .withTolerance( new Tolerance(new Tolerate(new DurationValue("PT5S"))))
                        .withXEiNotification(new DurationPropType(new DurationValue("PT5S")))
                    ))
                .withEiEventSignals( new EiEventSignals()
                    .withEiEventSignals( new EiEventSignal()
                        .withSignalID("hi there")
                        .withCurrentValue(new CurrentValue(new PayloadFloatType(1.0f)))
                        .withSignalName("simple")
                        .withSignalType(SignalTypeEnumeratedType.LEVEL)
                        .withIntervals( new Intervals()
                            .withIntervals( new Interval()
                              .withStreamPayloadBases( eiObjectFactory.createSignalPayload(
                                      new SignalPayload( eiObjectFactory.createPayloadFloat(
                                              new PayloadFloatType( 1.0f) ) ) ) )
                              .withDuration( new DurationPropType( new DurationValue( "PT1M" )) )
                              .withDtstart( new Dtstart(new DateTime( startDttm )) )
                            )
                        )
                    )
                )
View Full Code Here

                    .withPriority(1L)
                    .withEiMarketContext(new EiMarketContext(
                        new MarketContext("http://enernoc.com")))
                    .withCreatedDateTime(new DateTime(startDttm)))
                .withEiActivePeriod(new EiActivePeriod()
                    .withProperties(new Properties()
                        .withDtstart(new Dtstart(new DateTime(startDttm)))
                        .withDuration(new DurationPropType(new DurationValue("PT1M")))
                        .withTolerance( new Tolerance(new Tolerate(new DurationValue("PT5S"))))
                        .withXEiNotification(new DurationPropType(new DurationValue("PT5S")))
                    ))
View Full Code Here

                    .withCreatedDateTime(new DateTime(startDttm)))
                .withEiActivePeriod(new EiActivePeriod()
                    .withProperties(new Properties()
                        .withDtstart(new Dtstart(new DateTime(startDttm)))
                        .withDuration(new DurationPropType(new DurationValue("PT1M")))
                        .withTolerance( new Tolerance(new Tolerate(new DurationValue("PT5S"))))
                        .withXEiNotification(new DurationPropType(new DurationValue("PT5S")))
                    ))
                .withEiEventSignals( new EiEventSignals()
                    .withEiEventSignals( new EiEventSignal()
                        .withSignalID("hi there")
View Full Code Here

                    .withCreatedDateTime(new DateTime(startDttm)))
                .withEiActivePeriod(new EiActivePeriod()
                    .withProperties(new Properties()
                        .withDtstart(new Dtstart(new DateTime(startDttm)))
                        .withDuration(new DurationPropType(new DurationValue("PT1M")))
                        .withTolerance( new Tolerance(new Tolerate(new DurationValue("PT5S"))))
                        .withXEiNotification(new DurationPropType(new DurationValue("PT5S")))
                    ))
                .withEiEventSignals( new EiEventSignals()
                    .withEiEventSignals( new EiEventSignal()
                        .withSignalID("hi there")
View Full Code Here

  @Test public void testPacketExtension() throws Exception {
   
    OADRPacketCollector packetCollector = new OADRPacketCollector();
      venConnection.addPacketListener(packetCollector, new OADR2PacketFilter());
     
      IQ iq = new OADR2IQ(new OADR2PacketExtension(createEventPayload(), this.marshaller));
      iq.setTo(venConnection.getUser());
      iq.setType(IQ.Type.SET);
     
      vtnConnection.sendPacket(iq);
     
      Packet packet = packetCollector.getQueue().poll(5,TimeUnit.SECONDS);
     
View Full Code Here

  @Test public void testPacketExtension() throws Exception {
   
    OADRPacketCollector packetCollector = new OADRPacketCollector();
      venConnection.addPacketListener(packetCollector, new OADR2PacketFilter());
     
      IQ iq = new OADR2IQ(new OADR2PacketExtension(createEventPayload(), this.marshaller));
      iq.setTo(venConnection.getUser());
      iq.setType(IQ.Type.SET);
     
      vtnConnection.sendPacket(iq);
     
      Packet packet = packetCollector.getQueue().poll(5,TimeUnit.SECONDS);
     
//      Thread.sleep(1000000);
     
      assertNotNull( "Received packet should not be null", packet);
      assertTrue( "Packet should be an instance of OADRIQ", packet instanceof OADR2IQ );
      assertNotNull( "OADR payload should not be null", ((OADR2IQ)packet).getOADRPayload() );
     
      OADR2PacketExtension extension = (OADR2PacketExtension)packet.getExtension(XMLNS.OADR2.getNamespaceURI());
      assertEquals( "Packet extension should be an oadrSignedObject element",
              "oadrSignedObject", extension.getElementName());
      assertEquals( "Extension should have the OADR2 namespace",
              XMLNS.OADR2.getNamespaceURI(), extension.getNamespace());
      Object pObj = extension.getPayload();
      assertNotNull( "Extension payload should not be null", pObj );
      assertTrue( "Extension payload should be an OadrSignedObject", pObj instanceof OadrSignedObject );
      OadrSignedObject payload = (OadrSignedObject)pObj;
      assertEquals( "Request ID should match what was sent",
              "test 1234", payload.getOadrDistributeEvent().getRequestID() );
View Full Code Here

public class XMPPExtensionProvider extends com.enernoc.open.oadr2.xmpp.XMPPExtensionProvider {

  public XMPPExtensionProvider() {
        try {
            this.jaxb = new JAXBManager();
            this.unmarshaller = new PullUnmarshaller(jaxb.getContext());
        }
        catch ( JAXBException ex ) {
            throw new RuntimeException("Error initializing JAXB context",ex);
        }
  }
View Full Code Here

TOP

Related Classes of com.enernoc.open.oadr2.model.Interval

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.