Performs a Versioned put operation with the specified composite request
object

@param requestWrapper Composite request object containing the key and the
versioned object
@return Version of the value for the successful put
@throws ObsoleteVersionException
546324
public Version putVersionedWithCustomTimeout(CompositeVoldemortRequest<K, V> requestWrapper)
            throws ObsoleteVersionException {
        validateTimeout(requestWrapper.getRoutingTimeoutInMs());
        for(int attempts = 0; attempts < this.metadataRefreshAttempts; attempts++) {
            try {
                String keyHexString = "";
                long startTimeInMs = System.currentTimeMillis();
                if(logger.isDebugEnabled()) {
                    ByteArray key = (ByteArray) requestWrapper.getKey();
                    keyHexString = RestUtils.getKeyHexString(key);
                    debugLogStart("PUT_VERSION",
                                  requestWrapper.getRequestOriginTimeInMs(),
                                  startTimeInMs,
                                  keyHexString);
                }
                store.put(requestWrapper);
                if(logger.isDebugEnabled()) {
                    debugLogEnd("PUT_VERSION",
                                requestWrapper.getRequestOriginTimeInMs(),
                                startTimeInMs,
                                System.currentTimeMillis(),
                                keyHexString,
                                0);
                }
                return requestWrapper.getValue().getVersion();
            } catch(InvalidMetadataException e) {
                logger.info("Received invalid metadata exception during put [  " + e.getMessage()
                            + " ] on store '" + storeName + "'. Rebootstrapping");
                bootStrap();
            }
        }
        throw new VoldemortException(this.metadataRefreshAttempts
                                     + " metadata refresh attempts failed.");
    }
1020378
public TransactionWrapper getTransactionWrapper(Transaction t) {
    	if (t == null) {
    		return null;
    	}
    	final TransactionWrapperAppData twad = (TransactionWrapperAppData) t.getApplicationData();
    	return twad != null ? twad.getTransactionWrapper(t, this) : null;
	}
498362
public static<T extends Object> T getWrapper(Class<T> clientType){
        return getWrapper(clientType,generateClientId(clientType));
    }
967893
public Version getVersion(Jid jid) throws NoResponseException, XMPPErrorException,
                    NotConnectedException, InterruptedException {
        if (!isSupported(jid)) {
            return null;
        }
        return connection().createStanzaCollectorAndSend(new Version(jid)).nextResultOrThrow();
    }
485505
@Patch("/status")
    @Consumes("application/json-patch+json")
    @RequiresAdministrator
    public CompletableFuture<ServerStatus> updateStatus(ServiceRequestContext ctx,
                                                        JsonNode patch) throws Exception {
        // TODO(trustin): Consider extracting this into common utility or Armeria.
        final ServerStatus oldStatus = status();
        final JsonNode oldValue = Jackson.valueToTree(oldStatus);
        final JsonNode newValue;
        try {
            newValue = JsonPatch.fromJson(patch).apply(oldValue);
        } catch (JsonPatchException e) {
            // Failed to apply the given JSON patch.
            return rejectStatusPatch(patch);
        }

        if (!newValue.isObject()) {
            return rejectStatusPatch(patch);
        }

        final JsonNode writableNode = newValue.get("writable");
        final JsonNode replicatingNode = newValue.get("replicating");
        if (!writableNode.isBoolean() || !replicatingNode.isBoolean()) {
            return rejectStatusPatch(patch);
        }

        final boolean writable = writableNode.asBoolean();
        final boolean replicating = replicatingNode.asBoolean();
        if (writable && !replicating) {
            return HttpApiUtil.throwResponse(ctx, HttpStatus.BAD_REQUEST,
                                             "'replicating' must be 'true' if 'writable' is 'true'.");
        }

        if (oldStatus.writable) {
            if (!writable) { // writable -> unwritable
                executor().setWritable(false);
                if (replicating) {
                    logger.warn("Entered read-only mode with replication enabled");
                    return CompletableFuture.completedFuture(status());
                } else {
                    logger.warn("Entering read-only mode with replication disabled ..");
                    return executor().stop().handle((unused, cause) -> {
                        if (cause != null) {
                            logger.warn("Failed to stop the command executor:", cause);
                        } else {
                            logger.info("Entered read-only mode with replication disabled");
                        }
                        return status();
                    });
                }
            }
        } else if (writable) { // unwritable -> writable
            logger.warn("Leaving read-only mode ..");
            executor().setWritable(true);
            return executor().start().handle((unused, cause) -> {
                if (cause != null) {
                    logger.warn("Failed to leave read-only mode:", cause);
                } else {
                    logger.info("Left read-only mode");
                }
                return status();
            });
        }

        throw HttpStatusException.of(HttpStatus.NOT_MODIFIED);
    }
1045664
@Override
    public Version put(K key, V value) {
        return put(key, new Versioned<V>(value));
    }
1192720
public static <K, N> InternalTimersSnapshotReader<K, N> getReaderForVersion(
		int version, ClassLoader userCodeClassLoader) {

		switch (version) {
			case NO_VERSION:
				return new InternalTimersSnapshotReaderPreVersioned<>(userCodeClassLoader);

			case 1:
				return new InternalTimersSnapshotReaderV1<>(userCodeClassLoader);

			case InternalTimerServiceSerializationProxy.VERSION:
				return new InternalTimersSnapshotReaderV2<>(userCodeClassLoader);

			default:
				// guard for future
				throw new IllegalStateException(
					"Unrecognized internal timers snapshot writer version: " + version);
		}
	}
1133968
@Override
    public <Y> SingularAttribute<? super X, Y> getVersion(Class<Y> paramClass)
    {
        // TODO: Versioning not yet supported.
        throw new UnsupportedOperationException("Method not supported");
    }
896289
function getVersion(req) {
   var version;
   if (!req.version) {
      if (req.headers && req.headers['accept-version']) {
         version = req.headers['accept-version'];
      }
   } else {
      version = String(req.version);
   }
   return version;
}
837920
public static final ClientVersionAlreadyExistsException clientVersionAlreadyExistsException(String clientName, String version) {
        return new ClientVersionAlreadyExistsException(Messages.i18n.format("clientVersionAlreadyExists", clientName, version)); //$NON-NLS-1$
    }
650319
public static function parseWrapper(DataTablesWrapperInterface $wrapper, Request $request) {
        $wrapper->setRequest(static::parseRequest($wrapper, $request));
        $wrapper->setResponse(static::newResponse($wrapper));
    }
321013
public function updateVersion($contentId, $versionNumber, Request $request)
    {
        if (!$this->isUserContent($contentId)) {
            return parent::updateVersion($contentId, $versionNumber, $request);
        }

        $updatedUser = $this->repository->getUserService()->updateUser(
            $this->repository->getUserService()->loadUser($contentId),
            $this->mapRequestToUserUpdateStruct($request)
        );

        return $this->mapUserToVersion($updatedUser, $request);
    }
187357
@RequirePOST
    public HttpResponse doUpgrade(StaplerRequest req, StaplerResponse rsp) {
        final String thruVerParam = req.getParameter("thruVer");
        final VersionNumber thruVer = thruVerParam.equals("all") ? null : new VersionNumber(thruVerParam);

        saveAndRemoveEntries(new Predicate<Map.Entry<SaveableReference, VersionRange>>() {
            @Override
            public boolean apply(Map.Entry<SaveableReference, VersionRange> entry) {
                VersionNumber version = entry.getValue().max;
                return version != null && (thruVer == null || !version.isNewerThan(thruVer));
            }
        });

        return HttpResponses.forwardToPreviousPage();
    }
195435
@Override
    public final EJSWrapperCommon getWrapper(BeanId id) // f111627
    throws CSIException,
                    RemoteException
    {
        homeEnabled();
        return wrapperManager.getWrapper(id); // d156807.1
    }
405028
public function getCurrentRemoteVersion(Updater $updater)
    {
        /** Switch remote request errors to HttpRequestExceptions */
        set_error_handler(array($updater, 'throwHttpRequestException'));
        $version = get_contents($this->getVersionUrl());
        restore_error_handler();
        if (false === $version) {
            throw new HttpRequestException(sprintf(
                'Request to URL failed: %s', $this->getVersionUrl()
            ));
        }
        if (empty($version)) {
            throw new HttpRequestException(
                'Version request returned empty response.'
            );
        }
        if (!preg_match('%^[a-z0-9]{40}%', $version, $matches)) {
            throw new HttpRequestException(
                'Version request returned incorrectly formatted response.'
            );
        }

        return $matches[0];
    }
338910
public MockitoBundlesOption version( final String version )
    {
        ( (MavenArtifactUrlReference) ( (WrappedUrlProvisionOption) getDelegate() ).getUrlReference() ).version(
            version
        );
        return this;
    }
75928
static XARecoveryWrapper deserialize(byte[] serializedWrapper)
    {
        if (tc.isEntryEnabled()) Tr.entry(tc, "deserialize");

        XARecoveryWrapper wrapper = null;
            
        try
        {
            final ByteArrayInputStream bis = new ByteArrayInputStream(serializedWrapper);
            final ObjectInputStream oin = new ObjectInputStream(bis);
            wrapper = (XARecoveryWrapper) oin.readObject();
            oin.close();
        }
        catch (ClassNotFoundException e)
        {
            FFDCFilter.processException(e, "com.ibm.ws.Transaction.JTA.XARecoveryWrapper.deserialize", "298");
            if (tc.isDebugEnabled()) Tr.debug(tc, "Unable to deserialize an object from byte stream", e);
            String notfound = e.getMessage ();
            final int index = notfound.indexOf (":");
            notfound = notfound.substring (index + 1);
            Tr.error(tc, "WTRN0002_UNABLE_TO_FIND_RESOURCE_CLASS", notfound);
        }
        catch (Throwable t)
        {
            FFDCFilter.processException(t, "com.ibm.ws.Transaction.JTA.XARecoveryWrapper.deserialize", "306");
            if (tc.isDebugEnabled()) Tr.debug(tc, "Unable to deserialize an object from byte stream", t);
            Tr.error(tc, "WTRN0040_OBJECT_DESERIALIZE_FAILED", t);
        }

        if (tc.isEntryEnabled()) Tr.exit(tc, "deserialize", wrapper);
        return wrapper;
    }