Package org.apache.geronimo.kernel.repository

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


            filter(sourceFile, filteredPlanFile);

            XmlObject doc = XmlObject.Factory.parse(filteredPlanFile);
            XmlCursor xmlCursor = doc.newCursor();
            LinkedHashSet<org.apache.geronimo.kernel.repository.Dependency> dependencies = toKernelDependencies(this.dependencies, useMavenDependencies);
            Artifact configId = new Artifact(project.getGroupId(), project.getArtifactId(), project.getVersion(), "car");

            try {
                mergeEnvironment(xmlCursor, configId, dependencies);

                if (targetDir.exists()) {
View Full Code Here


            throw new MojoExecutionException("Could not archive plugin", e);
        }
    }

    private void archive(String type, ArchiverGBean archiver) throws ArchiverException, IOException {
        Artifact artifact1 = new Artifact(project.getArtifact().getGroupId(), project.getArtifact().getArtifactId(), project.getArtifact().getVersion(), type);
        File target1 = archiver.archive("", destDir.getAbsolutePath(), artifact1);
        projectHelper.attachArtifact( project, artifact1.getType(), "bin", target1 );
    }
View Full Code Here

    }

    public void updatePluginList(PluginType plugin, PluginListType pluginList) throws NoSuchStoreException {
        PluginType key = PluginInstallerGBean.toKey(plugin);
        PluginArtifactType instance = plugin.getPluginArtifact().get(0);
        Artifact id = PluginInstallerGBean.toArtifact(instance.getModuleId());
        boolean foundKey = false;
        boolean foundModule = false;
        for (Iterator<PluginType> pit = pluginList.getPlugin().iterator(); pit.hasNext();) {
            PluginType test = pit.next();
            for (Iterator<PluginArtifactType> it = test.getPluginArtifact().iterator(); it.hasNext();) {
                PluginArtifactType testInstance = it.next();
                Artifact testId = PluginInstallerGBean.toArtifact(testInstance.getModuleId());
                if (id.equals(testId)) {
                    //if the module id appears anywhere, remove that instance
                    //however, this would cause plugin without plugin artifact
                    it.remove();
                    foundModule = true;
View Full Code Here

     * @param certReqStorePath Path for CertificateRequestStore directory: Note: This CA uses FileCertificateRequestStore
     */
    private void createCARelatedGBeans(PortletRequest request, GeronimoManagedBean caKeystore, String certStorePath, String certReqStorePath) {
        // Get hold of configuration containing caKeystore GBean
        AbstractName caKeystoreName = PortletManager.getNameFor(request, caKeystore);
        Artifact configurationId =  PortletManager.getConfigurationFor(request, caKeystoreName);
        ServerInfo serverInfo = PortletManager.getCurrentServer(request).getServerInfo();
        AbstractName serverInfoName = PortletManager.getNameFor(request, serverInfo);
        Naming naming = PortletManager.getManagementHelper(request).getNaming();
       
        // Add a CertificateStore GBean
View Full Code Here

                        }
                    }
                }


                repo.copyToRepository(file, new Artifact(group, artifact, version, fileType), new FileWriteMonitor() {
                    public void writeStarted(String fileDescription, int fileSize) {
                        log.info("Copying into repository " + fileDescription + "...");
                    }

                    public void writeProgress(int bytes) {
View Full Code Here

        String action = actionRequest.getParameter("action");
        actionResponse.setRenderParameter("message", ""); // set to blank first
        try {
            ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
            String config = getConfigID(actionRequest);
            Artifact configId = Artifact.create(config);

            if (START_ACTION.equals(action)) {
                if(!configurationManager.isLoaded(configId)) {
                    configurationManager.loadConfiguration(configId);
                }
View Full Code Here

    }

    public static File getRepositoryEntry(PortletRequest request, String repositoryURI) {
        J2EEServer server = getCurrentServer(request);
        Repository[] repos = server.getRepositories();
        Artifact uri = Artifact.create(repositoryURI);
        if (!uri.isResolved()) {
            Artifact[] all = server.getConfigurationManager().getArtifactResolver().queryArtifacts(uri);
            if (all.length == 0) {
                return null;
            } else {
                uri = all[all.length - 1];
View Full Code Here

    private LoginModule loadModule(PortletRequest request, RealmData data, Map options) throws ClassNotFoundException, InstantiationException, IllegalAccessException {
        ClassLoader loader = getClass().getClassLoader();
        if (data.jar != null && !data.jar.equals("")) {
            try {
                Artifact one = Artifact.create(data.getJar());
                ListableRepository[] repos = PortletManager.getCurrentServer(request).getRepositories();
                for (int i = 0; i < repos.length; i++) {
                    ListableRepository repo = repos[i];
                    File file = repo.getLocation(one);
                    if (file != null) {
View Full Code Here

        parent.setArtifactId("j2ee-security");
        parent.setType("car");
        // Dependencies
        if (data.getJar() != null) {
            ArtifactType artifactType = dependenciesType.addNewDependency();
            Artifact artifact = Artifact.create(data.getJar());
            artifactType.setGroupId(artifact.getGroupId());
            artifactType.setArtifactId(artifact.getArtifactId());
            artifactType.setVersion(artifact.getVersion().toString());
            artifactType.setType(artifact.getType());
        }
        // Build the realm GBean
        GbeanType realm = GbeanType.Factory.newInstance();
        realm.setName(data.getName());
        realm.setClass1("org.apache.geronimo.security.realm.GenericSecurityRealm");
        AttributeType realmName = realm.addNewAttribute();
        realmName.setName("realmName");
        realmName.setStringValue(data.getName());
        ReferenceType serverInfo = realm.addNewReference();
        serverInfo.setName2("ServerInfo");
        serverInfo.setName((String) PortletManager.getNameFor(request, PortletManager.getCurrentServer(request).getServerInfo()).getName().get("name"));
        ReferenceType loginService = realm.addNewReference();
        loginService.setName2("LoginService");
        loginService.setName((String) PortletManager.getNameFor(request, PortletManager.getCurrentServer(request).getLoginService()).getName().get("name"));
        XmlAttributeType config = realm.addNewXmlReference();
        // Construct the content to put in the XmlAttributeType
        GerLoginConfigDocument lcDoc = GerLoginConfigDocument.Factory.newInstance();
        GerLoginConfigType login = lcDoc.addNewLoginConfig();
        for (int i = 0; i < data.getModules().length; i++) {
            LoginModuleDetails details = data.getModules()[i];
            if (details.getLoginDomainName() == null || details.getLoginDomainName().equals("")) {
                continue;
            }
            GerLoginModuleType module = login.addNewLoginModule();
            module.setControlFlag(details.getControlFlag().equals("OPTIONAL") ? GerControlFlagType.OPTIONAL :
                    details.getControlFlag().equals("REQUIRED") ? GerControlFlagType.REQUIRED :
                            details.getControlFlag().equals("REQUISITE") ? GerControlFlagType.REQUISITE :
                                    details.getControlFlag().equals("SUFFICIENT") ? GerControlFlagType.SUFFICIENT :
                                            GerControlFlagType.OPTIONAL);
            module.setServerSide(details.isServerSide());
            module.setLoginDomainName(details.getLoginDomainName());
            module.setLoginModuleClass(details.getClassName());
            module.setWrapPrincipals(details.isWrapPrincipals());
            for (Iterator it = details.getOptions().entrySet().iterator(); it.hasNext();) {
                Map.Entry entry = (Map.Entry) it.next();
                GerOptionType option = module.addNewOption();
                option.setName((String) entry.getKey());
                option.setStringValue((String) entry.getValue());
            }

            // bit of a hack -- to put the DataSource module in as a parent for SQL modules
            if (details.getClassName().indexOf("SQL") > -1) {
                String poolName = (String) details.getOptions().get("dataSourceName");
                String appName = (String) details.getOptions().get("dataSourceApplication");
                if (poolName != null) {
                    if (appName == null) appName = "null";
                    JCAManagedConnectionFactory[] factories = PortletManager.getOutboundFactoriesOfType(request, "javax.sql.DataSource");
                    for (int j = 0; j < factories.length; j++) {
                        JCAManagedConnectionFactory factory = factories[j];
                        try {
                            ObjectName objectName = ObjectName.getInstance(factory.getObjectName());
                            final String testName = objectName.getKeyProperty(NameFactory.J2EE_NAME);
                            final String testApp = objectName.getKeyProperty(NameFactory.J2EE_APPLICATION);
                            if (testName.equals(poolName) && testApp.equals(appName)) {
                                String moduleName = objectName.getKeyProperty(NameFactory.JCA_RESOURCE);

                                ArtifactType artifactType = dependenciesType.addNewDependency();
                                Artifact artifact = Artifact.create(moduleName);
                                artifactType.setGroupId(artifact.getGroupId());
                                artifactType.setArtifactId(artifact.getArtifactId());
                                artifactType.setVersion(artifact.getVersion().toString());
                                artifactType.setType(artifact.getType());
                                break;
                            }
                        } catch (MalformedObjectNameException e) {
                            log.error("Unable to parse ObjectName", e);
                        }
View Full Code Here

            ListableRepository repo = repos[i];

            SortedSet artifacts = repo.list();
            outer:
            for (Iterator iterator = artifacts.iterator(); iterator.hasNext();) {
                Artifact artifact = (Artifact) iterator.next();
                String test = artifact.toString();
                // todo should only test groupId and should check for long (org.apache.geronimo) and short form
                for (int k = 0; k < SKIP_ENTRIES_WITH.length; k++) {
                    String skip = SKIP_ENTRIES_WITH[k];
                    if (test.indexOf(skip) > -1) {
                        continue outer;
View Full Code Here

TOP

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

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.