Package org.wso2.carbon.application.deployer.config

Examples of org.wso2.carbon.application.deployer.config.Artifact$Dependency


        ArchiveManipulator archiveManipulator = new ArchiveManipulator();

        String repo = axisConfig.getRepository().getPath();
        String artifactPath, destPath;
        for (Artifact.Dependency dep : artifacts) {
            Artifact artifact = dep.getArtifact();
            if (artifact == null) {
                continue;
            }
            if (MashupAppDeployer.MASHUP_TYPE.equals(artifact.getType())) {
                destPath = repo + File.separator + MashupAppDeployer.MASHUP_DIR + File.separator +
                        MashupAppDeployer.MASHUP_CONTEXT;
            } else {
                continue;
            }

            List<CappFile> files = artifact.getFiles();
            if (files.size() != 1) {
                log.error(
                        "A Mashup must have a single file. But " + files.size() + " files found.");
                continue;
            }
            String fileName = artifact.getFiles().get(0).getName();
            artifactPath = artifact.getExtractedPath() + File.separator + fileName;
            File artifactInRepo;
            if (new File(artifactPath).exists()) {
                try {
                    String[] filesInZip = archiveManipulator.check(artifactPath);
                    File jsFile = null;
                    for (String file : filesInZip) {
                        String artifactRepoPath = destPath + File.separator + file;
                        if (file.indexOf("/") == -1) {
                            String extension = file.substring(file.indexOf(".") + 1);
                            if ("js".equals(extension)) {
                                jsFile = new File(destPath + File.separator + file);
                            } else {
                                artifactInRepo = new File(artifactRepoPath);
                                if (artifactInRepo.exists() && artifactInRepo.delete()) {
                                    log.warn("Couldn't delete Mashup artifact file : " + artifactPath);
                                }
                            }
                        }
                    }
                    if (jsFile != null && jsFile.exists() && !jsFile.delete()) {
                        log.warn("Couldn't delete Mashup artifact file : " + artifactPath);
                    }
                } catch (IOException e) {
                    log.error("Error reading the content of the artifact : " + artifact.getName(), e);
                }
            }
        }
    }
View Full Code Here


        String synapseRepo = axisConfig.getRepository().getPath() + File.separator +
                SynapseAppDeployerConstants.SYNAPSE_CONFIGS + File.separator +
                SynapseAppDeployerConstants.DEFAULT_DIR;
        String artifactPath, destPath;
        for (Artifact.Dependency dep : artifacts) {
            Artifact artifact = dep.getArtifact();
            if (artifact == null) {
                continue;
            }

            if (!isAccepted(artifact.getType())) {
                log.warn("Can't deploy artifact : " + artifact.getName() + " of type : " +
                        artifact.getType() + ". Required features are not installed in the system");
                continue;
            }

            if (SynapseAppDeployerConstants.SEQUENCE_TYPE.equals(artifact.getType())) {
                destPath = synapseRepo + SynapseAppDeployerConstants.SEQUENCES_FOLDER;
            } else if (SynapseAppDeployerConstants.ENDPOINT_TYPE.equals(artifact.getType())) {
                destPath = synapseRepo + SynapseAppDeployerConstants.ENDPOINTS_FOLDER;
            } else if (SynapseAppDeployerConstants.PROXY_SERVICE_TYPE.equals(artifact.getType())) {
                destPath = synapseRepo + SynapseAppDeployerConstants.PROXY_SERVICES_FOLDER;
            } else if (SynapseAppDeployerConstants.LOCAL_ENTRY_TYPE.equals(artifact.getType())) {
                destPath = synapseRepo + SynapseAppDeployerConstants.LOCAL_ENTRIES_FOLDER;
            } else if (SynapseAppDeployerConstants.EVENT_SOURCE_TYPE.equals(artifact.getType())) {
                destPath = synapseRepo + SynapseAppDeployerConstants.EVENTS_FOLDER;
            } else if (SynapseAppDeployerConstants.TASK_TYPE.equals(artifact.getType())) {
                destPath = synapseRepo + SynapseAppDeployerConstants.TASKS_FOLDER;
            } else if(SynapseAppDeployerConstants.MESSAGE_STORE_TYPE.endsWith(artifact.getType())){
                destPath = synapseRepo + SynapseAppDeployerConstants.MESSAGE_STORE_FOLDER;
            } else if(SynapseAppDeployerConstants.MESSAGE_PROCESSOR_TYPE.endsWith(artifact.getType())){
                destPath = synapseRepo + SynapseAppDeployerConstants.MESSAGE_PROCESSOR_FOLDER;
            } else {
                continue;
            }

            List<CappFile> files = artifact.getFiles();
            if (files.size() != 1) {
                log.error("Synapse artifact types must have a single file to " +
                        "be deployed. But " + files.size() + " files found.");
                continue;
            }
            String fileName = artifact.getFiles().get(0).getName();
            artifactPath = artifact.getExtractedPath() + File.separator + fileName;
            AppDeployerUtils.createDir(destPath);
            AppDeployerUtils.copyFile(artifactPath, destPath + File.separator + fileName);
        }
    }
View Full Code Here

           ArchiveManipulator archiveManipulator = new ArchiveManipulator();

           String repo = axisConfig.getRepository().getPath();
           String artifactPath, destPath;
           for (Artifact.Dependency dep : artifacts) {
               Artifact artifact = dep.getArtifact();
               if (artifact == null) {
                   continue;
               }
               if (BRSAppDeployer.BRS_TYPE.equals(artifact.getType())) {
                   destPath = repo + File.separator + BRSAppDeployer.BRS_DIR;
               } else {
                   continue;
               }

               List<CappFile> files = artifact.getFiles();
               if (files.size() != 1) {
                   log.error(
                           "A BRS must have a single file. But " + files.size() + " files found.");
                   continue;
               }
               String fileName = artifact.getFiles().get(0).getName();
               artifactPath = artifact.getExtractedPath() + File.separator + fileName;
               File artifactInRepo;
               try {
                   String[] filesInZip = archiveManipulator.check(artifactPath);
                   File jsFile = null;
                   for (String file : filesInZip) {
                       String artifactRepoPath = destPath + File.separator + file;
                       if (file.indexOf("/") == -1) {
                           String extension = file.substring(file.indexOf(".") + 1);
                           if ("js".equals(extension)) {
                               jsFile = new File(destPath + File.separator + file);
                           } else {
                               artifactInRepo = new File(artifactRepoPath);
                               if (artifactInRepo.exists() && artifactInRepo.delete()) {
                                   log.warn("Couldn't delete BRS artifact file : " + artifactPath);
                               }
                           }
                       }
                   }
                   if (jsFile != null && jsFile.exists() && !jsFile.delete()) {
                       log.warn("Couldn't delete BRS artifact file : " + artifactPath);
                   }
               } catch (IOException e) {
                   log.error("Error reading the content of the artifact : " + artifact.getName(), e);
               }
           }
       }
View Full Code Here

          String repo = axisConfig.getRepository().getPath();

          String artifactPath, destPath;
          for (Artifact.Dependency dep : artifacts) {
              Artifact artifact = dep.getArtifact();
              if (artifact == null) {
                  continue;
              }

              String artifactName = artifact.getName();
              if (!isAccepted(artifact.getType())) {
                  log.warn("Can't deploy artifact : " + artifactName + " of type : " +
                          artifact.getType() + ". Required features are not installed in the system");
                  continue;
              }

              if (BRS_TYPE.equals(artifact.getType())) {
                  destPath = repo  + BRS_DIR;
              } else {
                  continue;
              }

              List<CappFile> files = artifact.getFiles();
              if (files.size() != 1) {
                  log.error(
                          "BRS must have a single file to " + "be deployed. But " + files.size() +
                                  " files found.");
                  continue;
              }
              String fileName = artifact.getFiles().get(0).getName();
              artifactPath = artifact.getExtractedPath() + File.separator + fileName;
              try {
                   FileManipulator.copyFileToDir(new File(artifactPath),new File(destPath));
              } catch (IOException e) {
                  log.error("Unable to copy the BRS : " + artifactName, e);
              }
View Full Code Here

        String repo = axisConfig.getRepository().getPath();

        String artifactPath, destPath;
        for (Artifact.Dependency dep : artifacts) {
            Artifact artifact = dep.getArtifact();
            if (artifact == null) {
                continue;
            }

            if (!isAccepted(artifact.getType())) {
                log.warn("Can't deploy artifact : " + artifact.getName() + " of type : " +
                        artifact.getType() + ". Required features are not installed in the system");
                continue;
            }

            if (WAR_TYPE.equals(artifact.getType())) {
                destPath = repo + File.separator + WAR_DIR;
            } else {
                continue;
            }

            List<CappFile> files = artifact.getFiles();
            if (files.size() != 1) {
                log.error("Web Applications must have a single WAR file to " +
                        "be deployed. But " + files.size() + " files found.");
                continue;
            }
            String fileName = artifact.getFiles().get(0).getName();
            artifactPath = artifact.getExtractedPath() + File.separator + fileName;
            AppDeployerUtils.createDir(destPath);
            AppDeployerUtils.copyFile(artifactPath, destPath + File.separator + fileName);
        }
    }
View Full Code Here

                .getDependencies();

        String repo = axisConfig.getRepository().getPath();
        String artifactPath, destPath;
        for (Artifact.Dependency dep : artifacts) {
            Artifact artifact = dep.getArtifact();
            if (artifact == null) {
                continue;
            }
            if (WARCappDeployer.WAR_TYPE.equals(artifact.getType())) {
                destPath = repo + File.separator + WARCappDeployer.WAR_DIR;
            } else {
                continue;
            }

            List<CappFile> files = artifact.getFiles();
            if (files.size() != 1) {
                log.error("Web Applications must have a single WAR file. But " +
                        files.size() + " files found.");
                continue;
            }
            String fileName = artifact.getFiles().get(0).getName();
            artifactPath = destPath + File.separator + fileName;
            File artifactFile = new File(artifactPath);
            if (artifactFile.exists() && !artifactFile.delete()) {
                log.warn("Couldn't delete WAR file : " + artifactPath);
            }
View Full Code Here

        String synapseRepo = axisConfig.getRepository().getPath() + File.separator +
                SynapseAppDeployerConstants.SYNAPSE_CONFIGS + File.separator +
                SynapseAppDeployerConstants.DEFAULT_DIR;
        String artifactPath, destPath;
        for (Artifact.Dependency dep : artifacts) {
            Artifact artifact = dep.getArtifact();
            if (artifact == null) {
                continue;
            }
            if (SynapseAppDeployerConstants.SEQUENCE_TYPE.equals(artifact.getType())) {
                destPath = synapseRepo + SynapseAppDeployerConstants.SEQUENCES_FOLDER;
            } else if (SynapseAppDeployerConstants.ENDPOINT_TYPE.equals(artifact.getType())) {
                destPath = synapseRepo + SynapseAppDeployerConstants.ENDPOINTS_FOLDER;
            } else if (SynapseAppDeployerConstants.PROXY_SERVICE_TYPE.equals(artifact.getType())) {
                destPath = synapseRepo + SynapseAppDeployerConstants.PROXY_SERVICES_FOLDER;
            } else if (SynapseAppDeployerConstants.LOCAL_ENTRY_TYPE.equals(artifact.getType())) {
                destPath = synapseRepo + SynapseAppDeployerConstants.LOCAL_ENTRIES_FOLDER;
            } else if (SynapseAppDeployerConstants.EVENT_SOURCE_TYPE.equals(artifact.getType())) {
                destPath = synapseRepo + SynapseAppDeployerConstants.EVENTS_FOLDER;
            } else if (SynapseAppDeployerConstants.TASK_TYPE.equals(artifact.getType())) {
                destPath = synapseRepo + SynapseAppDeployerConstants.TASKS_FOLDER;
            } else if(SynapseAppDeployerConstants.MESSAGE_STORE_TYPE.equals(artifact.getType())) {
                destPath = synapseRepo + SynapseAppDeployerConstants.MESSAGE_STORE_FOLDER;
            } else if(SynapseAppDeployerConstants.MESSAGE_PROCESSOR_TYPE.equals(artifact.getType())){
                destPath = synapseRepo + SynapseAppDeployerConstants.MESSAGE_PROCESSOR_FOLDER;
            } else {
                continue;
            }

            List<CappFile> files = artifact.getFiles();
            if (files.size() != 1) {
                log.error("Synapse artifact types must have a single file. But " +
                        files.size() + " files found.");
                continue;
            }
            String fileName = artifact.getFiles().get(0).getName();
            artifactPath = destPath + File.separator + fileName;
            File artifactFile = new File(artifactPath);
            if (artifactFile.exists() && !artifactFile.delete()) {
                log.warn("Couldn't delete App artifact file : " + artifactPath);
            }
View Full Code Here

        // package list to return
        List<PackageMetadata> packageList = new ArrayList<PackageMetadata>();

        String packageName;
        for (Artifact.Dependency dep : deps) {
            Artifact artifact = dep.getArtifact();
            packageName = artifact.getRuntimeObjectName();
            if (packageName == null) {
                continue;
            }
            if (BPELAppDeployer.BPEL_TYPE.equals(artifact.getType())) {
                PackageMetadata packageMetadata = new PackageMetadata();
                packageMetadata.setPackageName(packageName);

                // get the list of processes
//                ProcessesInPackage processes = bpelAdmin.listProcessesInPackage(packageName);
View Full Code Here

        List<Artifact.Dependency> dependencies = currentApplication.getAppConfig().
                getApplicationArtifact().getDependencies();

        // iterate the dependent artifacts and create metadata elements
        for (Artifact.Dependency dependency : dependencies) {
            Artifact artifact = dependency.getArtifact();

            String type = artifact.getType();
            String instanceName = artifact.getRuntimeObjectName();

            // if the instance name is null, artifact deployment has failed..
            if (instanceName == null) {
                continue;
            }
View Full Code Here

        List<Artifact.Dependency> dependencies = currentApplication.getAppConfig().
                getApplicationArtifact().getDependencies();

        for (Artifact.Dependency dependency : dependencies) {
            Artifact artifact = dependency.getArtifact();
            String type = artifact.getType();
            String instanceName = artifact.getRuntimeObjectName();

            if (DefaultAppDeployer.AAR_TYPE.equals(type) ||
                    DefaultAppDeployer.JAXWS_TYPE.equals(type) ||
                    DefaultAppDeployer.DS_TYPE.equals(type)) {

                AxisServiceGroup sg;
                if (instanceName == null) {
                    sg = findServiceGroupForArtifact(artifact);
                    if (sg != null) {
                        // set the instance name in Artifact so that we don't have to find it
                        // next time
                        artifact.setRuntimeObjectName(sg.getServiceGroupName());
                    }
                } else {
                    sg = getAxisConfig().getServiceGroup(instanceName);
                }

                if (sg == null) {
                    continue;
                }
                // set the service group name
                ServiceGroupMetadata sgMetadata = new ServiceGroupMetadata();
                sgMetadata.setSgName(sg.getServiceGroupName());
                sgMetadata.setSgType(type);

                // find services in the service group
                List<String> services = new ArrayList<String>();
                for (Iterator serviceIter = sg.getServices(); serviceIter.hasNext();) {
                    AxisService axisService = (AxisService) serviceIter.next();
                    // ignore if this is a client side serivce
                    if (axisService.isClientSide()) {
                        break;
                    }
                    services.add(axisService.getName());
                }
                sgMetadata.setServices(services.toArray(new String[services.size()]));
                serviceGroups.add(sgMetadata);

            } else if (RegistryResourceDeployer.REGISTRY_RESOURCE_TYPE.equals(type)) {
                // Create a Registry config metadata instance
                RegistryConfig regConf = artifact.getRegConfig();
                if (regConf == null) {
                    regConf = readRegConfig(currentApplication.getAppName(), artifact.getName());
                }
                if (regConf == null) {
                    continue;
                }
                artifact.setRegConfig(regConf);
                RegistryMetadata regMeta = new RegistryMetadata();
                regMeta.setArtifactName(artifact.getName());

                List<String> resources = new ArrayList<String>();
                List<String> collections = new ArrayList<String>();
                List<Association> associations = new ArrayList<Association>();
View Full Code Here

TOP

Related Classes of org.wso2.carbon.application.deployer.config.Artifact$Dependency

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.