Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/main' into 604-filter-ma…
Browse files Browse the repository at this point in the history
…nagement-service
  • Loading branch information
TorbenSiegismund-GIP committed Dec 13, 2023
2 parents 0b2ea09 + 5054b34 commit 52d3306
Show file tree
Hide file tree
Showing 14 changed files with 149 additions and 25 deletions.
2 changes: 1 addition & 1 deletion installation/delivery/delivery.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ delivery.dir=/tmp
#release number of the delivery item
release.number=v9.0.4.0
#tag of xyna-modeller release
xynamodeller.release.tag=9.0.3.1
xynamodeller.release.tag=main
25 changes: 25 additions & 0 deletions modules/xact/ssh/file/XMOM/xact/ssh/file/SSHServerParameter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,31 @@
<Type>Integer</Type>
</Meta>
</Data>
<Data Label="PrivateKey" VariableName="privateKey">
<Meta>
<Type>String</Type>
</Meta>
</Data>
<Data Label="PublicKey" VariableName="publicKey">
<Meta>
<Type>String</Type>
</Meta>
</Data>
<Data Label="PassPhrase" VariableName="passPhrase">
<Meta>
<Type>String</Type>
</Meta>
</Data>
<Data Label="PrivateKeyFile" VariableName="privateKeyFile">
<Meta>
<Type>String</Type>
</Meta>
</Data>
<Data Label="KnownHostFile" VariableName="knownHostFile">
<Meta>
<Type>String</Type>
</Meta>
</Data>
<Data Label="Bandwidth" VariableName="bandwidth">
<Meta>
<Documentation>Limit Bandwidth; kbit/s</Documentation>
Expand Down
2 changes: 1 addition & 1 deletion modules/xact/ssh/file/application.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* limitations under the License.
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-->
<Application applicationName="SSHFile" comment="" factoryVersion="" versionName="1.0.5" xmlVersion="1.1">
<Application applicationName="SSHFile" comment="" factoryVersion="" versionName="1.0.6" xmlVersion="1.1">
<ApplicationInfo>
<Description Lang="DE">SSH File Transfer (SCP)</Description>
<Description Lang="EN">SSH file transfer (SCP)</Description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public Long getOnUnDeploymentTimeout() {
// If null is returned, the default timeout (defined by XynaProperty xyna.xdev.xfractmod.xmdm.deploymenthandler.timeout) will be used.
return null;
}

public BehaviorAfterOnUnDeploymentTimeout getBehaviorAfterOnUnDeploymentTimeout() {
// Defines the behavior of the (un)deployment after reaching the timeout and if this service ignores a Thread.interrupt.
// - BehaviorAfterOnUnDeploymentTimeout.EXCEPTION: Deployment will be aborted, while undeployment will log the exception and NOT abort.
Expand Down Expand Up @@ -118,7 +118,7 @@ public void scpDocumentToRemoteHost(SSHServerParameter server, Document document

@Override
public Container scpFromRemoteHost(SSHServerParameter server, File remoteFile, Text location) {
String localName = remoteFile.getPath(); //FIXME lokaler name übergebn?
String localName = remoteFile.getPath(); //FIXME lokaler name übergebn?
int idx = localName.lastIndexOf('/');
if ( idx > 0 ) {
localName = localName.substring(idx+1);
Expand Down Expand Up @@ -211,15 +211,45 @@ private Session getSession(SSHServerParameter server) throws JSchException {

int port = server.getPort() == null ? 22 : server.getPort().intValue();
Session s = jsch.getSession(server.getUser(), server.getHost(), port);
PassphraseRetrievingUserInfo userInfo =
new PassphraseRetrievingUserInfo(new SecureStorablePassphraseStore(), new LogAdapter(logger) );
s.setUserInfo(userInfo);
s.setConfig("StrictHostKeyChecking", "no"); //FIXME sinnvoll?

if (server.getPassword() != null && server.getPassword().length() > 0) {
PassphraseRetrievingUserInfo userInfo =
new PassphraseRetrievingUserInfo(new SecureStorablePassphraseStore(), new LogAdapter(logger) );
s.setUserInfo(userInfo);
s.setPassword(server.getPassword());
userInfo.setPassword(server.getPassword());
s.setConfig("PreferredAuthentications", "password,keyboard-interactive");
}
s.setConfig("PreferredAuthentications", "password,keyboard-interactive");

String knownHostsFile = server.getKnownHostFile();
String privateKeyFile = server.getPrivateKeyFile();
String privateKey = server.getPrivateKey();
String publicKey = server.getPublicKey();
String passPhrase = server.getPassPhrase();
if (privateKey != null && privateKey.length() > 0) {
String charset = "US-ASCII";
try {
if (publicKey==null) publicKey = "";
if (passPhrase==null) passPhrase = "";
byte[] privateKeyBytes = privateKey.getBytes(charset);
byte[] publicKeyBytes = publicKey.getBytes(charset);
byte[] passPhraseBytes = passPhrase.getBytes(charset);
jsch.setConfig("PreferredAuthentications", "publickey");
jsch.addIdentity("id_rsa", privateKeyBytes, publicKeyBytes, passPhraseBytes);
} catch(Exception ex) {

}
} else if (privateKeyFile != null && privateKeyFile.length() > 0) {
jsch.setConfig("PreferredAuthentications", "publickey");
jsch.setConfig("StrictHostKeyChecking", "no");
jsch.addIdentity(privateKeyFile, passPhrase);
}
if (knownHostsFile != null && knownHostsFile.length() > 0) {
jsch.setKnownHosts(knownHostsFile);
jsch.setConfig("StrictHostKeyChecking", "yes");
}

if(server.getSCPTimeouts() != null && server.getSCPTimeouts().getConnectionTimeout() != null && server.getSCPTimeouts().getConnectionTimeout() > 0)
s.connect(server.getSCPTimeouts().getConnectionTimeout());
else
Expand Down
2 changes: 1 addition & 1 deletion modules/xmcp/gitIntegration/application.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
--><Application applicationName="GitIntegration" comment="" factoryVersion="9.0.2.0" versionName="0.1.1" xmlVersion="1.1">
--><Application applicationName="GitIntegration" comment="" factoryVersion="" versionName="0.1.2" xmlVersion="1.1">
<ApplicationInfo>
<RuntimeContextRequirements>
<RuntimeContextRequirement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

import com.gip.xyna.XynaFactory;
import com.gip.xyna.xnwh.persistence.xmom.XMOMODSMapping;
import com.gip.xyna.xnwh.persistence.xmom.XMOMODSMappingUtils;
import com.gip.xyna.xprc.xfractwfe.generation.xml.XmlBuilder;
Expand Down Expand Up @@ -207,23 +208,36 @@ public List<XMOMStorable> createItems(Long revision) {

@Override
public void create(XMOMStorable item, long revision) {
// TODO Auto-generated method stub

XMOMODSMapping mapping = new XMOMODSMapping();
mapping.setId(XynaFactory.getInstance().getXynaNetworkWarehouse().getXMOMPersistence().getXMOMPersistenceManagement().genId());
mapping.setRevision(revision);
mapping.setPath(item.getPath());
mapping.setFqpath(item.getFQPath());
mapping.setFqxmlname(item.getXMLName());
mapping.setTablename(item.getODSName());
mapping.setColumnname(item.getColumnName());
mapping.setUserdefined(false);
try {
XMOMODSMappingUtils.storeMapping(mapping);
} catch (Exception e) {
throw new RuntimeException(e);
}
}


@Override
public void modify(XMOMStorable from, XMOMStorable to, long revision) {
// TODO Auto-generated method stub

this.delete(from, revision);
this.create(to, revision);
}


@Override
public void delete(XMOMStorable item, long revision) {
// TODO Auto-generated method stub

try {
XMOMODSMappingUtils.removeForRevisionNameAndFqPath(revision, item.getXMLName(), item.getFQPath());
} catch (Exception e) {
throw new RuntimeException(e);
}
}


}
2 changes: 1 addition & 1 deletion modules/xmcp/guihttp/application.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</RuntimeContextRequirement>
<RuntimeContextRequirement>
<ApplicationName>ZetaFramework</ApplicationName>
<VersionName>0.6.47</VersionName>
<VersionName>0.6.48</VersionName>
</RuntimeContextRequirement>
<RuntimeContextRequirement>
<ApplicationName>XynaPropertyMgmt</ApplicationName>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Configurator:

factorySettings = {
"ip": str,
"port": bool,
"port": int,
"username": str,
"password": str,
"https": bool,
Expand Down
2 changes: 1 addition & 1 deletion modules/xmcp/multirole/application.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</RuntimeContextRequirement>
<RuntimeContextRequirement>
<ApplicationName>ZetaFramework</ApplicationName>
<VersionName>0.6.47</VersionName>
<VersionName>0.6.48</VersionName>
</RuntimeContextRequirement>
</RuntimeContextRequirements>
</ApplicationInfo>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* Copyright 2022 Xyna GmbH, Germany
*
* Licensed 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.
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-->
<DataType xmlns="http://www.gip.com/xyna/xdev/xfractmod" BaseTypeName="ButtonDefinition" BaseTypePath="xmcp.forms.datatypes" IsAbstract="false" Label="Upload Button Definition" TypeName="UploadButtonDefinition" TypePath="xmcp.forms.datatypes" Version="1.8">
<Meta>
<IsServiceGroupOnly>false</IsServiceGroupOnly>
</Meta>
<Data Label="Host" VariableName="host">
<Meta>
<Type>String</Type>
</Meta>
</Data>
</DataType>
6 changes: 5 additions & 1 deletion modules/xmcp/zetaFramework/application.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* limitations under the License.
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-->
<Application applicationName="ZetaFramework" comment="" factoryVersion="" versionName="0.6.47" xmlVersion="1.1">
<Application applicationName="ZetaFramework" comment="" factoryVersion="" versionName="0.6.48" xmlVersion="1.1">
<ApplicationInfo>
<RuntimeContextRequirements>
<RuntimeContextRequirement>
Expand Down Expand Up @@ -191,6 +191,10 @@
<FqName>xmcp.forms.datatypes.TreePanelDefinition</FqName>
<Type>DATATYPE</Type>
</XMOMEntry>
<XMOMEntry implicitDependency="false">
<FqName>xmcp.forms.datatypes.UploadButtonDefinition</FqName>
<Type>DATATYPE</Type>
</XMOMEntry>
<XMOMEntry implicitDependency="false">
<FqName>xmcp.forms.datatypes.DefinitionListDefinition</FqName>
<Type>DATATYPE</Type>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public void run() {
}
}
});
thread.setName("MessageStore");
thread.setDaemon(true);
thread.start();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -480,11 +480,18 @@ private static void createMapping(PathBuilder path, NameType nameType, String un
mapping.setColumnname(uniqueName);
break;
default :
new IllegalArgumentException("Unextpacted NameType: " + nameType);
new IllegalArgumentException("Unexpected NameType: " + nameType);
}
mapping.setUserdefined(false);
mapping.setUserdefined(false);
XMOMODSMappingUtils.storeMapping(mapping);
}


public static void storeMapping(XMOMODSMapping mapping) throws PersistenceLayerException {
ODS ods = ODSImpl.getInstance();
ODSConnection con = ods.openConnection(ODSConnectionType.HISTORY);
XMOMPersistenceManagement persistenceMgmt = XynaFactory.getInstance().getXynaNetworkWarehouse().getXMOMPersistence().getXMOMPersistenceManagement();
try {
persistenceMgmt.storeConfigAndSetPersistenceLayers(mapping, con);
} finally {
Expand All @@ -495,8 +502,8 @@ private static void createMapping(PathBuilder path, NameType nameType, String un
}
}
}


public static Set<String> discoverPaths(Set<DOM> domsThatCacheSubtypes, DOM dom, GenerationBaseCache parseAdditionalCache) {
DOM currentRoot = getSuperRoot(dom);
Set<String> paths = new HashSet<String>();
Expand Down Expand Up @@ -734,6 +741,21 @@ public static XMOMODSMapping getByNameRevisionFqPath(String name, Long revision,
}


public static void removeForRevisionNameAndFqPath(Long revision, String name, String fqPath) throws PersistenceLayerException {
ODS ods = ODSImpl.getInstance();
ODSConnection con = ods.openConnection(ODSConnectionType.HISTORY);
try {
List<XMOMODSMapping> result = executeQuery(con, ROOTNAME_REVISION_AND_FQPATH_QUERY, new Parameter(name, revision, fqPath));
if (result.size() > 0) {
con.delete(result);
con.commit();
}
} finally {
con.closeConnection();
}
}


public static void removeAllForRevision(long revision) throws PersistenceLayerException {
ODS ods = ODSImpl.getInstance();
ODSConnection con = ods.openConnection(ODSConnectionType.HISTORY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public void onChange(ClusterState newState) {

private class FactoryShutdownClusterStateChangeHandler implements ClusterStateChangeHandler {

private volatile Timer shutdownTimer = new Timer();
private volatile Timer shutdownTimer = new Timer("CapacityManagement - FactoryShutdownClusterStateChangeHandler - shutdown timer");
private volatile boolean shutDownInitialized = false;
private ClusterState state;

Expand Down

0 comments on commit 52d3306

Please sign in to comment.