Search in sources :

Example 1 with VersionDefinition

use of lucee.runtime.osgi.OSGiUtil.VersionDefinition in project Lucee by lucee.

the class DumpUtil method toArray2.

private static Array toArray2(List<PackageQuery> list) {
    Struct sct, _sct;
    Array arr = new ArrayImpl(), _arr;
    Iterator<PackageQuery> it = list.iterator();
    PackageQuery pd;
    Iterator<VersionDefinition> _it;
    VersionDefinition vd;
    while (it.hasNext()) {
        pd = it.next();
        sct = new StructImpl();
        sct.setEL(KeyConstants._package, pd.getName());
        sct.setEL("versions", _arr = new ArrayImpl());
        _it = pd.getVersionDefinitons().iterator();
        while (_it.hasNext()) {
            vd = _it.next();
            _sct = new StructImpl();
            _sct.setEL(KeyConstants._bundleVersion, vd.getVersion().toString());
            _sct.setEL("operator", vd.getOpAsString());
            _arr.appendEL(_sct);
        }
        arr.appendEL(sct);
    }
    return arr;
}
Also used : Array(lucee.runtime.type.Array) VersionDefinition(lucee.runtime.osgi.OSGiUtil.VersionDefinition) StructImpl(lucee.runtime.type.StructImpl) PackageQuery(lucee.runtime.osgi.OSGiUtil.PackageQuery) ArrayImpl(lucee.runtime.type.ArrayImpl) Struct(lucee.runtime.type.Struct)

Example 2 with VersionDefinition

use of lucee.runtime.osgi.OSGiUtil.VersionDefinition in project Lucee by lucee.

the class DumpUtil method requiredBundles.

private static void requiredBundles(DumpTable parent, Bundle b) {
    try {
        List<BundleDefinition> list = OSGiUtil.getRequiredBundles(b);
        if (list.isEmpty())
            return;
        DumpTable dt = new DumpTable("#6289a3", "#dee3e9", "#000000");
        dt.appendRow(-1, new SimpleDumpData("name"), new SimpleDumpData("version"), new SimpleDumpData("operator"));
        Iterator<BundleDefinition> it = list.iterator();
        BundleDefinition bd;
        VersionDefinition vd;
        String v, op;
        while (it.hasNext()) {
            bd = it.next();
            vd = bd.getVersionDefiniton();
            if (vd != null) {
                v = vd.getVersionAsString();
                op = vd.getOpAsString();
            } else {
                v = "";
                op = "";
            }
            dt.appendRow(0, new SimpleDumpData(bd.getName()), new SimpleDumpData(v), new SimpleDumpData(op));
        }
        parent.appendRow(1, new SimpleDumpData("required-bundles"), dt);
    } catch (Throwable t) {
        ExceptionUtil.rethrowIfNecessary(t);
    }
}
Also used : BundleDefinition(lucee.runtime.osgi.OSGiUtil.BundleDefinition) VersionDefinition(lucee.runtime.osgi.OSGiUtil.VersionDefinition)

Example 3 with VersionDefinition

use of lucee.runtime.osgi.OSGiUtil.VersionDefinition in project Lucee by lucee.

the class BundleInfo method toArray2.

private static Array toArray2(List<PackageQuery> list) {
    Struct sct, _sct;
    Array arr = new ArrayImpl(), _arr;
    Iterator<PackageQuery> it = list.iterator();
    PackageQuery pd;
    Iterator<VersionDefinition> _it;
    VersionDefinition vd;
    while (it.hasNext()) {
        pd = it.next();
        sct = new StructImpl();
        sct.setEL(KeyConstants._package, pd.getName());
        sct.setEL("versions", _arr = new ArrayImpl());
        _it = pd.getVersionDefinitons().iterator();
        while (_it.hasNext()) {
            vd = _it.next();
            _sct = new StructImpl();
            _sct.setEL(KeyConstants._bundleVersion, vd.getVersion().toString());
            _sct.setEL("operator", vd.getOpAsString());
            _arr.appendEL(_sct);
        }
        arr.appendEL(sct);
    }
    return arr;
}
Also used : Array(lucee.runtime.type.Array) VersionDefinition(lucee.runtime.osgi.OSGiUtil.VersionDefinition) StructImpl(lucee.runtime.type.StructImpl) PackageQuery(lucee.runtime.osgi.OSGiUtil.PackageQuery) ArrayImpl(lucee.runtime.type.ArrayImpl) Struct(lucee.runtime.type.Struct)

Example 4 with VersionDefinition

use of lucee.runtime.osgi.OSGiUtil.VersionDefinition in project Lucee by lucee.

the class BundleInfo method toArray1.

private static Array toArray1(List<BundleDefinition> list) {
    Struct sct;
    Array arr = new ArrayImpl();
    Iterator<BundleDefinition> it = list.iterator();
    BundleDefinition bd;
    VersionDefinition vd;
    while (it.hasNext()) {
        bd = it.next();
        sct = new StructImpl();
        sct.setEL(KeyConstants._bundleName, bd.getName());
        vd = bd.getVersionDefiniton();
        if (vd != null) {
            sct.setEL(KeyConstants._bundleVersion, vd.getVersionAsString());
            sct.setEL("operator", vd.getOpAsString());
        }
        arr.appendEL(sct);
    }
    return arr;
}
Also used : Array(lucee.runtime.type.Array) BundleDefinition(lucee.runtime.osgi.OSGiUtil.BundleDefinition) VersionDefinition(lucee.runtime.osgi.OSGiUtil.VersionDefinition) StructImpl(lucee.runtime.type.StructImpl) ArrayImpl(lucee.runtime.type.ArrayImpl) Struct(lucee.runtime.type.Struct)

Aggregations

VersionDefinition (lucee.runtime.osgi.OSGiUtil.VersionDefinition)4 Array (lucee.runtime.type.Array)3 ArrayImpl (lucee.runtime.type.ArrayImpl)3 Struct (lucee.runtime.type.Struct)3 StructImpl (lucee.runtime.type.StructImpl)3 BundleDefinition (lucee.runtime.osgi.OSGiUtil.BundleDefinition)2 PackageQuery (lucee.runtime.osgi.OSGiUtil.PackageQuery)2