private ConstraintTypesManager() { super(new ConstraintTypesId()); }
public NamespacesResource() { super(new NamespacesId()); namespaceManager = RepositoryFactory.getRepository().getNamespaceManager(); }
@Override public AccountabilityConfigurationManager getAccountabilityConfigurationManager() { RepositoryFileReference repoRef = BackendUtils.getRefOfConfiguration(new AccountabilityId()); RepositoryFileReference keystoreRef = new RepositoryFileReference(new AccountabilityId(), "CustomKeystore.json"); RepositoryFileReference defaultKeystoreRef = new RepositoryFileReference(new AccountabilityId(), "DefaultKeystore.json"); return AccountabilityConfigurationManager.getInstance(ref2AbsolutePath(repoRef).toFile(), ref2AbsolutePath(keystoreRef).toFile(), ref2AbsolutePath(defaultKeystoreRef).toFile()); }
private PlanTypesManager() { super(new PlanTypesId()); // add data without rendering in the plan types file this.addData(org.eclipse.winery.repository.Constants.TOSCA_PLANTYPE_BUILD_PLAN, "Build Plan"); this.addData(org.eclipse.winery.repository.Constants.TOSCA_PLANTYPE_TERMINATION_PLAN, "Termination Plan"); this.addData(org.eclipse.winery.repository.Constants.TOSCA_PLANTYPE_MANAGEMENT_PLAN, "Management Plan"); } }
private PlanLanguagesManager() { super(new PlanLanguagesId()); // add data without rendering in the plan languages file this.addData(Namespaces.URI_BPEL20_EXECUTABLE, "BPEL 2.0"); this.addData(Namespaces.URI_BPMN20_MODEL, "BPMN 2.0"); this.addData(Namespaces.URI_BPMN4TOSCA_20, "BPMN4TOSCA 2.0"); } }
/** * Writes the configured mapping namespaceprefix -> namespace to the archive * <p> * This is kind of a quick hack. TODO: during the import, the prefixes should be extracted using JAXB and stored in * the NamespacesResource */ private void addNamespacePrefixes(IRepository repository, Map<CsarContentProperties, CsarEntry> refMap) throws IOException { // ensure that the namespaces are saved as json SortedSet<RepositoryFileReference> references = repository.getContainedFiles(new NamespacesId()); references.forEach(repositoryFileReference -> { if (repositoryFileReference.getFileName().toLowerCase().endsWith(Constants.SUFFIX_JSON)) { CsarContentProperties csarContentProperties = new CsarContentProperties(CsarExporter.PATH_TO_NAMESPACES_JSON); refMap.put(csarContentProperties, new RepositoryRefBasedCsarEntry(repositoryFileReference)); } }); }
@Override public int hashCode() { return this.getXmlId().hashCode(); }
@Override public NamespaceManager getNamespaceManager() { NamespaceManager manager; RepositoryFileReference ref = BackendUtils.getRefOfJsonConfiguration(new NamespacesId()); manager = new JsonBasedNamespaceManager(ref2AbsolutePath(ref).toFile()); Configuration configuration = this.getConfiguration(new NamespacesId()); if (!configuration.isEmpty()) { ConfigurationBasedNamespaceManager old = new ConfigurationBasedNamespaceManager(configuration); manager.replaceAll(old.getAllNamespaces()); try { forceDelete(BackendUtils.getRefOfConfiguration(new NamespacesId())); } catch (IOException e) { LOGGER.error("Could not remove old namespace configuration.", e); } } return manager; }
@Override public int compareTo(GenericId o) { if (o instanceof AdminId) { return this.getXmlId().compareTo(o.getXmlId()); } else { throw new IllegalStateException(); } }