本文整理汇总了Java中org.identityconnectors.common.pooling.ObjectPoolConfiguration类的典型用法代码示例。如果您正苦于以下问题:Java ObjectPoolConfiguration类的具体用法?Java ObjectPoolConfiguration怎么用?Java ObjectPoolConfiguration使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ObjectPoolConfiguration类属于org.identityconnectors.common.pooling包,在下文中一共展示了ObjectPoolConfiguration类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateObjectPoolConfiguration
import org.identityconnectors.common.pooling.ObjectPoolConfiguration; //导入依赖的package包/类
public static void updateObjectPoolConfiguration(
final ObjectPoolConfiguration opc, final ConnPoolConf cpc) {
if (cpc.getMaxIdle() != null) {
opc.setMaxIdle(cpc.getMaxIdle());
}
if (cpc.getMaxObjects() != null) {
opc.setMaxObjects(cpc.getMaxObjects());
}
if (cpc.getMaxWait() != null) {
opc.setMaxWait(cpc.getMaxWait());
}
if (cpc.getMinEvictableIdleTimeMillis() != null) {
opc.setMinEvictableIdleTimeMillis(cpc.getMinEvictableIdleTimeMillis());
}
if (cpc.getMinIdle() != null) {
opc.setMinIdle(cpc.getMinIdle());
}
}
示例2: getConnPoolConf
import org.identityconnectors.common.pooling.ObjectPoolConfiguration; //导入依赖的package包/类
public static ConnPoolConf getConnPoolConf(final ConnPoolConfTO cpcto, final ConnPoolConf cpc) {
ObjectPoolConfiguration opc = new ObjectPoolConfiguration();
cpc.setMaxIdle(cpcto.getMaxIdle() == null ? opc.getMaxIdle() : cpcto.getMaxIdle());
cpc.setMaxObjects(cpcto.getMaxObjects() == null ? opc.getMaxObjects() : cpcto.getMaxObjects());
cpc.setMaxWait(cpcto.getMaxWait() == null ? opc.getMaxWait() : cpcto.getMaxWait());
cpc.setMinEvictableIdleTimeMillis(cpcto.getMinEvictableIdleTimeMillis() == null
? opc.getMinEvictableIdleTimeMillis() : cpcto.getMinEvictableIdleTimeMillis());
cpc.setMinIdle(cpcto.getMinIdle() == null ? opc.getMinIdle() : cpcto.getMinIdle());
return cpc;
}
示例3: transformConnectorConfiguration
import org.identityconnectors.common.pooling.ObjectPoolConfiguration; //导入依赖的package包/类
/**
* Transforms midPoint XML configuration of the connector to the ICF
* configuration.
* <p/>
* The "configuration" part of the XML resource definition will be used.
* <p/>
* The provided ICF APIConfiguration will be modified, some values may be
* overwritten.
*
* @param apiConfig
* ICF connector configuration
* @param resourceType
* midPoint XML configuration
* @throws SchemaException
* @throws ConfigurationException
*/
public APIConfiguration transformConnectorConfiguration(PrismContainerValue configuration)
throws SchemaException, ConfigurationException {
APIConfiguration apiConfig = cinfo.createDefaultAPIConfiguration();
ConfigurationProperties configProps = apiConfig.getConfigurationProperties();
// The namespace of all the configuration properties specific to the
// connector instance will have a connector instance namespace. This
// namespace can be found in the resource definition.
String connectorConfNs = connectorType.getNamespace();
PrismContainer configurationPropertiesContainer = configuration
.findContainer(SchemaConstants.CONNECTOR_SCHEMA_CONFIGURATION_PROPERTIES_ELEMENT_QNAME);
if (configurationPropertiesContainer == null) {
// Also try this. This is an older way.
configurationPropertiesContainer = configuration.findContainer(new QName(connectorConfNs,
SchemaConstants.CONNECTOR_SCHEMA_CONFIGURATION_PROPERTIES_ELEMENT_LOCAL_NAME));
}
transformConnectorConfigurationProperties(configProps, configurationPropertiesContainer, connectorConfNs);
PrismContainer connectorPoolContainer = configuration.findContainer(new QName(
SchemaConstants.NS_ICF_CONFIGURATION,
ConnectorFactoryConnIdImpl.CONNECTOR_SCHEMA_CONNECTOR_POOL_CONFIGURATION_XML_ELEMENT_NAME));
ObjectPoolConfiguration connectorPoolConfiguration = apiConfig.getConnectorPoolConfiguration();
transformConnectorPoolConfiguration(connectorPoolConfiguration, connectorPoolContainer);
PrismProperty producerBufferSizeProperty = configuration.findProperty(new QName(
SchemaConstants.NS_ICF_CONFIGURATION,
ConnectorFactoryConnIdImpl.CONNECTOR_SCHEMA_PRODUCER_BUFFER_SIZE_XML_ELEMENT_NAME));
if (producerBufferSizeProperty != null) {
apiConfig.setProducerBufferSize(parseInt(producerBufferSizeProperty));
}
PrismContainer connectorTimeoutsContainer = configuration.findContainer(new QName(
SchemaConstants.NS_ICF_CONFIGURATION,
ConnectorFactoryConnIdImpl.CONNECTOR_SCHEMA_TIMEOUTS_XML_ELEMENT_NAME));
transformConnectorTimeoutsConfiguration(apiConfig, connectorTimeoutsContainer);
PrismContainer resultsHandlerConfigurationContainer = configuration.findContainer(new QName(
SchemaConstants.NS_ICF_CONFIGURATION,
ConnectorFactoryConnIdImpl.CONNECTOR_SCHEMA_RESULTS_HANDLER_CONFIGURATION_ELEMENT_LOCAL_NAME));
ResultsHandlerConfiguration resultsHandlerConfiguration = apiConfig.getResultsHandlerConfiguration();
transformResultsHandlerConfiguration(resultsHandlerConfiguration, resultsHandlerConfigurationContainer);
return apiConfig;
}
示例4: transformConnectorPoolConfiguration
import org.identityconnectors.common.pooling.ObjectPoolConfiguration; //导入依赖的package包/类
private void transformConnectorPoolConfiguration(ObjectPoolConfiguration connectorPoolConfiguration,
PrismContainer<?> connectorPoolContainer) throws SchemaException {
if (connectorPoolContainer == null || connectorPoolContainer.getValue() == null) {
return;
}
for (PrismProperty prismProperty : connectorPoolContainer.getValue().getProperties()) {
QName propertyQName = prismProperty.getElementName();
if (propertyQName.getNamespaceURI().equals(SchemaConstants.NS_ICF_CONFIGURATION)) {
String subelementName = propertyQName.getLocalPart();
if (ConnectorFactoryConnIdImpl.CONNECTOR_SCHEMA_CONNECTOR_POOL_CONFIGURATION_MIN_EVICTABLE_IDLE_TIME_MILLIS
.equals(subelementName)) {
connectorPoolConfiguration.setMinEvictableIdleTimeMillis(parseLong(prismProperty));
} else if (ConnectorFactoryConnIdImpl.CONNECTOR_SCHEMA_CONNECTOR_POOL_CONFIGURATION_MIN_IDLE
.equals(subelementName)) {
connectorPoolConfiguration.setMinIdle(parseInt(prismProperty));
} else if (ConnectorFactoryConnIdImpl.CONNECTOR_SCHEMA_CONNECTOR_POOL_CONFIGURATION_MAX_IDLE
.equals(subelementName)) {
connectorPoolConfiguration.setMaxIdle(parseInt(prismProperty));
} else if (ConnectorFactoryConnIdImpl.CONNECTOR_SCHEMA_CONNECTOR_POOL_CONFIGURATION_MAX_OBJECTS
.equals(subelementName)) {
connectorPoolConfiguration.setMaxObjects(parseInt(prismProperty));
} else if (ConnectorFactoryConnIdImpl.CONNECTOR_SCHEMA_CONNECTOR_POOL_CONFIGURATION_MAX_WAIT
.equals(subelementName)) {
connectorPoolConfiguration.setMaxWait(parseLong(prismProperty));
} else {
throw new SchemaException(
"Unexpected element "
+ propertyQName
+ " in "
+ ConnectorFactoryConnIdImpl.CONNECTOR_SCHEMA_CONNECTOR_POOL_CONFIGURATION_XML_ELEMENT_NAME);
}
} else {
throw new SchemaException(
"Unexpected element "
+ propertyQName
+ " in "
+ ConnectorFactoryConnIdImpl.CONNECTOR_SCHEMA_CONNECTOR_POOL_CONFIGURATION_XML_ELEMENT_NAME);
}
}
}
示例5: getOperationalStatus
import org.identityconnectors.common.pooling.ObjectPoolConfiguration; //导入依赖的package包/类
@Override
public ConnectorOperationalStatus getOperationalStatus() throws ObjectNotFoundException {
if (!(cinfo instanceof LocalConnectorInfoImpl)) {
LOGGER.trace("Cannot get operational status of a remote connector {}", connectorType);
return null;
}
if (apiConfig == null) {
LOGGER.trace("Cannot get operational status of a connector {}: connector not yet configured", connectorType);
throw new IllegalStateException("Connector "+connectorType+" not yet configured");
}
ConnectorOperationalStatus status = new ConnectorOperationalStatus();
ConnectorOperationalContext connectorOperationalContext = new ConnectorOperationalContext((LocalConnectorInfoImpl)cinfo, (APIConfigurationImpl) apiConfig);
Class<? extends Connector> connectorClass = connectorOperationalContext.getConnectorClass();
if (connectorClass != null) {
status.setConnectorClassName(connectorClass.getName());
}
ObjectPoolConfiguration poolConfiguration = apiConfig.getConnectorPoolConfiguration();
if (poolConfiguration != null) {
status.setPoolConfigMaxSize(poolConfiguration.getMaxObjects());
status.setPoolConfigMinIdle(poolConfiguration.getMinIdle());
status.setPoolConfigMaxIdle(poolConfiguration.getMaxIdle());
status.setPoolConfigWaitTimeout(poolConfiguration.getMaxWait());
status.setPoolConfigMinEvictableIdleTime(poolConfiguration.getMinEvictableIdleTimeMillis());
}
ObjectPool<PoolableConnector> pool = connectorOperationalContext.getPool();
if (pool != null) {
Statistics poolStats = pool.getStatistics();
if (poolStats != null) {
status.setPoolStatusNumActive(poolStats.getNumActive());
status.setPoolStatusNumIdle(poolStats.getNumIdle());
}
}
return status;
}
示例6: transformConnectorConfiguration
import org.identityconnectors.common.pooling.ObjectPoolConfiguration; //导入依赖的package包/类
/**
* Transforms midPoint XML configuration of the connector to the ICF
* configuration.
* <p/>
* The "configuration" part of the XML resource definition will be used.
* <p/>
* The provided ICF APIConfiguration will be modified, some values may be
* overwritten.
*
* @param apiConfig
* ICF connector configuration
* @param resourceType
* midPoint XML configuration
* @throws SchemaException
* @throws ConfigurationException
*/
public APIConfiguration transformConnectorConfiguration(PrismContainerValue configuration)
throws SchemaException, ConfigurationException {
APIConfiguration apiConfig = cinfo.createDefaultAPIConfiguration();
ConfigurationProperties configProps = apiConfig.getConfigurationProperties();
// The namespace of all the configuration properties specific to the
// connector instance will have a connector instance namespace. This
// namespace can be found in the resource definition.
String connectorConfNs = connectorType.getNamespace();
PrismContainer configurationPropertiesContainer = configuration
.findContainer(SchemaConstants.CONNECTOR_SCHEMA_CONFIGURATION_PROPERTIES_ELEMENT_QNAME);
if (configurationPropertiesContainer == null) {
// Also try this. This is an older way.
configurationPropertiesContainer = configuration.findContainer(new QName(connectorConfNs,
SchemaConstants.CONNECTOR_SCHEMA_CONFIGURATION_PROPERTIES_ELEMENT_LOCAL_NAME));
}
transformConnectorConfigurationProperties(configProps, configurationPropertiesContainer, connectorConfNs);
PrismContainer connectorPoolContainer = configuration.findContainer(new QName(
SchemaConstants.NS_ICF_CONFIGURATION,
ConnectorFactoryConnIdImpl.CONNECTOR_SCHEMA_CONNECTOR_POOL_CONFIGURATION_XML_ELEMENT_NAME));
ObjectPoolConfiguration connectorPoolConfiguration = apiConfig.getConnectorPoolConfiguration();
transformConnectorPoolConfiguration(connectorPoolConfiguration, connectorPoolContainer);
PrismProperty producerBufferSizeProperty = configuration.findProperty(new QName(
SchemaConstants.NS_ICF_CONFIGURATION,
ConnectorFactoryConnIdImpl.CONNECTOR_SCHEMA_PRODUCER_BUFFER_SIZE_XML_ELEMENT_NAME));
if (producerBufferSizeProperty != null) {
apiConfig.setProducerBufferSize(parseInt(producerBufferSizeProperty));
}
PrismContainer connectorTimeoutsContainer = configuration.findContainer(new QName(
SchemaConstants.NS_ICF_CONFIGURATION,
ConnectorFactoryConnIdImpl.CONNECTOR_SCHEMA_TIMEOUTS_XML_ELEMENT_NAME));
transformConnectorTimeoutsConfiguration(apiConfig, connectorTimeoutsContainer);
PrismContainer resultsHandlerConfigurationContainer = configuration.findContainer(new QName(
SchemaConstants.NS_ICF_CONFIGURATION,
ConnectorFactoryConnIdImpl.CONNECTOR_SCHEMA_RESULTS_HANDLER_CONFIGURATION_ELEMENT_LOCAL_NAME));
ResultsHandlerConfiguration resultsHandlerConfiguration = apiConfig.getResultsHandlerConfiguration();
transformResultsHandlerConfiguration(resultsHandlerConfiguration, resultsHandlerConfigurationContainer);
return apiConfig;
}
示例7: getOperationalStatus
import org.identityconnectors.common.pooling.ObjectPoolConfiguration; //导入依赖的package包/类
@Override
public ConnectorOperationalStatus getOperationalStatus() throws ObjectNotFoundException {
if (!(cinfo instanceof LocalConnectorInfoImpl)) {
LOGGER.trace("Cannot get operational status of a remote connector {}", connectorType);
return null;
}
if (apiConfig == null) {
LOGGER.trace("Cannot get operational status of a connector {}: connector not yet configured", connectorType);
throw new IllegalStateException("Connector "+connectorType+" not yet configured");
}
ConnectorOperationalStatus status = new ConnectorOperationalStatus();
ConnectorOperationalContext connectorOperationalContext = new ConnectorOperationalContext((LocalConnectorInfoImpl)cinfo, (APIConfigurationImpl) apiConfig);
Class<? extends Connector> connectorClass = connectorOperationalContext.getConnectorClass();
if (connectorClass != null) {
status.setConnectorClassName(connectorClass.getName());
}
ObjectPoolConfiguration poolConfiguration = apiConfig.getConnectorPoolConfiguration();
if (poolConfiguration != null) {
status.setPoolConfigMaxSize(poolConfiguration.getMaxObjects());
status.setPoolConfigMinIdle(poolConfiguration.getMinIdle());
status.setPoolConfigMaxIdle(poolConfiguration.getMaxIdle());
status.setPoolConfigWaitTimeout(poolConfiguration.getMaxWait());
status.setPoolConfigMinEvictableIdleTime(poolConfiguration.getMinEvictableIdleTimeMillis());
}
ObjectPool<PoolableConnector> pool = connectorOperationalContext.getPool();
if (pool != null) {
Statistics poolStats = pool.getStatistics();
if (poolStats != null) {
status.setPoolStatusNumActive(poolStats.getNumActive());
status.setPoolStatusNumIdle(poolStats.getNumIdle());
}
}
return status;
}
示例8: getObjectPoolConfiguration
import org.identityconnectors.common.pooling.ObjectPoolConfiguration; //导入依赖的package包/类
public static ObjectPoolConfiguration getObjectPoolConfiguration(final ConnPoolConf cpc) {
ObjectPoolConfiguration opc = new ObjectPoolConfiguration();
updateObjectPoolConfiguration(opc, cpc);
return opc;
}