Skip to content

Commit

Permalink
Restoring previous REST API behavior (#302)
Browse files Browse the repository at this point in the history
Former-commit-id: b2fe84e
  • Loading branch information
silvanheller authored May 13, 2022
1 parent d245d89 commit c504abe
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 44 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ allprojects {
group = 'org.vitrivr'

/* Our current version, on dev branch this should always be release+1-SNAPSHOT */
version = '3.11.2'
version = '3.11.3'

apply plugin: 'java-library'
apply plugin: 'maven-publish'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@
*/
public record Ping(StatusEnum status, @JsonProperty(required = true) MessageType messageType) implements Message {

public Ping {
if (messageType != MessageType.PING) {
throw new IllegalStateException("MessageType was not PING, but " + messageType);
}
}

public Ping(StatusEnum status) {
this(status, MessageType.PING);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@
*/
public record MoreLikeThisQuery(@JsonProperty(required = true) String segmentId, @JsonProperty(required = true) List<String> categories, List<MetadataAccessSpecification> metadataAccessSpec, QueryConfig config, @JsonProperty(required = true) MessageType messageType) implements Query {

public MoreLikeThisQuery {
if (messageType != MessageType.Q_MLT) {
throw new IllegalStateException("MessageType was not Q_MLT, but " + messageType);
}
}

}


Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,4 @@
*/
public record NeighboringSegmentQuery(@JsonProperty(required = true) String segmentId, @JsonProperty(required = true) Integer count, List<MetadataAccessSpecification> metadataAccessSpec, QueryConfig config, @JsonProperty(required = true) MessageType messageType) implements Query {

public NeighboringSegmentQuery {
if (messageType != MessageType.Q_NESEG) {
throw new IllegalStateException("MessageType was not Q_NESEG, but " + messageType);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,4 @@
*/
public record SegmentQuery(@JsonProperty(required = true) String segmentId, @JsonProperty(required = true) List<MetadataAccessSpecification> metadataAccessSpec, QueryConfig config, @JsonProperty(required = true) MessageType messageType) implements Query {

public SegmentQuery {
if (messageType != MessageType.Q_SEG) {
throw new IllegalStateException("MessageType was not Q_SEG, but " + messageType);
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@
/**
* A {@link SimilarityQuery} contains a list of {@link QueryTerm}s. This object represents a similarity-query message, i.e. a request for a similarity-search.
*/
public record SimilarityQuery(@JsonProperty(required = true) List<QueryTerm> terms, @JsonProperty(required = true) List<MetadataAccessSpecification> metadataAccessSpec, QueryConfig config, MessageType messageType) implements Query {

public SimilarityQuery {
if (messageType != MessageType.Q_SIM) {
throw new IllegalStateException("MessageType was not Q_SIM, but " + messageType);
}
}
public record SimilarityQuery(@JsonProperty(required = true) List<QueryTerm> terms, List<MetadataAccessSpecification> metadataAccessSpec, QueryConfig config, MessageType messageType) implements Query {

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,7 @@
/**
* This object represents a temporal-query message of temporal query version 2, i.e. a request for a temporally staged similarity-search.
*/
public record TemporalQuery(@JsonProperty(required = true) List<StagedSimilarityQuery> queries, @JsonProperty(required = true) List<MetadataAccessSpecification> metadataAccessSpec, TemporalQueryConfig config, @JsonProperty(required = true) MessageType messageType) implements Query {

public TemporalQuery {
if (messageType != MessageType.Q_TEMPORAL) {
throw new IllegalStateException("MessageType was not Q_TEMPORAL, but " + messageType);
}
}
public record TemporalQuery(@JsonProperty(required = true) List<StagedSimilarityQuery> queries, List<MetadataAccessSpecification> metadataAccessSpec, TemporalQueryConfig config, @JsonProperty(required = true) MessageType messageType) implements Query {

/**
* Convenience getter for timeDistances.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@
*/
public record StartSessionMessage(Credentials credentials, MessageType messageType) implements Message {

public StartSessionMessage {
if (messageType != MessageType.SESSION_START) {
throw new IllegalStateException("MessageType was not SESSION_START, but " + messageType);
}
}

public StartSessionMessage(Credentials credentials) {
this(credentials, MessageType.SESSION_START);
}
Expand Down

0 comments on commit c504abe

Please sign in to comment.