Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add no-op query service implementation #31

Merged
merged 1 commit into from
May 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 108 additions & 0 deletions src/main/java/com/glencoesoftware/omero/ms/core/NoopQueryImpl.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
/*
* Copyright (C) 2024 Glencoe Software, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

package com.glencoesoftware.omero.ms.core;

import java.util.List;

import ome.api.IQuery;
import ome.conditions.ApiUsageException;
import ome.conditions.ValidationException;
import ome.model.IObject;
import ome.parameters.Filter;
import ome.parameters.Parameters;

/**
* No-op server side internal query service implementation to shim certain
* services for which it is required but not actually used.
*/
public class NoopQueryImpl implements IQuery {

public NoopQueryImpl() {
}

@Override
public <T extends IObject> T get(Class<T> klass, long id)
throws ValidationException {
throw new IllegalArgumentException("Not implemented");
}

@Override
public <T extends IObject> T find(Class<T> klass, long id) {
throw new IllegalArgumentException("Not implemented");
}

@Override
public <T extends IObject> List<T> findAll(Class<T> klass, Filter filter) {
throw new IllegalArgumentException("Not implemented");
}

@Override
public <T extends IObject> T findByExample(T example)
throws ApiUsageException {
throw new IllegalArgumentException("Not implemented");
}

@Override
public <T extends IObject> List<T> findAllByExample(T example,
Filter filter) {
throw new IllegalArgumentException("Not implemented");
}

@Override
public <T extends IObject> T findByString(Class<T> klass, String field,
String value) throws ApiUsageException {
throw new IllegalArgumentException("Not implemented");
}

@Override
public <T extends IObject> List<T> findAllByString(Class<T> klass,
String field, String stringValue, boolean caseSensitive,
Filter filter) {
throw new IllegalArgumentException("Not implemented");
}

@Override
public <T extends IObject> T findByQuery(String queryName,
Parameters parameters) throws ValidationException {
throw new IllegalArgumentException("Not implemented");
}

@Override
public <T extends IObject> List<T> findAllByQuery(String queryName,
Parameters parameters) {
throw new IllegalArgumentException("Not implemented");
}

@Override
public <T extends IObject> List<T> findAllByFullText(Class<T> type,
String query, Parameters parameters) {
throw new IllegalArgumentException("Not implemented");
}

@Override
public List<Object[]> projection(String query, Parameters parameters) {
throw new IllegalArgumentException("Not implemented");
}

@Override
public <T extends IObject> T refresh(T iObject) throws ApiUsageException {
throw new IllegalArgumentException("Not implemented");
}

}