/*
Set the Guaranteed Delivery Value End Tick value in the message.

Javadoc description supplied by JsMessage interface.
511234
public final void setGuaranteedValueEndTick(long value) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setGuaranteedValueEndTick", Long.valueOf(value));
        getHdr2().setLongField(JsHdr2Access.GUARANTEEDVALUE_SET_ENDTICK, value);
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setGuaranteedValueEndTick");
    }
871842
@Override
    public final void setReplyPriority(int value) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setReplyPriority", Integer.valueOf(value));
        if ((value >= MfpConstants.MIN_PRIORITY) && (value <= MfpConstants.MAX_PRIORITY)) {
            getApi().setIntField(JsApiAccess.REPLYPRIORITY_VALUE, value);
        }
        else {
            IllegalArgumentException e = new IllegalArgumentException(Integer.toString(value));
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(this, tc, "setReplyPriority", e);
            throw e;
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setReplyPriority");
    }
391987
function(arr, sendUpdatedEvt) {
		var values = arr[0].split(":").concat(arr[1].split(":"));
      inputEx.TimeRange.superclass.setValue.call(this, values, sendUpdatedEvt);
		this.toogleEndMinutes();
   }
176918
public List sendValueMessages(
    List msgList,
    long completedPrefix,
    boolean requestedOnly,
    int priority,
    Reliability reliability,
    SIBUuid12 stream) throws SIResourceException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "sendValueMessages",
        new Object[] { msgList,
                       new Long(completedPrefix),
                       new Boolean(requestedOnly)});

    // We will send the messages using MPIO
    // Work out the cellule pair needed by the
    // messageTransmitter
    SIBUuid8[] fromTo = new SIBUuid8[1];
    fromTo[0] = _targetMEUuid;

    JsMessage jsMsg = null;

    TickRange tickRange = null;
    MessageItem msgItem = null;
    long msgId = -1;
    List<TickRange> expiredMsgs = null;
    
    for (int i = 0; i < msgList.size(); i++)
    {
      tickRange = (TickRange)msgList.get(i);
     
      // Get the messageStore Id from the stream
      msgId = tickRange.itemStreamIndex;

      // Retrieve the message from the non-persistent ItemStream
      msgItem =
        _destinationHandler.
          getPubSubRealization().
            retrieveMessageFromItemStream(msgId);
                  
      // If the item wasn't found it has expired  
      if ( msgItem == null )
      {
        if ( expiredMsgs == null )
          expiredMsgs = new ArrayList<TickRange>();
        
        expiredMsgs.add(tickRange);   

        // In this case send Silence instead      
        ControlMessage cMsg = createSilenceMessage(tickRange.valuestamp,
                                                   completedPrefix,
                                                   priority,
                                                   reliability,
                                                   stream);

        ((ControlSilence)cMsg).setRequestedOnly(requestedOnly);
             
        // If the destination in a Link add Link specific properties to message
        if( _isLink )
        {
          cMsg = addLinkProps(cMsg);
          cMsg.setRoutingDestination( _routingDestination );  
        }
                  
        // Send the message to the MessageTransmitter
        // Send at priority+1 if this is a response to a Nack
        if( requestedOnly )
          _mpio.sendDownTree(fromTo, priority+1, cMsg);
        else
          _mpio.sendDownTree(fromTo, priority, cMsg);
  
      }
      else
      {
        try
        {
          // PM34074
          // Retrieve a copy of the message from MessageItem
          jsMsg = msgItem.getMessage().getReceived();
        }
        catch(MessageCopyFailedException e)
        {
          FFDCFilter.processException(
            e,
            "com.ibm.ws.sib.processor.impl.PubSubOutputHandler.sendValueMessages",
            "1:960:1.164.1.5",
            this);
            
          if (tc.isEntryEnabled())
            SibTr.exit(tc, "sendValueMessages", "SIErrorException: "+e);  
          throw new SIErrorException(e);
        }
      
        // Modify the streamId if necessary     
        if( jsMsg.getGuaranteedStreamUUID() !=  stream)
        {
          jsMsg.setGuaranteedStreamUUID(stream);
        }

        // Are there Completed ticks after this Value
        // If so we need to adjust the message to reflect this
        if (tickRange.endstamp > tickRange.valuestamp)
        {
          jsMsg.setGuaranteedValueEndTick(tickRange.endstamp);
        }
      
        // Update the completedPrefix to current value
        jsMsg.setGuaranteedValueCompletedPrefix(completedPrefix);

        // Set the requestedOnly flag
        jsMsg.setGuaranteedValueRequestedOnly(requestedOnly);
      
        // If the destination in a Link add Link specific properties to message
        if( _isLink )
        {
          jsMsg = addLinkProps(jsMsg);
          jsMsg.setRoutingDestination( _routingDestination );  
        }
      
        if (TraceComponent.isAnyTracingEnabled() && UserTrace.tc_mt.isDebugEnabled())
        {
          DestinationHandler dest = 
            _messageProcessor.getDestinationManager().getDestinationInternal(_destinationHandler.getUuid(), false);
          
          if (dest != null)
            UserTrace.traceOutboundSend(jsMsg, 
                                        _neighbour.getUUID(), 
                                        dest.getName(),
                                        dest.isForeignBus() || dest.isLink(),
                                        dest.isMQLink(),
                                        dest.isTemporary());
          else
            UserTrace.traceOutboundSend(jsMsg, 
                                        _neighbour.getUUID(), 
                                        _destinationHandler.getUuid().toString().toString(),
                                        false,
                                        false,
                                        false);

        }
        
        // Send the message to the MessageTransmitter
        // Send at priority+1 if this is a response to a Nack
        if( requestedOnly )
          _mpio.sendDownTree(fromTo, priority+1, jsMsg);
        else
          _mpio.sendDownTree(fromTo, priority, jsMsg);
                        
      }
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "sendValueMessages", expiredMsgs);
      
    return expiredMsgs;  
  }
708405
public void setPriority(int value) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setPriority", Integer.valueOf(value));
        /* Set the cached value */
        cachedPriority = Integer.valueOf(value);
        // Set the value into the message itself
        getHdr2().setIntField(JsHdr2Access.PRIORITY, value);
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setPriority");
    }
1066887
public void setValue(int value) { 
		if(value < min  || value > max) {
			throw new IllegalArgumentException("The value " + value + " is out of the admitted range [" + min + ", " + max + "].");
		}
		if(value != min && value != max) {
			if(timer == null) {
				logger.trace("creating timer");
				timer = new Timer(50, this);
			}
			if(!timer.isRunning()) {
				logger.trace("starting timer");
				timer.start();
			}
		} else {
			logger.trace("value is '{}' (in range [{}, {}]", value, min, max);
			if(timer != null && timer.isRunning()) {
				logger.trace("stopping timer");
				timer.stop();
				// unless we force a repaint, the component may stop at 99%
				repaint();
			}
		}
		this.value = value;
	}
66027
public void setMaxValue(final double VALUE) {
        if (Status.RUNNING == timeline.getStatus()) { timeline.jumpTo(Duration.ONE); }
        if (null == maxValue) {
            if (VALUE < getMinValue()) { setMinValue(VALUE); }
            _maxValue = Helper.clamp(getMinValue(), Double.MAX_VALUE, VALUE);
            setRange(_maxValue - getMinValue());
            if (Double.compare(originalMaxValue, Double.MAX_VALUE) == 0) originalMaxValue = _maxValue;
            if (Double.compare(originalThreshold, getThreshold()) > 0) { setThreshold(Helper.clamp(getMinValue(), _maxValue, originalThreshold)); }

            if (!valueProperty().isBound()) Gauge.this.setValue(Helper.clamp(getMinValue(), getMaxValue(), Gauge.this.getValue()));
            updateFormatString();
            fireUpdateEvent(RECALC_EVENT);
        } else {
            maxValue.set(VALUE);
        }
    }
989065
@Override
    public List sendValueMessages(
                                  List msgList,
                                  long completedPrefix,
                                  boolean requestedOnly,
                                  int priority,
                                  Reliability reliability,
                                  SIBUuid12 stream)
    {
        // NOP, PubSubOutputHandlers are responsible for pushing value
        // messages downstream.
        return null;
    }
814383
final JsMessage setPropertiesInMessage(LMEMessage theMessage)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "setPropertiesInMessage", theMessage);

    boolean copyMade = false;

    //  If this is pubsub we share this message with other subscribers so we have
    //  to make a copy prior to any updates. If this is pt-to-pt then any changes
    //  we make here can be done before the copy, the copy is still required to
    //  prevent a consumer from rolling back after modifying the message but
    //  anything we set here will be reset the next time round so there's no harm
    //  done. It is best to defer the 'copy' until after we've changed it so there
    //  is less likelyhood of a real copy being required.
    JsMessageWrapper jsMessageWrapper = (JsMessageWrapper) theMessage.message;
    JsMessage jsMsg = jsMessageWrapper.getMessage();

    try
    {
      //set the redeliveredCount if required
      if (jsMessageWrapper.guessRedeliveredCount() != 0)
      {
        if(isPubsub)
        {
          jsMsg = jsMsg.getReceived();
          copyMade = true;
        }

        jsMsg.setRedeliveredCount(jsMessageWrapper.guessRedeliveredCount());
      }

      long waitTime = jsMessageWrapper.updateStatisticsMessageWaitTime();

      //Only store wait time in message where explicitly
      // asked
      if (setWaitTime )
      {
        //defect 256701: we only set the message wait time if it is
        //a significant value.
        boolean waitTimeIsSignificant =
          waitTime > messageProcessor.getCustomProperties().get_message_wait_time_granularity();

        if(waitTimeIsSignificant)
        {
          if(isPubsub && !copyMade)
          {
            jsMsg = jsMsg.getReceived();
            copyMade = true;
          }

          jsMsg.setMessageWaitTime(waitTime);
        }
      }

      // If we deferred the copy till now we need to see if one is
      // needed. This will be the case either if the consumer has indicated that
      // it may change the message (not a comms client) and the message is still
      // on an itemStream (i.e. they could rollback the message with their changes).
      // Otherwise we can just give them our copy as we'll never want it back or
      // give it to anyone else.
      if(!copyMade && ((theMessage.isStored && copyMsg) || isPubsub))
        jsMsg = jsMsg.getReceived();
    }
    catch (MessageCopyFailedException e)
    {
      FFDCFilter.processException(
        e,
        "com.ibm.ws.sib.processor.impl.AbstractLockedMessageEnumeration.setPropertiesInMessage",
        "1:2086:1.154.3.1",
        this);

      SibTr.exception(tc, e);
      SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
        new Object[] {
          "com.ibm.ws.sib.processor.impl.AbstractLockedMessageEnumeration",
          "1:2093:1.154.3.1",
          e });

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.exit(tc, "setPropertiesInMessage", e);

      throw new SIErrorException(
        nls.getFormattedMessage(
          "INTERNAL_MESSAGING_ERROR_CWSIP0002",
          new Object[] {
            "com.ibm.ws.sib.processor.impl.AbstractLockedMessageEnumeration",
            "1:2104:1.154.3.1",
            e },
          null),
        e);
    }


    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "setPropertiesInMessage", jsMsg);
    return jsMsg;
  }
216006
public final void setGuaranteedTargetMessagingEngineUUID(SIBUuid8 value) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setGuaranteedTargetMessagingEngineUUID", value);
        if (value != null)
            getHdr2().setField(JsHdr2Access.GUARANTEED_SET_TARGETMEUUID, value.toByteArray());
        else
            getHdr2().setField(JsHdr2Access.GUARANTEED_SET_TARGETMEUUID, null);
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setGuaranteedTargetMessagingEngineUUID");
    }
679458
public boolean writeValue(SIMPMessage m) throws SIResourceException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(this, tc, "writeValue", m);

    TickRange tr = null;
    boolean sendMessage = true;
    
    long msgStoreId = AbstractItem.NO_ID;
    try
    {
      if (m.isInStore())
        msgStoreId = m.getID();
    }
    catch(MessageStoreException e)
    {
      // FFDC
      FFDCFilter.processException(
          e,
          "com.ibm.ws.sib.processor.gd.SourceStream.writeValue",
          "1:520:1.138",
          this);  
                  
      SibTr.exception(tc, e); 
      
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.exit(tc, "writeValue", e);
      
      throw new SIResourceException(e);
    }
      
    JsMessage jsMsg = m.getMessage();

    long stamp = jsMsg.getGuaranteedValueValueTick();
    long starts = jsMsg.getGuaranteedValueStartTick();
    long ends = jsMsg.getGuaranteedValueEndTick();

    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
    {
      SibTr.debug(tc, "writeValue at: " + stamp + " with Value from: " + starts + " to " + ends + " on Stream " +  stream);
    }

    synchronized (this)
    {
      // Now update Value tick to indicate it is now committed
      tr = TickRange.newValueTick(stamp, null, msgStoreId);
      tr.startstamp = starts;
      tr.endstamp = ends;

      oststream.writeCombinedRange(tr);
      sendMessage = msgCanBeSent(stamp, false);

      if (sendMessage)
      {
        // Only move the lastMsgSent forward, not backwards. Other threads with greater
        // ticks could already have passed through here and moved the lastMsgSent on past
        // this tick
        if(stamp > lastMsgSent)
          lastMsgSent = stamp;
        
        if (!ackExpAlarmStarted)
        {
          ackExpAlarmStarted = true;
          timerStartSendTick = lastMsgSent;
          ackExpInterval = GDConfig.GD_ACK_EXPECTED_THRESHOLD;
          
          am.create(ackExpInterval, ackExpExpiryHandler);
        }
        
        // SIB0105
        // Message committed so reset the health state if we've solved a blocking problem
        if (blockedStreamAlarm != null)
          blockedStreamAlarm.checkState(false);        
      }

    } // end synchronized

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "writeValue", Boolean.valueOf(sendMessage));

    return sendMessage;
  }
493107
public MessageLite setValue(MessageLite value) {
    MessageLite originalValue = this.value;
    this.value = value;
    bytes = null;
    isDirty = true;
    return originalValue;
  }
1032006
@Override
    public void setReadAhead(String value) throws JMSException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setReadAhead", value);

        // Check for null then ensure that the value is one of the permitted constants.
        if ((value != null)
            && ((ApiJmsConstants.READ_AHEAD_DEFAULT.equals(value))
                || (ApiJmsConstants.READ_AHEAD_ON.equals(value))
                || (ApiJmsConstants.READ_AHEAD_OFF.equals(value))
            )) {
            jcaManagedConnectionFactory.setReadAhead(value);
        }
        else {
            throw (JMSException) JmsErrorUtils.newThrowable(
                                                            JMSException.class,
                                                            "INVALID_VALUE_CWSIA0261",
                                                            new Object[] { "readAhead", value },
                                                            tc
                            );
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setReadAhead");
    }
1054411
public AIRequestedTick updateRequestToValue(
    long tick,
    AIMessageItem msgItem,
    boolean valueDelivered,
    SendDispatcher sendDispatcher)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(
        tc,
        "updateRequestToValue",
        new Object[] { Long.valueOf(tick), msgItem, Boolean.valueOf(valueDelivered)});

    AIRequestedTick rt = null;
    _targetStream.setCursor(tick);
    TickRange tickRange = _targetStream.getNext();
    if (tickRange.type == TickRange.Requested)
    {
      rt = (AIRequestedTick) tickRange.value;
      RemoteDispatchableKey ck = rt.getRemoteDispatchableKey();

      // The tick keeps the in-memory Java reference of the message object if valueDelivered=false,
      //      the constructor takes the reference to extract reliability and priority
      // Re-enter the ck as part of the V/U's state, just in case ordered
      //      delivery applies to consumer cardinality other than one
      AIValueTick valueTick =
        new AIValueTick(
          tick,
          msgItem,
          valueDelivered,
          ck,
          rt.getOriginalTimeout(),
          rt.getIssueTime(),
          msgItem.getMessage().getRedeliveredCount().intValue());
      TickRange valueRange = new TickRange(TickRange.Value, tick, tick);
      valueRange.value = valueTick;
      valueRange.valuestamp = tick;

      _targetStream.writeRange(valueRange);

      if (rt.getTimeout() > 0L || rt.getTimeout() == _mp.getCustomProperties().get_infinite_timeout())
      {
        if (rt.isSlowed())
        {
          _slowedGetTOM.removeTimeoutEntry(rt);
        }
        else
        {
          _eagerGetTOM.removeTimeoutEntry(rt);
        }
      }
    }
    else if (tickRange.type == TickRange.Accepted)
    {
      sendDispatcher.sendAccept(tick);
    }
    else if (tickRange.type == TickRange.Rejected)
    {
      AIRejectedRange rr = (AIRejectedRange)tickRange.value;
      sendDispatcher.sendReject(tick, tick, rr.unlockCount, rr.recovery);
    }
    else if (tickRange.type == TickRange.Completed)
    {
      sendDispatcher.sendCompleted(tick, tick);
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "updateRequestToValue", rt);

    return rt;
  }
1139986
public void setWarningMessage(int valueIndex, String message, CmsTabbedPanel<?> tabbedPanel) {

        if (!m_attributeValueViews.isEmpty()) {
            FlowPanel parent = (FlowPanel)m_attributeValueViews.get(0).getParent();
            CmsAttributeValueView valueView = (CmsAttributeValueView)parent.getWidget(valueIndex);
            valueView.setWarningMessage(message);
            if (tabbedPanel != null) {
                int tabIndex = tabbedPanel.getTabIndex(valueView.getElement());
                if (tabIndex > -1) {
                    Widget tab = tabbedPanel.getTabWidget(tabIndex);
                    tab.setTitle("This tab has warnings.");
                    tab.getParent().addStyleName(I_CmsLayoutBundle.INSTANCE.form().hasWarning());
                }

            }
        }
    }
891184
public final void setRemainingTimeToLive(long value) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setRemainingTimeToLive", Long.valueOf(value));
        if (value < 0) {
            getHdr2().setLongField(JsHdr2Access.TIMETOLIVE, 0);
        }
        else if (value == 0) {
            getHdr2().setLongField(JsHdr2Access.TIMETOLIVE, 1);
        }
        else {
            long ttl = getMessageWaitTime().longValue() + value;
            /* Call setTimeToLive so that bounds checking takes place for an API message. */
            setTimeToLive(ttl);
        }
        wasTimeToLiveChanged = true;
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setRemainingTimeToLive");
    }
1078908
private void validateDeliveryMode(int deliveryMode) throws JMSException {
        switch (deliveryMode) {
            case DeliveryMode.NON_PERSISTENT:
            case DeliveryMode.PERSISTENT:
                // OK - no problems.
                break;
            default:
                throw (JMSException) JmsErrorUtils.newThrowable(
                                                                JMSException.class,
                                                                "INVALID_VALUE_CWSIA0068",
                                                                new Object[] { "JMSDeliveryMode", "" + deliveryMode },
                                                                tc
                                );
        }
    }