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

org.duracloud.mill.audit.AuditLogStoreUtil Maven / Gradle / Ivy

/*
 * 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.mill.audit;

import java.io.IOException;
import java.util.Map;

import org.duracloud.common.error.DuraCloudRuntimeException;
import org.duracloud.common.json.JaxbJsonSerializer;

/**
 * @author Daniel Bernstein
 *	       Date: May 14, 2014
 */
public class AuditLogStoreUtil {
    
    private static JaxbJsonSerializer> MAP_SERIALIZER = new JaxbJsonSerializer(
                                                                                  Map.class);

    /**
     * @param props
     * @return
     */
    public static String serialize(Map props) {
        try {
            return MAP_SERIALIZER.serialize(props);
        } catch (IOException e) {
            throw new DuraCloudRuntimeException(e);
        }
    }
    
    public static Map deserialize(String string) {
        try {
            return MAP_SERIALIZER.deserialize(string);
        } catch (IOException e) {
            throw new DuraCloudRuntimeException(e);
        }
    }
    

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy