All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.duracloud.snapshot.dto.task.GetSnapshotTaskResult Maven / Gradle / Ivy

There is a newer version: 8.1.0
Show newest version
/*
 * The contents of this file are subject to the license and copyright
 * detailed in the LICENSE and NOTICE files at the root of the source
 * tree and available online at
 *
 *     http://duracloud.org/license/
 */
package org.duracloud.snapshot.dto.task;

import org.duracloud.common.json.JaxbJsonSerializer;
import org.duracloud.snapshot.dto.bridge.GetSnapshotBridgeResult;
import org.duracloud.snapshot.error.SnapshotDataException;

import java.io.IOException;

/**
 * @author Bill Branan
 *         Date: 7/29/14
 */
public class GetSnapshotTaskResult extends GetSnapshotBridgeResult {

    /**
     * Parses properties from task result
     *
     * @param taskResult - JSON formatted set of properties
     */
    public static GetSnapshotTaskResult deserialize(String taskResult) {
        JaxbJsonSerializer serializer =
            new JaxbJsonSerializer<>(GetSnapshotTaskResult.class);
        try {
            return serializer.deserialize(taskResult);
        } catch(IOException e) {
            throw new SnapshotDataException(
                "Unable to create task result due to: " + e.getMessage());
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy