Package org.apache.isis.core.metamodel.adapter.version

Examples of org.apache.isis.core.metamodel.adapter.version.Version


           
            try {
                if(concurrencyChecking.isChecking()) {
                   
                    // check for exception, but don't throw if suppressed through thread-local
                    final Version otherVersion = originalOid.getVersion();
                    final Version thisVersion = recreatedOid.getVersion();
                    if(thisVersion != null &&
                       otherVersion != null &&
                       thisVersion.different(otherVersion)) {
                       
                        if(isConcurrencyCheckingGloballyEnabled() && ConcurrencyChecking.isCurrentlyEnabled()) {
                            LOG.info("concurrency conflict detected on " + recreatedOid + " (" + otherVersion + ")");
                            final String currentUser = getAuthenticationSession().getUserName();
                            throw new ConcurrencyException(currentUser, recreatedOid, thisVersion, otherVersion);
                        } else {
                            LOG.warn("concurrency conflict detected but suppressed, on " + recreatedOid + " (" + otherVersion + ")");
                        }
                    }
                }
            } finally {
               
                final Version originalVersion = originalOid.getVersion();
                final Version recreatedVersion = recreatedOid.getVersion();
                if(recreatedVersion != null && (
                        originalVersion == null ||
                        recreatedVersion.different(originalVersion))
                    ) {
                   LOG.info("updating version in oid, on " + originalOid + " (" + originalVersion + ") to (" + recreatedVersion +")");
                   originalOid.setVersion(recreatedVersion);
                }
            }
View Full Code Here


        final String collectionName = collectionPart != null ? collectionPart.substring(1) : null;
       
        final String versionSequence = getGroup(matcher, 10);
        final String versionUser = getGroup(matcher, 11);
        final String versionUtcTimestamp = getGroup(matcher, 12);
        final Version version = Version.create(versionSequence, versionUser, versionUtcTimestamp);

        if(collectionName == null) {
            if(aggregateOidParts.isEmpty()) {
                ensureCorrectType(oidStr, requestedType, RootOidDefault.class);
                return (T)new RootOidDefault(ObjectSpecId.of(rootObjectType), rootIdentifier, state, version);
View Full Code Here

        final DomainObjectReprRenderer renderer = new DomainObjectReprRenderer(resourceContext, null, JsonRepresentation.newMap());
        renderer.with(objectAdapter).includesSelf();

        final ResponseBuilder respBuilder = ResourceAbstract.responseOfOk(renderer, Caching.NONE);

        final Version version = objectAdapter.getVersion();
        if (version != null && version.getTime() != null) {
            respBuilder.tag(ETAG_FORMAT.format(version.getTime()));
        }
        return respBuilder.build();
    }
View Full Code Here

        renderer.with(new ObjectAndActionInvocation(objectAdapter, action, arguments, returnedAdapter)).using(adapterLinkTo);

        final ResponseBuilder respBuilder = ResourceAbstract.responseOfOk(renderer, Caching.NONE);

        final Version version = objectAdapter.getVersion();
        ResourceAbstract.addLastModifiedAndETagIfAvailable(respBuilder, version);

        return respBuilder.build();
    }
View Full Code Here

               
                // need to do eagerly, because (if a viewModel then) a
                // viewModel's #viewModelMemento might need to use services
                getPersistenceSession().getServicesInjector().injectServicesInto(pojo);
               
                final Version datastoreVersion = getVersionIfAny(pc);
               
                final RootOid originalOid ;
                ObjectAdapter originalAdapter = getAdapterManager().getAdapterFor(pojo);
                if(originalAdapter != null) {
                    ensureRootObject(pojo);
                    originalOid = (RootOid) originalAdapter.getOid();

                    final Version originalVersion = originalAdapter.getVersion();

                    // sync the pojo held by the adapter with that just loaded
                    getPersistenceSession().remapRecreatedPojo(originalAdapter, pojo);
                   
                    // since there was already an adapter, do concurrency check
                    // (but don't set abort cause if checking is suppressed through thread-local)
                    final RootOid thisOid = originalOid;
                    final Version thisVersion = originalVersion;
                    final Version otherVersion = datastoreVersion;
                   
                    if(thisVersion != null &&
                       otherVersion != null &&
                       thisVersion.different(otherVersion)) {
View Full Code Here

                    // already called in preDirty and the post value is captured lazily
                }
               
                Utils.clearDirtyFor(adapter);
               
                Version versionIfAny = getVersionIfAny(pojo);
                adapter.setVersion(versionIfAny);
                CallbackUtils.callCallback(adapter, callbackFacetClass);

               
                ensureFrameworksInAgreement(pojo);
View Full Code Here

TOP

Related Classes of org.apache.isis.core.metamodel.adapter.version.Version

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.