public final class StructurizrClient
extends java.lang.Object
| Constructor | Description |
|---|---|
StructurizrClient() |
Creates a new Structurizr client based upon configuration in a structurizr.properties file
on the classpath with the following name-value pairs:
- structurizr.api.url
- structurizr.api.key
- structurizr.api.secret
|
StructurizrClient(java.lang.String apiKey,
java.lang.String apiSecret) |
Creates a new Structurizr API client with the specified API key and secret,
for the default API URL (https://api.structurizr.com).
|
StructurizrClient(java.lang.String url,
java.lang.String apiKey,
java.lang.String apiSecret) |
Creates a new Structurizr client with the specified API URL, key and secret.
|
| Modifier and Type | Method | Description |
|---|---|---|
java.lang.String |
getUrl() |
Gets the API URL that this client is for.
|
com.structurizr.Workspace |
getWorkspace(long workspaceId) |
Gets the workspace with the given ID.
|
java.io.File |
getWorkspaceArchiveLocation() |
Gets the location where a copy of the workspace is archived when it is retrieved from the server.
|
void |
putWorkspace(long workspaceId,
com.structurizr.Workspace workspace) |
Updates the given workspace.
|
void |
setEncryptionStrategy(EncryptionStrategy encryptionStrategy) |
Sets the encryption strategy for use when getting or putting workspaces.
|
void |
setMergeFromRemote(boolean mergeFromRemote) |
Specifies whether the layout of diagrams from a remote workspace should be retained when putting
a new version of the workspace.
|
void |
setWorkspaceArchiveLocation(java.io.File workspaceArchiveLocation) |
Sets the location where a copy of the workspace will be archived whenever it is retrieved from
the server.
|
public StructurizrClient()
throws StructurizrClientException
StructurizrClientException - if something goes wrongpublic StructurizrClient(java.lang.String apiKey,
java.lang.String apiSecret)
apiKey - the API key of your workspaceapiSecret - the API secret of your workspacepublic StructurizrClient(java.lang.String url,
java.lang.String apiKey,
java.lang.String apiSecret)
url - the URL of your structurizr web instanceapiKey - the API key of your workspaceapiSecret - the API secret of your workspacepublic java.lang.String getUrl()
public java.io.File getWorkspaceArchiveLocation()
public void setWorkspaceArchiveLocation(java.io.File workspaceArchiveLocation)
workspaceArchiveLocation - a File instance representing a directory, or null if
you don't want archivingpublic void setEncryptionStrategy(EncryptionStrategy encryptionStrategy)
encryptionStrategy - an EncryptionStrategy implementationpublic void setMergeFromRemote(boolean mergeFromRemote)
mergeFromRemote - true if layout information should be merged from the remote workspace, false otherwisepublic com.structurizr.Workspace getWorkspace(long workspaceId)
throws StructurizrClientException
workspaceId - the ID of your workspaceStructurizrClientException - if there are problems related to the network, authorization, JSON deserialization, etcpublic void putWorkspace(long workspaceId,
com.structurizr.Workspace workspace)
throws StructurizrClientException
workspaceId - the ID of your workspaceworkspace - the workspace instance to updateStructurizrClientException - if there are problems related to the network, authorization, JSON serialization, etc