@Override public Outbound getOutboundPayload() { return wrapped.getOutboundPayload(); }
@Override public Outbound getOutboundPayload() { return wrapped.getOutboundPayload(); }
private void pumpItOut(AdminCommandContext context) { String fileName = file_name != null && !file_name.isEmpty() ? file_name : getDefaultBundleName(); File localFile = new File(fileName.replace('\\', '/')); Properties props = new Properties(); File parent = localFile.getParentFile(); if (parent == null) { parent = localFile; } props.setProperty("file-xfer-root", parent.getPath().replace('\\', '/')); URI parentURI = parent.toURI(); try { context.getOutboundPayload().attachFile( "application/octet-stream", parentURI.relativize(localFile.toURI()), "sync-bundle", props, syncBundleExport); } catch (IOException ex) { setError(Strings.get("export.sync.bundle.retrieveFailed", ex.getLocalizedMessage())); logger.finer("fileURI: " + parentURI.relativize(localFile.toURI())); logger.finer("file-xfer-root: " + parent.getPath().replace('\\', '/')); logger.finer("file: " + syncBundleExport.getAbsolutePath()); } }
private void pumpItOut(AdminCommandContext context) { String fileName = file_name != null && !file_name.isEmpty() ? file_name : getDefaultBundleName(); File localFile = new File(fileName.replace('\\', '/')); Properties props = new Properties(); File parent = localFile.getParentFile(); if (parent == null) { parent = localFile; } props.setProperty("file-xfer-root", parent.getPath().replace('\\', '/')); URI parentURI = parent.toURI(); try { context.getOutboundPayload().attachFile( "application/octet-stream", parentURI.relativize(localFile.toURI()), "sync-bundle", props, syncBundleExport); } catch (IOException ex) { setError(Strings.get("export.sync.bundle.retrieveFailed", ex.getLocalizedMessage())); if (logger.isLoggable(Level.FINER)) { logger.finer("fileURI: " + parentURI.relativize(localFile.toURI())); logger.finer("file-xfer-root: " + parent.getPath().replace('\\', '/')); logger.finer("file: " + syncBundleExport.getAbsolutePath()); } } }
Payload.Outbound outboundPayload = context.getOutboundPayload(); boolean fileAttachedToPayload = false; if (outboundPayload == null) {
@Override public void execute(AdminCommandContext context) { final ActionReport report = context.getActionReport(); final Payload.Outbound outboundPayload = context.getOutboundPayload(); final File instanceRoot = env.getInstanceRoot(); try { for (File f : bootstrappedFiles) { outboundPayload.attachFile( DOWNLOADED_FILE_MIME_TYPE, instanceRoot.toURI().relativize(f.toURI()), DOWNLOAD_DATA_REQUEST_NAME, f); } report.setActionExitCode(ActionReport.ExitCode.SUCCESS); } catch (IOException ex) { report.setActionExitCode(ActionReport.ExitCode.FAILURE); report.setFailureCause(ex); } } }
@Override public void execute(AdminCommandContext context) { final ActionReport report = context.getActionReport(); final Payload.Outbound outboundPayload = context.getOutboundPayload(); final File instanceRoot = env.getInstanceRoot(); try { for (File f : bootstrappedFiles) { outboundPayload.attachFile( DOWNLOADED_FILE_MIME_TYPE, instanceRoot.toURI().relativize(f.toURI()), DOWNLOAD_DATA_REQUEST_NAME, f); } report.setActionExitCode(ActionReport.ExitCode.SUCCESS); } catch (IOException ex) { report.setActionExitCode(ActionReport.ExitCode.FAILURE); report.setFailureCause(ex); } } }
FileOutputStream targetStream = null; try { Payload.Outbound outboundPayload = context.getOutboundPayload();
Payload.Outbound outboundPayload = context.getOutboundPayload(); Properties props = new Properties();
oos.writeObject(checkpoint); oos.close(); Outbound outboundPayload = checkpoint.getContext().getOutboundPayload(); if (outboundPayload != null && outboundPayload.isDirty()) { saveOutbound(outboundPayload, cf.getForPayload(false).getFile());
sync.synchronize(server, sr, context.getOutboundPayload(), report, logger); stateService.setState(server.getName(), InstanceState.StateType.NO_RESPONSE, true);
/** * Executes the command. * * @param context information */ public void execute(AdminCommandContext context) { final ActionReport report = context.getActionReport(); if (!validateParameters(name, report)) { return; } final ParameterMap paramMap; final ParameterMapExtractor extractor = new ParameterMapExtractor(this); try { paramMap = extractor.extract(excludedDeployCommandParamNames); } catch (IllegalArgumentException ex) { throw new RuntimeException(ex); } catch (IllegalAccessException ex) { throw new RuntimeException(ex); } paramMap.set("force", String.valueOf(true)); CommandRunner.CommandInvocation inv = commandRunner.getCommandInvocation("deploy", report); inv.parameters(paramMap).inbound(context.getInboundPayload()).outbound(context.getOutboundPayload()).execute(); }
sync.synchronize(server, sr, context.getOutboundPayload(), report, logger); stateService.setState(server.getName(), InstanceState.StateType.NO_RESPONSE, true);
@Override public void execute(AdminCommandContext context) { ActionReport ar = context.getActionReport(); Job job = registry.get(jobID); if (job == null) { ar.setActionExitCode(ActionReport.ExitCode.FAILURE); ar.setMessage(strings.getLocalString("getPayload.wrong.commandinstance.id", "Command instance {0} does not exist.", jobID)); return; } Outbound jobPayload = job.getPayload(); if (jobPayload == null) { ar.setMessage(strings.getLocalString("getPayload.nopayload", "Outbound payload does not exist.")); return; //Just return. This is OK. } Outbound paylaod = context.getOutboundPayload(); if ((paylaod instanceof PayloadImpl.Outbound) && (jobPayload instanceof PayloadImpl.Outbound)) { PayloadImpl.Outbound destination = (PayloadImpl.Outbound) paylaod; PayloadImpl.Outbound source = (PayloadImpl.Outbound) jobPayload; destination.getParts().addAll(source.getParts()); } else { ar.setActionExitCode(ActionReport.ExitCode.FAILURE); ar.setMessage(strings.getLocalString("getPayload.unsupported", "Payload type is not supported. Can not download data.")); } }
this.report = context.getActionReport(); this.inbound = context.getInboundPayload(); this.outbound = context.getOutboundPayload(); this.scope = job.getScope(); this.name = job.getName();
this.report = context.getActionReport(); this.inbound = context.getInboundPayload(); this.outbound = context.getOutboundPayload(); this.scope = job.getScope(); this.name = job.getName();