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

refactor: remove deprecated methods from parameter extractor #2156

Merged
merged 2 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
import org.apache.streampipes.model.staticproperty.StaticProperty;
import org.apache.streampipes.model.staticproperty.StaticPropertyGroup;

import java.io.IOException;
import java.io.InputStream;
import java.util.List;

public interface IParameterExtractor {
Expand All @@ -48,23 +46,8 @@ public interface IParameterExtractor {

String selectedColor(String internalName);

@Deprecated(since = "0.90.0", forRemoval = true)
String fileContentsAsString(String internalName) throws IOException;

@Deprecated(since = "0.90.0", forRemoval = true)
byte[] fileContentsAsByteArray(String internalName) throws IOException;

@Deprecated(since = "0.90.0", forRemoval = true)
InputStream fileContentsAsStream(String internalName) throws IOException;

String selectedFilename(String internalName);

@Deprecated(since = "0.90.0", forRemoval = true)
String selectedFileFetchUrl(String internalName);

@Deprecated
<V> V selectedSingleValueFromRemote(String internalName, Class<V> targetClass);

<V> V selectedSingleValue(String internalName, Class<V> targetClass);

<V> V selectedSingleValueInternalName(String internalName, Class<V> targetClass);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@

import com.github.drapostolos.typeparser.TypeParser;

import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
Expand Down Expand Up @@ -150,55 +148,11 @@ public String selectedColor(String internalName) {
return getStaticPropertyByName(internalName, ColorPickerStaticProperty.class).getSelectedColor();
}

/**
* @deprecated This won't work after release 0.69.0 as all API requests against the core need to be authenticated.
* Use the StreamPipes Client File API instead (e.g., StreamPipesClientResolver.makeStreamPipesClientInstance()).
**/
@Override
@Deprecated(since = "0.90.0", forRemoval = true)
public String fileContentsAsString(String internalName) throws IOException {
throw new IllegalArgumentException(
"Deprecated as API requests need to be authenticated - use the StreamPipes Client file API instead.");
}

/**
* @deprecated This won't work after release 0.69.0 as all API requests against the core need to be authenticated.
* Use the StreamPipes Client File API instead (e.g., StreamPipesClientResolver.makeStreamPipesClientInstance()).
**/
@Override
@Deprecated(since = "0.90.0", forRemoval = true)
public byte[] fileContentsAsByteArray(String internalName) throws IOException {
throw new IllegalArgumentException(
"Deprecated as API requests need to be authenticated - use the StreamPipes Client file API instead.");
}

/**
* @deprecated This won't work after release 0.69.0 as all API requests against the core need to be authenticated.
* Use the StreamPipes Client File API instead (e.g., StreamPipesClientResolver.makeStreamPipesClientInstance()).
**/
@Override
@Deprecated(since = "0.90.0", forRemoval = true)
public InputStream fileContentsAsStream(String internalName) throws IOException {
throw new IllegalArgumentException(
"Deprecated as API requests need to be authenticated - use the StreamPipes Client file API instead.");
}

@Override
public String selectedFilename(String internalName) {
return getStaticPropertyByName(internalName, FileStaticProperty.class).getLocationPath();
}

/**
* @deprecated This won't work after release 0.69.0 as all API requests against the core need to be authenticated.
* Use the StreamPipes Client File API instead (e.g., StreamPipesClientResolver.makeStreamPipesClientInstance()).
**/
@Override
@Deprecated(since = "0.90.0", forRemoval = true)
public String selectedFileFetchUrl(String internalName) {
throw new IllegalArgumentException(
"Deprecated as API requests need to be authenticated - use the StreamPipes Client file API instead.");
}

private <V, T extends SelectionStaticProperty> V selectedSingleValue(String internalName, Class<V> targetClass,
Class<T> oneOfStaticProperty) {
return typeParser.parse(getStaticPropertyByName(internalName, oneOfStaticProperty)
Expand All @@ -210,16 +164,6 @@ private <V, T extends SelectionStaticProperty> V selectedSingleValue(String inte
.getName(), targetClass);
}


/**
* @deprecated Use {@link #selectedSingleValue(String, Class)} instead
*/
@Override
@Deprecated
public <V> V selectedSingleValueFromRemote(String internalName, Class<V> targetClass) {
return selectedSingleValue(internalName, targetClass);
}

@Override
public <V> V selectedSingleValue(String internalName, Class<V> targetClass) {
return selectedSingleValue(internalName, targetClass, OneOfStaticProperty.class);
Expand Down