实例同步开关 curl http://127.0.0.1:8081/syncSwitch/example/off -X PUT

@param destination 实例名称
@param status 开关状态: off on
@return
495988
@PutMapping("/syncSwitch/{destination}/{status}")
    public Result etl(@PathVariable String destination, @PathVariable String status) {
        if (status.equals("on")) {
            syncSwitch.on(destination);
            logger.info("#Destination: {} sync on", destination);
            return Result.createSuccess("实例: " + destination + " 开启同步成功");
        } else if (status.equals("off")) {
            syncSwitch.off(destination);
            logger.info("#Destination: {} sync off", destination);
            return Result.createSuccess("实例: " + destination + " 关闭同步成功");
        } else {
            Result result = new Result();
            result.setCode(50000);
            result.setMessage("实例: " + destination + " 操作失败");
            return result;
        }
    }
480638
public void putRolloutStatus(final Long rolloutId, final List<TotalTargetCountActionStatus> status) {
        final Cache cache = cacheManager.getCache(CACHE_RO_NAME);
        putIntoCache(rolloutId, status, cache);
    }
290147
private JmsDestinationImpl validateDestination(Destination destination) throws JMSException {

        // if this is an identified producer, throw an
        // UnsupportedOperationException as this is an unidentified producer
        // method.

        if (this.dest != null) {
            if (destination == null) {
                throw (InvalidDestinationException) JmsErrorUtils.newThrowable(InvalidDestinationException.class
                                                                               , "INVALID_VALUE_CWSIA0281"
                                                                               , new Object[] { "Destination", null }
                                                                               , tc);
            }

            throw (UnsupportedOperationException) JmsErrorUtils.newThrowable(
                                                                             UnsupportedOperationException.class,
                                                                             "DEST_SPECIFIED_ON_SEND_CWSIA0066",
                                                                             null,
                                                                             tc);
        }

        // if the supplied destination is set to null, or it isn't a jetstream
        // destination, throw a jms InvalidDestinationException.
        // Note that in some situations this method call can return a _different_
        // destination than the one passed in as the parameter (e.g. Spring).
        JmsDestinationImpl nativeDest = JmsDestinationImpl.checkNativeInstance(destination);

        // for an identified producer, this check will have been done at constructor time.
        if (this.dest == null) {
            // Check that this destination is not blocked from creating consumers
            JmsDestinationImpl.checkBlockedStatus(nativeDest);
        }

        return nativeDest;

    }
458647
private void writeStatus(Result.Status status) throws XMLStreamException {
        xmlStreamWriter.writeStartElement("status");
        xmlStreamWriter.writeCharacters(status.name().toLowerCase());
        xmlStreamWriter.writeEndElement();
    }
402600
public void sendStatusOnly(final HttpResponseStatus status) {
    if (!chan.isConnected()) {
      if(stats != null) {
        stats.markSendFailed();
      }
      done();
      return;
    }

    response.setStatus(status);
    final boolean keepalive = HttpHeaders.isKeepAlive(request);
    if (keepalive) {
      HttpHeaders.setContentLength(response, 0);
    }
    final ChannelFuture future = chan.write(response);
    if (stats != null) {
      future.addListener(new SendSuccess());
    }
    if (!keepalive) {
      future.addListener(ChannelFutureListener.CLOSE);
    }
    done();
  }
51531
public static void serializeTo( Destination destination , RawDataBuffer out )
    {
    	try
    	{
    		if (destination == null)
    		{
    			out.writeByte(NO_DESTINATION);
    		}
    		else
	        if (destination instanceof Queue)
	        {
	            out.writeByte(TYPE_QUEUE);
	            out.writeUTF(((Queue)destination).getQueueName());
	        }
	        else
            if (destination instanceof Topic)
            {
            	out.writeByte(TYPE_TOPIC);
                out.writeUTF(((Topic)destination).getTopicName());
            }
            else
                throw new IllegalArgumentException("Unsupported destination : "+destination);
    	}
    	catch (JMSException e)
    	{
    		throw new IllegalArgumentException("Cannot serialize destination : "+e.getMessage());
    	}
    }
574783
public synchronized void statusMachine(final String status, final DeviceState state) throws DevFailed {
        if (status != null) {
            logger.debug("Changing status to: {}", status);
            this.status = status;
            if (setStatusMethod != null) {
                try {
                    setStatusMethod.invoke(businessObject, status);
                } catch (final IllegalArgumentException e) {
                    throw DevFailedUtils.newDevFailed(e);
                } catch (final IllegalAccessException e) {
                    throw DevFailedUtils.newDevFailed(e);
                } catch (final InvocationTargetException e) {
                    if (e.getCause() instanceof DevFailed) {
                        throw (DevFailed) e.getCause();
                    } else {
                        throw DevFailedUtils.newDevFailed(e.getCause());
                    }
                }
            }
        }
    }
612359
public void setDestination(String destination)
  {
    if (tc.isEntryEnabled())
      SibTr.entry(tc, "setDestination", destination);

    this.destination = destination;

    if (tc.isEntryEnabled())
      SibTr.exit(tc, "setDestination");
  }
310367
public static DestinationUrl createDestinationUrl(String destination) {
        String[] split = splitDestination(destination);
        String host = split[0].trim();
        String jmsDestination = split[1].trim();
        return new DestinationUrl(host, jmsDestination);
    }
1226359
@Override
	protected void serializeTo(RawDataBuffer out)
    {
        super.serializeTo(out);
        out.writeInt(consumerId.asInt());
        DestinationSerializer.serializeTo(destination, out);
        out.writeNullableUTF(messageSelector);
        out.writeBoolean(noLocal);
    }
1153363
public static void copy(InputStream source, OutputStream destination) throws IOException
    {
        Check.notNull(source);
        Check.notNull(destination);

        final byte[] buffer = new byte[BUFFER_COPY];
        while (true)
        {
            final int read = source.read(buffer);
            if (read == -1)
            {
                break;
            }
            destination.write(buffer, 0, read);
        }
    }
574154
public void setStatus(int status) {
        // 311717
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {  //306998.15
            logger.entering(CLASS_NAME,"setStatus", " status --> " + String.valueOf(status)+ " ["+this+"]");
        }
        WebAppDispatcherContext dispatchContext = (WebAppDispatcherContext) getRequest().getWebAppDispatcherContext();
        if (dispatchContext.isInclude() == true) {
            if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {  //306998.15
                logger.logp(Level.FINE, CLASS_NAME,"setStatus", nls.getString("Illegal.from.included.servlet", "Illegal from included servlet"), "setStatus status --> " + String.valueOf(status));  //311717
            }
        }
        else {
            if (!_ignoreStateErrors && isCommitted()) {
                logger.logp(Level.WARNING, CLASS_NAME,"setStatus", "Cannot.set.status.Response.already.committed");
            }
            else {
                if (WCCustomProperties.RESET_BUFFER_ON_SET_STATUS)
                    resetBuffer();
                _response.setStatusCode(status);
                _statusCode = status;
            }
        }
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {  //306998.15
            logger.exiting(CLASS_NAME,"setStatus");
        }
    }
171508
public function setOutputDestination(string $destination): PdfInterface
    {
        /**
         * Destinations can be sent to the following:
         *    - I/B [Inline]   - Sends output to browser (browser plug-in is used if avaialble)
         *                       If a $filename is given, the browser's "Save as..." option is provided
         *    - D   [Download] - Forces browser to download the file
         *    - F   [File]     - Saves the file to the server's filesystem cache
         *    - S   [String]   - Returns the PDF as a string
         */
        $this->setProperty(
            'outputDestination',
            strtoupper($destination[0]) === 'B' ? 'I' : strtoupper($destination[0])
        );

        return $this;
    }
920189
private synchronized ReceiveAllowedThread getReceiveAllowedThread(DestinationHandler destinationHandler)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "getReceiveAllowedThread", destinationHandler);

        if (_receiveAllowedThread == null)
        {
            _receiveAllowedThread = new ReceiveAllowedThread(destinationHandler);
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(tc, "getReceiveAllowedThread", _receiveAllowedThread);

            return _receiveAllowedThread;
        }

        _receiveAllowedThread.markForUpdate();
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "getReceiveAllowedThread", null);
        return null;
    }
728494
public InfoOperation getInfoOperation(final Field destination, final Field source) {
		
		Class<?> dClass = destination.getType();
		Class<?> sClass = source.getType();
		Class<?> dItem = null;
		Class<?> sItem = null;
		
		InfoOperation operation = new InfoOperation().setConversionType(UNDEFINED);
		
		// Array[] = Collection<>
		if(dClass.isArray() && collectionIsAssignableFrom(sClass)){
			dItem = dClass.getComponentType();
			sItem = getCollectionItemClass(source);
			operation.setInstructionType(ARRAY_LIST);

            if(areMappedObjects(dItem,sItem,xml))
				return operation.setInstructionType(ARRAY_LIST_WITH_MAPPED_ITEMS)
						        .setConfigChosen(configChosen(dItem,sItem,xml));
		}
		
		// Collection<> = Array[]
		if(collectionIsAssignableFrom(dClass) && sClass.isArray()){
			dItem = getCollectionItemClass(destination);
			sItem = sClass.getComponentType();
			operation.setInstructionType(LIST_ARRAY);
			
            if(areMappedObjects(dItem,sItem,xml))
				return operation.setInstructionType(LIST_ARRAY_WITH_MAPPED_ITEMS)
						        .setConfigChosen(configChosen(dItem,sItem,xml));
		}

		if(isAssignableFrom(dItem,sItem))
			return operation.setConversionType(ABSENT);

		// if components are primitive or wrapper types, apply implicit conversion
		if(areBasic(dItem,sItem))
			return operation.setConversionType(getConversionType(dItem, sItem));
				
		return operation;
	}
1082159
private void sendRedirectWithStatusCode(String location, int statusCode) throws IOException
    //PQ97429	
    {
        HttpServletResponse response = (HttpServletResponse) getResponse();
        if (!response.isCommitted())
        {
            // begin 133968: part 1
            if (location == null)
            {
                throw new IllegalArgumentException("Location cannot be null in javax.servlet.http.HttpServletResponse.sendRedirect(location)");
            }
            // end 133968: part 1

            // d128646 - we might not have a writer to flush at this point...make sure we do
            // PQ77141 overrides the above defect
//		try
//		{
//			response.getWriter();
//		}
//		catch (Throwable th)
//		{
//		}

            response.resetBuffer();

            location = convertRelativeURIToURL(location);

            // 115010 - begin - make header name begin with upper case
            response.setHeader("Location", location);
            // 115010 - end
            // PQ97429
            // response.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY);
            response.setStatus(statusCode);
            // PQ97429	    

            //response.flushBuffer();  PK79143

        }
        else
        {
            throw new IllegalStateException();
        }
    }
843742
function merge(source, destination) {
  source.forEach(function(current) {
    let matchFound = false;
    destination.forEach(function(target) {
      let isSameReceiver = identifiers.areMatch(current.receiverId,
                                                current.receiverIdType,
                                                target.receiverId,
                                                target.receiverIdType);
      if(isSameReceiver) {
        target.rssiSum = target.rssiSum ||
                         (target.rssi * target.numberOfDecodings);
        target.numberOfDecodings += current.numberOfDecodings || 1;
        target.rssiSum += current.rssiSum ||
                          (current.rssi * current.numberOfDecodings);
        target.rssi = Math.round(target.rssiSum / target.numberOfDecodings);
        matchFound = true;
      }
    });
    if(!matchFound) {
      destination.push(current);
    }
  });
  destination.sort(compareRssi);
}