Platform SDK Java 8.5 API Reference

com.genesyslab.platform.applicationblocks.com
Class ConfServiceFactory

java.lang.Object
  extended by com.genesyslab.platform.applicationblocks.com.ConfServiceFactory

public final class ConfServiceFactory
extends java.lang.Object

This class is used to create an instance of the Configuration Service. An instance of the cfgService must be created before any Configuration Server requests can be made. For example:

 // Initialize ConfService:
 PropertyConfiguration       config;
 ConfServerProtocol          protocol;
 IConfService                cfgService;

 config = new PropertyConfiguration();
 config.setUseAddp(true);
 config.setAddpClientTimeout(15);

 protocol = new ConfServerProtocol(new Endpoint("ConfigServer", csHost, csPort, config));
 protocol.setUserName(userName);
 protocol.setUserPassword(password);
 protocol.setClientName(clientName);
 protocol.setClientApplicationType(clientType.ordinal());

 cfgService = ConfServiceFactory.createConfService(protocol);
 protocol.open();

 ...

 // Deinitialize ConfService:
 protocol.close();
 ConfServiceFactory.releaseConfService(cfgService);
 cfgService = null;
 
Note: ConfService may be created on closed protocol instance only. Also, to dispose (to 'release') such ConfService instance, it is recommended to close the protocol before it.

Author:
Petr Makagon, Vladislav Baranovsky, Alexander Filatov, Anton Brazhnyk, Sergii Volokh

Method Summary
static IConfService createConfService(Protocol protocol)
          This method creates an instance of a Configuration Service based on the specified protocol.
static IConfService createConfService(Protocol protocol, boolean enableCaching)
          This method creates an instance of a Configuration Service based on the specified protocol.
static IConfService createConfService(Protocol protocol, IConfServicePolicy confServicePolicy, IConfCache cache)
          Creates a configuration service with the specified policy information.
static IConfService createConfService(Protocol protocol, IConfServicePolicy confServicePolicy, IConfCachePolicy confCachePolicy)
          Creates a configuration service with the specified policy information.
static void releaseConfService(IConfService confService)
          Removes the specified configuration service from the internal list and unregisters it using the subscription service with which it had been registered.
static IConfService retrieveConfService(Endpoint endpoint)
          Deprecated.  
static IConfService retrieveConfService(Protocol protocol)
          Retrieves an instance of the Configuration Service based on the specified protocol.
static void setConfServiceCreator(ConfServiceCreator creator)
          This method is intended for usage in exclusive cases by advanced users with deep understanding of COM AB architecture.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setConfServiceCreator

public static void setConfServiceCreator(ConfServiceCreator creator)
This method is intended for usage in exclusive cases by advanced users with deep understanding of COM AB architecture.


createConfService

public static IConfService createConfService(Protocol protocol)
This method creates an instance of a Configuration Service based on the specified protocol.

Parameters:
protocol - A configuration cfgService protocol
Returns:
a new Configuration Service

createConfService

public static IConfService createConfService(Protocol protocol,
                                             boolean enableCaching)
This method creates an instance of a Configuration Service based on the specified protocol. If caching is enabled, the default caching policy will be used. If caching is disabled, all policy flags related to caching will be "false".

Parameters:
protocol - The configuration service protocol
enableCaching - If set to true caching functionality will be turned on
Returns:
a new Configuration Service

createConfService

public static IConfService createConfService(Protocol protocol,
                                             IConfServicePolicy confServicePolicy,
                                             IConfCachePolicy confCachePolicy)
Creates a configuration service with the specified policy information. The created service will have caching enabled by default with the cache using the specified cache policy.

Parameters:
protocol - Configuration Server protocol
confServicePolicy - The policy for the created configuration service
confCachePolicy - The policy for the cache
Returns:
The created configuration service

createConfService

public static IConfService createConfService(Protocol protocol,
                                             IConfServicePolicy confServicePolicy,
                                             IConfCache cache)
Creates a configuration service with the specified policy information. The created service will have caching enabled if a cache object is passed as a parameter.

Parameters:
protocol - Configuration Server protocol
confServicePolicy - The policy for the service
cache - An object implementing the IConfCache interface
Returns:
The created configuration service

retrieveConfService

public static IConfService retrieveConfService(Protocol protocol)
Retrieves an instance of the Configuration Service based on the specified protocol.

Parameters:
protocol - An instance of configuration protocol associated with a previously created configuration service
Returns:
An instance of the associated Configuration Service, or null if not found

retrieveConfService

@Deprecated
public static IConfService retrieveConfService(Endpoint endpoint)
Deprecated. 

Retrieves an instance of the Configuration Service based on the specified endpoint.
It checks registered ConfService instances for active Endpoint usage.

Note: This method is not recommended for usage. It does not track WarmStandby switchovers, so, in some cases it may be unable to work properly.

Parameters:
endpoint - An endpoint identifier.
Returns:
An instance of the associated Configuration Service, or null if it was not found.

releaseConfService

public static void releaseConfService(IConfService confService)
Removes the specified configuration service from the internal list and unregisters it using the subscription service with which it had been registered. This method should be called when a configuration service which had been created using one of the factory's "Create" methods is no longer needed.

Parameters:
confService - the configuration service to release.
Throws:
java.lang.IllegalArgumentException - if given ConfService value is not valid.

Platform SDK Java 8.5 API Reference

Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 8.5.302.00
Copyright © 2006–2017 Genesys Telecommunications Laboratories, Inc. All rights reserved.