You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2013/03/27 11:24:30 UTC
svn commit: r1461503 [2/3] - in /syncope/trunk: ./
archetype/src/main/resources/archetype-resources/console/
archetype/src/main/resources/archetype-resources/core/ build-tools/
build-tools/src/main/java/org/apache/syncope/buildtools/
build-tools/src/ma...
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/beans/ConnInstance.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/beans/ConnInstance.java?rev=1461503&r1=1461502&r2=1461503&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/beans/ConnInstance.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/beans/ConnInstance.java Wed Mar 27 10:24:29 2013
@@ -20,6 +20,7 @@ package org.apache.syncope.core.persiste
import java.util.ArrayList;
import java.util.Collections;
+import java.util.EnumSet;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -35,9 +36,11 @@ import javax.persistence.Lob;
import javax.persistence.OneToMany;
import org.apache.syncope.common.types.ConnConfProperty;
import org.apache.syncope.common.types.ConnectorCapability;
+import org.apache.syncope.core.persistence.validation.entity.ConnInstanceCheck;
import org.apache.syncope.core.util.XMLSerializer;
@Entity
+@ConnInstanceCheck
public class ConnInstance extends AbstractBaseBean {
private static final long serialVersionUID = -2294708794497208872L;
@@ -48,21 +51,31 @@ public class ConnInstance extends Abstra
private Long id;
/**
- * Connector class name prefix used to retrieve configuration bean.
+ * URI identifying the local / remote ConnId location where the related connector bundle is found.
+ */
+ @Column(nullable = false)
+ private String location;
+
+ /**
+ * Connector bundle class name.
+ * Within a given location, the triple
+ * (ConnectorBundle-Name, ConnectorBundle-Version, ConnectorBundle-Version) must be unique.
*/
@Column(nullable = false)
private String connectorName;
/**
- * ConnectorBundle-Name: Qualified name for the connector bundle. Within a given deployment, the pair
- * (ConnectorBundle-Name, ConnectorBundle-Version) must be unique.
+ * Qualified name for the connector bundle.
+ * Within a given location, the triple
+ * (ConnectorBundle-Name, ConnectorBundle-Version, ConnectorBundle-Version) must be unique.
*/
@Column(nullable = false)
private String bundleName;
/**
- * ConnectorBundle-Version: The version of the bundle. Within a given deployment, the pair (ConnectorBundle-Name,
- * ConnectorBundle-Version) must be unique.
+ * Version of the bundle.
+ * Within a given location, the triple
+ * (ConnectorBundle-Name, ConnectorBundle-Version, ConnectorBundle-Version) must be unique.
*/
@Column(nullable = false)
private String version;
@@ -77,7 +90,9 @@ public class ConnInstance extends Abstra
/**
* The main configuration for the connector instance. This is directly implemented by the Configuration bean class
- * which contains annotated ConfigurationProperties (@ConfigurationProperty).
+ * which contains annotated ConfigurationProperties.
+ *
+ * @see org.identityconnectors.framework.api.ConfigurationProperty
*/
@Lob
private String xmlConfiguration;
@@ -100,32 +115,41 @@ public class ConnInstance extends Abstra
public ConnInstance() {
super();
+
capabilities = new HashSet<ConnectorCapability>();
resources = new ArrayList<ExternalResource>();
}
- public String getVersion() {
- return version;
+ public String getLocation() {
+ return location;
}
- public void setVersion(String majorVersion) {
- this.version = majorVersion;
+ public void setLocation(final String location) {
+ this.location = location;
+ }
+
+ public String getConnectorName() {
+ return connectorName;
+ }
+
+ public void setConnectorName(final String connectorName) {
+ this.connectorName = connectorName;
}
public String getBundleName() {
return bundleName;
}
- public void setBundleName(String bundleName) {
+ public void setBundleName(final String bundleName) {
this.bundleName = bundleName;
}
- public String getConnectorName() {
- return connectorName;
+ public String getVersion() {
+ return version;
}
- public void setConnectorName(String connectorName) {
- this.connectorName = connectorName;
+ public void setVersion(final String version) {
+ this.version = version;
}
public Set<ConnConfProperty> getConfiguration() {
@@ -148,7 +172,7 @@ public class ConnInstance extends Abstra
return displayName;
}
- public void setDisplayName(String displayName) {
+ public void setDisplayName(final String displayName) {
this.displayName = displayName;
}
@@ -156,26 +180,26 @@ public class ConnInstance extends Abstra
return this.resources;
}
- public void setResources(List<ExternalResource> resources) {
+ public void setResources(final List<ExternalResource> resources) {
this.resources.clear();
if (resources != null && !resources.isEmpty()) {
this.resources.addAll(resources);
}
}
- public boolean addResource(ExternalResource resource) {
+ public boolean addResource(final ExternalResource resource) {
return !this.resources.contains(resource) && this.resources.add(resource);
}
- public boolean removeResource(ExternalResource resource) {
+ public boolean removeResource(final ExternalResource resource) {
return this.resources.remove(resource);
}
- public boolean addCapability(ConnectorCapability capabitily) {
+ public boolean addCapability(final ConnectorCapability capabitily) {
return capabilities.add(capabitily);
}
- public boolean removeCapability(ConnectorCapability capabitily) {
+ public boolean removeCapability(final ConnectorCapability capabitily) {
return capabilities.remove(capabitily);
}
@@ -197,7 +221,7 @@ public class ConnInstance extends Abstra
return connRequestTimeout == null ? DEFAULT_TIMEOUT : connRequestTimeout;
}
- public void setConnRequestTimeout(Integer connRequestTimeout) {
+ public void setConnRequestTimeout(final Integer connRequestTimeout) {
this.connRequestTimeout = connRequestTimeout;
}
}
Added: syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/validation/entity/ConnInstanceCheck.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/validation/entity/ConnInstanceCheck.java?rev=1461503&view=auto
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/validation/entity/ConnInstanceCheck.java (added)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/validation/entity/ConnInstanceCheck.java Wed Mar 27 10:24:29 2013
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.core.persistence.validation.entity;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import javax.validation.Constraint;
+import javax.validation.Payload;
+
+@Target({ElementType.TYPE})
+@Retention(RetentionPolicy.RUNTIME)
+@Constraint(validatedBy = ConnInstanceValidator.class)
+@Documented
+public @interface ConnInstanceCheck {
+
+ String message() default "{org.apache.syncope.core.validation.connninstance}";
+
+ Class<?>[] groups() default {};
+
+ Class<? extends Payload>[] payload() default {};
+}
Propchange: syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/validation/entity/ConnInstanceCheck.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/validation/entity/ConnInstanceCheck.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/validation/entity/ConnInstanceCheck.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/validation/entity/ConnInstanceValidator.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/validation/entity/ConnInstanceValidator.java?rev=1461503&view=auto
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/validation/entity/ConnInstanceValidator.java (added)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/validation/entity/ConnInstanceValidator.java Wed Mar 27 10:24:29 2013
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.core.persistence.validation.entity;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+import org.apache.commons.lang.ArrayUtils;
+import org.apache.syncope.common.types.EntityViolationType;
+import org.apache.syncope.core.persistence.beans.ConnInstance;
+
+public class ConnInstanceValidator extends AbstractValidator implements
+ ConstraintValidator<ConnInstanceCheck, ConnInstance> {
+
+ private static final String[] ALLOWED_SCHEMES = {"file", "connid", "connids"};
+
+ @Override
+ public void initialize(final ConnInstanceCheck constraintAnnotation) {
+ }
+
+ @Override
+ public boolean isValid(final ConnInstance connInstance, final ConstraintValidatorContext context) {
+ boolean isValid = true;
+ try {
+ URI location = new URI(connInstance.getLocation());
+ isValid = ArrayUtils.contains(ALLOWED_SCHEMES, location.getScheme());
+ } catch (URISyntaxException e) {
+ context.disableDefaultConstraintViolation();
+ context.buildConstraintViolationWithTemplate(EntityViolationType.InvalidConnInstanceLocation.toString())
+ .addNode(" is not a valid URI for file:// or connid(s):// schemes").addConstraintViolation();
+ isValid = false;
+ }
+
+ return isValid;
+ }
+}
Propchange: syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/validation/entity/ConnInstanceValidator.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/validation/entity/ConnInstanceValidator.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/validation/entity/ConnInstanceValidator.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/impl/ConnectorFacadeProxy.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/impl/ConnectorFacadeProxy.java?rev=1461503&r1=1461502&r2=1461503&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/impl/ConnectorFacadeProxy.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/impl/ConnectorFacadeProxy.java Wed Mar 27 10:24:29 2013
@@ -33,7 +33,6 @@ import org.apache.syncope.common.types.P
import org.apache.syncope.common.types.ResourceOperation;
import org.apache.syncope.core.persistence.beans.AbstractMappingItem;
import org.apache.syncope.core.persistence.beans.ConnInstance;
-import org.apache.syncope.core.persistence.dao.MissingConfKeyException;
import org.apache.syncope.core.persistence.dao.NotFoundException;
import org.apache.syncope.core.propagation.Connector;
import org.apache.syncope.core.propagation.TimeoutException;
@@ -45,7 +44,6 @@ import org.identityconnectors.framework.
import org.identityconnectors.framework.api.ConnectorFacade;
import org.identityconnectors.framework.api.ConnectorFacadeFactory;
import org.identityconnectors.framework.api.ConnectorInfo;
-import org.identityconnectors.framework.api.ConnectorKey;
import org.identityconnectors.framework.common.objects.Attribute;
import org.identityconnectors.framework.common.objects.ConnectorObject;
import org.identityconnectors.framework.common.objects.Name;
@@ -93,7 +91,6 @@ public class ConnectorFacadeProxy implem
* Use the passed connector instance to build a ConnectorFacade that will be used to make all wrapped calls.
*
* @param connInstance the connector instance configuration
- * @see ConnectorKey
* @see ConnectorInfo
* @see APIConfiguration
* @see ConfigurationProperties
@@ -102,48 +99,22 @@ public class ConnectorFacadeProxy implem
public ConnectorFacadeProxy(final ConnInstance connInstance) {
this.activeConnInstance = connInstance;
- // specify a connector.
- ConnectorKey key = new ConnectorKey(
+ ConnectorInfo info = ConnIdBundleManager.getConnectorInfo(connInstance.getLocation(),
connInstance.getBundleName(), connInstance.getVersion(), connInstance.getConnectorName());
- if (LOG.isDebugEnabled()) {
- LOG.debug("Bundle name: " + key.getBundleName()
- + "\nBundle version: " + key.getBundleVersion()
- + "\nBundle class: " + key.getConnectorName());
- }
-
- // get the specified connector.
- ConnectorInfo info;
- try {
- info = ConnIdBundleManager.getConnManager().findConnectorInfo(key);
- if (info == null) {
- throw new NotFoundException("Connector Info for key " + key);
- }
- } catch (MissingConfKeyException e) {
- throw new NotFoundException("Connector Info for key " + key, e);
- }
-
// create default configuration
APIConfiguration apiConfig = info.createDefaultAPIConfiguration();
if (apiConfig == null) {
throw new NotFoundException("Default API configuration");
}
- // retrieve the ConfigurationProperties.
+ // retrieve the ConfigurationProperties
final ConfigurationProperties properties = apiConfig.getConfigurationProperties();
if (properties == null) {
throw new NotFoundException("Configuration properties");
}
- // Print out what the properties are (not necessary)
- if (LOG.isDebugEnabled()) {
- for (String propName : properties.getPropertyNames()) {
- LOG.debug("Property Name: {}\nProperty Type: {}",
- properties.getProperty(propName).getName(), properties.getProperty(propName).getType());
- }
- }
-
- // Set all of the ConfigurationProperties needed by the connector.
+ // set all of the ConfigurationProperties needed by the connector.
for (ConnConfProperty property : connInstance.getConfiguration()) {
if (property.getValues() != null && !property.getValues().isEmpty()) {
properties.setPropertyValue(property.getSchema().getName(),
@@ -151,13 +122,13 @@ public class ConnectorFacadeProxy implem
}
}
- // Use the ConnectorFacadeFactory's newInstance() method to get a new connector.
+ // use the ConnectorFacadeFactory's newInstance() method to get a new connector.
connector = ConnectorFacadeFactory.getInstance().newInstance(apiConfig);
if (connector == null) {
throw new NotFoundException("Connector");
}
- // Make sure we have set up the Configuration properly
+ // make sure we have set up the Configuration properly
connector.validate();
}
@@ -563,7 +534,7 @@ public class ConnectorFacadeProxy implem
} else if (File.class.equals(propertySchemaClass)) {
value = new File(values.get(0).toString());
} else if (String[].class.equals(propertySchemaClass)) {
- value = values.toArray(new String[]{});
+ value = values.toArray(new String[] {});
} else {
value = values.get(0) == null ? null : values.get(0).toString();
}
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ConnInstanceController.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ConnInstanceController.java?rev=1461503&r1=1461502&r2=1461503&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ConnInstanceController.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ConnInstanceController.java Wed Mar 27 10:24:29 2013
@@ -22,6 +22,7 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
+import java.util.Map;
import java.util.Set;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang.StringUtils;
@@ -50,7 +51,6 @@ import org.apache.syncope.core.util.Conn
import org.identityconnectors.common.l10n.CurrentLocale;
import org.identityconnectors.framework.api.ConfigurationProperties;
import org.identityconnectors.framework.api.ConnectorInfo;
-import org.identityconnectors.framework.api.ConnectorInfoManager;
import org.identityconnectors.framework.api.ConnectorKey;
import org.identityconnectors.framework.impl.api.ConfigurationPropertyImpl;
import org.springframework.beans.factory.annotation.Autowired;
@@ -225,34 +225,20 @@ public class ConnInstanceController exte
CurrentLocale.set(new Locale(lang));
}
- ConnectorInfoManager manager = ConnIdBundleManager.getConnManager();
-
- List<ConnectorInfo> bundles = manager.getConnectorInfos();
-
- if (LOG.isDebugEnabled() && bundles != null) {
- LOG.debug("#Bundles: {}", bundles.size());
-
- for (ConnectorInfo bundle : bundles) {
- LOG.debug("Bundle: {}", bundle.getConnectorDisplayName());
- }
- }
-
List<ConnBundleTO> connectorBundleTOs = new ArrayList<ConnBundleTO>();
- if (bundles != null) {
- for (ConnectorInfo bundle : bundles) {
- ConnBundleTO connectorBundleTO = new ConnBundleTO();
- connectorBundleTO.setDisplayName(bundle.getConnectorDisplayName());
-
- ConnectorKey key = bundle.getConnectorKey();
+ for (Map.Entry<String, List<ConnectorInfo>> entry : ConnIdBundleManager.getConnectorInfos().entrySet()) {
+ for (ConnectorInfo bundle : entry.getValue()) {
+ ConnBundleTO connBundleTO = new ConnBundleTO();
+ connBundleTO.setDisplayName(bundle.getConnectorDisplayName());
- LOG.debug("Bundle name: {}\nBundle version: {}\nBundle class: {}",
- key.getBundleName(), key.getBundleVersion(), key.getConnectorName());
+ connBundleTO.setLocation(entry.getKey());
- connectorBundleTO.setBundleName(key.getBundleName());
- connectorBundleTO.setConnectorName(key.getConnectorName());
- connectorBundleTO.setVersion(key.getBundleVersion());
+ ConnectorKey key = bundle.getConnectorKey();
+ connBundleTO.setBundleName(key.getBundleName());
+ connBundleTO.setConnectorName(key.getConnectorName());
+ connBundleTO.setVersion(key.getBundleVersion());
- ConfigurationProperties properties = ConnIdBundleManager.getConfProps(bundle);
+ ConfigurationProperties properties = ConnIdBundleManager.getConfigurationProperties(bundle);
for (String propName : properties.getPropertyNames()) {
ConnConfPropSchema connConfPropSchema = new ConnConfPropSchema();
@@ -260,33 +246,20 @@ public class ConnInstanceController exte
ConfigurationPropertyImpl configurationProperty =
(ConfigurationPropertyImpl) properties.getProperty(propName);
- // set name
connConfPropSchema.setName(configurationProperty.getName());
-
- // set display name
connConfPropSchema.setDisplayName(configurationProperty.getDisplayName(propName));
-
- // set help message
connConfPropSchema.setHelpMessage(configurationProperty.getHelpMessage(propName));
-
- // set if mandatory
connConfPropSchema.setRequired(configurationProperty.isRequired());
-
- // set type
connConfPropSchema.setType(configurationProperty.getType().getName());
-
- // set order
connConfPropSchema.setOrder(configurationProperty.getOrder());
-
- // set confidential
connConfPropSchema.setConfidential(configurationProperty.isConfidential());
- connectorBundleTO.addProperty(connConfPropSchema);
+ connBundleTO.addProperty(connConfPropSchema);
}
- LOG.debug("Bundle properties: {}", connectorBundleTO.getProperties());
+ LOG.debug("Connector bundle: {}", connBundleTO);
- connectorBundleTOs.add(connectorBundleTO);
+ connectorBundleTOs.add(connBundleTO);
}
}
@@ -328,7 +301,9 @@ public class ConnInstanceController exte
@PreAuthorize("hasRole('CONNECTOR_READ')")
@RequestMapping(method = RequestMethod.GET, value = "/{connInstanceId}/configurationProperty/list")
@Transactional(readOnly = true)
- public List<ConnConfProperty> getConfigurationProperties(@PathVariable("connInstanceId") final Long connInstanceId) {
+ public List<ConnConfProperty> getConfigurationProperties(
+ @PathVariable("connInstanceId") final Long connInstanceId) {
+
final ConnInstance connInstance = connInstanceDAO.find(connInstanceId);
if (connInstance == null) {
throw new NotFoundException("Connector '" + connInstanceId + "'");
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/ConnInstanceDataBinder.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/ConnInstanceDataBinder.java?rev=1461503&r1=1461502&r2=1461503&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/ConnInstanceDataBinder.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/ConnInstanceDataBinder.java Wed Mar 27 10:24:29 2013
@@ -85,6 +85,10 @@ public class ConnInstanceDataBinder {
SyncopeClientException requiredValuesMissing = new SyncopeClientException(
SyncopeClientExceptionType.RequiredValuesMissing);
+ if (connInstanceTO.getLocation() == null) {
+ requiredValuesMissing.addElement("location");
+ }
+
if (connInstanceTO.getBundleName() == null) {
requiredValuesMissing.addElement("bundlename");
}
@@ -101,9 +105,12 @@ public class ConnInstanceDataBinder {
requiredValuesMissing.addElement("configuration");
}
- ConnInstance connectorInstance = new ConnInstance();
+ ConnInstance connInstance = new ConnInstance();
- BeanUtils.copyProperties(connInstanceTO, connectorInstance, IGNORE_PROPERTIES);
+ BeanUtils.copyProperties(connInstanceTO, connInstance, IGNORE_PROPERTIES);
+ if (connInstanceTO.getLocation() != null) {
+ connInstance.setLocation(connInstanceTO.getLocation().toString());
+ }
// Throw composite exception if there is at least one element set
// in the composing exceptions
@@ -116,7 +123,7 @@ public class ConnInstanceDataBinder {
throw scee;
}
- return connectorInstance;
+ return connInstance;
}
public ConnInstance updateConnInstance(final long connInstanceId, final ConnInstanceTO connInstanceTO) {
@@ -131,6 +138,10 @@ public class ConnInstanceDataBinder {
ConnInstance connInstance = connInstanceDAO.find(connInstanceId);
+ if (connInstanceTO.getLocation() != null) {
+ connInstance.setLocation(connInstanceTO.getLocation().toString());
+ }
+
if (connInstanceTO.getBundleName() != null) {
connInstance.setBundleName(connInstanceTO.getBundleName());
}
@@ -174,9 +185,10 @@ public class ConnInstanceDataBinder {
ConnInstanceTO connInstanceTO = new ConnInstanceTO();
connInstanceTO.setId(connInstance.getId() == null ? 0L : connInstance.getId().longValue());
- // retrieve the ConfigurationProperties.
- ConfigurationProperties properties = ConnIdBundleManager.getConfProps(
- connInstance.getBundleName(), connInstance.getVersion(), connInstance.getConnectorName());
+ // retrieve the ConfigurationProperties
+ ConfigurationProperties properties = ConnIdBundleManager.getConfigurationProperties(
+ ConnIdBundleManager.getConnectorInfo(connInstance.getLocation(),
+ connInstance.getBundleName(), connInstance.getVersion(), connInstance.getConnectorName()));
BeanUtils.copyProperties(connInstance, connInstanceTO, IGNORE_PROPERTIES);
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/SchemaDataBinder.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/SchemaDataBinder.java?rev=1461503&r1=1461502&r2=1461503&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/SchemaDataBinder.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/SchemaDataBinder.java Wed Mar 27 10:24:29 2013
@@ -29,8 +29,6 @@ import org.apache.syncope.core.persisten
import org.apache.syncope.core.persistence.dao.SchemaDAO;
import org.apache.syncope.core.util.AttributableUtil;
import org.apache.syncope.core.util.JexlUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
@@ -39,11 +37,6 @@ import org.springframework.stereotype.Co
@Component
public class SchemaDataBinder {
- /**
- * Logger.
- */
- private static final Logger LOG = LoggerFactory.getLogger(SchemaDataBinder.class);
-
@Autowired
private SchemaDAO schemaDAO;
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/util/ConnIdBundleManager.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/util/ConnIdBundleManager.java?rev=1461503&r1=1461502&r2=1461503&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/util/ConnIdBundleManager.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/util/ConnIdBundleManager.java Wed Mar 27 10:24:29 2013
@@ -21,19 +21,32 @@ package org.apache.syncope.core.util;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
+import java.net.URI;
+import java.net.URISyntaxException;
import java.net.URL;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.LinkedHashMap;
import java.util.List;
+import java.util.Map;
import java.util.Properties;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.X509TrustManager;
import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang.StringUtils;
import org.apache.syncope.core.persistence.dao.NotFoundException;
import org.identityconnectors.common.IOUtil;
+import org.identityconnectors.common.security.GuardedString;
import org.identityconnectors.framework.api.APIConfiguration;
import org.identityconnectors.framework.api.ConfigurationProperties;
import org.identityconnectors.framework.api.ConnectorInfo;
import org.identityconnectors.framework.api.ConnectorInfoManager;
import org.identityconnectors.framework.api.ConnectorInfoManagerFactory;
import org.identityconnectors.framework.api.ConnectorKey;
+import org.identityconnectors.framework.api.RemoteFrameworkConnectionInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -50,40 +63,52 @@ public final class ConnIdBundleManager {
public static final String CONNID_PROPS = "/connid.properties";
/**
- * Directory path containing ConnId bundles.
+ * ConnId Locations.
*/
- private static String connIdBundlesDir;
+ private static final List<URI> LOCATIONS;
/**
- * Lock for operating on ConnectorInfoManager shared instance.
+ * ConnectorInfoManager instances.
*/
- private static final Object LOCK = new Object();
-
- /**
- * ConnectorInfoManager shared instance.
- */
- private static ConnectorInfoManager connManager;
+ private static final Map<URI, ConnectorInfoManager> CONN_MANAGERS;
static {
+ String[] stringLocations = null;
+
InputStream propStream = null;
try {
propStream = ConnIdBundleManager.class.getResourceAsStream(CONNID_PROPS);
Properties props = new Properties();
props.load(propStream);
- connIdBundlesDir = props.getProperty("bundles.directory");
+ stringLocations = props.getProperty("connid.locations").split(",");
+
+ LOG.debug("ConnId locations: {}", Arrays.asList(stringLocations));
} catch (Exception e) {
LOG.error("Could not load {}", CONNID_PROPS, e);
+ stringLocations = new String[0];
} finally {
IOUtils.closeQuietly(propStream);
}
+
+ List<URI> locations = new ArrayList<URI>();
+ for (String location : stringLocations) {
+ try {
+ locations.add(new URI(location.trim()));
+ LOG.info("Valid ConnId location: {}", location.trim());
+ } catch (URISyntaxException e) {
+ LOG.error("Invalid ConnId location: {}", location.trim(), e);
+ }
+ }
+ LOCATIONS = Collections.unmodifiableList(locations);
+ CONN_MANAGERS = Collections.synchronizedMap(new LinkedHashMap<URI, ConnectorInfoManager>());
}
- private static void initConnManager() {
- // 1. Find bundles inside connidBundlesDir
- File bundleDirectory = new File(connIdBundlesDir);
+ private static void initLocal(final URI location) {
+ // 1. Find bundles inside local directory
+ File bundleDirectory = new File(location);
String[] bundleFiles = bundleDirectory.list();
if (bundleFiles == null) {
- throw new NotFoundException("Connector bundles directory " + connIdBundlesDir);
+ throw new NotFoundException("Local bundles directory " + location);
}
List<URL> bundleFileURLs = new ArrayList<URL>();
@@ -97,43 +122,127 @@ public final class ConnIdBundleManager {
}
if (bundleFileURLs.isEmpty()) {
- LOG.warn("No connector bundles found in {}", connIdBundlesDir);
+ LOG.warn("No connector bundles found in {}", location);
}
- LOG.debug("Bundle file URLs: {}", bundleFileURLs);
+ LOG.debug("Configuring local connector server:"
+ + "\n\tFiles: {}", bundleFileURLs);
// 2. Get connector info manager
ConnectorInfoManager manager = ConnectorInfoManagerFactory.getInstance().getLocalManager(
bundleFileURLs.toArray(new URL[bundleFileURLs.size()]));
if (manager == null) {
- throw new NotFoundException("Connector Info Manager");
+ throw new NotFoundException("Local ConnectorInfoManager");
}
- connManager = manager;
+ CONN_MANAGERS.put(location, manager);
}
- public static void resetConnManager() {
- synchronized (LOCK) {
- connManager = null;
+ private static void initRemote(final URI location) {
+ // 1. Extract conf params for remote connection from given URI
+ final String host = location.getHost();
+ final int port = location.getPort();
+ final GuardedString key = new GuardedString(location.getUserInfo().toCharArray());
+ final boolean useSSL = location.getScheme().equals("connids");
+
+ final List<TrustManager> trustManagers = new ArrayList<TrustManager>();
+ final String[] params = StringUtils.isBlank(location.getQuery()) ? null : location.getQuery().split("&");
+ if (params != null && params.length > 0) {
+ final String[] trustAllCerts = params[0].split("=");
+ if (trustAllCerts != null && trustAllCerts.length > 1
+ && "trustAllCerts".equalsIgnoreCase(trustAllCerts[0])
+ && "true".equalsIgnoreCase(trustAllCerts[1])) {
+
+ trustManagers.add(new X509TrustManager() {
+
+ @Override
+ public void checkClientTrusted(final X509Certificate[] chain, final String authType)
+ throws CertificateException {
+ // no checks, trust all
+ }
+
+ @Override
+ public void checkServerTrusted(final X509Certificate[] chain, final String authType)
+ throws CertificateException {
+ // no checks, trust all
+ }
+
+ @Override
+ public X509Certificate[] getAcceptedIssuers() {
+ return null;
+ }
+ });
+ }
+ }
+
+ LOG.debug("Configuring remote connector server:"
+ + "\n\tHost: {}"
+ + "\n\tPort: {}"
+ + "\n\tKey: {}"
+ + "\n\tUseSSL: {}"
+ + "\n\tTrustAllCerts: {}",
+ host, port, key, useSSL, !trustManagers.isEmpty());
+
+ RemoteFrameworkConnectionInfo info =
+ new RemoteFrameworkConnectionInfo(host, port, key, useSSL, trustManagers, 60 * 1000);
+ LOG.debug("Remote connection info: {}", info);
+
+ // 2. Get connector info manager
+ ConnectorInfoManager manager = ConnectorInfoManagerFactory.getInstance().getRemoteManager(info);
+ if (manager == null) {
+ throw new NotFoundException("Remote ConnectorInfoManager");
}
+
+ CONN_MANAGERS.put(location, manager);
}
- public static ConnectorInfoManager getConnManager() {
- synchronized (LOCK) {
- if (connManager == null) {
- initConnManager();
+ public static void resetConnManagers() {
+ CONN_MANAGERS.clear();
+ }
+
+ public static Map<URI, ConnectorInfoManager> getConnManagers() {
+ if (CONN_MANAGERS.isEmpty()) {
+ for (URI location : LOCATIONS) {
+ try {
+ if ("file".equals(location.getScheme())) {
+ LOG.debug("Local initialization: {}", location);
+ initLocal(location);
+ } else if (location.getScheme().startsWith("connid")) {
+ LOG.debug("Remote initialization: {}", location);
+ initRemote(location);
+ } else {
+ LOG.warn("Unsupported scheme: {}", location);
+ }
+ } catch (Exception e) {
+ LOG.error("Could not process {}", location, e);
+ }
+ }
+ }
+
+ if (LOG.isDebugEnabled()) {
+ for (Map.Entry<URI, ConnectorInfoManager> entry : CONN_MANAGERS.entrySet()) {
+ LOG.debug("Connector bundles found at {}", entry.getKey());
+ for (ConnectorInfo connInfo : entry.getValue().getConnectorInfos()) {
+ LOG.debug("\t{}", connInfo.getConnectorDisplayName());
+ }
}
}
- return connManager;
+
+ return CONN_MANAGERS;
}
- public static ConfigurationProperties getConfProps(
- final String bundleName, final String bundleVersion, final String connectorName) {
+ public static ConnectorInfo getConnectorInfo(
+ final String location, final String bundleName, final String bundleVersion, final String connectorName) {
+
+ // check ConnIdLocation
+ URI uriLocation = null;
+ try {
+ uriLocation = new URI(location);
+ } catch (URISyntaxException e) {
+ throw new IllegalArgumentException("Invalid ConnId location " + location, e);
+ }
// create key for search all properties
final ConnectorKey key = new ConnectorKey(bundleName, bundleVersion, connectorName);
- if (key == null) {
- throw new NotFoundException("Connector Key");
- }
if (LOG.isDebugEnabled()) {
LOG.debug("\nBundle name: " + key.getBundleName()
@@ -142,15 +251,26 @@ public final class ConnIdBundleManager {
}
// get the specified connector
- ConnectorInfo info = getConnManager().findConnectorInfo(key);
+ ConnectorInfo info = null;
+ if (getConnManagers().containsKey(uriLocation)) {
+ info = getConnManagers().get(uriLocation).findConnectorInfo(key);
+ }
if (info == null) {
- throw new NotFoundException("Connector Info for key " + key);
+ throw new NotFoundException("Connector Info for location " + location + " and key " + key);
}
- return getConfProps(info);
+ return info;
+ }
+
+ public static Map<String, List<ConnectorInfo>> getConnectorInfos() {
+ final Map<String, List<ConnectorInfo>> infos = new LinkedHashMap<String, List<ConnectorInfo>>();
+ for (Map.Entry<URI, ConnectorInfoManager> entry : CONN_MANAGERS.entrySet()) {
+ infos.put(entry.getKey().toString(), entry.getValue().getConnectorInfos());
+ }
+ return infos;
}
- public static ConfigurationProperties getConfProps(final ConnectorInfo info) {
+ public static ConfigurationProperties getConfigurationProperties(final ConnectorInfo info) {
if (info == null) {
throw new NotFoundException("Invalid: connector info is null");
}
@@ -169,8 +289,10 @@ public final class ConnIdBundleManager {
if (LOG.isDebugEnabled()) {
for (String propName : properties.getPropertyNames()) {
- LOG.debug("Property Name: {}\nProperty Type: {}",
- properties.getProperty(propName).getName(), properties.getProperty(propName).getType());
+ LOG.debug("Property Name: {}"
+ + "\nProperty Type: {}",
+ properties.getProperty(propName).getName(),
+ properties.getProperty(propName).getType());
}
}
Modified: syncope/trunk/core/src/main/resources/connid.properties
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/resources/connid.properties?rev=1461503&r1=1461502&r2=1461503&view=diff
==============================================================================
--- syncope/trunk/core/src/main/resources/connid.properties (original)
+++ syncope/trunk/core/src/main/resources/connid.properties Wed Mar 27 10:24:29 2013
@@ -14,4 +14,4 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-bundles.directory=${bundles.directory}
+connid.locations=${connid.location}
Modified: syncope/trunk/core/src/main/resources/logback.xml
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/resources/logback.xml?rev=1461503&r1=1461502&r2=1461503&view=diff
==============================================================================
--- syncope/trunk/core/src/main/resources/logback.xml (original)
+++ syncope/trunk/core/src/main/resources/logback.xml Wed Mar 27 10:24:29 2013
@@ -110,14 +110,18 @@ under the License.
<level value="DEBUG"/>
<appender-ref ref="connid"/>
</logger>
- <logger name="org.apache.syncope.core.connid" additivity="false">
+ <logger name="org.connid" additivity="false">
<level value="DEBUG"/>
<appender-ref ref="connid"/>
</logger>
- <logger name="org.connid" additivity="false">
+ <logger name="org.apache.syncope.core.connid" additivity="false">
<level value="DEBUG"/>
<appender-ref ref="connid"/>
</logger>
+ <logger name="org.apache.syncope.core.util.ConnIdBundleManager" additivity="false">
+ <level value="INFO"/>
+ <appender-ref ref="connid"/>
+ </logger>
<logger name="org.springframework" additivity="false">
<level value="INFO"/>
Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/AbstractTest.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/AbstractTest.java?rev=1461503&r1=1461502&r2=1461503&view=diff
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/AbstractTest.java (original)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/AbstractTest.java Wed Mar 27 10:24:29 2013
@@ -48,7 +48,7 @@ public abstract class AbstractTest {
Properties props = new Properties();
props.load(propStream);
- bundlesDirectory = props.getProperty("bundles.directory");
+ bundlesDirectory = props.getProperty("connid.locations");
connidSoapVersion = props.getProperty("connid.soap.version");
} catch (Exception e) {
LOG.error("Could not load {}", ConnIdBundleManager.CONNID_PROPS, e);
Copied: syncope/trunk/core/src/test/java/org/apache/syncope/core/init/ConnectorManagerTest.java (from r1460576, syncope/trunk/core/src/test/java/org/apache/syncope/core/init/ConnInstanceLoaderTest.java)
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/init/ConnectorManagerTest.java?p2=syncope/trunk/core/src/test/java/org/apache/syncope/core/init/ConnectorManagerTest.java&p1=syncope/trunk/core/src/test/java/org/apache/syncope/core/init/ConnInstanceLoaderTest.java&r1=1460576&r2=1461503&rev=1461503&view=diff
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/init/ConnInstanceLoaderTest.java (original)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/init/ConnectorManagerTest.java Wed Mar 27 10:24:29 2013
@@ -21,20 +21,22 @@ package org.apache.syncope.core.init;
import static org.junit.Assert.assertEquals;
import org.apache.syncope.core.AbstractNonDAOTest;
+import org.apache.syncope.core.persistence.beans.ExternalResource;
import org.apache.syncope.core.persistence.dao.ResourceDAO;
import org.apache.syncope.core.propagation.Connector;
import org.apache.syncope.core.rest.data.ResourceDataBinder;
import org.apache.syncope.core.util.ApplicationContextProvider;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.util.ReflectionTestUtils;
import org.springframework.transaction.annotation.Transactional;
@Transactional
-public class ConnInstanceLoaderTest extends AbstractNonDAOTest {
+public class ConnectorManagerTest extends AbstractNonDAOTest {
- private ConnectorManager cil;
+ private ConnectorManager connManager;
@Autowired
private ResourceDAO resourceDAO;
@@ -44,24 +46,27 @@ public class ConnInstanceLoaderTest exte
@Before
public void before() {
- cil = new ConnectorManager();
- ReflectionTestUtils.setField(cil, "resourceDAO", resourceDAO);
- ReflectionTestUtils.setField(cil, "resourceDataBinder", resourceDataBinder);
-
- // Remove any other connector instance bean set up by
- // standard ConnInstanceLoader.load()
- for (String bean : ApplicationContextProvider.getApplicationContext().
- getBeanNamesForType(Connector.class)) {
+ connManager = new ConnectorManager();
+ ReflectionTestUtils.setField(connManager, "resourceDAO", resourceDAO);
+ ReflectionTestUtils.setField(connManager, "resourceDataBinder", resourceDataBinder);
- cil.unregisterConnector(bean);
- }
+ // Remove any other connector instance bean set up by standard ConnectorManager.load()
+ connManager.unload();
}
- @Test
+ @Test@Ignore
public void load() {
- cil.load();
+ connManager.load();
+
+ // only consider local connector bundles
+ int expected = 0;
+ for (ExternalResource resource : resourceDAO.findAll()) {
+ if (resource.getConnector().getLocation().startsWith("file")) {
+ expected++;
+ }
+ }
- assertEquals(resourceDAO.findAll().size(),
+ assertEquals(expected,
ApplicationContextProvider.getApplicationContext().
getBeanNamesForType(Connector.class, false, true).length);
}
Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/persistence/dao/ConnInstanceTest.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/persistence/dao/ConnInstanceTest.java?rev=1461503&r1=1461502&r2=1461503&view=diff
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/persistence/dao/ConnInstanceTest.java (original)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/persistence/dao/ConnInstanceTest.java Wed Mar 27 10:24:29 2013
@@ -20,6 +20,7 @@ package org.apache.syncope.core.persiste
import static org.junit.Assert.*;
+import java.io.File;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
@@ -60,21 +61,22 @@ public class ConnInstanceTest extends Ab
@Test
public void save() throws ClassNotFoundException {
+ ConnInstance connInstance = new ConnInstance();
- ConnInstance connectorInstance = new ConnInstance();
+ connInstance.setLocation(new File("java.io.tmpdir").toURI().toString());
// set connector version
- connectorInstance.setVersion("1.0");
+ connInstance.setVersion("1.0");
// set connector name
- connectorInstance.setConnectorName("WebService");
+ connInstance.setConnectorName("WebService");
// set bundle name
- connectorInstance.setBundleName("org.apache.syncope.core.persistence.test.util");
+ connInstance.setBundleName("org.apache.syncope.core.persistence.test.util");
- connectorInstance.setDisplayName("New");
+ connInstance.setDisplayName("New");
- connectorInstance.setConnRequestTimeout(60);
+ connInstance.setConnRequestTimeout(60);
// set the connector configuration using PropertyTO
Set<ConnConfProperty> conf = new HashSet<ConnConfProperty>();
@@ -99,11 +101,11 @@ public class ConnInstanceTest extends Ab
conf.add(servicename);
// set connector configuration
- connectorInstance.setConfiguration(conf);
- assertFalse(connectorInstance.getConfiguration().isEmpty());
+ connInstance.setConfiguration(conf);
+ assertFalse(connInstance.getConfiguration().isEmpty());
// perform save operation
- ConnInstance actual = connInstanceDAO.save(connectorInstance);
+ ConnInstance actual = connInstanceDAO.save(connInstance);
assertNotNull("save did not work", actual.getId());
@@ -114,13 +116,13 @@ public class ConnInstanceTest extends Ab
assertEquals("save did not work for \"bundle name\" attribute", "org.apache.syncope.core.persistence.test.util",
actual.getBundleName());
- assertEquals("save did not work for \"majorVersion\" attribute", "1.0", connectorInstance.getVersion());
+ assertEquals("save did not work for \"majorVersion\" attribute", "1.0", connInstance.getVersion());
assertEquals("New", actual.getDisplayName());
assertEquals(new Integer(60), actual.getConnRequestTimeout());
- conf = connectorInstance.getConfiguration();
+ conf = connInstance.getConfiguration();
assertFalse(conf.isEmpty());
assertNotNull("configuration retrieving failed", conf);
Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ConnInstanceTestITCase.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ConnInstanceTestITCase.java?rev=1461503&r1=1461502&r2=1461503&view=diff
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ConnInstanceTestITCase.java (original)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ConnInstanceTestITCase.java Wed Mar 27 10:24:29 2013
@@ -27,6 +27,7 @@ import static org.junit.Assert.fail;
import java.io.IOException;
import java.io.InputStream;
+import java.net.URI;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
@@ -64,18 +65,14 @@ public class ConnInstanceTestITCase exte
private static String connidDbTableVersion;
- private static String bundlesDirectory;
-
@BeforeClass
public static void setUpConnIdBundles() throws IOException {
InputStream propStream = null;
try {
Properties props = new Properties();
- propStream = org.apache.syncope.core.AbstractTest.class.
- getResourceAsStream(ConnIdBundleManager.CONNID_PROPS);
+ propStream = ConnInstanceTestITCase.class.getResourceAsStream(ConnIdBundleManager.CONNID_PROPS);
props.load(propStream);
- bundlesDirectory = props.getProperty("bundles.directory");
connidSoapVersion = props.getProperty("connid.soap.version");
connidDbTableVersion = props.getProperty("connid.db.table.version");
} catch (Exception e) {
@@ -83,7 +80,6 @@ public class ConnInstanceTestITCase exte
} finally {
IOUtils.closeQuietly(propStream);
}
- assertNotNull(bundlesDirectory);
assertNotNull(connidSoapVersion);
assertNotNull(connidDbTableVersion);
}
@@ -102,6 +98,8 @@ public class ConnInstanceTestITCase exte
public void create() {
ConnInstanceTO connectorTO = new ConnInstanceTO();
+ connectorTO.setLocation(ConnIdBundleManager.getConnManagers().keySet().iterator().next().toString());
+
// set connector version
connectorTO.setVersion(connidSoapVersion);
@@ -425,8 +423,13 @@ public class ConnInstanceTestITCase exte
@Test
public void validate() {
-
ConnInstanceTO connectorTO = new ConnInstanceTO();
+
+ for (URI location : ConnIdBundleManager.getConnManagers().keySet()) {
+ if (!location.getScheme().equals("file")) {
+ connectorTO.setLocation(location.toString());
+ }
+ }
// set connector version
connectorTO.setVersion(connidDbTableVersion);
@@ -549,12 +552,13 @@ public class ConnInstanceTestITCase exte
@Test
public void issueSYNCOPE112() {
-
// ----------------------------------------
// Create a new connector
// ----------------------------------------
ConnInstanceTO connectorTO = new ConnInstanceTO();
+ connectorTO.setLocation(ConnIdBundleManager.getConnManagers().keySet().iterator().next().toString());
+
// set connector version
connectorTO.setVersion(connidSoapVersion);
Modified: syncope/trunk/core/src/test/resources/connid.properties
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/resources/connid.properties?rev=1461503&r1=1461502&r2=1461503&view=diff
==============================================================================
--- syncope/trunk/core/src/test/resources/connid.properties (original)
+++ syncope/trunk/core/src/test/resources/connid.properties Wed Mar 27 10:24:29 2013
@@ -14,6 +14,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
+connid.locations=${connid.location},\
+connid://${testconnectorserver.key}@localhost:${testconnectorserver.port}
connid.soap.version=${connid.soap.version}
connid.db.table.version=${connid.db.table.version}
-bundles.directory=${bundles.directory}