public class RESTROIFinder extends java.lang.Object implements ROIFinder, java.lang.AutoCloseable
| Constructor and Description |
|---|
RESTROIFinder()
Default constructor for serialization.
|
RESTROIFinder(java.lang.String url)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addHeader(java.lang.String key,
java.lang.String val) |
void |
close()
Closes this resource, relinquishing any underlying resources.
|
double[] |
decodeData(java.lang.String enc)
Decodes a Base64 string into its input array
|
java.lang.String |
encodeData(double[] data)
Base64 encoding of an input array
|
long |
getConnectionTimeout() |
java.util.Map<java.lang.String,java.lang.String> |
getHeader() |
java.util.Map<java.lang.String,java.lang.Object> |
getObjectMap()
Creates a map of the important fields for the instance, suitable for serialization.
|
java.lang.String |
getPassword() |
long |
getSerializationVersion()
Returns the current version of the serialization format.
|
long |
getSocketTimeout() |
java.lang.String |
getUrl() |
java.lang.String |
getUsername() |
int |
getVersion()
Returns the current class version.
|
void |
initCurrentVersion(java.util.Map<java.lang.String,java.lang.Object> objectMap)
Initializes an instance with a current-version object graph.
|
boolean |
isROI(Dataset dataset)
Examine a dataset and return whether or not it seems to contain a region of interest (ROI)
|
boolean |
isROI(double[] data)
Examine an array of data and report whether it appears to contain a region of interest (ROI)
|
void |
legacyRead(com.esotericsoftware.kryo.Kryo kryo,
com.esotericsoftware.kryo.io.Input input) |
void |
legacyWrite(com.esotericsoftware.kryo.Kryo kryo,
com.esotericsoftware.kryo.io.Output output) |
boolean |
saveCredentials()
Reports the current basic auth serialization settings.
|
void |
setConnectionTimeout(long connectionTimeout) |
void |
setHeader(java.util.Map<java.lang.String,java.lang.String> header) |
void |
setHttpClient(org.apache.http.client.HttpClient newClient)
Sets the HTTPClient implementation to use.
|
void |
setPassword(java.lang.String password) |
void |
setSaveCredentials(boolean save)
Sets whether or not to save basic auth credentials during serialization.
|
void |
setSocketTimeout(long socketTimeout) |
void |
setUrl(java.lang.String url) |
void |
setUsername(java.lang.String username) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinit, initPreviousVersion, initUnknownVersion, load, read, save, writepublic RESTROIFinder(java.lang.String url)
url - REST API endpoint e.g. http://127.0.0.1:8080/api/isroipublic RESTROIFinder()
public boolean isROI(double[] data)
public boolean isROI(Dataset dataset)
public long getSerializationVersion()
ObjectMapgetSerializationVersion in interface ObjectMappublic int getVersion()
ObjectMapgetVersion in interface ObjectMappublic java.util.Map<java.lang.String,java.lang.Object> getObjectMap()
ObjectMapgetObjectMap in interface ObjectMappublic void initCurrentVersion(java.util.Map<java.lang.String,java.lang.Object> objectMap)
ObjectMapinitCurrentVersion in interface ObjectMapobjectMap - object graph for initializationpublic void legacyWrite(com.esotericsoftware.kryo.Kryo kryo,
com.esotericsoftware.kryo.io.Output output)
public void legacyRead(com.esotericsoftware.kryo.Kryo kryo,
com.esotericsoftware.kryo.io.Input input)
public void close()
throws java.lang.Exception
try-with-resources statement.
While this interface method is declared to throw Exception, implementers are strongly encouraged to
declare concrete implementations of the close method to
throw more specific exceptions, or to throw no exception at all
if the close operation cannot fail.
Cases where the close operation may fail require careful
attention by implementers. It is strongly advised to relinquish
the underlying resources and to internally mark the
resource as closed, prior to throwing the exception. The close method is unlikely to be invoked more than once and so
this ensures that the resources are released in a timely manner.
Furthermore it reduces problems that could arise when the resource
wraps, or is wrapped, by another resource.
Implementers of this interface are also strongly advised
to not have the close method throw InterruptedException.
This exception interacts with a thread's interrupted status,
and runtime misbehavior is likely to occur if an InterruptedException is suppressed.
More generally, if it would cause problems for an
exception to be suppressed, the AutoCloseable.close
method should not throw it.
Note that unlike the close
method of Closeable, this close method
is not required to be idempotent. In other words,
calling this close method more than once may have some
visible side effect, unlike Closeable.close which is
required to have no effect if called more than once.
However, implementers of this interface are strongly encouraged
to make their close methods idempotent.
close in interface java.lang.AutoCloseablejava.lang.Exception - if this resource cannot be closedpublic java.lang.String getUrl()
public void setUrl(java.lang.String url)
public java.util.Map<java.lang.String,java.lang.String> getHeader()
public void setHeader(java.util.Map<java.lang.String,java.lang.String> header)
public void addHeader(java.lang.String key,
java.lang.String val)
public java.lang.String getUsername()
public void setUsername(java.lang.String username)
public java.lang.String getPassword()
public void setPassword(java.lang.String password)
public long getConnectionTimeout()
public void setConnectionTimeout(long connectionTimeout)
public long getSocketTimeout()
public void setSocketTimeout(long socketTimeout)
public java.lang.String encodeData(double[] data)
throws java.io.IOException
data - data to encodejava.io.IOException - if unable to encode data or an I/O error occurspublic double[] decodeData(java.lang.String enc)
throws java.io.UnsupportedEncodingException
enc - encoded stringjava.io.UnsupportedEncodingException - UTF-8 Encoding is not supported (!).public void setHttpClient(org.apache.http.client.HttpClient newClient)
newClient - new clientpublic boolean saveCredentials()
public void setSaveCredentials(boolean save)
save - true to save username and password, false otherwise.