Tabnine Logo
Identity.getVersion
Code IndexAdd Tabnine to your IDE (free)

How to use
getVersion
method
in
org.jboss.as.patching.metadata.Identity

Best Java code snippets using org.jboss.as.patching.metadata.Identity.getVersion (Showing top 20 results out of 315)

origin: org.wildfly.core/wildfly-patching

result.get(Constants.IDENTITY_VERSION).set(identity.getVersion());
origin: wildfly/wildfly-core

result.get(Constants.IDENTITY_VERSION).set(identity.getVersion());
origin: wildfly/wildfly-core

final Patch metadata = next.getMetadata();
result.get(Constants.IDENTITY_NAME).set(metadata.getIdentity().getName());
result.get(Constants.IDENTITY_VERSION).set(metadata.getIdentity().getVersion());
result.get(Constants.DESCRIPTION).set(next.getMetadata().getDescription());
if (next.getMetadata().getLink() != null) {
origin: org.wildfly.core/wildfly-patching

final Patch metadata = next.getMetadata();
result.get(Constants.IDENTITY_NAME).set(metadata.getIdentity().getName());
result.get(Constants.IDENTITY_VERSION).set(metadata.getIdentity().getVersion());
result.get(Constants.DESCRIPTION).set(next.getMetadata().getDescription());
if (next.getMetadata().getLink() != null) {
origin: org.wildfly.core/wildfly-patching

protected PatchingResult execute(final File workDir, final ContentVerificationPolicy contentPolicy)
    throws PatchingException, IOException, XMLStreamException {
  final File patchBundleXml = new File(workDir, PatchBundleXml.MULTI_PATCH_XML);
  if (patchBundleXml.exists()) {
    final InputStream patchIs = new FileInputStream(patchBundleXml);
    try {
      // Handle multi patch installs
      final BundledPatch bundledPatch = PatchBundleXml.parse(patchIs);
      return applyPatchBundle(workDir, bundledPatch, contentPolicy);
    } finally {
      safeClose(patchIs);
    }
  } else {
    // Parse the xml
    File patchXml = new File(workDir, PatchXml.PATCH_XML);
    PatchMetadataResolver patchResolver = parsePatchXml(patchXml);
    Patch patch = patchResolver.resolvePatch(null, null);
    final InstalledIdentity installedIdentity = manager.getInstalledIdentity(patch.getIdentity().getName(), null);
    final String currentVersion = installedIdentity.getIdentity().getVersion();
    if(!Constants.UNKNOWN.equals(currentVersion) && !patch.getIdentity().getVersion().equals(currentVersion)) {
      patchXml = new File(workDir, currentVersion + PatchMerger.PATCH_XML_SUFFIX);
      if(!patchXml.exists()) {
        throw new PatchingException("The patch does not contain metadata for currently installed " + patch.getIdentity().getName() + " version " + currentVersion);
      }
      patchResolver = parsePatchXml(patchXml);
      patch = patchResolver.resolvePatch(null, null);
    }
    return apply(patchResolver, PatchContentProvider.DefaultContentProvider.create(workDir), contentPolicy);
  }
}
origin: org.wildfly.core/wildfly-patching

copyFile(new File(patch2Dir, PatchXml.PATCH_XML), new File(mergedDir, patch2Metadata.getIdentity().getVersion() +  PATCH_XML_SUFFIX));
origin: wildfly/wildfly-core

protected PatchingResult execute(final File workDir, final ContentVerificationPolicy contentPolicy)
    throws PatchingException, IOException, XMLStreamException {
  final File patchBundleXml = new File(workDir, PatchBundleXml.MULTI_PATCH_XML);
  if (patchBundleXml.exists()) {
    final InputStream patchIs = new FileInputStream(patchBundleXml);
    try {
      // Handle multi patch installs
      final BundledPatch bundledPatch = PatchBundleXml.parse(patchIs);
      return applyPatchBundle(workDir, bundledPatch, contentPolicy);
    } finally {
      safeClose(patchIs);
    }
  } else {
    // Parse the xml
    File patchXml = new File(workDir, PatchXml.PATCH_XML);
    PatchMetadataResolver patchResolver = parsePatchXml(patchXml);
    Patch patch = patchResolver.resolvePatch(null, null);
    final InstalledIdentity installedIdentity = manager.getInstalledIdentity(patch.getIdentity().getName(), null);
    final String currentVersion = installedIdentity.getIdentity().getVersion();
    if(!Constants.UNKNOWN.equals(currentVersion) && !patch.getIdentity().getVersion().equals(currentVersion)) {
      patchXml = new File(workDir, currentVersion + PatchMerger.PATCH_XML_SUFFIX);
      if(!patchXml.exists()) {
        throw new PatchingException("The patch does not contain metadata for currently installed " + patch.getIdentity().getName() + " version " + currentVersion);
      }
      patchResolver = parsePatchXml(patchXml);
      patch = patchResolver.resolvePatch(null, null);
    }
    return apply(patchResolver, PatchContentProvider.DefaultContentProvider.create(workDir), contentPolicy);
  }
}
origin: wildfly/wildfly-core

copyFile(new File(patch2Dir, PatchXml.PATCH_XML), new File(mergedDir, patch2Metadata.getIdentity().getVersion() +  PATCH_XML_SUFFIX));
origin: org.wildfly.core/wildfly-patching

protected PatchingResult apply(final PatchMetadataResolver patchResolver, final PatchContentProvider contentProvider, final ContentVerificationPolicy contentPolicy) throws PatchingException {
  // Apply the patch
  final org.jboss.as.patching.metadata.Identity identity = patchResolver.resolvePatch(null, null).getIdentity();
  final InstallationManager.InstallationModification modification = ((InstallationManagerImpl)manager).
      getInstalledIdentity(identity.getName(), identity.getVersion()).modifyInstallation(callback);
  try {
    return runner.applyPatch(patchResolver, contentProvider, contentPolicy, modification);
  } catch (Exception e) {
    modification.cancel();
    throw rethrowException(e);
  }
}
origin: wildfly/wildfly-core

protected PatchingResult apply(final PatchMetadataResolver patchResolver, final PatchContentProvider contentProvider, final ContentVerificationPolicy contentPolicy) throws PatchingException {
  // Apply the patch
  final org.jboss.as.patching.metadata.Identity identity = patchResolver.resolvePatch(null, null).getIdentity();
  final InstallationManager.InstallationModification modification = ((InstallationManagerImpl)manager).
      getInstalledIdentity(identity.getName(), identity.getVersion()).modifyInstallation(callback);
  try {
    return runner.applyPatch(patchResolver, contentProvider, contentPolicy, modification);
  } catch (Exception e) {
    modification.cancel();
    throw rethrowException(e);
  }
}
origin: org.wildfly.core/wildfly-patching

final String appliesTo = identity.getVersion();
if (!appliesTo.equals(modification.getVersion())) {
  throw PatchLogger.ROOT_LOGGER.doesNotApply(appliesTo, modification.getVersion());
origin: wildfly/wildfly-core

final String appliesTo = identity.getVersion();
if (!appliesTo.equals(modification.getVersion())) {
  throw PatchLogger.ROOT_LOGGER.doesNotApply(appliesTo, modification.getVersion());
origin: wildfly/wildfly-core

@Test
public void testParseOneOff() throws Exception {
  final InputStream is = getResource("patch-02-ONE-OFF.xml");
  final Patch patch = PatchXml.parse(is).resolvePatch(null, null);
  // One-off Patch
  assertNotNull(patch);
  assertNotNull(patch.getPatchId());
  assertNotNull(patch.getDescription());
  final Identity identity = patch.getIdentity();
  assertNotNull(identity);
  assertNotNull(patch.getIdentity().getVersion());
}
origin: wildfly/wildfly-core

@Test
public void testParseCP() throws Exception {
  final InputStream is = getResource("patch-01-CP.xml");
  final Patch patch = PatchXml.parse(is).resolvePatch(null, null);
  // Cumulative Patch
  assertNotNull(patch);
  assertNotNull(patch.getPatchId());
  assertNotNull(patch.getDescription());
  final Identity identity = patch.getIdentity();
  assertNotNull(identity);
  assertEquals(Patch.PatchType.CUMULATIVE, identity.getPatchType());
  assertNotNull(identity.forType(Patch.PatchType.CUMULATIVE, Identity.IdentityUpgrade.class).getResultingVersion());
  assertNotNull(identity.getVersion());
}
origin: wildfly/wildfly-core

  private void displayPatchXml(CommandContext ctx, Patch patch) throws CommandException {
    final Identity identity = patch.getIdentity();
    SimpleTable table = new SimpleTable(2, ctx.getTerminalWidth());
    table.addLine(new String[]{"Patch ID:", patch.getPatchId()});
    table.addLine(new String[]{"Type:", identity.getPatchType().getName()});
    table.addLine(new String[]{"Identity name:", identity.getName()});
    table.addLine(new String[]{"Identity version:", identity.getVersion()});
    table.addLine(new String[]{"Description:", patch.getDescription() == null ? "n/a" : patch.getDescription()});
    if (patch.getLink() != null) {
      table.addLine(new String[]{"Link:", patch.getLink()});
    }
    ctx.printLine(table.toString(false));

    if (verbose) {
      ctx.printLine("");
      ctx.printLine("ELEMENTS");
      for (PatchElement e : patch.getElements()) {
        table = new SimpleTable(2, ctx.getTerminalWidth());
        table.addLine(new String[]{"Patch ID:", e.getId()});
        table.addLine(new String[]{"Name:", e.getProvider().getName()});
        table.addLine(new String[]{"Type:", e.getProvider().isAddOn() ? Constants.ADD_ON : Constants.LAYER});
        table.addLine(new String[]{"Description:", e.getDescription()});
        ctx.printLine("");
        ctx.printLine(table.toString(false));
      }
    }
  }
}
origin: org.wildfly.core/wildfly-patching

  private void displayPatchXml(CommandContext ctx, Patch patch) throws CommandException {
    final Identity identity = patch.getIdentity();
    SimpleTable table = new SimpleTable(2, ctx.getTerminalWidth());
    table.addLine(new String[]{"Patch ID:", patch.getPatchId()});
    table.addLine(new String[]{"Type:", identity.getPatchType().getName()});
    table.addLine(new String[]{"Identity name:", identity.getName()});
    table.addLine(new String[]{"Identity version:", identity.getVersion()});
    table.addLine(new String[]{"Description:", patch.getDescription() == null ? "n/a" : patch.getDescription()});
    if (patch.getLink() != null) {
      table.addLine(new String[]{"Link:", patch.getLink()});
    }
    ctx.printLine(table.toString(false));

    if (verbose) {
      ctx.printLine("");
      ctx.printLine("ELEMENTS");
      for (PatchElement e : patch.getElements()) {
        table = new SimpleTable(2, ctx.getTerminalWidth());
        table.addLine(new String[]{"Patch ID:", e.getId()});
        table.addLine(new String[]{"Name:", e.getProvider().getName()});
        table.addLine(new String[]{"Type:", e.getProvider().isAddOn() ? Constants.ADD_ON : Constants.LAYER});
        table.addLine(new String[]{"Description:", e.getDescription()});
        ctx.printLine("");
        ctx.printLine(table.toString(false));
      }
    }
  }
}
origin: org.wildfly.core/wildfly-patching

private void displayPatchXml(CommandContext ctx, Patch patch) throws CommandLineException {
  final Identity identity = patch.getIdentity();
  SimpleTable table = new SimpleTable(2, ctx.getTerminalWidth());
  table.addLine(new String[]{"Patch ID:", patch.getPatchId()});
  table.addLine(new String[]{"Type:", identity.getPatchType().getName()});
  table.addLine(new String[]{"Identity name:", identity.getName()});
  table.addLine(new String[]{"Identity version:", identity.getVersion()});
  table.addLine(new String[]{"Description:", patch.getDescription() == null ? "n/a" : patch.getDescription()});
  if (patch.getLink() != null) {
    table.addLine(new String[]{"Link:", patch.getLink()});
  }
  ctx.printLine(table.toString(false));
  if(verbose.isPresent(ctx.getParsedCommandLine())) {
    ctx.printLine("");
    ctx.printLine("ELEMENTS");
    for(PatchElement e : patch.getElements()) {
      table = new SimpleTable(2, ctx.getTerminalWidth());
      table.addLine(new String[]{"Patch ID:", e.getId()});
      table.addLine(new String[]{"Name:", e.getProvider().getName()});
      table.addLine(new String[]{"Type:", e.getProvider().isAddOn() ? Constants.ADD_ON : Constants.LAYER});
      table.addLine(new String[]{"Description:", e.getDescription()});
      ctx.printLine("");
      ctx.printLine(table.toString(false));
    }
  }
}
origin: wildfly/wildfly-core

private void displayPatchXml(CommandContext ctx, Patch patch) throws CommandLineException {
  final Identity identity = patch.getIdentity();
  SimpleTable table = new SimpleTable(2, ctx.getTerminalWidth());
  table.addLine(new String[]{"Patch ID:", patch.getPatchId()});
  table.addLine(new String[]{"Type:", identity.getPatchType().getName()});
  table.addLine(new String[]{"Identity name:", identity.getName()});
  table.addLine(new String[]{"Identity version:", identity.getVersion()});
  table.addLine(new String[]{"Description:", patch.getDescription() == null ? "n/a" : patch.getDescription()});
  if (patch.getLink() != null) {
    table.addLine(new String[]{"Link:", patch.getLink()});
  }
  ctx.printLine(table.toString(false));
  if(verbose.isPresent(ctx.getParsedCommandLine())) {
    ctx.printLine("");
    ctx.printLine("ELEMENTS");
    for(PatchElement e : patch.getElements()) {
      table = new SimpleTable(2, ctx.getTerminalWidth());
      table.addLine(new String[]{"Patch ID:", e.getId()});
      table.addLine(new String[]{"Name:", e.getProvider().getName()});
      table.addLine(new String[]{"Type:", e.getProvider().isAddOn() ? Constants.ADD_ON : Constants.LAYER});
      table.addLine(new String[]{"Description:", e.getDescription()});
      ctx.printLine("");
      ctx.printLine(table.toString(false));
    }
  }
}
origin: org.wildfly.core/wildfly-patching

writer.writeAttribute(Attribute.VERSION.name, identity.getVersion());
origin: wildfly/wildfly-core

static void assertNotApplied(final Patch patch, InstallationManager manager) throws IOException {
  InstalledIdentity installedIdentity = null;
  try {
    installedIdentity = manager.getInstalledIdentity(patch.getIdentity().getName(), patch.getIdentity().getVersion());
  } catch (PatchingException e) {
    Assert.fail(e.getLocalizedMessage());
  }
  final PatchableTarget.TargetInfo identity = installedIdentity.getIdentity().loadTargetInfo();
  assertNotApplied(patch.getIdentity().getPatchType(), patch.getPatchId(), identity);
  assertDoesNotExists(identity.getDirectoryStructure().getInstalledImage().getPatchHistoryDir(patch.getPatchId()));
  for (final PatchElement element : patch.getElements()) {
    final PatchElementProvider provider = element.getProvider();
    final PatchableTarget target = provider.isAddOn() ? installedIdentity.getAddOn(provider.getName()) : installedIdentity.getLayer(provider.getName());
    Assert.assertNotNull(target);
    assertNotApplied(provider.getPatchType(), element.getId(), target.loadTargetInfo());
  }
}
org.jboss.as.patching.metadataIdentitygetVersion

Javadoc

Get the target version.

Popular methods of Identity

  • forType
  • getName
  • getPatchType
  • getRequires

Popular in Java

  • Making http post requests using okhttp
  • requestLocationUpdates (LocationManager)
  • getSystemService (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now