Beispiel #1
0
        /**********************************************************/

        private void initOpt(string requestID, string optID, OptTypeType optType, OptReasonEnumeratedType optReason, string venID, string marketContext = null)
        {
            request = new oadrCreateOptType();

            request.schemaVersion = "2.0b";
            request.requestID     = requestID;
            request.optID         = optID;
            request.optType       = optType;
            request.optReason     = (optReason == OptReasonEnumeratedType.xschedule ? "x-schedule" : optReason.ToString());

            if (marketContext != null)
            {
                request.marketContext = marketContext;
            }

            request.venID = venID;

            request.createdDateTime = DateTime.UtcNow;
        }
Beispiel #2
0
        /**********************************************************/

        public void processCreateEventOpt(List <oadrDistributeEventTypeOadrEvent> evts, OptTypeType optType, OptReasonEnumeratedType optReason, string resourceID)
        {
            try
            {
                setVENParameters();

                m_venWrapper.updateEventOpt(evts, optType, optReason, resourceID);
            }
            catch (Exception ex)
            {
                updateError(ex);
            }
        }
        /**********************************************************************************/

        public void updateEventOpt(List <oadrDistributeEventTypeOadrEvent> evts, OptTypeType optType, OptReasonEnumeratedType optReason, string resourceID)
        {
            Thread thread = new Thread(delegate()
            {
                try
                {
                    CreateOpt createOpt;

                    foreach (oadrDistributeEventTypeOadrEvent evt in evts)
                    {
                        lock (m_ven)
                        {
                            createOpt = m_ven.createOptEvent(RandomHex.instance().generateRandomHex(10), RandomHex.instance().generateRandomHex(10),
                                                             evt, optType, optReason, resourceID);
                        }

                        m_callbacks.processCreateOpt(createOpt);
                    }
                }
                catch (Exception ex)
                {
                    m_callbacks.processException(ex);
                }
            });

            thread.Start();
        }
Beispiel #4
0
        /**********************************************************/

        public CreateOpt createOptEvent(string requestID, string optID, oadrDistributeEventTypeOadrEvent evt, OptTypeType optType, OptReasonEnumeratedType optReason, string resourceID = null)
        {
            CreateOpt request = new CreateOpt();

            string requestBody = request.createOptEvent(requestID, optID, evt, optType, optReason, VENID, resourceID);

            if ((request.response = (oadrCreatedOptType)postRequest(requestBody, "/EiOpt", request)) != null)
            {
                request.setEiResponse(request.response.eiResponse);
            }

            return(request);
        }
Beispiel #5
0
        /**********************************************************/

        public string createOptEvent(string requestID, string optID, oadrDistributeEventTypeOadrEvent evt, OptTypeType optType, OptReasonEnumeratedType optReason, string venID, string resourceID = null)
        {
            initOpt(requestID, optID, optType, optReason, venID);

            request.qualifiedEventID                    = new QualifiedEventIDType();
            request.qualifiedEventID.eventID            = evt.eiEvent.eventDescriptor.eventID;
            request.qualifiedEventID.modificationNumber = evt.eiEvent.eventDescriptor.modificationNumber;

            if (resourceID != null)
            {
                request.eiTarget               = new EiTargetType();
                request.eiTarget.resourceID    = new string[1];
                request.eiTarget.resourceID[0] = resourceID;
            }

            return(serializeObject(request));
        }