public SchemaVersion(String schemaText, String description, Byte initialState, byte [] stateDetails) { this.description = description; this.schemaText = schemaText; this.initialState = initialState != null ? initialState : SchemaVersionLifecycleStates.ENABLED.getId(); this.stateDetails = stateDetails; }
public SchemaVersion(String schemaText, String description, Byte initialState, byte [] stateDetails) { this.description = description; this.schemaText = schemaText; this.initialState = initialState != null ? initialState : SchemaVersionLifecycleStates.ENABLED.getId(); this.stateDetails = stateDetails; }
public SchemaVersionInfo(Long id, String name, Integer version, Long schemaMetadataId, String schemaText, Long timestamp, String description, Byte stateId) { this.id = id; this.name = name; this.schemaMetadataId = schemaMetadataId; this.description = description; this.version = version; this.schemaText = schemaText; this.timestamp = timestamp; this.stateId = stateId == null ? SchemaVersionLifecycleStates.ENABLED.getId() : stateId; }
public SchemaVersionInfo(Long id, String name, Integer version, Long schemaMetadataId, String schemaText, Long timestamp, String description, Byte stateId) { this.id = id; this.name = name; this.schemaMetadataId = schemaMetadataId; this.description = description; this.version = version; this.schemaText = schemaText; this.timestamp = timestamp; this.stateId = stateId == null ? SchemaVersionLifecycleStates.ENABLED.getId() : stateId; }
public SchemaVersionInfo getLatestEnabledSchemaVersionInfo(String schemaBranchName, String schemaName) throws SchemaNotFoundException, SchemaBranchNotFoundException { Preconditions.checkNotNull(schemaBranchName, "Schema branch name can't be null"); Preconditions.checkNotNull(schemaName, "schemaName can't be null"); return getLatestSchemaVersionInfo(schemaBranchName, schemaName, SchemaVersionLifecycleStates.ENABLED.getId()); }
@Path("/review/technical/schema/{versionId}/accept") @POST @Timed public Response declineTechnicalReview(@ApiParam(value = "Details about schema version",required = true) @PathParam("versionId") Long schemaVersionId) { return transition(schemaVersionId, SchemaVersionLifecycleStates.REVIEWED.getId(), "Reviewed by :- M and N" ); }
@Path("/review/technical/schema/{versionId}/modify") @POST @Timed public Response changesRequiredTechnicalReview(@ApiParam(value = "Details about schema version",required = true) @PathParam("versionId") Long schemaVersionId) { return transition(schemaVersionId, SchemaVersionLifecycleStates.CHANGES_REQUIRED.getId(), "Changes requested by - N" ); }
@Path("/review/peer/schema/{versionId}/modify") @POST @Timed public Response changesRequiredPeerReview(@ApiParam(value = "Details about schema version",required = true) @PathParam("versionId") Long schemaVersionId) { return transition(schemaVersionId, SchemaVersionLifecycleStates.CHANGES_REQUIRED.getId(), "Changes requested by - B" ); }
private static Pair<SchemaVersionLifecycleStateTransition, SchemaVersionLifecycleStateAction> createDisableAction(Byte sourceStateId) { return Pair.of(new SchemaVersionLifecycleStateTransition(sourceStateId, DISABLED.getId(), "Disable", "Disables the schema version"), context -> { try { transitionToDisableState(context); } catch (SchemaNotFoundException e) { throw new SchemaLifecycleException(e); } }); }
private static Pair<SchemaVersionLifecycleStateTransition, SchemaVersionLifecycleStateAction> createStartReviewTransitionActionPair(Byte sourceStateId) { return Pair.of(new SchemaVersionLifecycleStateTransition(sourceStateId, START_REVIEW.getId(), "StartReview", "Starts review state"), context -> { try { transitionToStartReview(context); } catch (SchemaNotFoundException e) { throw new SchemaLifecycleException(e); } }); }
private static Pair<SchemaVersionLifecycleStateTransition, SchemaVersionLifecycleStateAction> createDisableAction(Byte sourceStateId) { return Pair.of(new SchemaVersionLifecycleStateTransition(sourceStateId, DISABLED.getId(), "Disable", "Disables the schema version"), context -> { try { transitionToDisableState(context); } catch (SchemaNotFoundException e) { throw new SchemaLifecycleException(e); } }); }
private static Pair<SchemaVersionLifecycleStateTransition, SchemaVersionLifecycleStateAction> createArchiveTransitionAction(Byte sourceStateId) { return Pair.of(new SchemaVersionLifecycleStateTransition(sourceStateId, ARCHIVED.getId(), "Archive", "Archives the schema version"), context -> { try { transitionToArchiveState(context); } catch (SchemaNotFoundException e) { throw new SchemaLifecycleException(e); } }); }
private static Pair<SchemaVersionLifecycleStateTransition, SchemaVersionLifecycleStateAction> createStartReviewTransitionActionPair(Byte sourceStateId) { return Pair.of(new SchemaVersionLifecycleStateTransition(sourceStateId, START_REVIEW.getId(), "StartReview", "Starts review state"), context -> { try { transitionToStartReview(context); } catch (SchemaNotFoundException e) { throw new SchemaLifecycleException(e); } }); }
private static Pair<SchemaVersionLifecycleStateTransition, SchemaVersionLifecycleStateAction> createArchiveTransitionAction(Byte sourceStateId) { return Pair.of(new SchemaVersionLifecycleStateTransition(sourceStateId, ARCHIVED.getId(), "Archive", "Archives the schema version"), context -> { try { transitionToArchiveState(context); } catch (SchemaNotFoundException e) { throw new SchemaLifecycleException(e); } }); }
private static Pair<SchemaVersionLifecycleStateTransition, SchemaVersionLifecycleStateAction> createEnableTransitionAction(Byte sourceStateId) { return Pair.of(new SchemaVersionLifecycleStateTransition(sourceStateId, ENABLED.getId(), "Enable", "Enables the schema version"), context -> { try { transitionToEnableState(context); } catch (SchemaNotFoundException | IncompatibleSchemaException | SchemaBranchNotFoundException e) { throw new SchemaLifecycleException(e); } }); }
private static Pair<SchemaVersionLifecycleStateTransition, SchemaVersionLifecycleStateAction> createEnableTransitionAction(Byte sourceStateId) { return Pair.of(new SchemaVersionLifecycleStateTransition(sourceStateId, ENABLED.getId(), "Enable", "Enables the schema version"), context -> { try { transitionToEnableState(context); } catch (SchemaNotFoundException | IncompatibleSchemaException | SchemaBranchNotFoundException e) { throw new SchemaLifecycleException(e); } }); }
private static Pair<SchemaVersionLifecycleStateTransition, SchemaVersionLifecycleStateAction> createDeleteTransitionActionPair( Byte sourceStateId) { return Pair.of(new SchemaVersionLifecycleStateTransition(sourceStateId, DELETED.getId(), "Delete", "Deletes the schema version"), context -> { try { transitionToDeleteState(context); } catch (SchemaNotFoundException e) { throw new SchemaLifecycleException(e); } }); }
private static Pair<SchemaVersionLifecycleStateTransition, SchemaVersionLifecycleStateAction> createDeleteTransitionActionPair( Byte sourceStateId) { return Pair.of(new SchemaVersionLifecycleStateTransition(sourceStateId, DELETED.getId(), "Delete", "Deletes the schema version"), context -> { try { transitionToDeleteState(context); } catch (SchemaNotFoundException e) { throw new SchemaLifecycleException(e); } }); }
public void registerReviewedState(SchemaVersionLifecycleStateMachine.Builder builder) { builder.transition(new SchemaVersionLifecycleStateTransition(CustomReviewCycleStates.TECHNICAL_LEAD_REVIEW_STATE.getId(), SchemaVersionLifecycleStates.REVIEWED.getId(), SchemaVersionLifecycleStates.REVIEWED.getName(), SchemaVersionLifecycleStates.REVIEWED.getDescription()), (SchemaVersionLifecycleContext context) -> { // Plugin a custom code to trigger as a part of the state transition, here we just record the state change in the database LOG.debug("Making a transition from 'TECHNICAL LEAD REVIEW' to 'REVIEWED' state"); transitionToState(context, SchemaVersionLifecycleStates.REVIEWED); }); }
public void registerChangesRequiredState(SchemaVersionLifecycleStateMachine.Builder builder) { builder.transition(new SchemaVersionLifecycleStateTransition(CustomReviewCycleStates.PEER_REVIEW_STATE.getId(), SchemaVersionLifecycleStates.CHANGES_REQUIRED.getId(), SchemaVersionLifecycleStates.CHANGES_REQUIRED.getName(), SchemaVersionLifecycleStates.CHANGES_REQUIRED.getDescription()), (SchemaVersionLifecycleContext context) -> { // Plugin a custom code to trigger as a part of the state transition, here we just record the state change in the database LOG.debug("Making a transition from 'PEER REVIEW' to 'REJECTED' state"); transitionToState(context, SchemaVersionLifecycleStates.CHANGES_REQUIRED); }); builder.transition(new SchemaVersionLifecycleStateTransition(CustomReviewCycleStates.TECHNICAL_LEAD_REVIEW_STATE.getId(), SchemaVersionLifecycleStates.CHANGES_REQUIRED.getId(), SchemaVersionLifecycleStates.CHANGES_REQUIRED.getName(), SchemaVersionLifecycleStates.CHANGES_REQUIRED.getDescription()), (SchemaVersionLifecycleContext context) -> { // Plugin a custom code to trigger as a part of the state transition, here we just record the state change in the database LOG.debug("Making a transition from 'TECHNICAL LEAD REVIEW' to 'REJECTED' state"); transitionToState(context, SchemaVersionLifecycleStates.CHANGES_REQUIRED); }); }