Package net.java.trueupdate.artifact.spec

Examples of net.java.trueupdate.artifact.spec.ArtifactDescriptor


                downloadUpdateVersionsFromServer();
            }

            void downloadUpdateVersionsFromServer() throws Exception {
                for (final UpdateMessage um : sessions) {
                    final ArtifactDescriptor ad = um.artifactDescriptor();
                    final UpdateDescriptor ud = uds.get(ad);
                    if (null == ud)
                        uds.put(ad, updateDescriptor(ad,
                                updateClient().version(ad)));
                }
            }

            @Override public Void call() throws Exception {
                tellUpdateResolver();
                notifySubscribers();
                return null;
            }

            void tellUpdateResolver() throws Exception {
                synchronized (updateResolver) {
                    updateResolver.restart();
                    for (UpdateMessage um : sessions)
                        for (UpdateDescriptor ud : availableUpdate(um))
                            updateResolver.allocate(ud);
                }
            }

            void notifySubscribers() throws Exception {
                for (UpdateMessage um : sessions)
                    for (UpdateDescriptor ud : availableUpdate(um))
                        if (!blacklisted.contains(ud))
                            sendAndLog(updateNotice(um, ud.updateVersion()));
            }

            @SuppressWarnings("unchecked")
            List<UpdateDescriptor> availableUpdate(UpdateMessage um) {
                final ArtifactDescriptor ad = um.artifactDescriptor();
                final UpdateDescriptor ud = uds.get(ad);
                return ud.updateVersion().equals(ad.version())
                        ? Collections.EMPTY_LIST
                        : Collections.singletonList(ud);
            }

            UpdateMessage updateNotice(UpdateMessage um, String uv) {
View Full Code Here


        logSent(message);
    }

    private static UpdateMessage installationSuccessResponse(
            final UpdateMessage request) {
        final ArtifactDescriptor ad = request
                .artifactDescriptor()
                .update()
                .version(request.updateVersion())
                .build();
        return responseFor(request)
View Full Code Here

                downloadUpdateVersionsFromServer();
            }

            void downloadUpdateVersionsFromServer() throws Exception {
                for (final UpdateMessage um : sessions) {
                    final ArtifactDescriptor ad = um.artifactDescriptor();
                    final UpdateDescriptor ud = uds.get(ad);
                    if (null == ud)
                        uds.put(ad, updateDescriptor(ad,
                                updateClient().version(ad)));
                }
View Full Code Here

                            sendAndLog(updateNotice(um, ud.updateVersion()));
            }

            @SuppressWarnings("unchecked")
            List<UpdateDescriptor> availableUpdate(UpdateMessage um) {
                final ArtifactDescriptor ad = um.artifactDescriptor();
                final UpdateDescriptor ud = uds.get(ad);
                return ud.updateVersion().equals(ad.version())
                        ? Collections.EMPTY_LIST
                        : Collections.singletonList(ud);
            }
View Full Code Here

    @Override
    public @Nullable UpdateMessage unmarshal(
            final @CheckForNull UpdateMessageDto dto)
    throws Exception {
        if (null == dto) return null;
        final ArtifactDescriptor ad = new ArtifactDescriptorAdapter()
                .unmarshal(dto.artifactDescriptor);
        final List<LogRecord> lrs = new LogRecordsAdapter()
                .unmarshal(dto.logRecords);
        final UpdateMessage um = UpdateMessage
                .builder()
View Full Code Here

            @Override protected void doStart() throws Exception {
                deltaZip = File.createTempFile("delta", ".zip");
            }

            @Override protected void doPerform() throws Exception {
                final ArtifactDescriptor ad = descriptor.artifactDescriptor();
                final String uv = descriptor.updateVersion();
                Copy.copy(updateClient().diff(ad, uv), new FileStore(deltaZip));
            }

            @Override protected void doRevert() throws Exception {
View Full Code Here

            @Override protected void doStart() throws Exception {
                deltaZip = File.createTempFile("delta", ".zip");
            }

            @Override protected void doPerform() throws Exception {
                final ArtifactDescriptor ad = descriptor.artifactDescriptor();
                final String uv = descriptor.updateVersion();
                Copy.copy(updateClient().diff(ad, uv), new FileStore(deltaZip));
            }
View Full Code Here

TOP

Related Classes of net.java.trueupdate.artifact.spec.ArtifactDescriptor

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.