Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/3.8' into 0002330
Browse files Browse the repository at this point in the history
  • Loading branch information
chenson42 committed Jan 4, 2016
2 parents 4e0e347 + 7399325 commit 74e1d93
Show file tree
Hide file tree
Showing 65 changed files with 555 additions and 159 deletions.
Expand Up @@ -27,7 +27,7 @@ Batch Rollback Script:: The script to execute if the batch rolls back.
Handle Error Script:: A script to execute if data cannot be processed.

.Variables available within scripts
[cols="3,^1,^1,5"]
[cols="3,^1,^1,^1,5"]
|===
|Variable|BSH|SQL|JAVA|Description

Expand Down
9 changes: 8 additions & 1 deletion symmetric-client-clib/inc/common/Log.h
Expand Up @@ -23,12 +23,16 @@
#define SYM_LOG_H

#include <stdio.h>
#include <stdarg.h>
#include <errno.h>
#include <time.h>
#include <libgen.h>
#include <dirent.h>
#include <sys/stat.h>
#include "util/StringBuilder.h"
#include "util/Properties.h"
#include "util/Date.h"
#include "util/StringUtils.h"
#include "util/FileUtils.h"

typedef enum {SYM_LOG_LEVEL_DEBUG, SYM_LOG_LEVEL_INFO, SYM_LOG_LEVEL_WARN, SYM_LOG_LEVEL_ERROR} SymLogLevel;

Expand All @@ -37,6 +41,9 @@ typedef enum {SYM_LOG_LEVEL_DEBUG, SYM_LOG_LEVEL_INFO, SYM_LOG_LEVEL_WARN, SYM_L
#define SYM_LOG_SETTINGS_LOG_LEVEL "client.log.level"
#define SYM_LOG_SETTINGS_LOG_DESTINATION "client.log.destination"
#define SYM_LOG_SETTINGS_LOG_SHOW_SOURCE_FILE "client.log.show.source.file"
#define SYM_LOG_SETTINGS_LOG_MAX_FILE_SIZE "client.log.max.file.size"
#define SYM_LOG_SETTINGS_LOG_BACKUP_APPEND "client.log.backup.append"
#define SYM_LOG_SETTINGS_LOG_DAYS_TO_KEEP "client.log.backup.days.to.keep"

#define SYM_LOG_LEVEL_DESC_DEBUG "DEBUG"
#define SYM_LOG_LEVEL_DESC_INFO "INFO"
Expand Down
1 change: 1 addition & 0 deletions symmetric-client-clib/inc/common/ParameterConstants.h
Expand Up @@ -94,5 +94,6 @@
#define SYM_PARAMETER_HTTPS_ALLOW_SELF_SIGNED_CERTS "https.allow.self.signed.certs"

#define SYM_PARAMETER_SQLITE_BUSY_TIMEOUT_MS "sqlite.busy.timeout.ms"
#define SYM_PARAMETER_SQLITE_INIT_SQL "sqlite.init.sql"

#endif
2 changes: 2 additions & 0 deletions symmetric-client-clib/inc/core/SymEngine.h
Expand Up @@ -35,6 +35,7 @@
#include "service/ParameterService.h"
#include "service/PushService.h"
#include "service/NodeService.h"
#include "service/NodeCommunicationService.h"
#include "service/PullService.h"
#include "service/RegistrationService.h"
#include "service/RouterService.h"
Expand Down Expand Up @@ -72,6 +73,7 @@ typedef struct SymEngine {
SymOfflinePushService *offlinePushService;
SymOfflinePullService *offlinePullService;
SymNodeService *nodeService;
SymNodeCommunicationService *nodeCommunicationService;
SymIncomingBatchService *incomingBatchService;
SymOutgoingBatchService *outgoingBatchService;
SymAcknowledgeService *acknowledgeService;
Expand Down
Expand Up @@ -27,6 +27,7 @@
#include "db/platform/DatabasePlatform.h"
#include "db/platform/sqlite/SqliteDdlReader.h"
#include "db/sqlite/SqliteSqlTemplate.h"
#include "util/StringArray.h"

#define SYM_SQLITE_DEFAULT_BUSY_TIMEOUT_MS "30000"

Expand Down
1 change: 1 addition & 0 deletions symmetric-client-clib/inc/io/writer/DataWriter.h
Expand Up @@ -38,6 +38,7 @@ typedef struct SymDataWriter {
void (*endTable)(struct SymDataWriter *this, SymTable *table);
void (*endBatch)(struct SymDataWriter *this, SymBatch *batch);
void (*destroy)(struct SymDataWriter *this);
unsigned short isSyncTriggersNeeded;
} SymDataWriter;

SymDataWriter * SymDataWriter_new(SymDataWriter *this);
Expand Down
7 changes: 6 additions & 1 deletion symmetric-client-clib/inc/io/writer/DefaultDatabaseWriter.h
Expand Up @@ -40,10 +40,15 @@
#include "db/SymDialect.h"
#include "model/IncomingBatch.h"
#include "service/IncomingBatchService.h"
#include "service/ParameterService.h"
#include "common/TableConstants.h"
#include "common/ParameterConstants.h"
#include "common/Constants.h"

typedef struct SymDefaultDatabaseWriter {
SymDataWriter super;
SymIncomingBatchService *incomingBatchService;
SymParameterService *parameterService;
SymDatabasePlatform *platform;
SymDialect *dialect;
SymDatabaseWriterSettings *settings;
Expand All @@ -59,6 +64,6 @@ typedef struct SymDefaultDatabaseWriter {
} SymDefaultDatabaseWriter;

SymDefaultDatabaseWriter * SymDefaultDatabaseWriter_new(SymDefaultDatabaseWriter *this, SymIncomingBatchService *incomingBatchService,
SymDatabasePlatform *platform, SymDialect *dialect, SymDatabaseWriterSettings *settings);
SymParameterService *parameterService, SymDatabasePlatform *platform, SymDialect *dialect, SymDatabaseWriterSettings *settings);

#endif
2 changes: 1 addition & 1 deletion symmetric-client-clib/inc/model/Node.h
Expand Up @@ -23,7 +23,7 @@

#include <stdlib.h>

#define SYM_VERSION "3.7.23"
#define SYM_VERSION "3.7.27.5"

typedef enum SymNodeStatus {
SYM_NODE_STATUS_DATA_LOAD_NOT_STARTED,
Expand Down
4 changes: 3 additions & 1 deletion symmetric-client-clib/inc/service/DataLoaderService.h
Expand Up @@ -27,6 +27,7 @@
#include "service/NodeService.h"
#include "service/IncomingBatchService.h"
#include "service/ParameterService.h"
#include "service/TriggerRouterService.h"
#include "transport/TransportManager.h"
#include "transport/IncomingTransport.h"
#include "model/Node.h"
Expand All @@ -44,6 +45,7 @@
typedef struct SymDataLoaderService {
SymParameterService *parameterService;
SymNodeService *nodeService;
SymTriggerRouterService *triggerRouterService;
SymTransportManager *transportManager;
SymTransportManager *fileTransportManager;
SymDatabasePlatform *platform;
Expand All @@ -56,7 +58,7 @@ typedef struct SymDataLoaderService {
void (*destroy)(struct SymDataLoaderService *this);
} SymDataLoaderService;

SymDataLoaderService * SymDataLoaderService_new(SymDataLoaderService *this, SymParameterService *parameterService, SymNodeService *nodeService,
SymDataLoaderService * SymDataLoaderService_new(SymDataLoaderService *this, SymParameterService *parameterService, SymNodeService *nodeService, SymTriggerRouterService *triggerRouterService,
SymTransportManager *transportManager, SymTransportManager *fileTransportManager, SymDatabasePlatform *platform, SymDialect *dialect, SymIncomingBatchService *incomingBatchService);

#endif
3 changes: 3 additions & 0 deletions symmetric-client-clib/inc/service/IncomingBatchService.h
Expand Up @@ -41,6 +41,7 @@ typedef struct SymIncomingBatchService {
int (*updateIncomingBatch)(struct SymIncomingBatchService *this, SymIncomingBatch *incomingBatch);
int (*deleteIncomingBatch)(struct SymIncomingBatchService *this, SymIncomingBatch *incomingBatch);
unsigned short (*isRecordOkBatchesEnabled)(struct SymIncomingBatchService *this);
int (*countIncomingBatchesInError)(struct SymIncomingBatchService *this);
void (*destroy)(struct SymIncomingBatchService *this);
} SymIncomingBatchService;

Expand Down Expand Up @@ -69,4 +70,6 @@ where batch_id = ? and node_id = ?"

#define SYM_SQL_DELETE_INCOMING_BATCH "delete from sym_incoming_batch where batch_id = ? and node_id = ?"

#define SYM_SQL_COUNT_INCOMING_BATCHES_ERRORS "select count(*) from sym_incoming_batch where error_flag = 1"

#endif
3 changes: 2 additions & 1 deletion symmetric-client-clib/inc/service/NodeCommunicationService.h
Expand Up @@ -37,6 +37,7 @@ typedef struct SymNodeCommunicationService {
void (*destroy)(struct SymNodeCommunicationService *this);
} SymNodeCommunicationService;

SymNodeCommunicationService * SymNodeCommunicationService_new(SymNodeCommunicationService *this, SymNodeService * nodeService);
SymNodeCommunicationService * SymNodeCommunicationService_new(SymNodeCommunicationService *this,
SymNodeService * nodeService, SymParameterService *parameterService);

#endif
7 changes: 5 additions & 2 deletions symmetric-client-clib/inc/service/OfflinePullService.h
Expand Up @@ -29,6 +29,7 @@
#include "service/DataLoaderService.h"
#include "service/RegistrationService.h"
#include "service/ConfigurationService.h"
#include "service/NodeCommunicationService.h"
#include "util/Map.h"
#include "common/Log.h"

Expand All @@ -37,12 +38,14 @@ typedef struct SymOfflinePullService {
SymDataLoaderService *dataLoaderService;
SymRegistrationService *registrationService;
SymConfigurationService *configurationService;
SymNodeCommunicationService *nodeCommunicationService;
SymRemoteNodeStatuses * (*pullData)(struct SymOfflinePullService *this);
void (*destroy)(struct SymOfflinePullService *this);
} SymOfflinePullService;

SymOfflinePullService * SymOfflinePullService_new(SymOfflinePullService *this, SymNodeService *nodeService, SymDataLoaderService *dataLoaderService,
SymRegistrationService *registrationService, SymConfigurationService *configurationService);
SymOfflinePullService * SymOfflinePullService_new(SymOfflinePullService *this, SymNodeService *nodeService,
SymDataLoaderService *dataLoaderService, SymRegistrationService *registrationService,
SymConfigurationService *configurationService, SymNodeCommunicationService *nodeCommunicationService);


#endif
10 changes: 6 additions & 4 deletions symmetric-client-clib/inc/service/OfflinePushService.h
Expand Up @@ -32,6 +32,7 @@
#include "service/ConfigurationService.h"
#include "service/DataExtractorService.h"
#include "service/AcknowledgeService.h"
#include "service/NodeCommunicationService.h"
#include "transport/TransportManager.h"
#include "transport/file/FileOutgoingTransport.h"
#include "util/List.h"
Expand All @@ -45,13 +46,14 @@ typedef struct SymOfflinePushService {
SymParameterService *parameterService;
SymConfigurationService *configurationService;
SymAcknowledgeService *acknowledgeService;
SymNodeCommunicationService *nodeCommunicationService;
SymRemoteNodeStatuses * (*pushData)(struct SymOfflinePushService *this);
void (*destroy)(struct SymOfflinePushService *);
} SymOfflinePushService;

SymOfflinePushService * SymOfflinePushService_new(SymOfflinePushService *this, SymNodeService *nodeService, SymDataExtractorService *dataExtractorService,
SymTransportManager *transportManager, SymParameterService *parameterService, SymConfigurationService *configurationService,
SymAcknowledgeService *acknowledgeService);

SymOfflinePushService * SymOfflinePushService_new(SymOfflinePushService *this, SymNodeService *nodeService,
SymDataExtractorService *dataExtractorService, SymTransportManager *transportManager,
SymParameterService *parameterService, SymConfigurationService *configurationService,
SymAcknowledgeService *acknowledgeService, SymNodeCommunicationService *nodeCommunicationService);

#endif
5 changes: 4 additions & 1 deletion symmetric-client-clib/inc/service/PullService.h
Expand Up @@ -29,6 +29,7 @@
#include "service/DataLoaderService.h"
#include "service/RegistrationService.h"
#include "service/ConfigurationService.h"
#include "service/NodeCommunicationService.h"
#include "util/Map.h"
#include "common/Log.h"

Expand All @@ -37,11 +38,13 @@ typedef struct SymPullService {
SymDataLoaderService *dataLoaderService;
SymRegistrationService *registrationService;
SymConfigurationService *configurationService;
SymNodeCommunicationService *nodeCommunicationService;
SymRemoteNodeStatuses * (*pullData)(struct SymPullService *this);
void (*destroy)(struct SymPullService *this);
} SymPullService;

SymPullService * SymPullService_new(SymPullService *this, SymNodeService *nodeService, SymDataLoaderService *dataLoaderService,
SymRegistrationService *registrationService, SymConfigurationService *configurationService);
SymRegistrationService *registrationService, SymConfigurationService *configurationService,
SymNodeCommunicationService *nodeCommunicationService);

#endif
4 changes: 3 additions & 1 deletion symmetric-client-clib/inc/service/PushService.h
Expand Up @@ -27,6 +27,7 @@
#include "model/RemoteNodeStatus.h"
#include "model/RemoteNodeStatuses.h"
#include "service/NodeService.h"
#include "service/NodeCommunicationService.h"
#include "service/ParameterService.h"
#include "service/ConfigurationService.h"
#include "service/DataExtractorService.h"
Expand All @@ -37,6 +38,7 @@
#include "common/Log.h"

typedef struct SymPushService {
SymNodeCommunicationService *nodeCommunicationService;
SymNodeService *nodeService;
SymDataExtractorService *dataExtractorService;
SymTransportManager *transportManager;
Expand All @@ -49,6 +51,6 @@ typedef struct SymPushService {

SymPushService * SymPushService_new(SymPushService *this, SymNodeService *nodeService, SymDataExtractorService *dataExtractorService,
SymTransportManager *transportManager, SymParameterService *parameterService, SymConfigurationService *configurationService,
SymAcknowledgeService *acknowledgeService);
SymAcknowledgeService *acknowledgeService, SymNodeCommunicationService *nodeCommunicationService);

#endif
7 changes: 5 additions & 2 deletions symmetric-client-clib/inc/service/RegistrationService.h
Expand Up @@ -28,18 +28,21 @@
#include "service/DataLoaderService.h"
#include "service/ConfigurationService.h"
#include "model/Node.h"
#include "service/DataService.h"

typedef struct SymRegistrationService {
SymNodeService *nodeService;
SymDataLoaderService *dataLoaderService;
SymParameterService *parameterService;
SymConfigurationService *configurationService;
SymDataService *dataService;
void (*registerWithServer)(struct SymRegistrationService *this);
unsigned short (*isRegisteredWithServer)(struct SymRegistrationService *this);
void (*destroy)(struct SymRegistrationService *this);
} SymRegistrationService;

SymRegistrationService * SymRegistrationService_new(SymRegistrationService *this, SymNodeService *nodeService, SymDataLoaderService *dataLoaderService,
SymParameterService *parameterService, SymConfigurationService *configurationService);
SymRegistrationService * SymRegistrationService_new(SymRegistrationService *this, SymNodeService *nodeService,
SymDataLoaderService *dataLoaderService, SymParameterService *parameterService,
SymConfigurationService *configurationService, SymDataService *dataService);

#endif
Expand Up @@ -23,6 +23,7 @@

#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <curl/curl.h>
#include <util/Properties.h>
#include <dirent.h>
Expand All @@ -32,6 +33,7 @@
#include "common/Log.h"
#include "util/StringUtils.h"
#include "util/StringArray.h"
#include "util/FileUtils.h"

typedef struct SymFileIncomingTransport {
SymIncomingTransport super;
Expand Down
Expand Up @@ -22,6 +22,7 @@
#define SYM_FILEOUTGOINGTRANSPORT_H

#include <stdlib.h>
#include <errno.h>
#include "common/Log.h"
#include "model/Node.h"
#include "service/ParameterService.h"
Expand Down
2 changes: 1 addition & 1 deletion symmetric-client-clib/inc/util/BinaryEncoding.h
Expand Up @@ -27,7 +27,7 @@

#define SYM_BINARY_ENCODING_NONE "none"
#define SYM_BINARY_ENCODING_BASE64 "base64"
#define SYM_BINARY_ENCODING_HEX "hex"
#define SYM_BINARY_ENCODING_HEX "HEX"

typedef enum SymBinaryEncoding {
SymBinaryEncoding_NONE, SymBinaryEncoding_BASE64, SymBinaryEncoding_HEX
Expand Down
34 changes: 34 additions & 0 deletions symmetric-client-clib/inc/util/FileUtils.h
@@ -0,0 +1,34 @@
/**
* Licensed to JumpMind Inc under one or more contributor
* license agreements. See the NOTICE file distributed
* with this work for additional information regarding
* copyright ownership. JumpMind Inc licenses this file
* to you under the GNU General Public License, version 3.0 (GPLv3)
* (the "License"); you may not use this file except in compliance
* with the License.
*
* You should have received a copy of the GNU General Public License,
* version 3.0 (GPLv3) along with this library; if not, see
* <http://www.gnu.org/licenses/>.
*
* 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.
*/
#ifndef SYM_FILEUTILS_H
#define SYM_FILEUTILS_H

#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <errno.h>
#include "common/Log.h"

int SymFileUtils_mkdir(char* dirName);
int SymFileUtils_getFileSize(char *filename);
unsigned short SymFileUtils_exists(char *filename);

#endif

0 comments on commit 74e1d93

Please sign in to comment.