public static String getConnectorHostTypeOid(ConnectorType connectorType) { if (connectorType.getConnectorHostRef() != null) { return connectorType.getConnectorHostRef().getOid(); } else if (connectorType.getConnectorHost() != null) { return connectorType.getConnectorHost().getOid(); } else { return null; } }
if (hostType != null && foundConnector.getConnectorHost() == null) { foundConnector.setConnectorHost(hostType);
/** * Get contect informations * * @param connectorType * @return * @throws ObjectNotFoundException */ private ConnectorInfo getConnectorInfo(ConnectorType connectorType) throws ObjectNotFoundException { if (!SchemaConstants.ICF_FRAMEWORK_URI.equals(connectorType.getFramework())) { throw new ObjectNotFoundException("Requested connector for framework " + connectorType.getFramework() + " cannot be found in framework " + SchemaConstants.ICF_FRAMEWORK_URI); } ConnectorKey key = getConnectorKey(connectorType); if (connectorType.getConnectorHost() == null && connectorType.getConnectorHostRef() == null) { // Local connector return getLocalConnectorInfoManager().findConnectorInfo(key); } ConnectorHostType host = connectorType.getConnectorHost(); if (host == null) { throw new ObjectNotFoundException( "Attempt to use remote connector without ConnectorHostType resolved (there is only ConnectorHostRef"); } return getRemoteConnectorInfoManager(host).findConnectorInfo(key); }
ObjectTypeUtil.toShortString(connectorType)); LOGGER.trace("Connector object: {}", ObjectTypeUtil.dump(connectorType)); LOGGER.trace("Connector host object: {}", ObjectTypeUtil.dump(connectorType.getConnectorHost())); throw new ObjectNotFoundException("The classes (JAR) of " + ObjectTypeUtil.toShortString(connectorType) + " were not found by the ICF framework; bundle="+connectorType.getConnectorBundle()+" connector type=" + connectorType.getConnectorType() + ", version="+connectorType.getConnectorVersion());
ConnectorType foundConnectorType = foundConnector.asObjectable(); if (connectorType.getConnectorHost() != null) { if (foundConnectorType.getConnectorHost() == null) { connectorType.setConnectorHostRef(ObjectTypeUtil.createObjectRef(connectorType.getConnectorHost().getOid(), ObjectTypes.CONNECTOR_HOST)); connectorType.setConnectorHost(null);
if (connectorType.getConnectorHost() == null && connectorType.getConnectorHostRef() != null) {
public static void copyFromJAXB(ConnectorType jaxb, RConnector repo, RepositoryContext repositoryContext, IdGeneratorResult generatorResult) throws DtoTranslationException { copyAssignmentHolderInformationFromJAXB(jaxb, repo, repositoryContext, generatorResult); repo.setNameCopy(RPolyString.copyFromJAXB(jaxb.getName())); repo.setConnectorBundle(jaxb.getConnectorBundle()); repo.setConnectorType(jaxb.getConnectorType()); repo.setConnectorVersion(jaxb.getConnectorVersion()); repo.setFramework(jaxb.getFramework()); repo.setConnectorHostRef(RUtil.jaxbRefToEmbeddedRepoRef(jaxb.getConnectorHostRef(), repositoryContext.relationRegistry)); if (jaxb.getConnectorHost() != null) { LOGGER.warn("Connector host from connector type won't be saved. It should be " + "translated to connector host reference."); } try { repo.setTargetSystemType(RUtil.listToSet(jaxb.getTargetSystemType())); } catch (Exception ex) { throw new DtoTranslationException(ex.getMessage(), ex); } } }