Facility FTP Settings

This page was created because of  OLMIS-1319 - Getting issue details... STATUS  and provide basic information about FTP settings for facility which will be used to establish an connection with the FTP server and send a CSV file related with created order.

FTP Properties

Each setting has to have the following properties:

  • facilityId - this property is used to connect a facility with a setting. The facility can have only one setting.
  • protocol - one of the following value is allowed: ftpsftpftps.
  • username - it will be used to establish a connection with the FTP server
  • password - the same as username
  • serverHost - address to the FTP server
  • serverPort - port on which the FTP server is available
  • remoteDirectory - set where CSV files should be stored on FTP server
  • localDirectory - set where CSV files should be stored locally (the local file will be removed if transfer to the FTP server will end successfully)
  • passiveMode - true if connection should use passive mode; otherwise false
FacilityFtpSetting
public class FacilityFtpSetting {
  private UUID facilityId;
  private String protocol;
  private String username;
  private String password;
  private String serverHost;
  private Integer serverPort;
  private String removeDirectory;
  private String localDirectory;
  private boolean passiveMode;
}

Management

The fulfillment service should provide the following options:

  • add - user should have ability to add a setting for the given facility. The facility must exist in the system when the setting are passed to the fulfillment service. Also if the setting already exist, the user should use another method.
  • update - user should have ability to update existing setting for the given facility.
  • retrieve - user should be able to see what are current setting for the given facility.
  • delete - at any time a user should have ability to remove current setting.

Also if there is no setting for the given facility the fulfillment service should still save an order into database.

Open FTP connection

The fulfillment service uses Apache Camel to establish an connection with the FTP server set in setting. When an order is saved firstly it retrieves a setting from the database by supplyingFacilityId property from the Order class. If there is no setting the service will save the order in database and finish the work. If there is setting for the given facility the fulfillment service will store a generated CSV file locally (in directory set in setting), will try to send the file into the FTP server. If transfer ends with success the local file will be removed, otherwise the file will be still present in the folder and a user would have ability to manually transfer the file to the FTP server.

OpenLMIS: the global initiative for powerful LMIS software