Tm1Capabilities
import io.skipcheck.tm1.client.version.Tm1Capabilities; What a connected TM1 server supports, read from its own $metadata: the way
OData intends clients to detect features, with no version tables. It works for any TM1,
including versions the client has never seen.
// Does the server's $metadata define the cube's tm1.Reserve action?
Tm1Capability reserve = Tm1Capability.boundOperation("tm1.Cube", "tm1.Reserve").since("11.8.34");
return session.capabilities().map(capabilities -> capabilities.supports(reserve));
Members
of static | The capabilities a $metadata document describes. |
schemaVersion | The REST API schema version the server reports in Core.SchemaVersion, such as 11.8.35. |
productVersion | The server's product version, such as 11.8.03500.6. |
metadata | The server's $metadata, for anything the checks here don't cover. |
supports | Whether the server defines capability. |
check | Checks the server defines capability. |
toString |
of
staticstatic Tm1Capabilities of(CsdlDocument metadata, Tm1Version productVersion) The capabilities a $metadata document describes.
Parameters
metadata- the server's
$metadata, parsed productVersion- the server's version (
Server.ProductVersion), ornullif not known
Returns
- the capabilities
schemaVersion
Optional<String> schemaVersion() The REST API schema version the server reports in Core.SchemaVersion, such
as 11.8.35. Not the product version: a different number.
Returns
- the schema version, or empty if the server doesn't report one
productVersion
Optional<Tm1Version> productVersion() The server's product version, such as 11.8.03500.6.
Returns
- the version, or empty if not known
metadata
CsdlDocument metadata() The server's $metadata, for anything the checks here don't cover.
Returns
- the parsed document
supports
boolean supports(Tm1Capability capability) Whether the server defines capability.
Parameters
capability- what's needed
Returns
trueif the server's$metadatadefines it
check
Optional<Tm1UnsupportedOperationException> check(Tm1Capability capability, String server) Checks the server defines capability.
Parameters
capability- what's needed
server- the server, for the message, such as its service root
Returns
- empty if it's defined, otherwise the exception to fail with, saying what's missing and comparing schema versions when the version that added it is known
toString
String toString()Also in the Javadoc.