public interface SaperionClientFactory
For an application SaperionClientFactory is the entry point for connecting to saperion. Such an application will
typically call newInstance
with configured properties to obtain an instance of this interface.
Map<String, String> properties = loadConfiguration();
SaperionClientFactory factory = SaperionClientFactory.newInstance(properties);
The required configuration parameters depend on the kind of communication layer (HTTP or RMI) in use.
For HTTP:
For RMI:
Which kind of communication (HTTP or RMI) is used depends on the available libraries. The Saperion Client API is available in three different packaging options:
When the complete version is used, the communication kind can be defined by setting an additional configuration parameter:
An application may as well specify the implementation of ConnectorFactory
directly to specify the
underlying low level api
Map<String, String> properties = loadConfiguration();
SaperionClientFactory factory = SaperionClientFactory.newInstance(properties, new MyFancyConnectorFactory());
With a saperion client factory one can create instances of SaperionClient
by authenticating:
SaperionClientFactory factory = ...
SaperionClient client = factory.newClient("user", "password", LicenseEnumeration.ADMIN, "System");
Modifier and Type | Method and Description |
---|---|
SaperionClient |
changePassword(String userName,
String oldPassword,
String newPassword,
LicenseEnumeration licenseType,
String tenant)
This method creates a new saperion client with a new session in the context of the given user credentials.
|
static SaperionClientFactory |
getSaperionClientFactory(Map<String,String> properties,
ConnectorFactory connectorFactory)
This factory method creates a new saperion client factory given an implementation of
ConnectorFactory . |
SaperionClient |
newClient(String userName,
String password,
LicenseEnumeration licenseType)
This method creates a new saperion client with a new session in the context of the given user credentials.
|
SaperionClient |
newClient(String userName,
String password,
LicenseEnumeration licenseType,
String tenant)
This method creates a new saperion client with a new session in the context of the given user credentials.
|
static SaperionClientFactory |
newInstance(Map<String,String> properties)
This static factory method uses the
connector factory spi to create a new client
factory. |
SaperionClient newClient(String userName, String password, LicenseEnumeration licenseType, String tenant) throws EcmException
userName
- the name of the userpassword
- the password of the userlicenseType
- the saperion license to use for the sessiontenant
- the name of the tenantEcmException
SaperionClient newClient(String userName, String password, LicenseEnumeration licenseType) throws EcmException
newClient(String, String, LicenseEnumeration, String)
instead.userName
- the name of the userpassword
- the password of the userlicenseType
- the saperion license to use for the sessionEcmException
SaperionClient changePassword(String userName, String oldPassword, String newPassword, LicenseEnumeration licenseType, String tenant) throws EcmException
userName
- the name of the useroldPassword
- the current (possibly expired) password of the usernewPassword
- the new password of the userlicenseType
- the saperion license to use for the sessiontenant
- the name of the tenantEcmException
static SaperionClientFactory newInstance(Map<String,String> properties)
connector factory spi
to create a new client
factory. Note that an implementation of ConnectorFactory must be registered as a java service for this to work.
Note that depending on the service implementation different properties may be required.properties
- configuration properties depending on the concrete service implementationstatic SaperionClientFactory getSaperionClientFactory(Map<String,String> properties, ConnectorFactory connectorFactory)
ConnectorFactory
.properties
- configuration properties depending on the concrete service implementationconnectorFactory
- an implementation of ConnectorFactory instantiating the underlying low level apiCopyright © 2016 Lexmark Enterprise Software Deutschland GmbH. All rights reserved.