private Map<String, Revision> mapDtoToRevision(final Map<String, RevisionDTO> revisionMap) { final Map<String, Revision> revisions = new HashMap<>(revisionMap.size()); for (final Map.Entry<String, RevisionDTO> entry : revisionMap.entrySet()) { final RevisionDTO revisionDto = entry.getValue(); final Revision revision = new Revision(revisionDto.getVersion(), revisionDto.getClientId(), entry.getKey()); revisions.put(entry.getKey(), revision); } return revisions; }
/** * Converts a Revision DTO and an associated Component ID into a Revision object * * @param revisionDto the Revision DTO * @param componentId the ID of the component that the Revision DTO belongs to * @return a Revision that has the same client ID and Version as the Revision DTO and the Component ID specified */ protected Revision getRevision(final RevisionDTO revisionDto, final String componentId) { return new Revision(revisionDto.getVersion(), revisionDto.getClientId(), componentId); }
.collect(Collectors.toMap(Map.Entry::getKey, e -> { final RevisionDTO rev = e.getValue(); return new Revision(rev.getVersion(), rev.getClientId(), e.getKey()); })); final Set<Revision> requestRevisions = new HashSet<>(requestReferencingRevisions.values()); .collect(Collectors.toMap(Map.Entry::getKey, e -> { final RevisionDTO rev = e.getValue(); return new Revision(rev.getVersion(), rev.getClientId(), e.getKey()); }));
if (requestRegistryClientEntity.getRevision() == null || (requestRegistryClientEntity.getRevision().getVersion() == null || requestRegistryClientEntity.getRevision().getVersion() != 0)) { throw new IllegalArgumentException("A revision of 0 must be specified when creating a new Registry.");
final Revision groupRevision = new Revision(revisionDto.getVersion(), revisionDto.getClientId(), groupId); return withWriteLock( serviceFacade,
if (requestUserGroupEntity.getRevision() == null || (requestUserGroupEntity.getRevision().getVersion() == null || requestUserGroupEntity.getRevision().getVersion() != 0)) { throw new IllegalArgumentException("A revision of 0 must be specified when creating a new User Group."); Revision revision = new Revision(revisionDTO.getVersion(), revisionDTO.getClientId(), userGroupEntity.getComponent().getId());
if (requestUserEntity.getRevision() == null || (requestUserEntity.getRevision().getVersion() == null || requestUserEntity.getRevision().getVersion() != 0)) { throw new IllegalArgumentException("A revision of 0 must be specified when creating a new User."); Revision revision = new Revision(revisionDTO.getVersion(), revisionDTO.getClientId(), userEntity.getComponent().getId());
final Revision groupRevision = new Revision(revisionDto.getVersion(), revisionDto.getClientId(), groupId); return withWriteLock( serviceFacade,
if (requestAccessPolicyEntity.getRevision() == null || (requestAccessPolicyEntity.getRevision().getVersion() == null || requestAccessPolicyEntity.getRevision().getVersion() != 0)) { throw new IllegalArgumentException("A revision of 0 must be specified when creating a new Policy."); Revision revision = new Revision(revisionDTO.getVersion(), revisionDTO.getClientId(), accessPolicyEntity.getComponent().getId());
|| (requestRemoteProcessGroupEntity.getRevision().getVersion() == null || requestRemoteProcessGroupEntity.getRevision().getVersion() != 0)) { throw new IllegalArgumentException("A revision of 0 must be specified when creating a new Remote process group.");
if (requestPortEntity.getRevision() == null || (requestPortEntity.getRevision().getVersion() == null || requestPortEntity.getRevision().getVersion() != 0)) { throw new IllegalArgumentException("A revision of 0 must be specified when creating a new Input port.");
if (requestLabelEntity.getRevision() == null || (requestLabelEntity.getRevision().getVersion() == null || requestLabelEntity.getRevision().getVersion() != 0)) { throw new IllegalArgumentException("A revision of 0 must be specified when creating a new Label.");
if (requestPortEntity.getRevision() == null || (requestPortEntity.getRevision().getVersion() == null || requestPortEntity.getRevision().getVersion() != 0)) { throw new IllegalArgumentException("A revision of 0 must be specified when creating a new Output port.");
if (requestFunnelEntity.getRevision() == null || (requestFunnelEntity.getRevision().getVersion() == null || requestFunnelEntity.getRevision().getVersion() != 0)) { throw new IllegalArgumentException("A revision of 0 must be specified when creating a new Funnel.");
if (requestReportingTaskEntity.getRevision() == null || (requestReportingTaskEntity.getRevision().getVersion() == null || requestReportingTaskEntity.getRevision().getVersion() != 0)) { throw new IllegalArgumentException("A revision of 0 must be specified when creating a new Reporting task.");
if (requestProcessorEntity.getRevision() == null || (requestProcessorEntity.getRevision().getVersion() == null || requestProcessorEntity.getRevision().getVersion() != 0)) { throw new IllegalArgumentException("A revision of 0 must be specified when creating a new Processor.");
|| (requestControllerServiceEntity.getRevision().getVersion() == null || requestControllerServiceEntity.getRevision().getVersion() != 0)) { throw new IllegalArgumentException("A revision of 0 must be specified when creating a new Controller service.");
|| (requestControllerServiceEntity.getRevision().getVersion() == null || requestControllerServiceEntity.getRevision().getVersion() != 0)) { throw new IllegalArgumentException("A revision of 0 must be specified when creating a new Controller service.");
if (requestConnectionEntity.getRevision() == null || (requestConnectionEntity.getRevision().getVersion() == null || requestConnectionEntity.getRevision().getVersion() != 0)) { throw new IllegalArgumentException("A revision of 0 must be specified when creating a new Connection.");
if (requestProcessGroupEntity.getRevision() == null || (requestProcessGroupEntity.getRevision().getVersion() == null || requestProcessGroupEntity.getRevision().getVersion() != 0)) { throw new IllegalArgumentException("A revision of 0 must be specified when creating a new Process group."); final RevisionDTO revisionDto = entity.getRevision(); final String newGroupId = entity.getComponent().getId(); final Revision newGroupRevision = new Revision(revisionDto.getVersion(), revisionDto.getClientId(), newGroupId);