当前位置: 首页>>代码示例>>Java>>正文


Java DataSetDef.setUUID方法代码示例

本文整理汇总了Java中org.dashbuilder.dataset.def.DataSetDef.setUUID方法的典型用法代码示例。如果您正苦于以下问题:Java DataSetDef.setUUID方法的具体用法?Java DataSetDef.setUUID怎么用?Java DataSetDef.setUUID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.dashbuilder.dataset.def.DataSetDef的用法示例。


在下文中一共展示了DataSetDef.setUUID方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: registerDataSetDef

import org.dashbuilder.dataset.def.DataSetDef; //导入方法依赖的package包/类
@Override
public void registerDataSetDef(DataSetDef def,
                               String subjectId,
                               String message) {

    if (def.getUUID() == null) {
        final String uuid = uuidGenerator.newUuid();
        def.setUUID(uuid);
    }

    if (subjectId == null || message == null) {
        ioService.startBatch(fileSystem);
    } else {
        ioService.startBatch(fileSystem,
                             new CommentedOption(subjectId,
                                                 message));
    }

    try {
        String defJson = getDataSetDefJsonMarshaller().toJsonString(def);
        Path defPath = resolveNioPath(def);
        ioService.write(defPath,
                        defJson);

        // CSV specific
        if (def instanceof CSVDataSetDef) {
            saveCSVFile((CSVDataSetDef) def);
        }
        super.registerDataSetDef(def,
                                 subjectId,
                                 message);
    } catch (Exception e) {
        throw exceptionManager.handleException(
                new Exception("Can't register the data set definition\n" + def,
                              e));
    } finally {
        ioService.endBatch();
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:40,代码来源:DataSetDefRegistryCDI.java

示例2: registerDataSetDef

import org.dashbuilder.dataset.def.DataSetDef; //导入方法依赖的package包/类
@Override
public String registerDataSetDef(DataSetDef definition, String comment) {
    // Data sets registered from the UI does not contain a UUID.
    if (definition.getUUID() == null) {
        final String uuid = uuidGenerator.newUuid();
        definition.setUUID(uuid);
    }
    dataSetDefRegistry.registerDataSetDef(definition,
            identity != null ? identity.getIdentifier() : "---",
            comment);
    return definition.getUUID();
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:13,代码来源:DataSetDefServicesImpl.java

示例3: lookupDataSet

import org.dashbuilder.dataset.def.DataSetDef; //导入方法依赖的package包/类
public DataSet lookupDataSet(DataSetDef def, DataSetLookup lookup) throws Exception {
    try {
        // Although if using a not registered definition, it must have an uuid set for performing lookups.
        if (def.getUUID() == null) {
            final String uuid = uuidGenerator.newUuid();
            def.setUUID(uuid);
            lookup.setDataSetUUID(uuid);
        }
        return dataSetManager.resolveProvider(def)
                .lookupDataSet(def, lookup);
    } catch (Exception e) {
        throw exceptionManager.handleException(e);
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:15,代码来源:DataSetLookupServicesImpl.java

示例4: copyDataSetDef

import org.dashbuilder.dataset.def.DataSetDef; //导入方法依赖的package包/类
public DataSetDef copyDataSetDef(DataSetDef def,
                                 String newName,
                                 String subjectId,
                                 String message) {
    DataSetDef clone = def.clone();
    clone.setUUID(uuidGenerator.newUuid());
    clone.setName(newName);

    if (subjectId == null || message == null) {
        ioService.startBatch(fileSystem);
    } else {
        ioService.startBatch(fileSystem,
                             new CommentedOption(subjectId,
                                                 message));
    }
    try {
        // CSV specific
        if (def instanceof CSVDataSetDef) {
            CSVDataSetDef csvDef = (CSVDataSetDef) def;
            CSVDataSetDef csvCloneDef = (CSVDataSetDef) clone;
            Path csvPath = resolveCsvPath(csvDef);
            Path cloneCsvPath = resolveCsvPath(csvCloneDef);
            ioService.copy(csvPath,
                           cloneCsvPath);
            csvCloneDef.setFilePath(convert(cloneCsvPath).toURI());
        }
        String defJson = getDataSetDefJsonMarshaller().toJsonString(clone);
        Path clonePath = resolveNioPath(clone);
        ioService.write(clonePath,
                        defJson);

        super.registerDataSetDef(clone,
                                 subjectId,
                                 message);
        return clone;
    } catch (Exception e) {
        throw exceptionManager.handleException(
                new Exception("Can't register the data set definition\n" + def,
                              e));
    } finally {
        ioService.endBatch();
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:44,代码来源:DataSetDefRegistryCDI.java

示例5: createDataSetDef

import org.dashbuilder.dataset.def.DataSetDef; //导入方法依赖的package包/类
@Override
public DataSetDef createDataSetDef(DataSetProviderType type) {
    DataSetDef result = type != null ? type.createDataSetDef() : new DataSetDef();
    result.setUUID(uuidGenerator.newUuid());
    return result;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:7,代码来源:DataSetDefServicesImpl.java


注:本文中的org.dashbuilder.dataset.def.DataSetDef.setUUID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。