public OperationBuilder(final ModelNode operation, boolean autoCloseStreams) { if (operation == null) { throw MESSAGES.nullVar("operation"); } this.operation = operation; this.autoCloseStreams = autoCloseStreams; }
private ServerGroupDeploymentPlan(final String serverGroupName, final boolean rollback, final boolean rollingToServers, final int maxFailures, final int maxFailurePercentage) { if (serverGroupName == null) { throw MESSAGES.nullVar("serverGroupName"); } this.serverGroupName = serverGroupName; this.rollback = rollback; this.rollingToServers = rollingToServers; this.maxFailures = maxFailures; this.maxFailurePercentage = maxFailurePercentage; }
public DeploymentPlanResultImpl(final DeploymentPlan plan, final InvalidDeploymentPlanException invalidPlanException) { if (plan == null) throw MESSAGES.nullVar("plan"); if (invalidPlanException == null) throw MESSAGES.nullVar("invalidPlanException"); this.plan = plan; this.results = null; this.idpe = invalidPlanException; }
DeploymentPlanBuilderImpl(DeploymentContentDistributor deploymentDistributor) { super(); if (deploymentDistributor == null) throw MESSAGES.nullVar("deploymentDistributor"); this.deploymentDistributor = deploymentDistributor; }
private DeploymentActionImpl(Type type, String deploymentUnitName, String newContentFileName, byte[] newContentHash, String replacedDeploymentUnitName) { if (type == null) { throw MESSAGES.nullVar("type"); } if (deploymentUnitName == null) { throw MESSAGES.nullVar("deploymentUnitName"); } this.type = type; this.deploymentUnitName = deploymentUnitName; this.newContentFileName = newContentFileName; this.newContentHash = newContentHash; this.oldDeploymentUnitName = replacedDeploymentUnitName; }
DeploymentPlanImpl(List<DeploymentActionImpl> actions, boolean globalRollback, boolean shutdown, long gracefulTimeout) { if (actions == null) throw MESSAGES.nullVar("actions"); this.deploymentActions.addAll(actions); this.globalRollback = globalRollback; this.shutdown = shutdown; this.gracefulShutdownPeriod = gracefulTimeout; }
/** * Associate an input stream with the operation. Closing the input stream * is the responsibility of the caller. * * @param in the input stream. Cannot be {@code null} * @return a builder than can be used to continue building the operation */ public OperationBuilder addInputStream(final InputStream in) { if(in == null) { throw MESSAGES.nullVar("input-stream"); } if (inputStreams == null) { inputStreams = new ArrayList<InputStream>(); } inputStreams.add(in); return this; }
public static DeploymentActionImpl getReplaceAction(String deploymentName, String replacedName) { if (replacedName == null) { throw MESSAGES.nullVar("replacedName"); } return new DeploymentActionImpl(Type.REPLACE, deploymentName, null, null, replacedName); }
@Override @Deprecated public Operation clone(final ModelNode operation) { if (operation == null) { throw MESSAGES.nullVar("operation"); } List<InputStream> streamsCopy = inputStreams == null ? null : new ArrayList<InputStream>(inputStreams); return new OperationImpl(operation, streamsCopy); }
/** * Associate a file with the operation. This will create a {@code FileInputStream} * and add it as attachment. * * @param file the file * @return the operation builder */ public OperationBuilder addFileAsAttachment(final File file) { if(file == null) { throw MESSAGES.nullVar("file"); } try { FileStreamEntry entry = new FileStreamEntry(file); if (inputStreams == null) { inputStreams = new ArrayList<InputStream>(); } inputStreams.add(entry); } catch (IOException e) { throw new RuntimeException(e); } return this; }