---
title: BimWorksClientFactory
summary: CLASS in nl.bimbase.bimworks.client.
order: 10
languages: [java]
sdk-package: Java · nl.bimbase.bimworks.client
---

# BimWorksClientFactory

[[page:reference/java/api|API catalogue]] · `nl.bimbase.bimworks.client` · CLASS

````java sdk=java sdk-namespace="nl.bimbase.bimworks.client"
public class BimWorksClientFactory
````

Factory 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 |
|---|---|---|
| [[page:reference/java/nl-bimbase-bimworks-client/bimworksclientfactory-5cc371b0#member-init-be911605902f|BimWorksClientFactory(String)]] | CONSTRUCTOR |  |
| [[page:reference/java/nl-bimbase-bimworks-client/bimworksclientfactory-5cc371b0#member-init-99be354bc2af|BimWorksClientFactory(String, ClientSettings)]] | CONSTRUCTOR |  |
| [[page:reference/java/nl-bimbase-bimworks-client/bimworksclientfactory-5cc371b0#member-setapplication-640a227493c5|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). … |
| [[page:reference/java/nl-bimbase-bimworks-client/bimworksclientfactory-5cc371b0#member-excludeplatforminfo-e9ef4f8ee3c3|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… |
| [[page:reference/java/nl-bimbase-bimworks-client/bimworksclientfactory-5cc371b0#member-createanonymousclient-ba6ef4d3aa3c|createAnonymousClient()]] | METHOD | Create a new BimWorksClient with anonymous access, only a very small set of API calls is allowed |
| [[page:reference/java/nl-bimbase-bimworks-client/bimworksclientfactory-5cc371b0#member-createclientwithusernamepassword-b9a480ef80f0|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… |
| [[page:reference/java/nl-bimbase-bimworks-client/bimworksclientfactory-5cc371b0#member-createclientwithapitoken-ab6a8abc28cb|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… |
| [[page:reference/java/nl-bimbase-bimworks-client/bimworksclientfactory-5cc371b0#member-createclientwithauth-2dc84120f3c0|createClientWithAuth(ObjectNode)]] | METHOD | Create a new BimWorksClient based on an Auth Token. Auth Tokens are short-lived tokens. See general documentation for more information. |
| [[page:reference/java/nl-bimbase-bimworks-client/bimworksclientfactory-5cc371b0#member-getaddress-a371e6e4e4f8|getAddress()]] | METHOD |  |
| [[page:reference/java/nl-bimbase-bimworks-client/bimworksclientfactory-5cc371b0#member-tostring-60bda8021dcc|toString()]] | METHOD |  |
| [[page:reference/java/nl-bimbase-bimworks-client/bimworksclientfactory-5cc371b0#member-close-8b86cc4d51f5|close()]] | METHOD |  |
| [[page:reference/java/nl-bimbase-bimworks-client/bimworksclientfactory-5cc371b0#member-createclient-4d783d3187f7|createClient(Credentials)]] | METHOD | Alternative way of creating BimWorksClient objects, generally @see BimWorksClientFactory.createClientWithApiToken and @see BimWorksClientFactory.createClient… |

## `BimWorksClientFactory(String)` {#member-init-be911605902f}

````java sdk=java sdk-namespace="nl.bimbase.bimworks.client"
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)` {#member-init-99be354bc2af}

````java sdk=java sdk-namespace="nl.bimbase.bimworks.client"
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)` {#member-setapplication-640a227493c5}

````java sdk=java sdk-namespace="nl.bimbase.bimworks.client"
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()` {#member-excludeplatforminfo-e9ef4f8ee3c3}

````java sdk=java sdk-namespace="nl.bimbase.bimworks.client"
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()` {#member-createanonymousclient-ba6ef4d3aa3c}

````java sdk=java sdk-namespace="nl.bimbase.bimworks.client"
public nl.bimbase.bimworks.client.BimWorksClient createAnonymousClient() throws nl.bimbase.bimworks.client.BimWorksException
````

Create 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)` {#member-createclientwithusernamepassword-b9a480ef80f0}

````java sdk=java sdk-namespace="nl.bimbase.bimworks.client"
public nl.bimbase.bimworks.client.BimWorksClient createClientWithUsernamePassword(java.lang.String username, java.lang.String password) throws nl.bimbase.bimworks.client.BimWorksException
````

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: 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)` {#member-createclientwithapitoken-ab6a8abc28cb}

````java sdk=java sdk-namespace="nl.bimbase.bimworks.client"
public nl.bimbase.bimworks.client.BimWorksClient createClientWithApiToken(java.lang.String apiToken) throws nl.bimbase.bimworks.client.BimWorksException
````

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 information.

### Parameters

| Name | Type | Description |
|---|---|---|
| `apiToken` | `java.lang.String` | Your API Token. API Tokens can be created with API calls in @see [[page:reference/java/nl-bimbase-bimworks-client-apis/authapi-a09c755c|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)` {#member-createclientwithauth-2dc84120f3c0}

````java sdk=java sdk-namespace="nl.bimbase.bimworks.client"
public nl.bimbase.bimworks.client.BimWorksClient createClientWithAuth(com.fasterxml.jackson.databind.node.ObjectNode auth) throws nl.bimbase.bimworks.client.BimWorksException
````

Create 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()` {#member-getaddress-a371e6e4e4f8}

````java sdk=java sdk-namespace="nl.bimbase.bimworks.client"
public java.lang.String getAddress()
````



### Returns

The address with which this factory was initialized

## `toString()` {#member-tostring-60bda8021dcc}

````java sdk=java sdk-namespace="nl.bimbase.bimworks.client"
@java.lang.Override
public java.lang.String toString()
````



## `close()` {#member-close-8b86cc4d51f5}

````java sdk=java sdk-namespace="nl.bimbase.bimworks.client"
@java.lang.Override
public void close() throws java.lang.Exception
````



## `createClient(Credentials)` {#member-createclient-4d783d3187f7}

````java sdk=java sdk-namespace="nl.bimbase.bimworks.client"
public nl.bimbase.bimworks.client.BimWorksClient createClient(nl.bimbase.bimworks.Credentials credentials) throws nl.bimbase.bimworks.client.BimWorksException
````

Alternative 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()`
