Package org.apache.geronimo.kernel.repository

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


            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)));
        }
        List availableList = Arrays.asList(available);
        if(availableList.contains(query.getVersion())){
            available = new Version[]{query.getVersion()};
        } else {
            Arrays.sort(available);
        }
        for(int i=available.length-1; i>=0; i--) {
            Version version = available[i];
            URL metadataURL = new URL(url.toString().trim().endsWith("/") ? url : new URL(url.toString().trim()+"/"), base+"/"+version+"/maven-metadata.xml");
            InputStream metadataStream = connect(metadataURL, username, password, monitor);
           
            if (metadataStream == null) {
                metadataURL = new URL(url.toString().trim().endsWith("/") ? url : new URL(url.toString().trim()+"/"), base+"/"+version+"/maven-metadata-local.xml");
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)));
        }
        List availableList = Arrays.asList(available);
        if(availableList.contains(query.getVersion())){
            available = new Version[]{query.getVersion()};
        } else {
            Arrays.sort(available);
        }
        for(int i=available.length-1; i>=0; i--) {
            Version version = available[i];
            URL metadataURL = new URL(url.toString().trim().endsWith("/") ? url : new URL(url.toString().trim()+"/"), base+"/"+version+"/maven-metadata.xml");
            InputStream metadataStream = connect(metadataURL, username, password, monitor);
           
            if (metadataStream == null) {
                metadataURL = new URL(url.toString().trim().endsWith("/") ? url : new URL(url.toString().trim()+"/"), base+"/"+version+"/maven-metadata-local.xml");
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

    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

            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 metadataURL = new URL(url.toString()+base+"/"+version+"/maven-metadata.xml");
            InputStream metadataStream = connect(metadataURL, username, password, monitor);
           
            // check for a snapshot qualifier
            if (metadataStream != null) {
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

        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

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.