public interface Connection extends AutoCloseable
This interface represents a connection to the API server.
Modifier and Type | Method and Description |
---|---|
String |
authenticate()
Return token which can be used for authentication instead of credentials.
|
void |
close(boolean logout)
Releases the resources used by this connection.
|
<TYPE> TYPE |
followLink(TYPE object)
Follows the
href attribute of the given object, retrieves the target object and returns it. |
boolean |
isLink(Object object)
Indicates if the given object is a link.
|
SystemService |
systemService()
Returns a reference to the root of the services tree.
|
close
SystemService systemService()
Returns a reference to the root of the services tree.
boolean isLink(Object object)
Indicates if the given object is a link. An object is a link if it has an href
attribute.
object
- the object to checktrue
iff the object is a link<TYPE> TYPE followLink(TYPE object)
Follows the href
attribute of the given object, retrieves the target object and returns it.
TYPE
- the type of the target of the linkobject
- the object containing the href
attributehref
String authenticate()
Return token which can be used for authentication instead of credentials.
It will be created, if it not exists, yet. By default the token will be
revoked when the connection is closed, unless the logout
parameter of
the close
method is false
.
Copyright © 2016. All rights reserved.