Package proseccoCoding.TLN.model
Class TrustedListFacade
java.lang.Object
proseccoCoding.TLN.model.TrustedListFacade
This class is used as interface for all the business logic operations.
Provides access to all trusted data and some basic methods for query management and query interaction.
It implements the Singleton pattern since there's the necessity to guarantee the uniqueness of the Facade.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static TrustedListFacade
Unique instance of TrustedListFacade classprivate Query
The query currently used or the latest usedprivate TrustedListData
Trusted data from the trusted service list -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetData()
Returns the TrustedListData objectstatic TrustedListFacade
Method to get the unique instance of singleton class TrustedListFacadegetQuery()
Returns the current query or null if there isn't onevoid
Tells APIHandler to request the services data to the TrustedListAPIRetrieves from APIHandler the list of the EU countries namesRetrieves from APIHandler the list of the service types names and codesboolean
startQuery
(ArrayList<String> countryCodes) Starts and initialize a new query with the given countries
-
Field Details
-
instance
Unique instance of TrustedListFacade class -
query
The query currently used or the latest used -
trustedListData
Trusted data from the trusted service list
-
-
Constructor Details
-
TrustedListFacade
private TrustedListFacade()Constructor for the facade class. It initializes the trusted list data structure.
-
-
Method Details
-
getInstance
Method to get the unique instance of singleton class TrustedListFacade- Returns:
- the unique TrustedListFacade object
-
startQuery
Starts and initialize a new query with the given countries- Parameters:
countryCodes
- Country codes of the selected countries (must have size>0)- Returns:
- true if the query has been initialized, false otherwise
- Throws:
IllegalArgumentException
- In case of null parameter
-
requestData
Tells APIHandler to request the services data to the TrustedListAPI- Throws:
Exception
-
retrieveCountriesNames
Retrieves from APIHandler the list of the EU countries names- Returns:
- ArrayList
containing the names of the EU countries
-
retriveServiceTypes
Retrieves from APIHandler the list of the service types names and codes- Returns:
- ArrayList<Pair<String, String>> containing Pairs which first value is the service type's code and the second one is its name
-
getQuery
Returns the current query or null if there isn't one- Returns:
- The Query in use or null if there isn't one
-
getData
Returns the TrustedListData object- Returns:
- trustedListData
-