congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
PatchingException
Code IndexAdd Tabnine to your IDE (free)

How to use
PatchingException
in
org.jboss.as.patching

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

origin: org.wildfly.core/wildfly-patching

@Override
public final PatchingException doesNotApply(final String appliesTo, final String version) {
  final PatchingException result = new PatchingException(String.format(getLoggingLocale(), doesNotApply$str(), appliesTo, version));
  final StackTraceElement[] st = result.getStackTrace();
  result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
  return result;
}
private static final String failedToDelete = "WFLYPAT0004: Failed to delete (%s)";
origin: wildfly/wildfly-core

static PatchingException rethrowException(final Exception e) {
  if (e instanceof PatchingException) {
    return (PatchingException) e;
  } else {
    return new PatchingException(e);
  }
}
origin: org.wildfly.core/wildfly-patching

public static void formatFailedResponse(final PatchingException e, final ModelNode failureDescription) {
  if(e instanceof ContentConflictsException) {
    failureDescription.get(Constants.MESSAGE).set(PatchLogger.ROOT_LOGGER.detectedConflicts());
    final ModelNode conflicts = failureDescription.get(Constants.CONFLICTS);
    for(final ContentItem item : ((ContentConflictsException)e).getConflicts()) {
      final ContentType type = item.getContentType();
      switch (type) {
        case BUNDLE:
          conflicts.get(Constants.BUNDLES).add(item.getRelativePath());
          break;
        case MODULE:
          conflicts.get(Constants.MODULES).add(item.getRelativePath());
          break;
        case MISC:
          conflicts.get(Constants.MISC).add(item.getRelativePath());
          break;
      }
    }
  } else {
    failureDescription.set(e.getLocalizedMessage());
  }
}
origin: org.wildfly.core/wildfly-patching

static PatchingException rethrowException(final Exception e) {
  if (e instanceof PatchingException) {
    return (PatchingException) e;
  } else {
    return new PatchingException(e);
  }
}
origin: wildfly/wildfly-core

public static void formatFailedResponse(final PatchingException e, final ModelNode failureDescription) {
  if(e instanceof ContentConflictsException) {
    failureDescription.get(Constants.MESSAGE).set(PatchLogger.ROOT_LOGGER.detectedConflicts());
    final ModelNode conflicts = failureDescription.get(Constants.CONFLICTS);
    for(final ContentItem item : ((ContentConflictsException)e).getConflicts()) {
      final ContentType type = item.getContentType();
      switch (type) {
        case BUNDLE:
          conflicts.get(Constants.BUNDLES).add(item.getRelativePath());
          break;
        case MODULE:
          conflicts.get(Constants.MODULES).add(item.getRelativePath());
          break;
        case MISC:
          conflicts.get(Constants.MISC).add(item.getRelativePath());
          break;
      }
    }
  } else {
    failureDescription.set(e.getLocalizedMessage());
  }
}
origin: org.wildfly.core/wildfly-patching

@Override
public final PatchingException cannotCopyFilesToTempDir(final String tempDir, final String reason, final Throwable cause) {
  final PatchingException result = new PatchingException(String.format(getLoggingLocale(), cannotCopyFilesToTempDir$str(), tempDir, reason), cause);
  final StackTraceElement[] st = result.getStackTrace();
  result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
  return result;
}
private static final String cannotCopyFiles = "WFLYPAT0047: Cannot copy files from %s to %s: %s";
origin: org.wildfly.core/wildfly-patching

static PatchingException rethrowException(final Exception e) {
  if (e instanceof PatchingException) {
    return (PatchingException) e;
  } else {
    return new PatchingException(e);
  }
}
origin: org.wildfly.core/wildfly-patching

  @Override
  protected Layer getProvider(final String name, final InstalledIdentity identity) throws OperationFailedException {
    final Layer target = identity.getLayer(name);
    if (target == null) {
      throw new OperationFailedException(PatchLogger.ROOT_LOGGER.noSuchLayer(name).getLocalizedMessage());
    }
    return target;
  }
}
origin: org.wildfly.core/wildfly-patching

@Override
public final PatchingException alreadyApplied(final String patchId) {
  final PatchingException result = new PatchingException(String.format(getLoggingLocale(), alreadyApplied$str(), patchId));
  final StackTraceElement[] st = result.getStackTrace();
  result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
  return result;
}
private static final String noSuchLayer = "WFLYPAT0013: There is no layer called %s installed";
origin: wildfly/wildfly-core

static PatchingException rethrowException(final Exception e) {
  if (e instanceof PatchingException) {
    return (PatchingException) e;
  } else {
    return new PatchingException(e);
  }
}
origin: org.wildfly.core/wildfly-patching

  @Override
  protected PatchableTarget getProvider(final String name, final InstalledIdentity identity) throws OperationFailedException {
    final AddOn target = identity.getAddOn(name);
    if (target == null) {
      throw new OperationFailedException(PatchLogger.ROOT_LOGGER.noSuchLayer(name).getLocalizedMessage());
    }
    return target;
  }
}
origin: wildfly/wildfly-core

@Override
public final PatchingException noSuchLayer(final String name) {
  final PatchingException result = new PatchingException(String.format(getLoggingLocale(), noSuchLayer$str(), name));
  final StackTraceElement[] st = result.getStackTrace();
  result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
  return result;
}
private static final String failedToResolvePatch = "WFLYPAT0014: Failed to resolve a valid patch descriptor for %s %s";
origin: wildfly/wildfly-core

private static void copyFile(File source, File target) throws PatchingException {
  try {
    Files.copy(source.toPath(), target.toPath());
  } catch (IOException e1) {
    throw new PatchingException("Failed to copy " + source.getAbsolutePath() + " to " + target.getAbsolutePath());
  }
}
origin: wildfly/wildfly-core

  @Override
  protected PatchableTarget getProvider(final String name, final InstalledIdentity identity) throws OperationFailedException {
    final AddOn target = identity.getAddOn(name);
    if (target == null) {
      throw new OperationFailedException(PatchLogger.ROOT_LOGGER.noSuchLayer(name).getLocalizedMessage());
    }
    return target;
  }
}
origin: wildfly/wildfly-core

@Override
public final PatchingException failedToResolvePatch(final String product, final String version) {
  final PatchingException result = new PatchingException(String.format(getLoggingLocale(), failedToResolvePatch$str(), product, version));
  final StackTraceElement[] st = result.getStackTrace();
  result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
  return result;
}
private static final String requiresPatch = "WFLYPAT0015: Requires patch '%s'";
origin: org.wildfly.core/wildfly-patching

private static void copyFile(File source, File target) throws PatchingException {
  try {
    Files.copy(source.toPath(), target.toPath());
  } catch (IOException e1) {
    throw new PatchingException("Failed to copy " + source.getAbsolutePath() + " to " + target.getAbsolutePath());
  }
}
origin: wildfly/wildfly-core

  @Override
  protected Layer getProvider(final String name, final InstalledIdentity identity) throws OperationFailedException {
    final Layer target = identity.getLayer(name);
    if (target == null) {
      throw new OperationFailedException(PatchLogger.ROOT_LOGGER.noSuchLayer(name).getLocalizedMessage());
    }
    return target;
  }
}
origin: wildfly/wildfly-core

@Override
public final PatchingException cannotRollbackPatch(final String id) {
  final PatchingException result = new PatchingException(String.format(getLoggingLocale(), cannotRollbackPatch$str(), id));
  final StackTraceElement[] st = result.getStackTrace();
  result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
  return result;
}
private static final String alreadyApplied = "WFLYPAT0012: Patch '%s' already applied";
origin: org.wildfly.core/wildfly-patching

protected static void copyDir(File src, File trg) throws PatchingException {
  try {
    IoUtils.copyFile(src, trg);
  } catch (IOException e) {
    throw new PatchingException("Failed to copy modification content from " + src.getAbsolutePath() + " to " + trg.getAbsolutePath(), e);
  }
}
origin: wildfly/wildfly-core

  return formatFailedResponse(e);
return formatFailedResponse(PatchLogger.ROOT_LOGGER.patchNotFoundInHistory(patchId).getLocalizedMessage());
org.jboss.as.patchingPatchingException

Most used methods

  • <init>
  • getLocalizedMessage
  • getStackTrace
  • setStackTrace

Popular in Java

  • Making http requests using okhttp
  • getApplicationContext (Context)
  • setScale (BigDecimal)
  • getContentResolver (Context)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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