BimWorksClientFactory
CLASS in nl.bimbase.bimworks.client.
API catalogue · nl.bimbase.bimworks.client · CLASS
public class BimWorksClientFactoryFactory for BimWorksClient objects. An instance of this class is supposed to be a long-lived object.
One BimWorksClientFactory is required per endpoint (in case you are connecting to multiple BIM.works environments from the same client).
Inheritance and interfaces#
java.lang.AutoCloseable
Members#
| Member | Kind | Description |
|---|---|---|
| BimWorksClientFactory(String) | CONSTRUCTOR | |
| BimWorksClientFactory(String, ClientSettings) | CONSTRUCTOR | |
| setApplication(String, String) | METHOD | Names your application, sent with every request of the clients created afterwards (the app of the X-BIMworks-Client header and the end of the User-Agent). … |
| excludePlatformInfo() | METHOD | Leaves the Java version and the operating system out of what the clients created afterwards send. The SDK's own name, version and build are always sent: supp… |
| createAnonymousClient() | METHOD | Create a new BimWorksClient with anonymous access, only a very small set of API calls is allowed |
| createClientWithUsernamePassword(String, String) | METHOD | Login to the API with a username / password. This is generally not the recommended way of connecting, the preferrable option is to use an API Token. See also… |
| createClientWithApiToken(String) | METHOD | Create a new BimWorksClient based on an API Token. API Tokens in BIM.works are long-lived tokens that can be revoked. See general documentation for more info… |
| createClientWithAuth(ObjectNode) | METHOD | Create a new BimWorksClient based on an Auth Token. Auth Tokens are short-lived tokens. See general documentation for more information. |
| getAddress() | METHOD | |
| toString() | METHOD | |
| close() | METHOD | |
| createClient(Credentials) | METHOD | Alternative way of creating BimWorksClient objects, generally @see BimWorksClientFactory.createClientWithApiToken and @see BimWorksClientFactory.createClient… |
BimWorksClientFactory(String)#
public BimWorksClientFactory(java.lang.String address)Parameters#
| Name | Type | Description |
|---|---|---|
address |
java.lang.String |
The address of your BIM.works environment. In the form of https://host[:port][/context_path] |
BimWorksClientFactory(String, ClientSettings)#
public BimWorksClientFactory(java.lang.String address, nl.sascom.backplane.client.ClientSettings settings)Parameters#
| Name | Type | Description |
|---|---|---|
address |
java.lang.String |
|
settings |
nl.sascom.backplane.client.ClientSettings |
setApplication(String, String)#
public nl.bimbase.bimworks.client.BimWorksClientFactory setApplication(java.lang.String name, java.lang.String version)Names your application, sent with every request of the clients created afterwards (the app of the
X-BIMworks-Client header and the end of the User-Agent). It tells BIM.works support which of your integrations
made a call. Letters, digits and . _ + -; anything else becomes _.
Parameters#
| Name | Type | Description |
|---|---|---|
name |
java.lang.String |
your application, e.g. acme-sync |
version |
java.lang.String |
its version, or null |
Returns#
this factory
excludePlatformInfo()#
public nl.bimbase.bimworks.client.BimWorksClientFactory excludePlatformInfo()Leaves the Java version and the operating system out of what the clients created afterwards send. The SDK's own name, version and build are always sent: support needs them.
Returns#
this factory
createAnonymousClient()#
public nl.bimbase.bimworks.client.BimWorksClient createAnonymousClient() throws nl.bimbase.bimworks.client.BimWorksExceptionCreate a new BimWorksClient with anonymous access, only a very small set of API calls is allowed
Returns#
A new BimWorksClient instance
Exceptions#
BimWorksException—
createClientWithUsernamePassword(String, String)#
public nl.bimbase.bimworks.client.BimWorksClient createClientWithUsernamePassword(java.lang.String username, java.lang.String password) throws nl.bimbase.bimworks.client.BimWorksExceptionLogin to the API with a username / password. This is generally not the recommended way of connecting, the preferrable option is to use an API Token.
See also: BimWorksClientFactory#createClientWithApiToken
Parameters#
| Name | Type | Description |
|---|---|---|
username |
java.lang.String |
Your username, always a valid email address format (it does not always have to exist) |
password |
java.lang.String |
You password |
Returns#
A new BimWorksClient instance on successful authentication
Exceptions#
BimWorksException—
createClientWithApiToken(String)#
public nl.bimbase.bimworks.client.BimWorksClient createClientWithApiToken(java.lang.String apiToken) throws nl.bimbase.bimworks.client.BimWorksExceptionCreate a new BimWorksClient based on an API Token. API Tokens in BIM.works are long-lived tokens that can be revoked. See general documentation for more information.
Parameters#
| Name | Type | Description |
|---|---|---|
apiToken |
java.lang.String |
Your API Token. API Tokens can be created with API calls in @see nl.bimbase.bimworks.client.apis.AuthApi. API Token are generally created using the BIM.works UI, as you generally do it once for each application. |
Returns#
A new BimWorksClient instance on successful authentication
Exceptions#
BimWorksException—
createClientWithAuth(ObjectNode)#
public nl.bimbase.bimworks.client.BimWorksClient createClientWithAuth(com.fasterxml.jackson.databind.node.ObjectNode auth) throws nl.bimbase.bimworks.client.BimWorksExceptionCreate a new BimWorksClient based on an Auth Token. Auth Tokens are short-lived tokens. See general documentation for more information.
Parameters#
| Name | Type | Description |
|---|---|---|
auth |
com.fasterxml.jackson.databind.node.ObjectNode |
The AuthToken as a Jackson ObjectNode |
Returns#
A new BimWorksClient instance on successful authentication
Exceptions#
BimWorksException—
getAddress()#
public java.lang.String getAddress()Returns#
The address with which this factory was initialized
toString()#
@java.lang.Override
public java.lang.String toString()close()#
@java.lang.Override
public void close() throws java.lang.ExceptioncreateClient(Credentials)#
public nl.bimbase.bimworks.client.BimWorksClient createClient(nl.bimbase.bimworks.Credentials credentials) throws nl.bimbase.bimworks.client.BimWorksExceptionAlternative way of creating BimWorksClient objects, generally @see BimWorksClientFactory.createClientWithApiToken and @see BimWorksClientFactory.createClientWithAuth are preferred.
Parameters#
| Name | Type | Description |
|---|---|---|
credentials |
nl.bimbase.bimworks.Credentials |
The credentials |
Returns#
A new BimWorksClient instance on successful authentication
Exceptions#
Exception—
Inherited members#
java.lang.Object#equals(java.lang.Object)java.lang.Object#wait(long)java.lang.Object#wait(long,int)java.lang.Object#wait()java.lang.Object#finalize()java.lang.Object#getClass()java.lang.Object#hashCode()java.lang.Object#clone()java.lang.Object#notify()java.lang.Object#notifyAll()