private RemoteProcessGroupPortDescriptor createPortDescriptor(final VersionedRemoteGroupPort proposed, final String componentIdSeed, final String rpgId) { final StandardRemoteProcessGroupPortDescriptor descriptor = new StandardRemoteProcessGroupPortDescriptor(); descriptor.setVersionedComponentId(proposed.getIdentifier()); final BatchSize batchSize = proposed.getBatchSize(); if (batchSize != null) { descriptor.setBatchCount(batchSize.getCount()); descriptor.setBatchDuration(batchSize.getDuration()); descriptor.setBatchSize(batchSize.getSize()); } descriptor.setComments(proposed.getComments()); descriptor.setConcurrentlySchedulableTaskCount(proposed.getConcurrentlySchedulableTaskCount()); descriptor.setGroupId(proposed.getRemoteGroupId()); descriptor.setTargetId(proposed.getTargetId()); descriptor.setId(generateUuid(proposed.getIdentifier(), rpgId, componentIdSeed)); descriptor.setName(proposed.getName()); descriptor.setUseCompression(proposed.isUseCompression()); return descriptor; }
@Override public RemotePortSchema apply(VersionedRemoteGroupPort versionedRemoteGroupPort) { Map<String, Object> map = new HashMap<>(); // If a targetId is specified, it takes precedence over the original id final String targetId = versionedRemoteGroupPort.getTargetId(); map.put(ID_KEY, StringUtils.isNotBlank(targetId) ? targetId : versionedRemoteGroupPort.getIdentifier()); map.put(NAME_KEY, versionedRemoteGroupPort.getName()); map.put(CommonPropertyKeys.COMMENT_KEY, versionedRemoteGroupPort.getComments()); map.put(CommonPropertyKeys.MAX_CONCURRENT_TASKS_KEY, versionedRemoteGroupPort.getConcurrentlySchedulableTaskCount()); map.put(CommonPropertyKeys.USE_COMPRESSION_KEY, versionedRemoteGroupPort.isUseCompression()); return new RemotePortSchema(map); } }
@Override public RemotePortSchema apply(VersionedRemoteGroupPort versionedRemoteGroupPort) { Map<String, Object> map = new HashMap<>(); // If a targetId is specified, it takes precedence over the original id final String targetId = versionedRemoteGroupPort.getTargetId(); map.put(ID_KEY, StringUtils.isNotBlank(targetId) ? targetId : versionedRemoteGroupPort.getIdentifier()); map.put(NAME_KEY, versionedRemoteGroupPort.getName()); map.put(CommonPropertyKeys.COMMENT_KEY, versionedRemoteGroupPort.getComments()); map.put(CommonPropertyKeys.MAX_CONCURRENT_TASKS_KEY, versionedRemoteGroupPort.getConcurrentlySchedulableTaskCount()); map.put(CommonPropertyKeys.USE_COMPRESSION_KEY, versionedRemoteGroupPort.isUseCompression()); return new RemotePortSchema(map); } }