skipcheck

TM1 client · Docs · Versions and capabilities

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 staticThe capabilities a $metadata document describes.
schemaVersionThe REST API schema version the server reports in Core.SchemaVersion, such as 11.8.35.
productVersionThe server's product version, such as 11.8.03500.6.
metadataThe server's $metadata, for anything the checks here don't cover.
supportsWhether the server defines capability.
checkChecks the server defines capability.
toString

of

static
static 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), or null if 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

true if the server's $metadata defines 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.