Package org.apache.geronimo.kernel.repository

Examples of org.apache.geronimo.kernel.repository.Version


        artifact1 = new Artifact("test", "1", "1.1", "bar");
        artifact2 = new Artifact("test", "2", "2.2", "bar");
        artifact3 = new Artifact("test", "3", "3.3", "bar");
        // As if it was deployed with no version, now its version is a timestamp
        artifact3NoVersion = new Artifact(artifact3.getGroupId(), artifact3.getArtifactId(), new Version(Long.toString(System.currentTimeMillis())), artifact3.getType());

        ConfigurationData configurationData1 = configStore.loadConfiguration(artifact1);
        gbean1 = configurationData1.addGBean("gbean1", TestBean.getGBeanInfo()).getAbstractName();
        configurations.put(artifact1, configurationData1);
View Full Code Here


public class ModuleIDBuilder {
    private Version defaultVersion;
    private String defaultGroup;

    public ModuleIDBuilder() {
        defaultVersion = new Version(Long.toString(System.currentTimeMillis()));
        defaultGroup = Artifact.DEFAULT_GROUP_ID;
    }
View Full Code Here

        }
        String artifactId = configID.getArtifactId();
        if (artifactId == null) {
            throw new DeploymentException("Every configuration to deploy must have a ConfigID with an ArtifactID (not " + configID + ")");
        }
        Version version = configID.getVersion();
        if (version == null) {
            version = new Version(Long.toString(System.currentTimeMillis()));
        }
        String type = configID.getType();
        if (type == null) {
            type = "car";
        }
View Full Code Here

    public boolean canConvert(Class clazz) {
        return Version.class.isAssignableFrom(clazz);
    }

    protected Object fromString(String string) {
        return new Version(string);
    }
View Full Code Here

        } else {
            // todo: not very efficient
            SortedSet set = list();
            String targetGroup = query.getGroupId();
            String targetArtifact = query.getArtifactId();
            Version targetVersion = query.getVersion();
            String targetType = query.getType();
            for (Iterator it = set.iterator(); it.hasNext();) {
                Artifact candidate = (Artifact) it.next();
                if(targetGroup != null && !targetGroup.equals(candidate.getGroupId())) {
                    continue;
                }
                if(targetArtifact != null && !targetArtifact.equals(candidate.getArtifactId())) {
                    continue;
                }
                if(targetType != null && !targetType.equals(candidate.getType())) {
                    continue;
                }
                if(targetVersion != null && !targetVersion.equals(candidate.getVersion())) {
                    continue;
                }
                artifacts.add(candidate);
            }
        }
View Full Code Here

       
        targetVersions = new HashMap();
        for (Iterator it = props.keySet().iterator(); it.hasNext();) {
            String product = (String) it.next();
            String version = props.getProperty(product);
            targetVersions.put(product, new Version(version));
        }
        RepositoryConfigurationStore store = new RepositoryConfigurationStore(destRepo);
        ServerInfo info = new ServerInfo() {
            public String getBaseDirectory() {
                return null;
View Full Code Here

            String version = getText(versions.item(i)).trim();
            if(version.equals(artifact.getVersion().toString())) {
                found = true;
                break;
            }
            Version test = new Version(version);
            if(test.compareTo(artifact.getVersion()) > 0) {
                Element newVersion = doc.createElement("version");
                newVersion.appendChild(doc.createTextNode(artifact.getVersion().toString()));
                versionsElement.insertBefore(newVersion, versions.item(i));
                found = true;
            }
View Full Code Here

                    gbean.setAttribute("xmlns", "http://geronimo.apache.org/xml/ns/attributes-1.1");
                }
                config.appendChild(content);
            }
        }
        Version ger = (Version) targetVersions.get("geronimo");
        createText(doc, root, "default-repository", "http://www.geronimoplugins.com/repository/geronimo-"+ger.getMajorVersion()+"."+ger.getMinorVersion());
        createText(doc, root, "default-repository", "http://www.ibiblio.org/maven2/");
        return doc;
    }
View Full Code Here

        artifact1 = new Artifact("test", "1", "1.1", "bar");
        artifact2 = new Artifact("test", "2", "2.2", "bar");
        artifact3 = new Artifact("test", "3", "3.3", "bar");
        // As if it was deployed with no version, now its version is a timestamp
        artifact3NoVersion = new Artifact(artifact3.getGroupId(), artifact3.getArtifactId(), new Version(Long.toString(System.currentTimeMillis())), artifact3.getType());

        Environment e1 = new Environment();
        e1.setConfigId(artifact1);
        ConfigurationData configurationData1 = new ConfigurationData(e1, kernel.getNaming());
        configurationData1.setConfigurationStore(configStore);
View Full Code Here

            return null;
        }
        list = ((Element)list.item(0)).getElementsByTagName("version");
        Version[] available = new Version[list.getLength()];
        for (int i = 0; i < available.length; i++) {
            available[i] = new Version(getText(list.item(i)));
        }
        Arrays.sort(available);
        for(int i=available.length-1; i>=0; i--) {
            Version version = available[i];
            URL test = new URL(url.toString()+base+"/"+version+"/"+query.getArtifactId()+"-"+version+"."+query.getType());
            InputStream testStream = connect(test, username, password, monitor, "HEAD");
            if(testStream == null) {
                log.warn("Maven repository "+url+" listed artifact "+query+" version "+version+" but I couldn't find it at "+test);
                continue;
View Full Code Here

TOP

Related Classes of org.apache.geronimo.kernel.repository.Version

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.