Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phi sat 2 #103

Open
wants to merge 173 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
173 commits
Select commit Hold shift + click to select a range
04f525f
[javadoc] Fixed chmod method javadoc
CesarCoelho Apr 13, 2021
deaab4c
Allows the Apps to be started from a non-root user account
CesarCoelho Apr 13, 2021
8c6c457
Added a start banner for all NMF Apps with System information
CesarCoelho Apr 14, 2021
8ea92e9
[nmf-app] Changed the location of the comArchive to the home directory
CesarCoelho Apr 14, 2021
18e367f
Moved to the home directory, the comArchive.db and the provider.prope…
CesarCoelho Apr 14, 2021
cfac887
Check if sudo is available before using it
CesarCoelho Apr 14, 2021
6d07cba
Code cleanup. Some logs were returning nothing because of: {}
CesarCoelho Apr 14, 2021
bdddc81
[nmfpack] During installation/uninstallation, replaced the use of use…
CesarCoelho Apr 15, 2021
5bf556a
[pictureprocessor] Code cleanup. Changed directory where the pictures…
CesarCoelho Apr 15, 2021
56b1b8a
[nmfpack] Support for additional libs or files.
CesarCoelho Jun 1, 2021
efb57d1
The App was using folders outside the restricted area. The code now f…
CesarCoelho Aug 31, 2021
eb098d2
Improved the startup banner
CesarCoelho Sep 13, 2021
911e3d2
New constructor with ConnectionConsumer. Cleanup of imports
CesarCoelho Sep 13, 2021
8508b09
The env variables were not being passed on Linux machines. This was a…
CesarCoelho Sep 13, 2021
697cc18
Installation is now supported on the Linux on Phi-Sat-2
CesarCoelho Sep 13, 2021
5833610
[nmfpack] The NMF Packages can carry fat jars (jar-with-dependencies)…
CesarCoelho Sep 14, 2021
c19cece
The AppStorage class is now setting the correct permissions during th…
CesarCoelho Sep 14, 2021
55fde6e
Fixed small bug in the creation of the Directories with the right per…
CesarCoelho Sep 24, 2021
6d4b438
Fixed the package receipt version 3. The mainjar was not being correc…
CesarCoelho Sep 24, 2021
13770e0
Reduced logger verbosity on the Package Manager
CesarCoelho Sep 24, 2021
f06243c
Fixed the update operation. Code cleanup. Enabled the keepUserData fu…
CesarCoelho Sep 24, 2021
a0ec428
The upgrade operation is now regeneration the Auxiliary files, e.g. s…
CesarCoelho Sep 30, 2021
956c1ac
Set correct permissions recursively to the App folder after ugrading it
CesarCoelho Oct 1, 2021
4c9e212
Fixed a bug on the validation of the JRE folder. Code cleanup
CesarCoelho Oct 1, 2021
44138a4
Fixed small typo in logger
CesarCoelho Oct 1, 2021
1e6aae8
System.console() might return null in some cases, so we must use Syst…
CesarCoelho Oct 4, 2021
377c510
[AppsLauncher] Check if sudo is (not) available using the termination…
CesarCoelho Dec 6, 2021
78bf1bb
Added the AI service
CesarCoelho Feb 17, 2022
4cdba3b
Added the Artificial Intelligence service consumer and generic provid…
CesarCoelho Feb 28, 2022
d67fa04
Code cleanup
CesarCoelho Feb 28, 2022
7b3baef
Added to the AI service to the Platform services' hooks
CesarCoelho Feb 28, 2022
d22c3e3
Fixed compilation problem on the Mission Simulator
CesarCoelho Mar 3, 2022
7fff810
Removed the startStatusTracking method from the interface as that met…
CesarCoelho Apr 7, 2022
008b279
[nmfpack] Fixed bug on Receipt version 3. The receipt could not be re…
CesarCoelho Apr 7, 2022
330742e
New App that triggers an external Python script
CesarCoelho Apr 7, 2022
9397313
Make the tcpip configuration to bind automatically.
CesarCoelho Apr 8, 2022
6722b6a
[python-script app] Updated the output folder name and the file type …
CesarCoelho Apr 11, 2022
1b839fd
Code cleanup
CesarCoelho Apr 11, 2022
0e0b7a4
More code cleanup
CesarCoelho Apr 11, 2022
f2fe08e
Even more code cleanup
CesarCoelho Apr 11, 2022
46e3222
[nmfpack] Code cleanup
CesarCoelho Apr 11, 2022
ba1a630
Added transport default properties in case there is no file with them…
CesarCoelho Apr 11, 2022
2be42ba
[com-archive] Code cleanup
CesarCoelho Apr 11, 2022
0d20c18
Code cleanup
CesarCoelho Apr 11, 2022
1029aa5
Update README.md
CesarCoelho Apr 12, 2022
c4f0053
[ai] Updates to the AI interface
CesarCoelho Apr 12, 2022
3d5f4d4
[ai] Updates to the AI service backend adapter interface
CesarCoelho Apr 19, 2022
46aa2ed
[nmp-package] Fixed the ZipSlip vulnerability
CesarCoelho Apr 19, 2022
4777d5a
Added javadocs comments
CesarCoelho Apr 19, 2022
3a9fff2
Improved the code for the Linux Users/Groups activities
CesarCoelho Apr 19, 2022
bdb4e49
[nmf-package] Improved javadocs and added a few extra conditions when…
CesarCoelho Apr 19, 2022
33c455f
Added the Edge AI App to the SDK. This App will demonstrate how to us…
CesarCoelho Apr 21, 2022
8e70bd0
[space2space] Code cleanup
CesarCoelho Apr 21, 2022
48994dd
[action service] Fixed submitAction bug... the action can now be pass…
CesarCoelho Apr 27, 2022
38d2fbd
[ai-service] Removed the weights path as the convention is to have th…
CesarCoelho Apr 28, 2022
2bba257
Update README.md
CesarCoelho Apr 28, 2022
fce8f19
Update README.md
CesarCoelho Apr 28, 2022
8faf0df
Update README.md
CesarCoelho Apr 29, 2022
5c0096c
[xml] Added better description for doInference
CesarCoelho May 17, 2022
200af5b
[nmf package] Added default maxHeap to 128m
CesarCoelho Apr 29, 2022
a94a21f
[edge-ai] Added method call to AI service
CesarCoelho May 17, 2022
5a901e2
Update README.md
CesarCoelho May 26, 2022
fc6ba0d
Refactoring & AI service WIP code
CesarCoelho May 27, 2022
ba13fc4
[com-archive] Faster overall startup with the delegation of the datab…
CesarCoelho May 27, 2022
626a4a0
[com-archive] Optimization for faster stores in the database.
CesarCoelho May 27, 2022
3b3b3ae
[ai-service] Small fixes to support better handling.
CesarCoelho Jun 21, 2022
5f6bf93
Updates the README with clear instructions to get started
CesarCoelho Aug 14, 2022
39eb17d
Updates the Banner code to be printed via the LOGGER instead of the S…
CesarCoelho Aug 14, 2022
f95aa0b
Fixes data type problems with nulls
CesarCoelho Aug 14, 2022
8332b81
Adds a preprocess operation to the Camera service. Updates the Camera…
CesarCoelho Sep 22, 2022
291bd63
Updates the AI adapter interface
CesarCoelho Sep 28, 2022
98f3efb
[nmf-package] Updates the plugin to support dependencies and the depe…
CesarCoelho Sep 28, 2022
ad35a04
Reorders the list of artifacts to be compiled
CesarCoelho Sep 28, 2022
4dcd218
[ai-service] WIP - Latest batch updates to the AI service
CesarCoelho Oct 5, 2022
f5923d0
[edge-ai] Updates the example with a model and two tiles to be used a…
CesarCoelho Oct 5, 2022
5fcd532
[nmf-package] Improves error message when the mainClass is not provided.
CesarCoelho Oct 5, 2022
c4b7b8d
[edge-ai] Updates the inputTilesPath
CesarCoelho Oct 5, 2022
7ee7fe4
[nmf-package] Refactors the code & Adds a new Metadata mechanism for …
CesarCoelho Oct 6, 2022
4600306
[nmf-pack] Fixes the max heap problem
CesarCoelho Oct 7, 2022
7929d4a
Updates the AI service to provide more information
CesarCoelho Oct 7, 2022
dc457a6
Updates the Linux commands to provide more info on the errors.
CesarCoelho Oct 7, 2022
ea934e2
CTT can now run directly from the main project folder (example, for l…
CesarCoelho Oct 7, 2022
a97b564
Cleans the code
CesarCoelho Oct 7, 2022
275af69
Better logging messages
CesarCoelho Oct 7, 2022
2405f89
Removes the exec from the generation of the start app script.
CesarCoelho Oct 7, 2022
6c0aa74
Updates the comment message
CesarCoelho Oct 7, 2022
1a266dd
Cleans up the code and adds the license to the header of the files
CesarCoelho Oct 12, 2022
848fe5a
Code cleanup
CesarCoelho Oct 23, 2022
4141ca5
[nmf-package] Migrates NMF Packages to version 4
CesarCoelho Oct 23, 2022
4c4686a
[nmf-package] Code cleanup
CesarCoelho Oct 23, 2022
ac276a8
Log the output of the execution
CesarCoelho Oct 23, 2022
2262637
Adds a Shutdown Hook to stop the running Apps when the supervisor is …
CesarCoelho Oct 23, 2022
395a3a2
[nmf-package] Adds support to carry Ddependencies via NMF Packages
CesarCoelho Oct 23, 2022
77ff3c8
[nmf-package] Declares the dependencies on the metadata of the NMF Pa…
CesarCoelho Oct 23, 2022
0a0cef8
[nmf-package] The dependencies are now also installed & code cleanup
CesarCoelho Oct 23, 2022
42cb92c
[ai-service] Adds an AI generic adapter for the Intel Movidius chip u…
CesarCoelho Oct 24, 2022
6c16b60
Better level of abstraction between the different metadata types
CesarCoelho Oct 24, 2022
990c49a
Fixes the listApp operation. The matching was not occurring for speci…
CesarCoelho Oct 25, 2022
c6fabd7
[nmf-packge] Adds the dependencies on the startApp.sh file & During u…
CesarCoelho Oct 25, 2022
1f5d22b
Added Licence to the Header of the file
CesarCoelho Oct 26, 2022
97aae8a
Reduced the logging messages
CesarCoelho Oct 26, 2022
59f8ca8
Better logging messages in the COM Archive
CesarCoelho Oct 26, 2022
d87f62a
Reduced log verbosity
CesarCoelho Oct 26, 2022
af9779c
Better Archive startup parallelization
CesarCoelho Oct 26, 2022
a8ad39f
Fixes the MP test
CesarCoelho Oct 26, 2022
c8d7804
[com-archive] Updates the backend startup and better logging for wipe…
CesarCoelho Oct 26, 2022
8270612
[archive-sync] Code cleanup
CesarCoelho Oct 26, 2022
ab03d88
Code cleanup
CesarCoelho Oct 26, 2022
2be6b1a
Code cleanup
CesarCoelho Oct 26, 2022
29fbc8c
[ai-service] Adds the frontend interface operation doComputerVision
CesarCoelho Oct 26, 2022
3d370e5
[nmf-package] Adds Apps installation support for Windows
CesarCoelho Oct 26, 2022
dd58e55
Adds a default value for the DummyValuesProvider class
CesarCoelho Oct 26, 2022
9dbec27
[ai-service] Disables the checking of the setupvars.sh for testng pur…
CesarCoelho Oct 27, 2022
ab18f28
[ai-service] Better handling when the setupvars.sh file is not found
CesarCoelho Oct 27, 2022
1647700
Refactors the GPS service to remove dependencies to Orekit on the gen…
CesarCoelho Oct 28, 2022
e0549df
Moved the Orekit resources to the Simulator mission
CesarCoelho Oct 28, 2022
a611b65
Updates the name of the project
CesarCoelho Oct 28, 2022
eded104
Updates the relativePath of the parent pom
CesarCoelho Oct 28, 2022
3a80531
[nmf-package] Refactors the classes
CesarCoelho Oct 28, 2022
ea3672c
Code cleanup
CesarCoelho Oct 29, 2022
7d4d4a2
Apps Launcher service support for multiple folders with Apps
CesarCoelho Oct 29, 2022
ef7c1b8
Better error handling
CesarCoelho Oct 29, 2022
7f1e276
Adds a timestamp to the service inits()
CesarCoelho Oct 29, 2022
272316c
Small optimizations
CesarCoelho Oct 30, 2022
485ec1b
Creates and sets permissions to the logs folder, so apps can store lo…
CesarCoelho Oct 31, 2022
0762e92
[edge-ai] Code cleanup
CesarCoelho Nov 1, 2022
9adf3a1
Adds to the ShellCommander the ability to run commands from a Mac mac…
Nov 3, 2022
6750109
Code cleanup
Nov 3, 2022
0592908
Fixes null pointer exception when trying to get the metadata of the N…
Nov 4, 2022
8c26424
(2) Fixes null pointer exception when trying to get the metadata of t…
Nov 4, 2022
744ecde
Adds support to Mac OS for the AI service execution
Nov 4, 2022
05109cb
[ctt] Close button is now threading the shutdown of the connections
Nov 4, 2022
bddf3f6
Adds support to non-fixed camera resolutions
Nov 4, 2022
243e180
Fixes to make the code compilable
CesarCoelho Nov 14, 2022
39e011c
Fixes the adduser problem when the command is called for a BusyBox in…
CesarCoelho Nov 16, 2022
ba2419f
The logs folder is now selected from the Deployment static class
CesarCoelho Nov 16, 2022
6e49780
Forces the transport to bind on 127.0.0.1 but with a auto-allocated p…
CesarCoelho Nov 16, 2022
b717c5d
Better Package Management handling
CesarCoelho Nov 16, 2022
1d1fc11
Adds the OneInstanceLock class to avoid multiple instances of the Sup…
CesarCoelho Nov 17, 2022
55d1e08
Updates the installation code to handle better the adduser linux command
CesarCoelho Nov 17, 2022
1578539
Better handling of Linux users creation during the installation of th…
CesarCoelho Nov 17, 2022
a7e6752
[nmf-package] Skips over the dependencies that are already installed …
CesarCoelho Nov 18, 2022
21ec9c7
Removes polluting code from the NanoSat MO Connector
CesarCoelho Nov 18, 2022
4887514
Better error handling
CesarCoelho Nov 18, 2022
fe5efda
Restored sanity to the file
CesarCoelho Nov 18, 2022
2a582fa
Code cleanup
CesarCoelho Nov 18, 2022
d992ad0
Adds a mechanism to configure the transport dispatcher executor threads.
CesarCoelho Nov 18, 2022
08ef8fb
Code refactoring
CesarCoelho Nov 20, 2022
271c002
Fixes the License Headers
CesarCoelho Nov 20, 2022
533486b
Prioritize the new jars-nmf folder over the old one & Set autohost as…
CesarCoelho Nov 20, 2022
ba02a19
Adds capability to create NMF Packages with Java inside
CesarCoelho Nov 20, 2022
893c190
Code cleanup
CesarCoelho Nov 20, 2022
5ec5c40
[nmf-package] Constructor of the NMFPackageBuilder has now a Metadata…
CesarCoelho Nov 21, 2022
f6ae25e
Disables the support for a dedicated nmf-apps group from the installa…
CesarCoelho Nov 23, 2022
241889b
Makes the JRE executable & After deliting a file, delete also the par…
CesarCoelho Nov 23, 2022
63ed970
Fixes the permissions to make the java JRE executable
CesarCoelho Nov 23, 2022
61e5fd4
Adds a timestamp for the installation/uninstallation/upgrade of NMF P…
CesarCoelho Nov 23, 2022
5c97592
Code cleanup
CesarCoelho Nov 23, 2022
367edc6
Small code improvements
CesarCoelho Nov 30, 2022
c6a6843
Improves the doComputerVision error
CesarCoelho Dec 1, 2022
a8a0c1a
Better username lookup from the /etc/passwd file
CesarCoelho Dec 1, 2022
37a1148
The supervisor will exit if ran as root user
Feb 3, 2023
6115fde
Updates on the code to fix the auto rebasing mistakes
CesarCoelho Feb 23, 2023
0268bb2
Fixes the CameraSettings arguments
CesarCoelho Feb 23, 2023
c5751e4
Removes the mo_pic from CTT and the Beans dependency
CesarCoelho Feb 24, 2023
5e69f79
Adds Exit Codes to the cli-tool & Fixes the start/stop/kill by gettin…
CesarCoelho Feb 24, 2023
8f8ec63
Code cleanup
CesarCoelho Feb 24, 2023
67cb515
Adds progress messages and ups the version of the picocli library
CesarCoelho Apr 19, 2023
8f5b99c
Refactors the code and adds a first class with the Package Management…
CesarCoelho Apr 19, 2023
b1a883c
Adds install, uninstall, and upgrade functionalities to the cli-tool
CesarCoelho Apr 19, 2023
dc45ee6
[CLI] Updated software management commands
mciccariello May 26, 2023
2108d16
Refactors the cli-tool and add the Action service
CesarCoelho Jun 9, 2023
0aca9b9
[CLI] Updated software management commands, added command to set appl…
mciccariello Mar 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 31 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# NanoSat MO Framework

The [NanoSat MO Framework] is a software framework for nanosatellites based on CCSDS Mission Operations services.
The [NanoSat MO Framework] is a software framework for small satellites based on CCSDS Mission Operations services.

It introduces the concept of apps in space that can be started and stopped from ground. Apps can retrieve data from the platform through a set of well-defined MO services. Many possibilities for extensions are available due to its modular and flexible design approach which is not limited to the space segment but extends down to ground by providing all the building blocks for a complete and free end-to-end solution.

Expand All @@ -21,20 +21,39 @@ The research was carried by Graz University of Technology in partnership with th
## Release
The latest NMF SDK release tag can be downloaded in [Releases]. However, the currently recommended distribution channel is directly from Git repository.

## Getting Started
## Building Prerequisites

1. Install Java SDK 1.8 (will work with higher SDKs but 1.8 is the recommended)
```bash
sudo apt-get install openjdk-8-jdk
```
2. Install Apache Maven
```bash
sudo apt-get install maven
```

### Building
## Building Instructions

Prerequisites:
3. Clone this repository
```bash
git clone https://github.com/esa/nanosat-mo-framework.git
```

- Java SDK 1.8 or higher
- Apache Maven
4. Set the environment variable NMF\_HOME with the path to this repository's root directory
```bash
export NMF_HOME=path_to_repository
```

Clone this repository, set the environment variable NMF\_HOME with the path to this repository's root directory and run `mvn install` in the root directory.
5. Build the cloned NanoSat MO Framework project:
```bash
mvn clean install
```

Note that the errors about missing module descriptors during Javadoc generation are to be expected and non breaking.
Note that the errors about missing module descriptors during Javadoc generation are to be expected and non-breaking.

In order to produce independently runnable Java executables (JAR artifacts with dependencies - equivalent of statically linked executables), use `mvn install -P assembly-with-dependencies`.
In order to produce independently runnable Java executables (JAR artifacts with dependencies - equivalent of statically linked executables), use `mvn install -P assembly-with-dependencies`

## Getting Started

### SDK and examples

Expand All @@ -56,7 +75,9 @@ Or directly in the respective source code repository.

## License

The NanoSat MO Framework is **licensed** under the **[European Space Agency Public License (ESA-PL) Weak Copyleft – v2.4]**.
The NanoSat MO Framework is **licensed** under:

**[European Space Agency Public License (ESA-PL) Weak Copyleft – v2.4]**.

[![][ESAImage]][website]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,16 @@
*/
public class ConnectionProvider {

private final static ServicesConnectionDetails GLOBAL_PROVIDERS_DETAILS_PRIMARY = new ServicesConnectionDetails();
private final static ServicesConnectionDetails GLOBAL_PROVIDERS_DETAILS_SECONDARY = new ServicesConnectionDetails();

private final SingleConnectionDetails primaryConnectionDetails = new SingleConnectionDetails();
private MALContextFactory malFactory;
private MALContext mal;
private MALProviderManager providerMgr;
private MALProvider primaryMALServiceProvider = null;
private MALProvider secondaryMALServiceProvider = null;
private final SingleConnectionDetails primaryConnectionDetails = new SingleConnectionDetails();
private SingleConnectionDetails secondaryConnectionDetails = null;
private static ServicesConnectionDetails globalProvidersDetailsPrimary = new ServicesConnectionDetails();
private static ServicesConnectionDetails globalProvidersDetailsSecondary = new ServicesConnectionDetails();

/**
* Getter for the primaryConnectionDetails object.
Expand Down Expand Up @@ -120,8 +121,8 @@ public MALProvider startService(String serviceName, MALService malService, MALIn
* @return MALProvider
* @throws MALException On error.
*/
public MALProvider startService(String serviceName, MALService malService, boolean isPublisher,
MALInteractionHandler handler) throws MALException {
public MALProvider startService(String serviceName, MALService malService,
boolean isPublisher, MALInteractionHandler handler) throws MALException {
return startService(serviceName, malService, isPublisher, handler, null);
}

Expand Down Expand Up @@ -188,9 +189,14 @@ public MALProvider startService(String serviceName, MALService malService, boole
serviceKey});

if (shouldInitUriFiles()) {
this.writeURIsOnFile(primaryConnectionDetails, serviceName, HelperMisc.PROVIDER_URIS_PROPERTIES_FILENAME);
String path = System.getProperty(HelperMisc.PROP_PROVIDERURIS_PATH,
HelperMisc.PROVIDER_URIS_PROPERTIES_FILENAME);

this.writeURIsOnFile(primaryConnectionDetails,
serviceName,
path);
}
globalProvidersDetailsPrimary.add(serviceName, primaryConnectionDetails);
GLOBAL_PROVIDERS_DETAILS_PRIMARY.add(serviceName, primaryConnectionDetails);

primaryMALServiceProvider = serviceProvider;

Expand Down Expand Up @@ -222,11 +228,14 @@ public MALProvider startService(String serviceName, MALService malService, boole
serviceKey});

if (shouldInitUriFiles()) {
this.writeURIsOnFile(secondaryConnectionDetails, serviceName,
HelperMisc.PROVIDER_URIS_SECONDARY_PROPERTIES_FILENAME);
}
globalProvidersDetailsSecondary.add(serviceName, secondaryConnectionDetails);
String pathSec = System.getProperty(HelperMisc.PROP_PROVIDERURIS_SEC_PATH,
HelperMisc.PROVIDER_URIS_SECONDARY_PROPERTIES_FILENAME);

this.writeURIsOnFile(secondaryConnectionDetails,
serviceName,
pathSec);
}
GLOBAL_PROVIDERS_DETAILS_SECONDARY.add(serviceName, secondaryConnectionDetails);
secondaryMALServiceProvider = serviceProvider2;
}

Expand Down Expand Up @@ -286,8 +295,7 @@ public void closeAll() {
}

/**
* Indicates whether the URI Files should be initialised.
* Defaults to false.
* Indicates whether the URI Files should be initialised. Defaults to false.
*
* @return true if URI Files should be initialised
*/
Expand All @@ -299,20 +307,24 @@ public static boolean shouldInitUriFiles() {
* Clears the URI links file if its generation is enabled
*/
public static void resetURILinks() {
globalProvidersDetailsPrimary.reset();
globalProvidersDetailsSecondary.reset();
GLOBAL_PROVIDERS_DETAILS_PRIMARY.reset();
GLOBAL_PROVIDERS_DETAILS_SECONDARY.reset();

if (shouldInitUriFiles()) {
try (BufferedWriter wrt = new BufferedWriter(new FileWriter(HelperMisc.PROVIDER_URIS_PROPERTIES_FILENAME,
false))) {
String path = System.getProperty(HelperMisc.PROP_PROVIDERURIS_PATH,
HelperMisc.PROVIDER_URIS_PROPERTIES_FILENAME);

try (BufferedWriter wrt = new BufferedWriter(new FileWriter(path, false))) {
} catch (IOException ex) {
Logger.getLogger(ConnectionProvider.class.getName()).log(Level.WARNING,
"Unable to reset URI information from properties file {0}", ex);
}

if (System.getProperty(HelperMisc.SECONDARY_PROTOCOL) != null) {
try (BufferedWriter wrt2 = new BufferedWriter(new FileWriter(
HelperMisc.PROVIDER_URIS_SECONDARY_PROPERTIES_FILENAME, false))) {
String pathSec = System.getProperty(HelperMisc.PROP_PROVIDERURIS_SEC_PATH,
HelperMisc.PROVIDER_URIS_SECONDARY_PROPERTIES_FILENAME);

try (BufferedWriter wrt2 = new BufferedWriter(new FileWriter(pathSec, false))) {
} catch (IOException ex) {
Logger.getLogger(ConnectionProvider.class.getName()).log(Level.WARNING,
"Unable to reset URI information from properties file {0}", ex);
Expand All @@ -322,28 +334,38 @@ public static void resetURILinks() {
}

/**
* Get primary connection interface details of all providers in the application.
*
* Get primary connection interface details of all providers in the
* application.
*
* @return Primary connection details of all providers in the application.
*/
public static ServicesConnectionDetails getGlobalProvidersDetailsPrimary() {
return globalProvidersDetailsPrimary;
return GLOBAL_PROVIDERS_DETAILS_PRIMARY;
}

/**
* Get secondary connection interface details of all providers in the application.
*
* Get secondary connection interface details of all providers in the
* application.
*
* @return Secondary connection details of all providers in the application.
*/
public static ServicesConnectionDetails getGlobalProvidersDetailsSecondary() {
return globalProvidersDetailsSecondary;
return GLOBAL_PROVIDERS_DETAILS_SECONDARY;
}

/**
* Writes the URIs on a text file
*/
private void writeURIsOnFile(SingleConnectionDetails connectionDetails, String serviceName, String filename) {
StringBuilder str = new StringBuilder();
str.append(serviceName).append(HelperConnections.SUFFIX_URI).append("=").append(connectionDetails.getProviderURI()).append("\n");
str.append(serviceName).append(HelperConnections.SUFFIX_BROKER).append("=").append(connectionDetails.getBrokerURI()).append("\n");
str.append(serviceName).append(HelperConnections.SUFFIX_DOMAIN).append("=").append(HelperMisc.domain2domainId(connectionDetails.getDomain())).append("\n");
str.append(serviceName).append(HelperConnections.SUFFIX_SERVICE_KEY).append("=").append(connectionDetails.getServiceKey()).append("\n");

try (BufferedWriter wrt = new BufferedWriter(new FileWriter(filename, true))) {
wrt.append(str.toString());
/*
wrt.append(serviceName + HelperConnections.SUFFIX_URI + "=" + connectionDetails.getProviderURI());
wrt.newLine();
wrt.append(serviceName + HelperConnections.SUFFIX_BROKER + "=" + connectionDetails.getBrokerURI());
Expand All @@ -353,6 +375,7 @@ private void writeURIsOnFile(SingleConnectionDetails connectionDetails, String s
wrt.newLine();
wrt.append(serviceName + HelperConnections.SUFFIX_SERVICE_KEY + "=" + connectionDetails.getServiceKey());
wrt.newLine();
*/
} catch (IOException ex) {
Logger.getLogger(ConnectionProvider.class.getName()).log(Level.WARNING,
"Unable to write URI information to properties file {0}", ex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Hashtable;
import java.util.HashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.ccsds.moims.mo.mal.MALContext;
Expand Down Expand Up @@ -72,9 +72,14 @@ public MALBrokerBinding startBroker(String brokerName, Blob authenticationId) th
brokerMgr = mal.createBrokerManager();

MALBroker sharedBroker = brokerMgr.createBroker();
MALBrokerBinding brokerBinding = brokerMgr.createBrokerBinding(sharedBroker, brokerName, System.getProperties()
.getProperty("org.ccsds.moims.mo.mal.transport.default.protocol"), null == authenticationId ? new Blob(""
.getBytes()) : authenticationId, new QoSLevel[]{QoSLevel.ASSURED}, new UInteger(1), new Hashtable());
MALBrokerBinding brokerBinding = brokerMgr.createBrokerBinding(
sharedBroker,
brokerName,
System.getProperties().getProperty("org.ccsds.moims.mo.mal.transport.default.protocol"),
null == authenticationId ? new Blob("".getBytes()) : authenticationId,
new QoSLevel[]{QoSLevel.ASSURED},
new UInteger(1),
new HashMap());

Logger.getLogger(ConnectionSharedBroker.class.getName()).log(Level.INFO, "Shared Broker URI: {0}", brokerBinding
.getURI());
Expand Down
Loading