Codota Logo
ConfigGroupMarshaller
Code IndexAdd Codota to your IDE (free)

How to use
ConfigGroupMarshaller
in
org.guvnor.structure.backend.config

Best Java code snippets using org.guvnor.structure.backend.config.ConfigGroupMarshaller (Showing top 10 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
origin: org.kie.workbench/kie-wb-common-cli-project-migration

  private void saveConfiguration(final ConfigGroup configGroup,
                  final Path filePath,
                  final CommentedOption commentedOption) {
    try {
      ioService.startBatch(filePath.getFileSystem());
      ioService.write(filePath,
              marshaller.marshall(configGroup),
              commentedOption);

      updateLastModified();
    } catch (Exception ex) {
      throw new RuntimeException(ex);
    } finally {
      ioService.endBatch();
    }
  }
}
origin: kiegroup/appformer

private List<ConfigGroup> getConfiguration(final Path dir,
                      final ConfigType type) {
  final List<ConfigGroup> configGroups = new ArrayList<>();
  if (!ioService.exists(dir)) {
    return configGroups;
  }
  final DirectoryStream<Path> foundConfigs = getDirectoryStreamForFilesWithParticularExtension(dir,
                                                 type.getExt());
  //Only load and cache if a file was found!
  final Iterator<Path> it = foundConfigs.iterator();
  if (it.hasNext()) {
    while (it.hasNext()) {
      final String content = ioService.readAllString(it.next());
      final ConfigGroup configGroup = marshaller.unmarshall(content);
      configGroups.add(configGroup);
    }
    return configGroups;
  }
  return null;
}
origin: org.kie.workbench/kie-wb-common-cli-project-migration

@Before
public void setup() throws IOException {
  fileSystemTestingUtils.setup();
  when(systemRepository.getUri()).thenReturn("git://amend-repo-test");
  marshaller = new ConfigGroupMarshaller();
  configurationFactory = new MigrationConfigurationFactoryImpl(new DefaultPasswordServiceImpl());
  ioService = mockIoService();
  configurationService = new MigrationConfigurationServiceImpl(systemRepository,
                                 marshaller,
                                 identity,
                                 ioService,
                                 repoChangedEvent,
                                 spaceChangedEvent,
                                 changedEvent,
                                 fileSystemTestingUtils.getFileSystem());
}
origin: org.uberfire/uberfire-structure-backend

@Before
public void setup() throws IOException {
  fileSystemTestingUtils.setup();
  when(systemRepository.getUri()).thenReturn("git://amend-repo-test");
  marshaller = new ConfigGroupMarshaller();
  configurationFactory = new ConfigurationFactoryImpl(new DefaultPasswordServiceImpl());
  ioService = mockIoService();
  configurationService = new ConfigurationServiceImpl(systemRepository,
                            marshaller,
                            identity,
                            ioService,
                            repoChangedEvent,
                            spaceChangedEvent,
                            changedEvent,
                            fileSystemTestingUtils.getFileSystem());
}
origin: org.guvnor/guvnor-structure-backend

@Override
public boolean updateConfiguration(ConfigGroup configGroup) {
  String filename = configGroup.getName().replaceAll(INVALID_FILENAME_CHARS,
                            "_");
  final Path filePath = ioService.get(systemRepository.getUri()).resolve(filename + configGroup.getType().getExt());
  final CommentedOption commentedOption = new CommentedOption(getIdentityName(),
                                "Updated config " + filePath.getFileName());
  try {
    ioService.startBatch(filePath.getFileSystem());
    ioService.write(filePath,
            marshaller.marshall(configGroup),
            commentedOption);
    updateLastModified();
  } catch (Exception ex) {
    throw new RuntimeException(ex);
  } finally {
    ioService.endBatch();
  }
  //Invalidate cache if a new item has been created; otherwise cached value is stale
  configuration.remove(configGroup.getType());
  return true;
}
origin: org.guvnor/guvnor-structure-backend

while (it.hasNext()) {
  final String content = ioService.readAllString(it.next());
  final ConfigGroup configGroup = marshaller.unmarshall(content);
  configGroups.add(configGroup);
origin: kiegroup/appformer

@Before
public void setup() throws IOException {
  fileSystemTestingUtils.setup();
  when(systemRepository.getUri()).thenReturn("git://amend-repo-test");
  marshaller = new ConfigGroupMarshaller();
  configurationFactory = new ConfigurationFactoryImpl(new DefaultPasswordServiceImpl());
  ioService = mockIoService();
  configurationService = new ConfigurationServiceImpl(systemRepository,
                            marshaller,
                            identity,
                            ioService,
                            repoChangedEvent,
                            spaceChangedEvent,
                            changedEvent,
                            fileSystemTestingUtils.getFileSystem());
}
origin: kiegroup/appformer

private boolean saveConfiguration(final ConfigGroup configGroup,
                 final Path path,
                 final String commitMessage,
                 final boolean isNew) {
  // avoid duplicated writes to not cause cyclic cluster sync
  if (isNew && ioService.exists(path)) {
    return true;
  }
  final CommentedOption commentedOption = new CommentedOption(getIdentityName(),
                                commitMessage);
  try {
    ioService.startBatch(path.getFileSystem());
    ioService.write(path,
            marshaller.marshall(configGroup),
            commentedOption);
    updateLastModified();
  } catch (Exception ex) {
    throw new RuntimeException(ex);
  } finally {
    ioService.endBatch();
  }
  invalidateCacheAfterUpdatingConfigGroup(configGroup);
  return true;
}
origin: org.kie.workbench/kie-wb-common-cli-project-migration

@Override
public List<ConfigGroup> getConfiguration(ConfigType configType) {
  if (ConfigType.SPACE.equals(configType)) {
    configType = ConfigType.ORGANIZATIONAL_UNIT;
  }
  final ConfigType type = configType;
  final List<ConfigGroup> configGroups = new ArrayList<>();
  final DirectoryStream<Path> foundConfigs = ioService.newDirectoryStream(ioService.get(systemRepository.getUri()),
                                      entry -> {
                                        if (!Files.isDirectory(entry) &&
                                            !entry.getFileName().toString().startsWith(".") &&
                                            entry.getFileName().toString().endsWith(type.getExt())) {
                                          return true;
                                        }
                                        return false;
                                      }
  );
  //Only load and cache if a file was found!
  final Iterator<Path> it = foundConfigs.iterator();
  if (it.hasNext()) {
    while (it.hasNext()) {
      final String content = ioService.readAllString(it.next());
      final ConfigGroup configGroup = marshaller.unmarshall(content);
      configGroups.add(configGroup);
    }
    configGroupsByTypeWithoutNamespace.put(type,
                        configGroups);
  }
  return configGroups;
}
origin: org.guvnor/guvnor-structure-backend

@Override
public boolean addConfiguration(final ConfigGroup configGroup) {
  String filename = configGroup.getName().replaceAll(INVALID_FILENAME_CHARS,
                            "_");
  final Path filePath = ioService.get(systemRepository.getUri()).resolve(filename + configGroup.getType().getExt());
  // avoid duplicated writes to not cause cyclic cluster sync
  if (ioService.exists(filePath)) {
    return true;
  }
  final CommentedOption commentedOption = new CommentedOption(getIdentityName(),
                                "Created config " + filePath.getFileName());
  try {
    ioService.startBatch(filePath.getFileSystem());
    ioService.write(filePath,
            marshaller.marshall(configGroup),
            commentedOption);
    updateLastModified();
  } catch (Exception ex) {
    throw new RuntimeException(ex);
  } finally {
    ioService.endBatch();
  }
  //Invalidate cache if a new item has been created; otherwise cached value is stale
  configuration.remove(configGroup.getType());
  return true;
}
org.guvnor.structure.backend.configConfigGroupMarshaller

Javadoc

Marshall a ConfigGroup to and from XML

Most used methods

  • marshall
  • unmarshall
  • <init>

Popular in Java

  • Making http requests using okhttp
  • getApplicationContext (Context)
  • putExtra (Intent)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • KeyStore (java.security)
    This class represents an in-memory collection of keys and certificates. It manages two types of entr
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • DataSource (javax.sql)
    A factory for connections to the physical data source that this DataSource object represents. An alt
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Join (org.hibernate.mapping)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now