Difference between revisions of "NAL"

From Gcube Wiki
Jump to: navigation, search
 
(16 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
[[Category:TO BE REMOVED]]
 +
 
=== Introduction ===
 
=== Introduction ===
  
The Node Access Library (NAL) is a Java Library that provides different functionalities to access the local node information. It allows to obtain the DHN unique ID, the Running Instance unique ID, the list of service running in the node, the running instance profile of the caller, and the node free disk space. Moreover, the NAL, gives access to the VO Maps and allows services to set/get both the Specific Data section and the State section in their Running Instance profile.
+
The Node Access Library (NAL) is a Java Library that provides different functionalities to access/change the local node information. It allows to obtain the DHN unique ID, the Running Instance unique ID, the list of service running in the node, the running instance profile of the caller, the node free disk space and other information. Moreover, the NAL, gives access to the VO Maps and allows services to set/get both the Specific Data section and the State section in their Running Instance profile.
  
 
===  Implentation Overview ===
 
===  Implentation Overview ===
Each WSRF service should instantiate a NAL object in order to have access to node information (see [[Usage Example]] for details).  
+
Each WSRF service should instantiate a NAL object in order to have access to node information (see [[NAL#Usage_Example|Usage Example]] for details).  
  
 
* Library functionalities description:
 
* Library functionalities description:
 
*# List VO Maps
 
*# List VO Maps
*#* Return a list with the name of the DHN VOs   
+
*#* Returns a list with the name of the DHN VOs   
 
*#*; signature
 
*#*; signature
 
*#*: public Vector getVOMapsList ( ) throws Exception
 
*#*: public Vector getVOMapsList ( ) throws Exception
Line 16: Line 18:
 
*#*: The list of the DHN VOs  
 
*#*: The list of the DHN VOs  
 
*# get VO Map
 
*# get VO Map
*#* Return a VO Map
+
*#* Returns a VO Map
 
*#*; signature
 
*#*; signature
 
*#*: public String getVOMap (String voname) throws Exception
 
*#*: public String getVOMap (String voname) throws Exception
Line 49: Line 51:
 
*#*; return  
 
*#*; return  
 
*#*: The service ID if valid {class, name} parameters were used, exception otherwise.
 
*#*: The service ID if valid {class, name} parameters were used, exception otherwise.
*#  
+
*# Get DHN ID
*#*  
+
*#* Returns the local DHN unique ID
 
*#*; signature
 
*#*; signature
*#*:  
+
*#*: public String getDHNID ( ) throws Exception
 
*#*; parameters
 
*#*; parameters
*#*:  
+
*#*: n.a.
 
*#*; return  
 
*#*; return  
*#*:
+
*#*: The DHN unique ID were the service is running, exception otherwise.
*#  
+
*# Get the list of RI configured DLs from Class and Name
*#*  
+
*#* Returns the list of DLs configured into the service RI
 
*#*; signature
 
*#*; signature
*#*:  
+
*#*: public String [] getDLs ( String serviceName, String serviceClass ) throws  Exception
 
*#*; parameters
 
*#*; parameters
*#*:  
+
*#*: A valid local RI service name
 +
*#*: A valid local RI service class
 
*#*; return  
 
*#*; return  
*#*:
+
*#*: The RI DL tag list
*#  
+
*# Get the list of RI configured DLs from EPR
*#*  
+
*#* Returns the list of DLs configured into the service RI
 
*#*; signature
 
*#*; signature
*#*:  
+
*#*: public String [] getDLsFromEPR (EndpointReferenceType epr) throws Exception
 
*#*; parameters
 
*#*; parameters
*#*:  
+
*#*: An end point reference
 
*#*; return  
 
*#*; return  
*#*:
+
*#*: The RI DL tag list
*#  
+
*# Get a RI profile from Class and Name
*#*  
+
*#* Returns a RI profile document
 
*#*; signature
 
*#*; signature
*#*:  
+
*#*: public Document getRIProfile ( String serviceName, String serviceClass )throws Exception
 
*#*; parameters
 
*#*; parameters
*#*:  
+
*#*: A valid local RI service name
 +
*#*: A valid local RI service class
 
*#*; return  
 
*#*; return  
*#*:
+
*#*: A Document object with the RI profile, exception otherwise.
*#  
+
*# Get the DL secure mode
*#*  
+
*#* Returns the DL secure status 
 
*#*; signature
 
*#*; signature
*#*:  
+
*#*: public boolean isDLSecure ( String serviceName, String serviceClass ) throws Exception
 
*#*; parameters
 
*#*; parameters
*#*:  
+
*#*: A valid local RI service name
 +
*#*: A valid local RI service class
 
*#*; return  
 
*#*; return  
*#*:
+
*#*: True if the RI is running in secure mode, false otherwise.
*#  
+
*# Set the RI specific data
*#*  
+
*#* Set the specific data tag of a RI service profile based on a given service name and service class
 
*#*; signature
 
*#*; signature
*#*:  
+
*#*: public boolean setSpecificData ( String serviceName, String serviceClass, String data)
 
*#*; parameters
 
*#*; parameters
*#*:  
+
*#*: A valid local RI service name
 +
*#*: A valid local RI service class
 +
*#*: The specific data
 
*#*; return  
 
*#*; return  
*#*:
+
*#*: True if set completed, false otherwise
*#  
+
*# Get the RI specific data
*#*  
+
*#* Returns the specific data tag of a RI service profile based on a given service name and service class.
 
*#*; signature
 
*#*; signature
*#*:  
+
*#*: public String getSpecificData ( String serviceName, String serviceClass ) throws  Exception
 
*#*; parameters
 
*#*; parameters
*#*:  
+
*#*: A valid local RI service name
 +
*#*: A valid local RI service class
 
*#*; return  
 
*#*; return  
*#*:
+
*#*: If the required RI service profile exists returns specific data section, exception otherwise
*#  
+
*# Set the RI state
*#*  
+
*#* Set the state of a RI based on a given service name and service class. It also causes the invocation of the related callback method:
 
*#*; signature
 
*#*; signature
*#*:  
+
*#*: public boolean setState ( String serviceName, String serviceClass, RI.State state, String messageState)
 
*#*; parameters
 
*#*; parameters
*#*:  
+
*#*: A valid local RI service name
 +
*#*: A valid local RI service class
 +
*#*: The state
 +
*#*: The message state
 
*#*; return  
 
*#*; return  
*#*:
+
*#*: True if set completed, false otherwise
*#  
+
*# Get the RI state
*#*  
+
*#* Returns the state data tag of a RI service profile based on a given service name and service class.
 
*#*; signature
 
*#*; signature
*#*:  
+
*#*: public String getState ( String serviceName, String serviceClass ) throws  Exception
 
*#*; parameters
 
*#*; parameters
*#*:  
+
*#*: A valid local RI service name
 +
*#*: A valid local RI service class
 +
*#*; return
 +
*#*: If the required RI service profile exists returns the state section, exception otherwise
 +
*# Get all services on DHN
 +
*#* Returns a list with all the services on the local DHN
 +
*#*; signature
 +
*#*: public Vector getAllServices() throws  Exception
 +
*#*; parameters
 +
*#*: n.a.
 +
*#*; return
 +
*#*: A list with the services {class, name} running on the DHN, exception otherwise
 +
*# Get service information
 +
*#* Returns the service information from a given EPR
 +
*#*; signature
 +
*#*: public ServiceData getServiceInfoFromEPR(EndpointReferenceType epr) throws Exception
 +
*#*; parameters
 +
*#*: An End Point Reference
 +
*#*; return
 +
*#*: The service information, exception otherwise
 +
*# Get the DHN free disk space
 +
*#* Returns the local free disk space 
 +
*#*; signature
 +
*#*: public String getDHNFreeSpace ( String fileSys ) throws Exception
 +
*#*; parameters
 +
*#*: A valid file system
 +
*#*; return
 +
*#*: The node disk free space (KBytes)
 +
*# Get the DHN secure mode
 +
*#* Returns the DHN secure mode
 +
*#*; signature
 +
*#*: public boolean isDHNSecurityEnable () throws Exception
 +
*#*; parameters
 +
*#*: n.a.
 
*#*; return  
 
*#*; return  
*#*:   
+
*#*:  True if DHN is running in secure mode, false otherwise.
 
+
 
+
 
+
  
 
=== Dependencies ===
 
=== Dependencies ===
 
The NAL used following external libraries:  
 
The NAL used following external libraries:  
 
* commons-io-1.2.jar
 
* commons-io-1.2.jar
* dvos.authentication-api.jar
 
 
* jaxb-api.jar
 
* jaxb-api.jar
 
* jaxb-impl.jar
 
* jaxb-impl.jar
Line 139: Line 179:
 
* org_diligentproject_common_profilemanager.jar
 
* org_diligentproject_common_profilemanager.jar
 
* org_diligentproject_keeperservice_hnm_stubs.jar
 
* org_diligentproject_keeperservice_hnm_stubs.jar
 +
* dvos.authentication-api.jar
  
  
Line 144: Line 185:
 
=== Usage Example ===
 
=== Usage Example ===
 
NAL Initialization
 
NAL Initialization
 +
 +
* With the default constructor:
 
<pre>
 
<pre>
Default constructor:
 
  
 
NAL    nal    = new NAL ();
 
NAL    nal    = new NAL ();
  
With a given base directory:
+
</pre>
 +
 
 +
* With a given base directory:
 +
<pre>
  
 
String baseDir = ContainerConfig.getBaseDirectory() + "/etc/org_diligentproject_keeperservice_hnm/HNMService";
 
String baseDir = ContainerConfig.getBaseDirectory() + "/etc/org_diligentproject_keeperservice_hnm/HNMService";
 
NAL    nal    = new NAL (baseDir);
 
NAL    nal    = new NAL (baseDir);
</pre>
 
  
Calling the get VO Map list method
 
<pre>
 
Vector voList = nal.getVOMapsList ();
 
 
</pre>
 
</pre>
  
Calling the set specific data method
+
 
<pre>
+
--[[User:Manuelesimi|ManueleSimi]] 12:50, 02 October 2007 (EET)
boolean result = nal.setSpecificData("PackageRepository", "Keeper", "PR specific data", "diligent");
+
</pre>
+

Latest revision as of 19:54, 6 July 2016


Introduction

The Node Access Library (NAL) is a Java Library that provides different functionalities to access/change the local node information. It allows to obtain the DHN unique ID, the Running Instance unique ID, the list of service running in the node, the running instance profile of the caller, the node free disk space and other information. Moreover, the NAL, gives access to the VO Maps and allows services to set/get both the Specific Data section and the State section in their Running Instance profile.

Implentation Overview

Each WSRF service should instantiate a NAL object in order to have access to node information (see Usage Example for details).

  • Library functionalities description:
    1. List VO Maps
      • Returns a list with the name of the DHN VOs
        signature
        public Vector getVOMapsList ( ) throws Exception
        parameters
        n.a.
        return
        The list of the DHN VOs
    2. get VO Map
      • Returns a VO Map
        signature
        public String getVOMap (String voname) throws Exception
        parameters
        The VO name
        return
        The VO Map if exists, exception otherwise.
    3. Get the Running Instance ID
      • Returns the RI unique ID of a given service name and service class
        signature
        public String getRIID ( String serviceName, String serviceClass ) throws Exception
        parameters
        A valid local RI service name
        A valid local RI service class
        return
        The RI ID if valid {class, name} parameters were used, exception otherwise.
    4. Get the Running Instance ID
      • Returns the RI unique ID of a given RI profile
        signature
        public String getRIID ( String riProfile ) throws Exception
        parameters
        A RI profile
        return
        The RI ID if valid RI profile parameter was used, exception otherwise.
    5. Get the service ID
      • Returns the service ID of a given service name and service class
        signature
        public String getServiceID ( String serviceName, String serviceClass ) throws Exception
        parameters
        A valid local service name
        A valid local service class
        return
        The service ID if valid {class, name} parameters were used, exception otherwise.
    6. Get DHN ID
      • Returns the local DHN unique ID
        signature
        public String getDHNID ( ) throws Exception
        parameters
        n.a.
        return
        The DHN unique ID were the service is running, exception otherwise.
    7. Get the list of RI configured DLs from Class and Name
      • Returns the list of DLs configured into the service RI
        signature
        public String [] getDLs ( String serviceName, String serviceClass ) throws Exception
        parameters
        A valid local RI service name
        A valid local RI service class
        return
        The RI DL tag list
    8. Get the list of RI configured DLs from EPR
      • Returns the list of DLs configured into the service RI
        signature
        public String [] getDLsFromEPR (EndpointReferenceType epr) throws Exception
        parameters
        An end point reference
        return
        The RI DL tag list
    9. Get a RI profile from Class and Name
      • Returns a RI profile document
        signature
        public Document getRIProfile ( String serviceName, String serviceClass )throws Exception
        parameters
        A valid local RI service name
        A valid local RI service class
        return
        A Document object with the RI profile, exception otherwise.
    10. Get the DL secure mode
      • Returns the DL secure status
        signature
        public boolean isDLSecure ( String serviceName, String serviceClass ) throws Exception
        parameters
        A valid local RI service name
        A valid local RI service class
        return
        True if the RI is running in secure mode, false otherwise.
    11. Set the RI specific data
      • Set the specific data tag of a RI service profile based on a given service name and service class
        signature
        public boolean setSpecificData ( String serviceName, String serviceClass, String data)
        parameters
        A valid local RI service name
        A valid local RI service class
        The specific data
        return
        True if set completed, false otherwise
    12. Get the RI specific data
      • Returns the specific data tag of a RI service profile based on a given service name and service class.
        signature
        public String getSpecificData ( String serviceName, String serviceClass ) throws Exception
        parameters
        A valid local RI service name
        A valid local RI service class
        return
        If the required RI service profile exists returns specific data section, exception otherwise
    13. Set the RI state
      • Set the state of a RI based on a given service name and service class. It also causes the invocation of the related callback method:
        signature
        public boolean setState ( String serviceName, String serviceClass, RI.State state, String messageState)
        parameters
        A valid local RI service name
        A valid local RI service class
        The state
        The message state
        return
        True if set completed, false otherwise
    14. Get the RI state
      • Returns the state data tag of a RI service profile based on a given service name and service class.
        signature
        public String getState ( String serviceName, String serviceClass ) throws Exception
        parameters
        A valid local RI service name
        A valid local RI service class
        return
        If the required RI service profile exists returns the state section, exception otherwise
    15. Get all services on DHN
      • Returns a list with all the services on the local DHN
        signature
        public Vector getAllServices() throws Exception
        parameters
        n.a.
        return
        A list with the services {class, name} running on the DHN, exception otherwise
    16. Get service information
      • Returns the service information from a given EPR
        signature
        public ServiceData getServiceInfoFromEPR(EndpointReferenceType epr) throws Exception
        parameters
        An End Point Reference
        return
        The service information, exception otherwise
    17. Get the DHN free disk space
      • Returns the local free disk space
        signature
        public String getDHNFreeSpace ( String fileSys ) throws Exception
        parameters
        A valid file system
        return
        The node disk free space (KBytes)
    18. Get the DHN secure mode
      • Returns the DHN secure mode
        signature
        public boolean isDHNSecurityEnable () throws Exception
        parameters
        n.a.
        return
        True if DHN is running in secure mode, false otherwise.

Dependencies

The NAL used following external libraries:

  • commons-io-1.2.jar
  • jaxb-api.jar
  • jaxb-impl.jar
  • jaxb-xjc.jar
  • jaxb1-impl.jar
  • jsr173_api.jar

As well as the following DILIGENT jar files:

  • org_diligentproject_common_profile.jar
  • org_diligentproject_common_profilemanager.jar
  • org_diligentproject_keeperservice_hnm_stubs.jar
  • dvos.authentication-api.jar


Usage Example

NAL Initialization

  • With the default constructor:

NAL    nal     = new NAL ();

  • With a given base directory:

String baseDir = ContainerConfig.getBaseDirectory() + "/etc/org_diligentproject_keeperservice_hnm/HNMService";
NAL    nal     = new NAL (baseDir);


--ManueleSimi 12:50, 02 October 2007 (EET)