Welcome to FIWARE Advanced Middleware KIARA documentation!

KIARA Advanced Middleware is a Java based communication middleware for modern, efficient and secure applications.

It is an implementation of the FIWARE Advanced Middleware Generic Enabler.

This first release focuses on the basic features of RPC communication:

  • Modern Interface Definition Language (IDL) with a syntax based on the Corba IDL.
  • Easy to use and extensible Application Programmer Interface (API).
  • IDL derived operation mode providing Stubs and Skeletons for RPC Client/Server implementations.
  • Synchronous and Asynchronous function calls.

Later versions will include additional features like:

  • Application derived and Mapped operation mode providing dynamic declaration of functions and data type mapping.
  • Advanced security features like field encryption and authentication.
  • Additional communication patterns like publish/subscribe.

KIARA Advanced Middleware is essentially a library which is incorporated into the developed applications, the requirements are rather minimal. In particular it requires no service running in the background.

Please also check out our Github repository

Advanced Middleware RPC API Specification

Date: 18th January 2016

Editors:

Copyright © 2013-2015 by eProsima, DFKI, ZHAW. All Rights Reserved


Abstract

Ahe Advanced Middleware GE enables flexible, efficient, scalable, and secure communication between distributed applications and to/between FIWARE GEs. The Middleware RPC API Specification describes the interfaces and procedures to do Request/Reply type Remote Procedure Calls (RPC).

It provides basic static compile-time Data-Mapping and generation of Function Stubs/Skeletons, created by a compile time IDL-Parser/Generator from the remote service description, which is provided in the Advanced Middleware Interface Definition Language (IDL) syntax, which is based on the Object Management Group (OMG) IDL draft submitted to W3C.

Status of this Document

Date Description
7-November-2014 Release 0.1.0
8-April-2015 Release 0.2.0
10-October-2015 Release 0.3.0
18-January-2016 Release 0.4.0

Introduction

Purpose

This document attempts to describe the Advanced Middleware RPC API.

A quick Example

Before the description of the public Advanced Middleware RPC API, a quick example is provided. It shows how a simple client is created, as well as a simple server. The example uses the following Advanced Middleware interface definition:

service Calculator
{
    i32 add(i32 num1, i32 num2);
};

Creating a client

The following code shows how to instanciate and start a client and execute a call to the server:

Context context = Advanced Middleware.createContext();
Connection connection = context.connect("tcp://192.168.1.18:8080?serialization=cdr");
CalculatorClient client = connection.getServiceProxy(CalculatorClient.class);

int result = client.add(3,4);

Creating a server

The following code shows how to instanciate and start a server:

Context context = Advanced Middleware.createContext();
Server server = context.createServer();
Service service = context.createService();

// User creates its implementation of the Middleware IDL service.
Calculator calculator_impl = new CalculatorImpl();

service.register(calculator_impl);
server.addService(service, "tcp://0.0.0.0:8080", "cdr");

server.run();

API Overview

This section enumerates and describes the classes provided by Advanced Middleware RPC API.

Main entry point

org.fiware.kiara.Kiara

This class is the main entry point to use the Advanced Middlware. It creates or provides implementation of the top level Advanced Middleware interfaces, especially the Context.

Functions:

  • getTypeDescriptorBuilder: This function returns an instance of the type descriptor builder. It is a part of the dynamic API and is described here.
  • getDynamicValueBuilder: This function returns an instance of the dynamic value builder. It is a part of the dynamic API and is described here.
  • createContext: This function creates a new instance of the Context class, which is described below.
  • shutdown: This function closes and releases all internal Advanced Middleware structures (e.g. stops all pending tasks). Call this before you exit your application.

Common interfaces

org.fiware.kiara.Context

This interface is the starting point to use the Advanced Middleware. It holds the configuration of the middleware and hides the process of negotiation, selection, and configuration of the correct implementation classes. Also it provides users a way to instantiate Advanced Middleware components.

Functions:

  • connect: This function creates a new connection to the server. This connection might be used by proxies to send requests to the server.
  • createTransport: This function provides a direct way to create a specific network Transport instance which can be configured for specific use cases.
  • createSerializer: This function provides a direct way to create a specific Serializer instance which can be configured for specific use cases.
  • createServer: This function creates a new Server instance used to add Service instances.
  • createService: This function creates a new Service instance used to register Servant instances.

Network transports

org.fiware.kiara.transport.Transport

This interface provides a basic abstraction for network transport implementations. To create a Transport instance directly, the developer must use the factory method createTransport of the interface org.fiware.kiara.Context, which will return a compliant network transport implementation.

Functions:

  • getTransportFactory: This function returns an instance of the factory class used to create this transport instance.

org.fiware.kiara.transport.ServerTransport

This interface provides an abstraction for a server-side connection endpoint waiting for incoming connections.

Functions:

  • getTransportFactory: This function returns an instance of a factory class which was used to create this server transport instance.
  • setDispatchingExecutor: This function sets executor service used for dispatching incoming messages.
  • getDispatchingExecutor: Returns executor service previously set.
  • isRunning: Returns true if server is up and waiting for incoming connections.
  • startServer: Starts server.
  • stopServer: Stops server.
  • getLocalTransportAddress: Returns transport address to which this server is bound.
org.fiware.kiara.client.AsyncCallback

This interface provides an abstraction used by the client to return the server’s reply when the call was asynchronous.

Functions:

  • onSuccess: This function will be called when the remote function call was successfull. It must be implemented by the user.
  • onFailure: This function will be called when the remote function call was not successfull.It must be implemented by the user.

Server API

org.fiware.kiara.server.Server

Using this interface, users can start up multiple services on different ports. The implementation uses serialization mechanisms and network transports to listen for client requests and executes the proper Servant implementation. The optional negotiation protocol provides automatic discovery of all available services via the HTTP protocol.

Functions:

  • enableNegotiationService: Enables the negotiation service on the specified port and configuration path.
  • disableNegotiationService: Disables the negotiation service.
  • addService: This function registers the service on a specified URL and with a specified serialization protocol.
  • removeService: Removes a previously registered service.
  • run: Starts the server.

org.fiware.kiara.server.Service

This interface represent a service that can be registered with the server.

Functions:

  • register: Register a Servant object or DynamicHandler with the service.
  • loadServiceIDLFromString: Load the service IDL from a string. This function is only required when the service is handled via dynamic handlers.

org.fiware.kiara.server.Servant

This interface provides an abstraction used by the server to execute the provided functions when a client request is received.

Functions:

  • getServiceName: Returns the name of the service implemented by this servant.
  • process: This function processes the incoming request message and returns the produced response message. It is automatically generated.

Dependent API

This subsection contains the interfaces and classes that are dependent from the user Advanced Middleware IDL definition. In the static version of the Advanced Middleware implementation these interfaces and classes should be generated by the compile time preprocessor.
This section uses the example in section API Usage Examples.

x.y.<IDL-ServiceName>

This interface is a mapping of the Advanced Middleware IDL service. It exposes the service’s procedures. All classes that implement these service’s procedures, have to inherit from this interface. For example the imlementation of the servant have to inherit from this interface, allowing the user to implement the service’s procedures.

Functions:

  • add: This function is the mapping of the Advanced Middleware IDL service procedure add().

x.y.<IDL-ServiceName>Async

This interface is a mapping of the Advanced Middleware IDL service. It exposes the asynchronous version of the service’s procedures. All classes that that implement these service’s asynchronous procedures have to inherit from this interface.

Functions:

  • add: This function is the asynchronous version of the Advanced Middleware IDL service’s procedure add(). It has no return value.

x.y.<IDL-ServiceName>Process

This class is a mapping of the Advanced Middleware IDL service. It provides the asynchronous version of the service’s processing procedures.

Functions:

  • add_processAsync: This function is the asynchronous version of the Advanced Middleware IDL service’s process procedure. It has no return value.

x.y.<IDL-ServiceName>Client

This interface provides the synchronous and asynchronous version of the Advanced Middleware IDL service, because it implements the previously described interfaces x.y.<IDL-ServiceName> and x.y.<IDL-ServiceInterface>Async. The Advanced Middleware IDL service proxy will implement this interface, allowing the user to call the service’s remote procedures synchronously or asynchronously. It is only used on the client side in order to make the Proxy to implement all the functions for this service (both synchronous and asynchronous).

Functions:

  • add: Function inherited from x.y.<IDL-ServiceName> interface. This function is the mapping of the Advanced Middleware IDL service.
  • add: Function inherited from x.y.<IDL-ServiceName>Async interface. This function is the asynchronous version of the Advanced Middleware IDL service’s procedure.

x.y.<IDL-ServiceName>Proxy

This class encapsulates the implementation of the interface x.y.<IDL-ServiceName>Client. It provides the logic to call the Advanced Middleware IDL service’s remote procedures, synchronously or asynchronously.

Functions:

  • add: Function inherited from x.y.<IDL-ServiceName>Client interface. This function is the mapping of the Advanced Middleware IDL service.
  • add: Function inherited from x.y.<IDL-ServiceName>Client interface. This function is the asynchronous version of the Advanced Middleware IDL service’s procedure.

x.y.<IDL-ServiceName>Servant

This abstract class can be used by users to implement the Advanced Middleware IDL service’s procedures. This class implements the interface org.fiware.kiara.server.Servant, providing the mechanism the server will use to call the user’s procedure implementations. Also it inherits from the interface x.y.<IDL-ServiceName> leaving the implementation of this functions to the user.

Detailed API

This section defines in detail the API provided by the classes defined above.

Main entry point

org.fiware.kiara.Kiara      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
getTypeDescriptorBuilder   TypeDescriptorBuilder  
getDynamicValueBuilder   DynamicValueBuilder  
createContext   Context  
shutdown   void  

Common interfaces

org.fiware.kiara.Context      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
connect   Connection IOException
  url String  
connect   Connection IOException
  transport Transport  
  serializer Serializer  
createService   Service  
createServer   Server  
createTransport   Transport IOException
  String url  
createServerTransport   ServerTransport IOException
  url String  
createSerializer   Serializer IOException
  name String  

Network transports

org.fiware.kiara.transport.Transport      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
getTransportFactory   TransportFactory  

Dependent API

Cause the described classes in this section are dependant of the Advanced Middleware IDL service, this section will use the example in section API Examples to define them.

x.y.<IDL-ServiceName>      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
add   int  
  num1 int  
  num2 int  
x.y.<IDL-ServiceName>Async      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
add   void  
  num1 int  
  num2 int  
  callback AsyncCallback<Integer>  
x.y.<IDL-ServiceName>Client      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
Inherited from x.y.<IDL-ServiceName> and x.y.<IDL-ServiceName>Async      
x.y.<IDL-ServiceName>Proxy      
Attributes      
Name Type    
m_ser org.fiware.kiara.serialization.Serializer    
m_transport org.fiware.kiara.transport.Transport    
Public Operations      
Name Parameters Returns/Type Raises
Inherited from x.y.<IDL-ServiceName> and x.y.<IDL-ServiceName>Async      
x.y.<IDL-ServiceName>Servant      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
getServiceName   String  
process   TransportMessage  
  ser Serializer  
  message TransportMessage  
  transport Transport  
  messageId Object  
  bis BinaryInputStream  
x.y.<IDL-ServiceName>Process      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
add_processsAsync   void  
  message TransportMessage  
  ser Serializer  
  callback AsyncCallback  

API Usage Examples

Examples used in this section are based on the following Advanced Middleware IDL:

service Calculator
{
    i32 add(i32 num1, i32 num2);
};

Client API

Direct connection to remote service

This example shows how to create a direct connection to a server using the TCP transport and the CDR serialization. After it creates the connection, the service proxy is instantiated and used to call a remote procedure.

Context context = Kiara.createContext();
Connection connection = context.connect("tcp://192.168.1.18:8080?serialization=cdr");
CalculatorClient client = connection.getServiceProxy(CalculatorClient.class);

int result = client.add(3,4);

Transport and Serialization instances are implizitly created by the connection, based on the string parameter of the connect method.

Secure connection to remote service

KIARA also provides a way to stablish secure TCP connections with servers running in secure mode. To to so, simply change the connection URL to use TCPS instead of TCP.

Context context = Kiara.createContext();
Connection connection = context.connect("tcps://192.168.1.18:8080?serialization=cdr");
CalculatorClient client = connection.getServiceProxy(CalculatorClient.class);

int result = client.add(3,4);

Note that a client running normal (non secure) TCP transport can initialize a connection with a non-secure TCP server, but this does not happen in the opposite way.

Explicitly instanciate and configure Advanced Middleware components

This examples shows how to create a direct connection as above, but using a TCP transport and CDR serialization created and configured explicitly by the user.

Context context = Kiara.createContext();
// User instantiates a transport object which can be configured later.
Transport transport = context.createTransport("tcp://192.168.1.18:8080");
// User instantiates a serialization object which can be configured later.
Serializer serializer = context.createSerializer("cdr");
Connection connection = context.connect(transport, serializer);
CalculatorClient client = connection.getServiceProxy(CalculatorClient.class);

int result = client.add(3,4);

Server API

Providing a service

This examples shows how to create a server and add a service to it.

Context context = Kiara.createContext();
Server server = context.createServer();
Service service = context.createService();

// User creates and registers it's implementation of the servant.
Calculator calculator_impl = new CalculatorServantImpl();
service.register(calculator_impl);

// Add the service to the server
server.addService(service, "tcp://0.0.0.0:8080", "cdr");

server.run();

Transport and Serialization instances are implizitly created by the connection, based on the string parameters of the addService method.

Explicitly instanciate and configure Advanced Middleware components

This example shows how to provide a service as above, but using a TCP transport and CDR serialization created and configured explicitly by the user.

Context context = Kiara.createContext();
Server server = context.createServer();
Service service = context.createService();

// User creates and registers it's implementation of the servant.
Calculator calculator_impl = new CalculatorServantImpl();
service.register(calculator_impl);

// Transport and Serializer are expicitly created ...
Transport transport = context.createTransport("tcp://0.0.0.0:8080");
Serializer serializer = context.createSerializer("cdr");

// ... and bound to the service when adding it to the server
server.addService(service, transport, serializer);

server.run();
Secure TCP server

KIARA allows the server to initialize using a secure TCP layer so that only clients using the same protocol can establish a connection with it.

The transport used to handle secure connections is SSL v3.1 (Secure Sockets Layer) over TLS v1.2 (Transport Layer Security). In order to start a secure server, the only change the user has to take into account is changing the URL of the server so that it uses TCPS instead of TCP.

This example shows how to create a secure server and add a service to it.

Context context = Kiara.createContext();
Server server = context.createServer();
Service service = context.createService();

// User creates and registers it's implementation of the servant.
Calculator calculator_impl = new CalculatorServantImpl();
service.register(calculator_impl);

// Add the service to the server
server.addService(service, "tcps://0.0.0.0:8080", "cdr");

server.run();

Transport and Serialization instances are implicitly created by the connection, based on the string parameters of the addService method.

Advanced Middleware RPC Dynamic Types API Specification

Date: 18th January 2016

Editors:

Copyright © 2013-2015 by eProsima, DFKI, ZHAW. All Rights Reserved


Abstract

The Advanced Middleware GE enables flexible, efficient, scalable, and secure communication between distributed applications and to/between FIWARE GEs. The Middleware RPC Dynamic Types API Specification describes the extensions to the Middleware RPC API Specification to do dynamic Request/Reply type Remote Procedure Calls (RPC).

It provides a dynamic runtime Data-Mapping and invocation of Function proxies, by parsing the IDL description of the remote service at runtime and map it to the function/data definition provided by the developer when setting up the connection.

Status of this Document

Date Description
30-January-2015 Frist release
04-February-2015 Update after review meeting
08-April-2015 Release 0.2.0
10-October-2015 Release 0.3.0
18-January-2016 Release 0.4.0

Introduction

Purpose

The purpose of this document is to specify the dynamic Remote Procedure Call (RPC) Application Programming Interface (API) for the Advanced Middleware GE.

A quick Example

Before the description of the public Advanced Middleware RPC Dynamic Types API, a quick example is provided. This example shows how a client should use this dynamic API framework to call a remote server and how a server can send the response.

First of all, let’s bear in mind that the server provides an IDL defining the services and their functions. The example uses the following Advanced Middleware interface definition:

service Calculator
{
    i32 add(i32 num1, i32 num2);
};

Loading the services’ definitions

To be able to call remote functions dynamically, it is required to know the services and what functions they offer. The use case is to load the TypeCodeelements when creating the connection, so it will be the Connection class which offers an API to get all the data definitions from the server.

Creating a client

On the client side, there is no differnce between the dynamic and the static API from the developers point of view in terms of creating the connection. In the dynamic case this connection will be used to obtain all the types and functions offered by the server.

This means, the user has to create a connection and then use it to get a definition of the function he wants to execute. Let’s walk through it based on the following example.

// Create context and connect with the server
Context context = Kiara.createContext();
Connection connection = context.connect("kiara://127.0.0.1:8080/service");

// Get a generic proxy based on the service interface
 DynamicProxy client = connection.getDynamicProxy("Calculator");

When connecting to the server, the scheme specified in the URI is used by the Context to decide from where to download the information. In this example, the scheme “kiara” means the connection information is going to be downloaded from the server and then used in the negotiation process. Otherwise, information such as the transport protocol and serialization mechanism must be specified in the URI itself.

Before being able to call remotely a function on the server, the client will need to have access to its functions, and in a typical RPC framework, this can be done by using a Proxy. The class named DynamicProxy allows the user to have access to this information from the data that has been downloaded from the server.

To do so, the Connection object offers a function called getDynamicProxy, which looks inside the dynamic data types created when connecting to the server and retrieves a DynamicProxy whose name is the same as the service name specified as a parameter.

Once the user has obtained this DynamicProxy, all the functions defined inside the service are available. To use them, two objects are necessary, the DynamicFunctionRequest and the DynamicFunctionResponse.

The DynamicFunctionRequest object is created at run-time by using the name of the function the user wants to execute on the server’s side. If there is a function whose name fits the one specified, this object will be filled with all the DynamicValue objects necessary to execute the function.

On the other hand, the DynamicFunctionResponse object will be created and filled with the response obtained from the server after the execution is finished (either if it finished properly or not).

// Create the function request
DynamicFunctionRequest request = dclient.createFunctionRequest("add");
((DynamicPrimitive) request.getParameterAt(0)).set(3.5);
((DynamicPrimitive) request.getParameterAt(1)).set(5.2);

// Execute the Remote Procedure Call
DynamicFunctionResponse response = drequest.execute();

In this example, the createFunctionRequest method has been executed specifying “add as” the function name. Therefore, the DynamicFunctionRequest object will have two primitive DynamicValue objects (DynamicPrimitive) inside (one for each parameter defined in the IDL description of the function). The user can easily modify these values and call the execute method on the request object, obtaining this way a DynamicFunctionResponse which holds the result of the function execution.

The execute method will have all the business logic so that the service name, the operation name, message ID, etc. as well as all the parameters are serialized properly according to the function that is going to be executed.

The same thing happens with the return type of each function. Depending on the DynamicValue that defines it, a different deserialization method will be executed. By using this method, the user only has to specify which function must be executed on the server’s side, and all the information will be (de)serialized automatically.

In order to know if the function finished the way it should, the DynamicFunctionResponse object offers a function named isException, which will return true if and only if the function did raise an exception. The following code snippet shows this behaviour:

// Check RPC result
if (dresponse.isException()) {
    DynamicData result = dresponse.getReturnValue();
    System.out.println("Exception = " + (DynamicPrimitive) result);
} else {
    DynamicData result = dresponse.getReturnValue();
    System.out.println("Result = " + ((DynamicPrimitive) result).get());
}

Creating a secure client

KIARA allows to use the Dynamic RPC API to connecto to a secure TCP server. This behaviour does not apply to the dynamic API, and therefore it can be found in the Advanced Middleware RPC API Specification document, in the section API Usage Examples.

API Overview

This section enumerates and describes the classes provided by Advanced Middleware Dynamic Types RPC API.

Main entry point

org.fiware.kiara.Kiara

This class is the main entry point to use Advanced Middleware middleware. It creates or provides implementation of top level Advanced Middleware interfaces, especially Context.

Functions:

  • getTypeDescriptorBuilder: This function returns an instance of the type DescriptorBuilder described below.
  • getDynamicValueBuilder: This function returns an instance of the DynamicValueBuilder described below.
  • createContext: This function creates a new instance of the Context class, which is part of the public Advanced Middleware RPC API.
  • shutdown: This function closes releases all internal Advanced Middleware structures, and is a part of the public Advanced Middleware RPC API.

Serialization mechanisms

org.fiware.kiara.serialization.Serializer

This interface is part of the public Advanced Middleware RPC API.

org.fiware.kiara.serialization.impl.Serializable

This interface is the one that must be implemented by all the used defined data types in order to be serializable. It defines the methods serialize and deserialize for each data type. This class will not be described in this document, for more information take a look at the Advanced Middleware RPC API document.

Client API

org.fiware.kiara.client.Connection

The Connection interface manages the connection to the server. It holds the required Transport objects and Serialization objects. Also it can create these object automatically depending on the server information. The connection provides the service proxy interfaces, which will be used by the application to call remote functions.

Functions:

  • getDynamicProxy: This function looks in the endpoint for a service whose name is the same as the one specified as a parameter, and creates a new DynamicProxy representing that service. This DynamicProxy will provide the user with all the functions defined in such a service.

TypeDescriptor

This subsection contains the interfaces and classes that are dependent on the user. This section will use the example in section API Usage Examples to define them.

_images/MiddlewareClassDiagramTypeDescriptor.png

Class Diagram TypeDescriptor


org.fiware.kiara.typecode.TypeDescriptorBuilder

This interface defined the operations used to create type-describing objects. It allows the users to create every supported data type inside Advanced Middleware by acting as a single access builder.

Functions:

  • createVoidType: This function creates a new DataTypeDescriptor representing a void data type..
  • createPrimitiveType: This function returns a new PrimitiveTypeDescriptor whose kind is the same specified as a parameter.
  • createArrayType: Function that creates a new ArrayTypeDescriptor object representing an array.
  • createListType: This function creates a new ListTypeDescriptor object representing a list of objects.
  • createSetType: Function that creates a new SetTypeDescriptor object representing a set. A set is defined as a list with no repeated objects.
  • createMapType: This function is used to create a MapTypeDescriptor object that represents a map data type.
  • createStructType: This function creates a new StructTypeDescriptor object representing a struct data type.
  • createEnumType: Function that creates a new EnumTypeDescriptor object representing an enumeration.
  • createUnionType: This function can be used to create a new UnionTypeDescriptor that represents a union data type.
  • createExceptionType: Function that creates a new ExceptionTypeDescriptor used to represent an exception data type.
  • createFunctionType: This function can be used to create a new FunctionTypeDescriptor representing a Remote Procedure Call (RPC).
  • createServiceType: Function that creates a new ServiceTypeDescriptor object used to represent a service defined in the server’s side.

org.fiware.kiara.typecode.TypeDescriptor

This class is used to manipulate the objects used to describe the data types. It allows the users to know what type of data an object represents.

_images/MiddlewareInterfaceTypeDescriptor.png

Interface TypeDescriptor

Functions:

  • getKind: Function that returns the TypeKind of a TypeDescriptor object.
  • isData: This function returns true if and only if the TypeDescriptor represented by the object in which is invoked describes a data type. Functions and services are not considered data types.
  • isPrimitive: Function used to know if a TypeCode object is a description of a primitive data type.
  • isVoid: This function returns true if the TypeDescriptor object represents a void data type.
  • isContainer: This function can be used to check if a TypeDescriptor object is representing a container type. The types considered as container data types are arrays, lists, sets and maps.
  • isArray: Function used to know if a TypeDescriptor object is a description of an array data type.
  • isList: Function used to know if a TypeDescriptor object is a description of a list data type.
  • isMap: Function used to know if a TypeDescriptor object is a description of a map data type.
  • isSet: Function used to know if a TypeDescriptor object is a description of a set data type.
  • isMembered: This function is used to know if a TypeDescriptor object is a description of a membered data type. Membered types are structs, enumerations, unions and exceptions.
  • isStruct: Function used to know if a TypeDescriptor object is a description of a struct data type.
  • isEnum: Function used to know if a TypeDescriptor object is a description of an enumeration data type.
  • isUnion: Function used to know if a TypeDescriptor object is a description of a union data type.
  • isException: Function used to know if a TypeDescriptor object is a description of an exception data type.
  • isFunction: Function used to know if a TypeDescriptor object is a description of a function.
  • isService: Function used to know if a TypeDescriptor object is a description of a service.

org.fiware.kiara.typecode.data.DataTypeDescriptor

Interface that represents the top level class of the data type hierarchy. It is used as a generic type to englobe only and exclusively data type descriptors.

_images/MiddlewareInterfaceDataTypeDescriptor.png

Interface DataTypeDescriptor

Functions: None


org.fiware.kiara.typecode.data.PrimitiveTypeDescriptor

Interface that represents a primitive data type. Primitive types include boolean, byte, i16, ui16, i32, ui32, i64, ui64, float32, float64, char and string.

_images/MiddlewareInterfacePrimitiveTypeDescriptor.png

Interface PrimitiveTypeDescriptor

Functions:

  • isString: This function returns true if and only if the PrimitiveTypeDescriptor object represents a string data type.
  • setMaxFixedLength: This function can only be used with string types. It sets the maximum length value for a specific string represented by the PrimitiveTypeDescriptor object.
  • getMaxFixedLength: This function returns the maximum length specified when creating the PrimitiveTypeDescriptor object if it represents a string data type.

org.fiware.kiara.typecode.data.ContainerTypeDescriptor

Interface that represents a container data type. Container data types are arrays, lists, maps and sets.

_images/MiddlewareInterfaceContainerTypeDescriptor.png

Interface ContainerTypeDescriptor

Functions:

  • setMaxSize: This function sets the maximum size of a container data type.
  • getMaxSize: This function returns the maximum size of a container data type.

org.fiware.kiara.typecode.data.ArrayTypeDescriptor

Interface that represents an array data type. Arrays can hold multiple repeated objects of the same data type inside.

_images/MiddlewareInterfaceArrayTypeDescriptor.png

Interface ArrayTypeDescriptor

Functions:

  • getElementType: This function returns the DataTypeDescriptor object describing the content type of the array.
  • setElementType: This function sets the DataTypeDescriptor object describing the content type of the array.
  • setDimensions: This method sets the dimensions of the array.
  • getDimensions: This method returns the different dimensions of the array.

org.fiware.kiara.typecode.data.ListTypeDescriptor

Interface that represents a list data type. Lists can hold multiple repeated objects of the same data type inside.

_images/MiddlewareInterfaceListTypeDescriptor.png

Interface ListTypeDescriptor

Functions:

  • getElementType: This function returns the DataTypeDescriptor object describing the content type of the list.
  • setElementType: This function sets the DataTypeDescriptor object describing the content type of the list.

org.fiware.kiara.typecode.data.SetTypeDescriptor

Interface that represents a set data type. Sets can have non repeated objects of the same data type inside.

_images/MiddlewareInterfaceSetTypeDescriptor.png

Interface SetTypeDescriptor

Functions:

  • getElementType: This function returns the DataTypeDescriptor object describing the content type of the set.
  • setElementType: This function sets the DataTypeDescriptor object describing the content type of the set.

org.fiware.kiara.typecode.data.MapTypeDescriptor

Interface that represents a map data type. Maps can hold multiple key-object pairs inside if and only if the key objects are unique.

_images/MiddlewareInterfaceMapTypeDescriptor.png

Interface MapTypeDescriptor

Functions:

  • getKeyTypeDescriptor: This function returns the DataTypeDescriptor object describing the key type of the map.
  • setKeyTypeDescriptor: This function sets the DataTypeDescriptor object describing the key type of the map.
  • getValueTypeDescriptor: This function returns the DataTypeDescriptor object describing the value type of the map.
  • setValueTypeDescriptor: This function sets the DataTypeDescriptor object describing the value type of the map.

org.fiware.kiara.typecode.data.MemberedTypeDescriptor

Interface that represents a membered data type. Membered data types are structs, enumerations, unions and exceptions.

_images/MiddlewareInterfaceMemberedTypeDescriptor.png

Interface MemberedTypeDescriptor

Functions:

  • getMembers: This function returns the list of member objects stored in a ContainerTypeDescriptor object.
  • getName: This function returns the name of the ContainerTypeDescriptor object.

org.fiware.kiara.typecode.data.StructTypeDescriptor

Interface that represents a struct data type. Structs can have multiple different DataTypeDescriptor objects inside stored as members. Every struct member is identified by a unique name.

_images/MiddlewareInterfaceStructTypeDescriptor.png

Interface StructTypeDescriptor

Functions:

  • addMember: This function adds a new TypeDescriptor object as a member using a specific name.
  • getMember: This function returns a DataTypeDescriptor object identified by the name introduced as a parameter.

org.fiware.kiara.typecode.data.EnumTypeDescriptor

Interface that represents an enumeration data type. Enumerations are formed by a group of different string values.

_images/MiddlewareInterfaceEnumTypeDescriptor.png

Interface EnumTypeDescriptor

Functions:

  • addValue: This function adds a new value to the enumeration using the string object received as a parameter.

org.fiware.kiara.typecode.data.UnionTypeDescriptor

Interface that represents a union data type. Unions are formed by a group of members identified by their names and the labels of the discriminator to which they are assigned.

_images/MiddlewareInterfaceUnionTypeDescriptor.png

Interface UnionTypeDescriptor

Functions:

  • addMember: This function adds a new TypeDescriptor object as a member using a specific name and the labels of the discriminator.

org.fiware.kiara.typecode.data.ExceptionTypeDescriptor

Interface that represents a struct data type. Exceptions can have multiple different DataTypeDescriptor objects inside stored as members. Every struct member is identified by a unique name.

_images/MiddlewareInterfaceExceptionTypeDescriptor.png

Interface ExceptionTypeDescriptor

Functions:

  • addMember: This function adds a new TypeDescriptor object as a member using a specific name.
  • getMember: This function returns a DataTypeDescriptor object identified by the name introduced as a parameter.
  • getMd5: This function returns the Md5 hash string of the exception name.

org.fiware.kiara.typecode.data.Member

Interface that represents a member of a MemberedTypeDescriptor object. Each member is identified by its name and the TypeDescriptor object that it holds.

_images/MiddlewareInterfaceMember.png

Interface Member

Functions:

  • getName: This function returns the member’s name.
  • getTypeDescriptor: This function returns a DataTypeDescriptor object stored inside the member.

org.fiware.kiara.typecode.data.EnumMember

Interface that represents a member of a EnumTypeDescriptor object. It inherits from Member interface and therefore it has no new methods.

_images/MiddlewareInterfaceEnumMember.png

Interface EnumMember

Functions: None


org.fiware.kiara.typecode.data.UnionMember

Interface that represents a member of a UnionTypeDescriptor object. It inherits from Member interface and therefore it has no new methods.

_images/MiddlewareInterfaceUnionMember.png

Interface UnionMember

Functions: None


org.fiware.kiara.typecode.services.FunctionTypeDescriptor

This interface represents a function, providing methods to easily describe it by setting its return type, parameters and exceptions that it might throw.

_images/MiddlewareInterfaceFunctionTypeDescriptor.png

Interface FunctionTypeDescriptor

Functions:

  • getReturnType:This function returns the return DataTypeDescriptor of the function.
  • setReturnType: This function sets the return DataTypeDescriptor of the function.
  • getParameter: This function returns a DataTypeDescriptor representing a parameter whose name is the same as the one indicated.
  • addParameter: This function adds a new DataTypeDescriptor to the parameters list with the name indicated.
  • getException: This function returns an ExceptionTypeDescriptor whose name is the same as the one specified as a parameter.
  • addException: This function adds a new ExceptionTypeDescriptor to the exceptions list.
  • getName: This function returns the function name.
  • getServiceName: This function returns the name of the ServiceTypeDescriptor in which the FunctionTypeDescriptor is defined.
  • setServiceName: This function sets the name of the ServiceTypeDescriptor in which the FunctionTypeDescriptor is defined.

org.fiware.kiara.typecode.services.ServiceTypeDescriptor

This interface represents a service, providing methods to add the FunctionTypeDescriptor objects representing every function defined in a specific service.

_images/MiddlewareInterfaceServiceTypeDescriptor.png

Interface ServiceTypeDescriptor

Functions:

  • getName: This function returns the service name.
  • getScopedName: This function returns the service scoped name.
  • getFunctions: This function returns the list of FunctionTypeDescriptor objects stored inside the ServiceTypeDescriptor.
  • addFunction: This function adds a FunctionTypeDescriptor to the list of functions defined inside the service.

Dynamic

This subsection contains the interfaces and classes that are designed to provide the developer with functions to create and manage dynamic data types.

_images/MiddlewareClassDiagramDynamicValue.png

Class Diagramm DynamicValue


org.fiware.kiara.dynamic.DynamicValueBuilder

This class allows the users to create new data types based on their TypeCode descriptions.

_images/MiddlewareInterfaceDynamicValueBuilder.png

Interface DynamicValueBuilder

Functions:

  • createData: This function allows the user to create new DynamicData objects by using their TypeDescriptor.
  • createFunctionRequest: This function receives a FunctionTypeDescriptor object describing a function, and it generates a new DynamicFunctionRequest (which inherits from DynamicData) object representing it.
  • createFunctionResponse: This function receives a FunctionTypeDescriptor object describing a function, and it generates a new DynamicFunctionResponse (which inherits from DynamicData) object representing it.
  • createService: This function receives a ServiceTypeDescriptor object describing a function, and it creates a new DynamicService object representing it.

org.fiware.kiara.dynamic.DynamicValue

Interface that acts as a supertype for every dynamic value that can be managed. Every DynamicValue object is defined by using a TypeDescriptor which is used to describe the data. It defines the common serialization functions as well as a function to retrieve the TypeDescriptor object it was created from.

_images/MiddlewareInterfaceDynamicValue.png

Interface DynamicValue

Functions:

  • getTypeDescriptor: This function returns the TypeDescriptor used when creating the DynamicValue object.
  • serialize: This function serializes the content of the DynamicValue object inside a BinaryOutputStream message.
  • deserialize: This function deserializes the content of a BinaryInputStream message into a DynamicValue object.

org.fiware.kiara.dynamic.data.DynamicData

Interface that is used to group all the DynamicValues representing data types.

_images/MiddlewareInterfaceDynamicData.png

Interface DynamicData

Functions: None


org.fiware.kiara.dynamic.data.DynamicPrimitive

This class allows the users to manipulate DynamicData objects made from PrimitiveTypeDescriptor objects.

_images/MiddlewareInterfaceDynamicPrimitive.png

Interface DynamicPrimitive

Functions:

  • set: This function sets the inner value of a DynamicPrimitive object according to the TypeDescriptor specified when creating it.
  • get: This function returns the value of a DynamicPrimitive object.

org.fiware.kiara.dynamic.data.DynamicContainer

This class holds the data values of a DynamicData object created from a ContainerTypeDescriptor.

_images/MiddlewareInterfaceDynamicContainer.png

Interface DynamicContainer

Functions: None


org.fiware.kiara.dynamic.data.DynamicArray

This class holds the data values of a DynamicData object created from an ArrayTypeDescriptor. A DynamicArray contains a group of DynamicData objects (all must be the same type) stored in single or multi dimensional matrixes.

_images/MiddlewareInterfaceDynamicArray.png

Interface DynamicArray

Functions:

  • getElementAt: This function returns DynamicData object stored in a certain position or coordinate..
  • setElementAt: This function sets a DynamicData object in a specific position inside the array. If the array has multiple dimensions, the object will be set in a specific coordinate.

org.fiware.kiara.dynamic.data.DynamicList

This class holds the data values of a DynamicData object created from a ListTypeDescriptor. A list can only have one dimension and it has a maximum length. All the DynamicData objects stored inside a DynamicList must have been created from the same TypeDescriptor definition.

_images/MiddlewareInterfaceDynamicList.png

Interface DynamicList

Functions:

  • add: This function adds a DynamicData object into the list in the last position or in the position specified via parameter.
  • get: This function returns a DynamicData object stored is a specific position in the list.
  • isEmpty: This function returns true if the DynamicList is empty.

org.fiware.kiara.dynamic.data.DynamicSet

This class holds the data values of a DynamicData object created from a SetTypeDescriptor. A set can only have one dimension and it has a maximum length. All the DynamicData objects stored inside a DynamicSet must have been created from the same TypeDescriptor definition and it cannot be duplicated objects.

_images/MiddlewareInterfaceDynamicSet.png

Interface DynamicSet

Functions:

  • add: This function adds a DynamicData object into the list in the last position or in the position specified via parameter.
  • get: This function returns a DynamicData object stored is a specific position in the list.
  • isEmpty: This function returns true if the DynamicSet is empty.

org.fiware.kiara.dynamic.data.DynamicMap

This class holds a list of pairs key-value instances of DynamicData. In a DynamicMap, the key values cannot be duplicated.

_images/MiddlewareInterfaceDynamicMap.png

Interface DynamicMap

Functions:

  • put: This function adds a new key-value pair using the DynamicData objets introduces as parameters. It will return false if the key value already exists in the map.
  • containsKey: This function returns true if the DynamicMap contains at least one key-value pair in which the key DynamicData object is equal to the one introduced as a parameter.
  • containsValue: This function returns true if the DynamicMap contains at least one key-value pair in which the value DynamicData object is equal to the one introduced as a parameter.
  • get: This function returns a DynamicData object from a key-value pair whose key is equal to the one introduced as a parameter.

org.fiware.kiara.dynamic.data.DynamicMembered

This class represents a DynamicData type formed by multiple DynamicData objects stored into a class named DynamicMember.

_images/MiddlewareInterfaceDynamicMembered.png

Interface DynamicMembered

Functions: None


org.fiware.kiara.dynamic.data.DynamicStruct

This class holds group of DynamicData objects acting as members of a stucture. Each member is identified by its name.

_images/MiddlewareInterfaceDynamicStruct.png

Interface DynamicStruct

Functions:

  • getMember: This function returns a DynamicData object (acting as a member of the structure) whose name is the same as the one introduced as a parameter.

org.fiware.kiara.dynamic.data.DynamicEnum

This class is used to dynamically manipulate enumerations described by a specific EnumTypeDescriptor object.

_images/MiddlewareInterfaceDynamicEnum.png

Interface DynamicEnum

Functions:

  • set: This function sets the actual value of the DynamicEnum object to the one specified as a parameter.
  • get: This function returns the actual value of the DynamicEnum object.

org.fiware.kiara.dynamic.data.DynamicUnion

This class is used to dynamically manipulate unions described by a specific UnionTypeDescriptor object. A union is formed by some DynamicData objects, and the valid one is selected by using a discriminator.

_images/MiddlewareInterfaceDynamicUnion.png

Interface DynamicUnion

Functions:

  • _d: This function either returns the discriminator or sets a new one, depending on the existence of an object parameter indicating a new value.
  • getMember: This function returns valid DynamicData value depending on the selected discriminator.
  • setMember: This function sets the DynamicData object received as a parameter in the member whose name is the same as the one introduced (if and only if the discriminator value is correct).

org.fiware.kiara.dynamic.data.DynamicException

This class holds group of DynamicData objects acting as members of an exception. Each member is identified by its own name.

_images/MiddlewareInterfaceDynamicException.png

Interface DynamicException

Functions:

  • getMember: This function returns a DynamicData object whose name is the same as the one introduced as a parameter.

org.fiware.kiara.dynamic.data.DynamicMember

This class represents a dynamic member of any DynamicMembered object. It is used to store the DynamicData objects inside structures, unions, enumerations and exceptions.

_images/MiddlewareInterfaceDynamicMember.png

Interface DynamicMember

Functions:

  • getName: This function returns the member’s name.
  • getDynamicData: This function returns the DynamicData stored inside a DynamicMember object.
  • equals: It returns true if two DynamicMember objects are equal.

org.fiware.kiara.dynamic.service.DynamicFunctionRequest

This class represents a dynamic function request. This class is used to create objects whose objective is to invoke functions remotely.

_images/MiddlewareInterfaceDynamicFunctionRequest.png

Interface DynamicFunctionRequest

Functions:

  • getParameter: This function returns a DynamicData object stored in the parameter list depending on its name or its position in such list.
  • execute: This function executes a function remotely. It serializes all the necessary information and sends the request over the wire. It returns a DynamicFunctionResponse with the result.
  • executeAsync: This function behaves the same way as the function execute. The only difference is that it needs a callback to be executed when the response arrives from the server.

org.fiware.kiara.dynamic.service.DynamicFunctionResponse

This class represents a dynamic function response. This class is used to retrieve the information sent from the server after a remote procedure call.

_images/MiddlewareInterfaceDynamicFunctionResponse.png

Interface DynamicFunctionResponse

Functions:

  • isException: This function returns true if the server raised an exception when executing the function.
  • setException: This method sets the attribute indicating that an exception has been thrown on the server side.
  • setReturnValue: This function sets a DynamicData object as a return value for the remote call.
  • getReturnValue: This function returns the DynamicData representing the result of the remote call.

org.fiware.kiara.dynamic.service.DynamicProxy

This class represents a proxy than can be dynamically used to create an instance of DynamicFunctionRequest or a DynamicFunctionResponse depending if the user wants an object to execute a remote call or to store the result.

_images/MiddlewareInterfaceDynamicProxy.png

Interface DynamicProxy

Functions:

  • getServiceName: This function returns the service name.
  • createFunctionRequest: This function creates a new object instance of DynamicFunctionRequest according to the FunctionTypeDescriptor that was used to describe it.
  • createFunctionResponse: This function creates a new object instance of DynamicFunctionResponse according to the FunctionTypeDescriptor that was used to describe it.

org.fiware.kiara.dynamic.service.DynamicFunctionHandler

This class represents a dynamic object used to hold the implementation of a specific function. Its process method must be defined by the user when creating the object, and it will be used to register the service’s functions on the server’s side.

_images/MiddlewareInterfaceDynamicFunctionHandler.png

Interface DynamicFunctionHandler

Functions:

  • process: This function is the one that will be registered to be executed when a client invokes remotely a function. It must be implemented by the user.

Detailed API

This section defines in detail the API provided by the classes defined above.

Main entry point

org.fiware.kiara.Kiara      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
getTypeDescriptorBuilder   TypeDescriptorBuilder  
getDynamicValueBuilder   DynamicValueBuilder  
createContext   Context  
shutdown   void  

Client API

This classes are those related to the client side API. This section includes all the relevant classes, attributes and methods.

org.fiware.kiara.client.Connection      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
getTransport   Transport  
getSerializer   Serializer  
getServiceProxy   T Exception
  interfaceClass Class<T>  
getDynamicProxy   DynamicProxy  
  name String  

TypeDescriptor

This classes are those related to the client’s side API. This section includes all the relevant classes, attributes and methods.

org.fiware.kiara.typecode.TypeDescriptorBuilder      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
createVoidType   DataTypeDescriptor  
createPrimitiveType   PrimitiveTypeDescriptor  
  kind TypeKind  
createArrayType   ArrayTypeDescriptor  
  contentDescriptor DataTypeDescriptor  
  dimensions int[]  
createListType   ListTypeDescriptor  
  contentDescriptor DataTypeDescriptor  
  maxSize int  
createSetType   SetTypeDescriptor  
  contentDescriptor DataTypeDescriptor  
  maxSize int  
createMapType   MapTypeDescriptor  
  keyDescriptor DataTypeDescriptor  
  valueDescriptor DataTypeDescriptor  
  maxSize int  
createStructType   StructTypeDescriptor  
  name String  
createEnumType   EnumTypeDescriptor  
  name String  
  values String[]  
createUnionType   UnionTypeDescriptor  
  name String  
  discriminatorDesc DataTypeDescriptor  
createExceptionType   ExceptionTypeDescriptor  
  name String  
createFunctionType   FunctionTypeDescriptor  
  name String  
createServiceType   ServiceTypeDescriptor  
  name String  
  scopedName String  
org.fiware.kiara.typecode.TypeDescriptor      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
getKind   TypeKind  
isData   boolean  
isPrimitive   boolean  
isVoid   boolean  
isContainer   boolean  
isArray   boolean  
isList   boolean  
isMap   boolean  
isSet   boolean  
isMembered   boolean  
isEnum   boolean  
isUnion   boolean  
isStruct   boolean  
isException   boolean  
isService   boolean  
isFunction   boolean  
org.fiware.kiara.typecode.data.DataTypeDescriptor      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
n/a      
org.fiware.kiara.typecode.data.PrimitiveTypeDescriptor      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
isString   boolean  
setMaxFixedLength   PrimitiveTypeDescriptor  
  length int  
getMaxFixedLength   int  
org.fiware.kiara.typecode.data.ContainerTypeDescriptor      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
setMaxSize   void  
  length int  
getMaxSize   int  
org.fiware.kiara.typecode.data.ArrayTypeDescriptor      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
getElementType   DataTypeDescriptor  
setElementType   boolean  
  contentType DataTypeDescriptor  
setDimensions   void  
  dimensions int[]  
getDimensions   List<Integer>  
org.fiware.kiara.typecode.data.ListTypeDescriptor      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
getElementType   DataTypeDescriptor  
setElementType   boolean  
  contentType DataTypeDescriptor  
org.fiware.kiara.typecode.data.SetTypeDescriptor      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
getElementType   DataTypeDescriptor  
setElementType   boolean  
  contentType DataTypeDescriptor  
org.fiware.kiara.typecode.data.MapTypeDescriptor      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
setKeyTypeDescriptor   boolean  
  keyTypeDescriptor DataTypeDescriptor  
getKeyTypeDescriptor   DataTypeDescriptor  
setValueTypeDescriptor   boolean  
  valueTypeDescriptor DataTypeDescriptor  
getValueTypeDescriptor   DataTypeDescriptor  
org.fiware.kiara.typecode.data.MemberedTypeDescriptor      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
getMembers   List<Member>  
getName   String  
org.fiware.kiara.typecode.data.StructTypeDescriptor      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
addMember   void  
  member TypeDescriptor  
  name String  
getMember   DataTypeDescriptor  
  name String  
org.fiware.kiara.typecode.data.EnumTypeDescriptor      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
addValue   void  
  value String  
org.fiware.kiara.typecode.data.UnionTypeDescriptor      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
addMember   UnionTypeDescriptor  
  typeDescriptor DataTypeDescriptor  
  name String  
  isDefault boolean  
  labels Object[]  
org.fiware.kiara.typecode.data.FunctionTypeDescriptor      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
getReturnType   DataTypeDescriptor  
setReturnType   void  
  returnType DataTypeDescriptor  
getParameter   DataTypeDescriptor  
  name String  
addParameter   void  
  parameter DataTypeDescriptor  
  name String  
getException   ExceptionTypeDescriptor  
  name String  
addException   void  
  exception ExceptionTypeDescriptor  
getName   String  
getServiceName   String  
setServiceName   FunctionTypeDescriptor  
  serviceName String  
org.fiware.kiara.typecode.data.ServiceTypeDescriptor      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
getName   String  
getScopedName   String  
getFunctions   List<FunctionTypeDescriptor>  
addFunction   void  
  functionTypeDesc FunctionTypeDescriptor  

Dynamic

The following classes are those related to creation and management of dynamic types, including data definition and function description and execution.

org.fiware.kiara.dynamic.DynamicValueBuilder      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
createData   DynamicData  
  dataDescriptor DataTypeDescriptor  
createFunctionRequest   DynamicFunctionRequest  
  functionDescriptor FunctionTypeDescriptor  
  serializer Serializer  
  transport Transport  
createFunctionRequest   DynamicFunctionRequest  
  functionDescriptor FunctionTypeDescriptor  
createFunctionResponse   DynamicFunctionResponse  
  functionDescriptor FunctionTypeDescriptor  
  serializer Serializer  
  transport Transport  
createFunctionResponse   DynamicFunctionResponse  
  functionDescriptor FunctionTypeDescriptor  
createService   DynamicProxy  
  serviceDescriptor ServiceTypeDescriptor  
  serializer Serializer  
  transport Transport  
org.fiware.kiara.dynamic.DynamicValue      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
getTypeDescriptor   TypeDescriptor  
serialize   void IOException
  impl SerializerImpl  
  message BinaryOutputStream  
  name String  
deserialize   void IOException
  impl SerializerImpl  
  message BinaryInputStream  
  name String  
org.fiware.kiara.dynamic.data.DynamicData      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
n/a      
org.fiware.kiara.dynamic.data.DynamicPrimitive      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
set   boolean  
  value Object  
get   Object  
set   boolean  
  value DynamicData  
org.fiware.kiara.dynamic.data.DynamicContainer      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
n/a      
org.fiware.kiara.dynamic.data.DynamicArray      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
getElement   DynamicData  
  position int[]  
setElementAt   boolean  
  value DynamicData  
  position int[]  
org.fiware.kiara.dynamic.data.DynamicList      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
add   boolean  
  element DynamicData  
add   void  
  index int  
  element DynamicData  
get   DynamicData  
  index int  
isEmpty   boolean  
org.fiware.kiara.dynamic.data.DynamicSet      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
add   boolean  
  element DynamicData  
add   void  
  index int  
  element DynamicData  
get   DynamicData  
  index int  
isEmpty   boolean  
org.fiware.kiara.dynamic.data.DynamicMap      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
put   boolean  
  key DynamicData  
  value DynamicData  
containsKey   boolean  
  key DynamicData  
containsValue   boolean  
  value DynamicData  
get   DynamicData  
  key DynamicData  
org.fiware.kiara.dynamic.data.DynamicMembered      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
n/a      
org.fiware.kiara.dynamic.data.DynamicStruct      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
getMember   DynamicData  
  name String  
org.fiware.kiara.dynamic.data.DynamicEnum      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
set   void  
  value String  
get   String  
org.fiware.kiara.dynamic.data.Dynamic      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
_d   void  
  value Object  
_d   Object  
getMember   DynamicData  
  name String  
setMember   void  
  name String  
  data DynamicData  
org.fiware.kiara.dynamic.data.DynamicException      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
getMember   DynamicData  
  name String  
org.fiware.kiara.dynamic.data.DynamicMember      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
getName   String  
getDynamicData   DynamicData  
equals   boolean  
  anotherObject Object  
org.fiware.kiara.dynamic.service.DynamicFunctionRequest      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
getParameter   DynamicData  
  name String  
getParameterAt   DynamicData  
  index int  
execute   DynamicFunctionResponse  
executeAsync   void  
  callback AsyncCallback<DynamicFunctionResponse>  
org.fiware.kiara.dynamic.service.DynamicFunctionResponse      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
isException   boolean  
setException   void  
  isException boolean  
setReturnValue   void  
  returnType DynamicData  
getReturnValue   DynamicData  
org.fiware.kiara.dynamic.service.DynamicProxy      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
getServiceName   String  
createFunctionRequest   DynamicFunctionRequest  
  name String  
createFunctionReqponse   DynamicFunctionResponse  
  name String  
org.fiware.kiara.dynamic.service.DynamicFunctionRequest      
Attributes      
Name Type    
n/a n/a    
Public Operations      
Name Parameters Returns/Type Raises
process   void  
  request DynamicFunctionRequest  
  response DynamicFunctionResponse  

Advanced Middleware Publication Subscription API Specification

Date: 01th November 2015

Editors:

Copyright © 2013-2015 by eProsima, DFKI, ZHAW. All Rights Reserved


Abstract

This document presents a proposal for a publication-subscription API. The goal of this document is to define the basic principles of a new KIARA Publication-Subscription framework.

The API proposed in this document will be very user-friendly in order to allow FI-WARE users to easily migrate to KIARA’s Publisher-Subscriber framework. The presented API should allow users to set up a publisher or a subscriber with very few calls and with little knowledge of the technology behind the framework.

Status of this Document

Date Description
29-April-2015 Release 0.2.0
01-November-2015 Release 0.3.0

Conformance

The conformance clause identifies which clauses of the specification are mandatory (or conditionally mandatory) and which are optional in order for an implementation to claim conformance to the specification.

Note: For conditionally mandatory clauses, the conditions must be specified.

Reference Material

The following normative documents contain provisions which, through reference in this text, constitute provisions of this specification. For dated references, subsequent amendments to, or revisions of, any of these publications do not apply.

API Overview

This section enumerates and describes the classes provided by the KIARA Publication-Subscription API.

The Publication-Subscription framework is a messaging pattern by which the information producers, in this case called publishers, publish messages characterized in a specific manner. On the other hand, the information consumers, called subscribers, state their interest in a certain type of messages. This pattern provides a larger flexibility and scalability compared to other messaging paradigms.

This pattern also allows for message filtering, and the most common way of doing so is by using a topic-based filter, where each publisher or subscriber produces or consumes information of a specific topic. Each topic has a unique name in the network, as well as a specific data type associated with it.

The main objective of this API is to allow users to easily have access to the basics of a Publication-Subscription messaging framework, providing them with a friendly interface and lowering the learning curve.

Main classes

There are four main classes in this API:

org.fiware.kiara.ps.participant.Participant

Singleton class representing a node in the network. It might have multiple publishers and subscribers associated to it. This object acts as a supervisor of this node in the network. All the methods in this class will be static, since the constructor will be hidden to the user.

Functions:

  • registerTopicDataType:

    This function is used to register new TopicDataType objects in a Participant (network node). The registration acts as a contract defining which data types a publisher is able to understand. It allows the creation of publishers and subscribers that use the registered TopicDataType.

  • createPublisher:

    Function to create a new Publisher for a specific TopicDataType object and associate it with a listener.

  • createSubscriber:

    Function to create a new Subscriber for a specific TopicDataType object and associate it with a listener.

  • removePubisher:

    This function removes a Publisher from this Participant.

  • removeSubscriber:

    This function removes a Subscriber from this Participant.

  • registerType:

    This function is used to register a TopicDataType in this participant.

org.fiware.kiara.ps.topic.TopicDataType

This interface describes the serialization and deserialization procedures of the selected data type. It also defines how the key is obtained from the data object in case the topic is a keyed topic.

Functions:

  • serialize:

    This function defines the signature of the serialization functions for every TopicDataType object existing in the framework.

  • deserialize:

    This function defines the signature of the deserialization functions for every TopicDataType object existing in the framework.

  • createData:

    This function returns a new object of the type represented by the TopicDataType.

  • getKey:

    This function is used to return the IntanceHandle object representing the 16-Byte key of the TopicDataType.

org.fiware.kiara.ps.publisher.Publisher

This class is the one used to describe a data publisher inside a specific node. It has multiple parameters grouped into a single PublisherAttributes object, which will be detailed later.

It also provides functions to easily change and manipulate the parameters of the publisher, as well as a function to send data over the wire.

Functions:

  • getAttributes:

    This function is used to retrieve the PublisherAttributes object contained within this class.

  • setAttributes:

    This function is used to set the PublisherAttributes object inside this class.

  • write:

    This function is the one used to send data through the network. Its function is to publish information about a specific topic which the publisher is able to use.

  • destroy:

    This function is used to delete all the entities associated to this publisher.

org.fiware.kiara.ps.subscriber.Subscriber

This class is similar to the Publisher class. All the parameters associated with each subscriber are aggregated into a single SubscriberAttributes object that can be retrieved and changed by using its accessor functions.

Functions:

  • getAttributes:

    This function is used to retrieve the SubscriberAttributes object contained within this class.

  • setAttributes:

    This function is used to set the SubscriberAttributes object inside this class.

  • readNextData:

    This function is used to retrieve an unread CacheChange with the data sent through the network. The data received belongs to a topic the subscriber has subscribed to.

  • takeNextData:

    This function is used to retrieve and remove the next unread CacheChange with data receiver over the wire.

  • waitForMessage:

    This method blocks the execution thread until a message is received. This message can be retrieved then using the read function.

  • destroy:

    This function is used to delete all the entities associated to this subscriber.

Secondary classes

This classes are those necessary for the main ones described before. In this group are included the classes that are used to deliberately specify a certain behaviour for an event that happened in the publisher or the subscriber side.

org.fiware.kiara.ps.listeners.PublisherListener

This interface is designed to be implemented for those classes that ought to manage certain events in the publisher side. It defines a set of methods that can be overwritten by the user to specify the behaviour of the publisher when certain events occur. An example of this would be a new subscriber that has been discovered.

Functions:

  • onPublicationMatched:

    This function is the one that will be called when the data published by a publisher matches with the subscriber for a specific topic. The MatchingInfo class provided as a parameter gives the user information about the matched subscriber.

org.fiware.kiara.ps.listeners.SubscriberListener

This interface is similar to the PublisherListener interface described above, but in this case it defines a set of methods used to specify the subscriber’s behaviour. An example of this would be a new message that has been received.

Functions:

  • onSubscriptionMatched:

    This method’s objective is the same as the one described in the PublisherListener class, but in this case, it will be executed when a new subscription matches with the data a publisher is publishing.

  • onNewDataMessage:

    This function will be executed when a new message is received by the subscriber.

Auxiliary classes

org.fiware.kiara.ps.utils.InstanceHandle

This class contains the serialized data of a specific message the user is sending or receiving through the network. It provides functions to retrieve the information of such message.

Functions: None

org.fiware.kiara.ps.attributes.TopicAttributes

This structure contains all the different attributes of a Topic. These attributes will include the topic name, the data type name and the topic kind.

Attributes:

  • topicKind:

    This attribute represents the kind of the Topic (with key or without key)

  • topicName:

    This attribute represents the topic name.

  • topicDataTypeName:

    This attribute represents the name of the data type for a specific topic.

  • historyQos:

    This attribute represents the History QoS.

  • resourceLimitQos:

    This attribute represents the limit of the resources for this topic.

org.fiware.kiara.ps.attributes.PublisherAttributes

This structure contains all the different attributes of a publisher. These attributes will include the topic attributes (topic name, topic data type, etc), as well as the list of locators, times and writer QoS.

Attributes:

  • topic:

    Object instance of TopicAttributes. It holds all the attributes of the Topic.

  • wqos:

    Represents the Qualities of Service associated to the Writer.

  • times:

    Time values associated to the Publisher entity.

  • unicastLocatorList:

    List of unicast locators representing different Endpoints.

  • multicastLocatorList:

    List of multicast locators representing different Endpoints.

Functions:

  • getUserDefinedID:

    Returns the user defined identifier for this object.

  • setUserDefinedID:

    Sets the user defined identifier for this object.

  • getEntityId:

    Returns the EntityID that uses this attributes class.

  • setEntityId:

    Sets the EntityID that uses this attributes class.

org.fiware.kiara.ps.attributes.SubscriberAttributes

This structure contains all the different attributes of subscriber. These attributes will include the topic attributes (name, topic data type, etc), as well as the list of locators, times and reader QoS.

Attributes:

  • topic:

    Object instance of TopicAttributes. It holds all the attributes of the Topic.

  • rqos:

    Represents the Qualities of Service associated to the Reader.

  • times:

    Time values associated to the Subscriber entity.

  • unicastLocatorList:

    List of unicast locators representing different Endpoints.

  • multicastLocatorList:

    List of multicast locators representing different Endpoints.

  • expectsInlineQos:

    This attribute defines whether or not the Subscriber will expect inline QoS.

Functions:

  • getUserDefinedID:

    Returns the user defined identifier for this object.

  • setUserDefinedID:

    Sets the user defined identifier for this object.

  • getEntityId:

    Returns the EntityID that uses this attributes class.

  • setEntityId:

    Sets the EntityID that uses this attributes class.

org.fiware.kiara.ps.utils.SampleInfo

This class contains information about each particular message, for example the publisher who originated it or a timestamp of its creation time. The GUID of the writer is related to the node from where the information comes from.

Functions:

  • getWriterGUID:

    This function is used to obtain the GUID of the writer who originated a specific message.

  • getTimestamp:

    This function returns the timestamp value indicating the exact time when the message was created.

org.fiware.kiara.ps.utils.MatchingInfo

This class informs the user of whether the event is a matching or an un-matching event and also the global identifier of the remote endpoint.

Functions:

  • getMatchingStatus:

    This function allows the users to know the matching status of a specific endpoint with the risen event.

  • getRemoteEndpointGUID:

    This function returns the endpoint’s unique identifier.

org.fiware.kiara.ps.common.GUID

This class represents a unique identifier of a node in the network. It is formed by two members, a prefix (12 Bytes) and an entity ID (4 Bytes).

Functions:

  • getEntityId:

    This function returns the EntityId associated to the GUID.

  • getGUIDPrefix:

    This function returns the GUIDPrefix associated to the GUID.

Note

There are some classes that do not appear yet in this document, and this is because their definition is too long (they will be included in an external annex)

A few examples of these classes are:

  • QoS related classes: QoSList, ReaderQos, WriterQos and QoSPolicy (and all its subclasses).
  • SerializableDataType: Interface between Serializable objects defined in KIARA and TopicDataTypes.
  • History classes: HistoryCache, SubscriberHistory and PublisherHistory

API Description

This section details the classes of this API and all their methods.

Main classes

org.fiware.kiara.ps.participant.Participant

The public methods of this class are listed below:

Attributes
  • None
Public Operations
Name Parameters Returns/Type Raises
registerTopicDataType   boolean  
  dataType TopicDataType<T>  
createPublisher   Publisher<T>  
  attributes PublisherAttributes  
  listener PublisherListener  
  topic TopicDataType<T>  
createSubscriber   Subscriber<T>  
  attributes SubscriberAttributes  
  listener SubscriberListener  
  topic TopicDataType<T>  
removePublisher   boolean  
  publisher Publisher<T>  
removeSubscriber   boolean  
  subscriber Subscriber<T>  
registerType   boolean  
  type TopicDataType<T>  
org.fiware.kiara.ps.topic.TopicDataType

The public methods of this class are listed below:

Attributes
  • None
Public Operations
Name Parameters Returns/Type Raises
serialize   void IOException
  payload SerializedPayload  
  object T  
deserialize   T IOException
  payload SerializerPayload  
createData   T  
getKey   InstanceHandle IOException
  object T  
org.fiware.kiara.ps.publisher.Publisher

The public methods of this class are listed below:

Attributes
  • None
Public Operations
Name Parameters Returns/Type Raises
getAttributes   Attributes  
setAttributes   void PublisherException
  attributes PublisherAttributes  
write   boolean PublisherException
  data TopicDataType<T>  
destroy   void  
org.fiware.kiara.ps.subscriber.Subscriber

The public methods of this class are listed below:

Attributes
  • None
Public Operations
Name Parameters Returns/Type Raises
getAttributes   Attributes  
setAttributes   void SubscriberException
  attributes SubscriberException  
waitForMessage   void SubscriberException
readNextData   boolean  
  info SampleInfo  
takeNextData   boolean  
  info SampleInfo  
destroy   void  

Secondary classes

org.fiware.kiara.ps.publisher.PublisherListener

The public methods of this class are listed below:

Attributes
  • None
Public Operations
Name Parameters Returns/Type Raises
onPublicationMatched   void PublisherException
  info MatchingInfo  
  pub Publisher  
org.fiware.kiara.ps.subscriber.SubscriberListener

The public methods of this class are listed below:

Attributes
  • None
Public Operations
Name Parameters Returns/Type Raises
onSubscriptionMatched   void SubscriberException
  info MatchingInfo  
  sub Subscriber  
onNewDataMessage   void SubscriberException
  sub Subscriber  

Auxiliary classes

org.fiware.kiara.ps.utils.InstanceHandle

The public methods of this class are listed below:

Attributes
  • None
Public Operations
  • None
org.fiware.kiara.ps.attributes.TopicAttributes

The public methods of this class are listed below:

Attributes

+———————+—————————+ | | Name | Type | | +=====================+===========================+ | | topicKind | TopicKind | | +———————+—————————+ | | topicName | String | | +———————+—————————+ | | topicDataTypeName | String | | +———————+—————————+ | | historyQos | HistoryPolicyQos | | +———————+—————————+ | | resourceLimitQos | ResourceLimitsQosPolicy | | +———————+—————————+ |

Public Operations
  • None
org.fiware.kiara.ps.attributes.PublisherAttributes

The public methods of this class are listed below:

Attributes

+————————+——————-+ | | Name | Type | | +========================+===================+ | | topic | TopicAttributes | | +————————+——————-+ | | wqos | WriterQos | | +————————+——————-+ | | times | WriterTimes | | +————————+——————-+ | | unicastLocatorList | LocatorList | | +————————+——————-+ | | multicastLocatorList | LocatorList | | +————————+——————-+ |

Public Operations
Name Parameters Returns/Type Raises
getUserDefinedID   short  
setUserDefinedID   void  
  userDefinedID short  
getEntityID   short  
setEntityID   void  
  entityID short  
org.fiware.kiara.ps.attributes.SubscriberAttributes

The public methods of this class are listed below:

Attributes

+————————+——————-+ | | Name | Type | | +========================+===================+ | | topic | TopicAttributes | | +————————+——————-+ | | rqos | ReaderQos | | +————————+——————-+ | | times | ReaderTimes | | +————————+——————-+ | | unicastLocatorList | LocatorList | | +————————+——————-+ | | multicastLocatorList | LocatorList | | +————————+——————-+ | | expectsInlineQos | boolean | | +————————+——————-+ |

Public Operations
Name Parameters Returns/Type Raises
getUserDefinedID   short  
setUserDefinedID   void  
  userDefinedID short  
getEntityID   short  
setEntityID   void  
  entityID short  
org.fiware.kiara.ps.utils.SampleInfo

The public methods of this class are listed below:

Attributes
  • None
Public Operations
Name Parameters Returns/Type Raises
getWriterGUID   GUID  
getTimestamp   Timestamp  
org.fiware.kiara.ps.utils.MatchingInfo

The public methods of this class are listed below:

Attributes
  • None
Public Operations
Name Parameters Returns/Type Raises
getMatchingStatus   MatchingStatus  
geRemoteEndpointGUID   GUID  
org.fiware.kiara.ps.common.GUID

The public methods of this class are listed below:

Attributes
  • None
Public Operations
Name Parameters Returns/Type Raises
getEntityId   EntityId  
setEntityId   void  
  entityID EntityId  
getGUIDPrefix   GuidPrefix  
setGUIDPrefix   void  
  guidPrefix GUIDPrefix  
equals   boolean  
  other Object  

Advanced Middleware IDL Specification

Date: 10th October 2015

Editors:

Copyright © 2013-2015 by eProsima, DFKI, ZHAW. All Rights Reserved


Abstract

Ahe Advanced Middleware GE enables flexible, efficient, scalable, and secure communication between distributed applications and to/between FIWARE GEs. The Interface Definition Language (IDL) Specifications allowes to describes the Data Types and Operations supported by a Service. Following is a list of the main features it supports:

  • IDL, Dynamic Types & Application Types: It support the usual schema of IDL compilation to generate support code for the data types.
  • IDL Grammar: An OMG-like grammar for the IDL as in DDS, Thrift, ZeroC ICE, CORBA, etc.
  • Types: Support of simple set of basic types, structs, and various high level types such as lists, sets, and dictionaries (maps).
  • Type inheritance, Extensible Types, Versioning: Advanced data types, extensions, and inheritance, and other advanced features will be supported.
  • Annotation Language: The IDL is extended with an annotation language to add properties to the data types and operations. These will, for example, allows adding security policies and QoS requirements.

Status of this Document

Date Description
8-April-2015 Release 0.2.0
10-October-2015 Release 0.3.0

Preface

The foundation of the FIWARE Middleware Interface Definition Language (IDL) is the Object Management Group (OMG) IDL 3.5. See Appendix C for the OMG IDL 3.5 grammar.

To maintain backward compatibility, the FIWARE Middleware IDL grammar embraces all OMG IDL 3.5 features. IDL parsers are not required to implement all of the extended OMG features. Check the documentation of the specific parser implementations.

The basic subset needed by DDS and future standard RPC over DDS must be supported.

Syntax Definition

The FIWARE Middleware IDL specification consists of one or more type definitions, constant definitions, exception definitions, or module definitions. Some definitions are allowed in the grammar for backward compatibility, but are not used by the FIWARE Middleware IDL and therefore will be ignored by the implmentations.

<specification> ::= <import>* <definition>+
<definition> ::= <type_dcl> ";"
             |   <const_dcl> ";"
             |   <except_dcl> ";"
             |   <interface> ";"
             |   <module> ";"
             |   <value> ";"
             |   <type_id_dcl> ";"
             |   <type_prefix_dcl> ";"
             |   <event> ";"
             |   <component> ";"
             |   <home_dcl> ";"
             |   <annotation_dcl> ";"
             |   <annotation_appl> <definition>
See section Import Declaration for the specification of <import>
See section Module Declaration for the specification of <module\>
See section Interface Declaration for the specification of <interface>
See section Value Declaration for the specification of <value\>
See section Constant Declaration for the specification of <const_dcl>
See section Type Declaration for the specification of <type_dcl>
See section Exception Declaration for the specification of <except_dcl>
See section Repository Identity Related Declarations for the specification of <type_id_dcl> and <type_prefix_dcl>
See section Event Declaration for the specification of <event>
See section Component Declaration for the specification of <component>
See section Event Declaration for the specification of <home_dcl>
See section Annotation Declaration for the specification of <annotation_dcl>
See section Annotation Application for the specification of < annotation_appl>

Import Declaration

An import statement conforms to the following syntax:

<import> ::= "import" <imported_scope> ";"
<imported_scope> ::= <scoped_name> | <string_lieral>

Import declarations are not supported by FIWARE Middleware. Any FIWARE Middleware IDL parser has to inform users about this and ignore the declaration.

Module Declaration

A module definition conforms to the following syntax:

<module> ::= ("module" | "namespace") <identifier> "{" <definition> + "}"

The module construct is used to scope IDL identifiers. FIWARE Middleware IDL supports the OMG IDL 3.5 keyword module, but also adds the modern keyword namespace as an alias.

Examples of module definitions:

namespace MyNamespace {
   ...
};

namespace YourNamespace {
   namespace HisNamespace {
      ...
   };
};

Interface Declaration

An interface definition conforms to the following syntax:

<interface> ::= <interface_dcl> | <forward_dcl>
<interface_dcl> ::= <interface_header> "{" <interface_body> "}"
<forward_dcl> ::= [ "abstract" | "local" ] ("interface" | "service") <identifier>
<interface_header> ::= [ "abstract" | "local" ]("interface" | "service") <identifier>
                       [ <interface_inheritance_spec> ]
<interface_body> ::= <export>*
<export> ::= <type_dcl> ";"
          |   <const_dcl> ";"
          |   <except_dcl> ";"
          |   <attr_dcl> ";"
          |   <op_dcl> ";"
          |   <type_id_dcl> ";"
          |   <type_prefix_dcl> ";"

Example of interface definition:

service MyService {
   ...
};
Interface Header

The interface header consists of three elements:

  1. An optional modifier specifying if the interface is an abstract interface.
  2. The interface name. The name must be preceded by the old OMG IDL 3.5 keyword interface or the new modern keyword service.
  3. An optional inheritance specification.

An interface declaration containing the keyword abstract in its header, declares an abstract interface. Abstract interfaces have slightly different rules from regular interfaces, as described in section Abstract interface.

An interface declaration containing the keyword local in its header, declares a local interface. Local interfaces are not currently supported by the FIWARE Middleware. Any FIWARE Middleware IDL parser has to inform users about this, and explain the interface will be used as a regular interface.

Interface Inheritance Specification

The syntax for interface inheritance is as follows:

<interface_inheritance_spec> ::= ":" <interface_name> { "," <interface_name> }*
<interface_name> ::= <scoped_name>
<scoped_name> ::= <identifier>
            |   "::" <identifier>
            |   <scoped_name> "::" <identifier>

Each <scoped_name> in an <interface_inheritance_spec> must be the name of a previously defined interface or an alias to a previously defined interface.

Interface Body

The interface body contains the following kind of declarations:

Abstract interface

An interface declaration contains the keyword abstract in its header, declares an abstract interface. The following special rule apply to abstract interfaces:

  • Abstract interfaces may only inherit from other abstract interfaces.

Value Declaration

Value type declarations are supported by FIWARE Middleware IDL, but aren’t by FIWARE Middleware. Any FIWARE Middleware IDL parser has to explain that these declarations are not used and the parser will ignore them.

Constant Declaration

A constant definition conforms to the following syntax:

<const_dcl> ::= "const" <const_type>
                <identifier> "=" <const_exp>
<const_type> ::= <integer_type>
             |   <char_type>
             |   <wide_char_type>
             |   <boolean_type>
             |   <floating_pt_type>
             |   <string_type>
             |   <wide_string_type>
             |   <fixed_pt_const_type>
             |   <scoped_name>
             |   <octet_type>
<const_exp> ::= <or_expr>
<or_expr> ::= <xor_expr>
           |  <or_expr> "|" <xor_expr>
<xor_expr> ::= <and_expr>
           |   <xor_expr> "^" <and_expr>
<and_expr> ::= <shift_expr>
           |   <and_expr> "&" <shift_expr>
<shift_expr> ::= <add_expr>
             |   <shift_expr> ">>" <add_expr>
             |   <shift_expr> "<<" <add_expr>
<add_expr> ::= <mult_expr>
           |   <add_expr> "+" <mult_expr>
           |   <add_expr> "-" <mult_expr>
<mult_expr> ::= <unary_expr>
            |   <mult_expr> "*" <unary_expr>
            |   <mult_expr> "/" <unary_expr>
            |   <mult_expr> "%" <unary_expr>
<unary_expr> ::= <unary_operator> <primary_expr>
             |   <primary_expr>
<unary_operator> ::= "-"
                 |   "+"
                 |   "~"
<primary_expr> ::= <scoped_name>
               |   <literal>
               |   "(" <const_exp> ")"
<literal> ::= <integer_literal>
          |   <string_literal>
          |   <wide_string_literal>
          |   <character_literal>
          |   <wide_character_literal>
          |   <fixed_pt_literal>
          |   <floating_pt_literal>
          |   <boolean_literal>
<boolean_literal> ::= "TRUE"
                  |   "FALSE"
<positive_int_const> ::= <const_exp>

Examples for constant declarations:

const string c_str = "HelloWorld";
const i32 c_int = 34;
const boolean c_bool = true;

Type Declaration

As in OMG IDL 3.5, FIWARE Middleware IDL provides constructs for naming data types; that is, it provides C language-like declarations that associate an identifier with a type. The IDL uses the keyword typedef to associate a name with a data type.

Type declarations conform to the following syntax:

<type_dcl> ::= "typedef" <type_declarator>
           |   <struct_type>
           |   <union_type>
           |   <enum_type>
           |   "native" <simple_declarator>
           |   <constr_forward_decl>
<type_declarator> ::= <type_spec> <declarators>

For type declarations, FIWARE Middleware IDL defines a set of type specifiers to represent typed value. The syntax is as follows:

<type_spec> ::= <simple_type_spec>
            |   <constr_type_spec>
<simple_type_spec> ::= <base_type_spec>
                   |   <template_type_spec>
                   |   <scoped_name>
<base_type_spec> ::= <floating_pt_type>
                 |   <integer_type>
                 |   <char_type>
                 |   <wide_char_type>
                 |   <boolean_type>
                 |   <octet_type>
                 |   <any_type>
                 |   <object_type>
                 |   <value_base_type>
<template_type_spec> ::= <sequence_type>
                     |   <set_type>
                     |   <map_type>
                     |   <string_type>
                     |   <wide_string_type>
                     |   <fixed_pt_type>
<constr_type_spec> ::= <struct_type>
                   |   <union_type>
                   |   <enum_type>
<declarators> ::= <declarator> { "," <declarator> }*
<declarator> ::= <simple_declarator>
             |   <complex_declarator>
<simple_declarator> ::= <identifier>
<complex_declarator> ::= <array_declarator>

The <scoped_name\> in <simple_type_spec> must be a previously defined type introduced by a type declaration(<type_dcl> - see section Type Declaration).

The next subsections describe basic and constructed type specifiers.

Basic Types

The syntax for the supported basic types is as follows:

<floating_pt_type> ::= "float"
                   |   "double"
                   |   "long" "double"
                   |   "float32"
                   |   "float64"
                   |   "float128"
<integer_type> ::= <signed_int>
               |   <unsigned_int>
<signed_int> ::= <signed_short_int>
             |   <signed_long_int>
             |   <signed_longlong_int>
<signed_short_int> ::= "short"
                   |   "i16"
<signed_long_int> ::= "long"
                  |    "i32"
<signed_longlong_int> ::= "long" "long"
                      |   "i64"
<unsigned_int> ::= <unsigned_short_int>
               |   <unsigned_long_int>
               |   <unsigned_longlong_int>
<unsigned_short_int> ::= "unsigned" "short"
                     |   "ui16"
<unsigned_long_int> ::= "unsigned" "long"
                    |   "ui32"
<unsigned_longlong_int> ::= "unsigned" "long" "long"
                        |   "ui64"
<char_type> ::= "char"
<wide_char_type> ::= "wchar"
<boolean_type> ::= "boolean"
<octet_type> ::= "octet"
             |   "byte"
<any_type> ::= "any"

Each IDL data type is mapped to a native data type via the appropriate language mapping. The syntax allows to use some OMG IDL 3.5 keywords and to use new modern keyword. For example, FIWARE Middleware IDL supports both keywords: long and i32.

The any type is not supported currently by FIWARE Middleware. Any FIWARE Middleware IDL parser has to inform users about this.

Constructed Types

Constructed types are structs, unions, and enums.
Their syntax is as follows:
<type_dcl> ::= "typedef" <type_declarator>
           |   <struct_type>
           |   <union_type>
           |   <enum_type>
           |   "native" <simple_declarator>
           |   <constr_forward_decl>
<constr_type_spec> ::= <struct_type>
                   |   <union_type>
                   |   <enum_type>
<constr_forward_decl> ::= "struct" <identifier>
                      |   "union" <identifier>
Structures

The syntax for the struct type is as follows:

<struct_type> ::= "struct" <identifier> "{" <member_list> "}"
<member_list> ::= <member> +
<member> ::= <type_spec> <declarators> ";"

Example of struct syntax:

struct MyStruct {
    i32 f_int;
    string f_str;
    boolean f_bool;
};
Unions

The syntax for the union type is as follows:

<union_type> ::= "union" <identifier> "switch"
                 "(" <switch_type_spec> ")"
                 "{" <switch_body> "}"
<switch_type_spec> ::= <integer_type>
                   |   <char_type>
                   |   <boolean_type>
                   |   <enum_type>
                   |   <scoped_name>
<switch_body> ::= <case> +
<case> ::= <case_label> + <element_spec> ";"
<case_label> ::= "case" <const_exp> ":"
             |   "default" ":"
<element_spec> ::= <type_spec> <declarator>

The <scoped_name> in the <switch_type_spec> production must be a previously defined integer, char, boolean or enum type.

Example of union syntax:

union MyUnion switch(i32)
{
   case 1:
      i32 f_int;
   case 2:
      string f_str;
   default:
      boolean f_bool;
};
Enumerations
Enumerated types consist of ordered lists of identifiers.
The syntax is as follows:
<enum_type> ::= "enum" <identifier>
                "{" <enumerator> { "," <enumerator> } * "}"
<enumerator> ::= <identifier>

Example of an enumerated type:

enum MyEnum {
   ENUM1,
   ENUM2,
   ENUM3
};
Template Types

Template types are:

<template_type_spec> ::= <sequence_type>
                     |   <set_type>
                     |   <map_type>
                     |   <string_type>
                     |   <wide_string_type>
                     |   <fixed_pt_type>
Lists

The FIWARE Middleware IDL defined the template type list. A list is similar to the OMG IDL 3.5 sequence type. It is one-dimensional array with two characteristics: a maximum size (which is fixed at compile time) and a length (which is determined at run time). The syntax is as follows:

<sequence_type> ::= "sequence" "<" <simple_type_spec> "," <positive_int_const> ">"
                |   "sequence" "<" <simple_type_spec> ">"
                |   "list" "<" <simple_type_spec> "," <positive_int_const> ">"
                |   "list" "<" <simple_type_spec> ">"

Examples of list type declarations:

list<string> mylist;
list<string, 32> myboundedlist;
Sets

The FIWARE Middleware IDL includes the template type set. At marshalling level it is like the template type list. But at a higher level, contrary to the list type, a set can only contain unique values. The syntax is as follows:

<set_type> ::= "set" "<" <simple_type_spec> "," <positive_int_const> ">"
                |   "set" "<" <simple_type_spec> ">"

Examples of set type declarations:

set<string> myset;
set<string, 32> myboundedset;
Maps

The FIWARE Middleware IDL includes the template type map, using the upcoming definition in OMG IDL 4.0. Maps are a collections, similar to lists, but items are associated with a key. Like lists, maps may be bounded or unbounded. The syntax is as follows:

<map_type> ::= "map" "<" <simple_type_spec> ","
                    <simple_type_spec> "," <positive_int_const> ">"
                |   "map" "<" <simple_type_spec> "," <simple_type_spec> ">"

Examples of map type declaration:

map<i32, string> mymap;
map<i32, string, 32> myboundedmap;

In CDR marshalling, objects of type map shall be represented according to the following equivalent OMG IDL 3.5 definition:

struct MapEntry_<key_type>_<value_type>[_<bound>] {
    <key_type> key;
    value_type> value;
};

typedef sequence<MapEntry_<key_type>_<value_type>[_<bound>][, <bound>]>
   Map_<key_type>_<value_type>[_<bound>];
Strings

The syntax for defining a string is as follows:

<string_type> ::= "string" "<" <positive_int_const> ">"
              |   "string"
Wstrings

The syntax for defining a wstring is as follows:

<wide_string_type> ::= "wstring" "<" <positive_int_const> ">"
                   |   "wstring"
Fixed Type

The fixed data type represents a fixed-point decimal number of up to 31 significant digits. The scale factor is a non-negative integer less than or equal to the total number of digits.

The fixed data type will be mapped to the native fixed point capability of a programming language, if available. If there is not a native fixed point type, then the IDL mapping for that language will provide a fixed point data types. The syntax of the fixed type is as follows:

<fixed_pt_type> ::= "fixed" "<" <positive_int_const> "," <positive_int_const> ">"
<fixed_pt_const_type> ::= "fixed"
Complex Types
Arrays

The syntax for array is as follows:

<array_declarator> ::= <identifier> <fixed_array_size>+
<fixed_array_size> ::= "[" <positive_int_const> "]"

Example of array type declarations:

i32 myi32array[32];
string mystrarray[32];
Native Types

The syntax for native types is as follows:

<type_dcl> ::= "native" <simple_declarator>
<simple_declarator> ::= <identifier>

Native types are not supported by FIWARE Middleware. Any FIWARE Middleware IDL parser has to inform users about this and ignore this definition.

Exception Declaration

Exception declarations permit the declaration of struct-like data structures, which may be returned to indicate that an exceptional condition has occurred during the performance of a request. The syntax is as follows:

<except_dcl> ::= "exception" <identifier> "{" <member>* "}"

Example of an exception declaration:

exception myException {
   string msg;
   i32 code;
};

Operation Declaration

Operation declarations in OMG IDL 3.5 and FIWARE Middleware IDL are similar to C function declarations. The syntax is as follows:

<op_dcl> ::= [ <op_attribute> ] <op_type_spec>
             <identifier> <parameter_dcls>
             [ <raises_expr> ] [ <context_expr> ]
<op_attribute> ::= "oneway"
<op_type_spec> ::= <param_type_spec>
               | "void"

Example of an operation declaration:

service myService {
    void set(i32 param);
    i32 get();
    i32 add(i32 param1, i32 param2) raises (myException);
};

An operation declaration consists of:

  • An optional operation attribute that is supported by FIWARE Middleware IDL for backward compatibility. Operation attributes are described in section Operation attribute.
  • The type of the operation’s return result. Operations that do not return a result must specify the void type.
  • An identifier that names the operation in the scope of the interface in which it is defined.
  • A parameter list that specifies zero or more parameter declarations for the operation. Parameter declaration is described in section Parameter Declarations.
  • An optional raises expression that indicates which exception may be raised as a result of an invocation of this operation. Raises expression are described in section Raises Expressions.
  • An optional context expression that is inherited from OMG IDL 3.5, but FIWARE Middleware will not use. Context expressions are described in section Context Expressions.
Operation attribute

The syntax for operation attributes is as follows:

<op_attribute> ::= "oneway"

This attribute is supported in FIWARE Middleware for backward compatibility. But in FIWARE Middleware IDL the preferedby way to define a oneway function is using the @Oneway annotation as described in section Oneway functions.

Parameter Declarations

Parameter declarations in FIWARE Middleware IDL operation declarations have the following syntax:

<parameter_dcls> ::= "(" <param_dcl> { "," <param_dcl> }* ")"
                 |   "(" ")"
<param_dcl> ::= [ <param_attribute> ] <param_type_spec> <simple_declarator>
<param_attribute> ::= "in"
                  |   "out"
                  |   "inout"
<raises_expr> ::= "raises" "(" <scoped_name> { "," <scoped_name> }* ")"
<param_type_spec> ::= <base_type_spec>
                  |   <string_type>
                  |   <wide_string_type>
                  |   <scoped_name>

The FIWARE Middleware IDL will not use output parameters, as modern IDLs do. It supports the keywords in, inout, and out, but any FIWARE Middleware IDL parser will inform users all parameters will be input parameters.

Raises Expressions

There are two kinds of raises expressions.

Raises Expression

A raises expression specifies which exceptions may be raised as a result of an invocation of the operation or accessing a readonly attribute. The syntax for its specification is as follows:

<raises_expr> ::= "raises" "(" <scoped_name> { "," <scoped_name> }* ")"

The <scoped_name>s in the raises expression must be previously defined exceptions.

getraises and setraises Expression

The syntax is as follows:

<attr_raises_expr> ::= <get_excep_expr> [ <set_excep_expr> ]
                   |   <set_excep_expr>
<get_excep_expr> ::= "getraises" <exception_list>
<set_excep_expr> ::= "setraises" <exception_list>
<exception_list> ::= "(" <scoped_name> { "," <scoped_name> }* ")"

getraises and setraises expressions are used in attribute declarations. Like in attribute declarations, theses expressions are supported by FIWARE Middleware IDL but not by FIWARE Middleware. Any FIWARE Middleware IDL parser has to inform users about this and it will ignore these expressions.

Context Expressions

The syntax for content expressions is as follows:

<context_expr> ::= "context" "(" <string_literal> { "," <string_literal> }* ")"

Context expressions are supported by FIWARE Middleware IDL but not by FIWARE Middleware. Any FIWARE Middleware IDL parser has to inform users about this and it will ignore these expressions.

Attribute Declaration

The syntax for attribute declarations is as follows:

<attr_dcl> ::= <readonly_attr_spec> | <attr_spec>
<readonly_attr_spec> ::= "readonly" "attribute" <param_type_spec>
                         <readonly_attr_declarator>
<readonly_attr_declarator> ::= <simple_declarator> <raises_expr>
                           |   <simple_declarator> { "," <simple_declarator> }*
<attr_spec> ::= "attribute" <param_type_spec>
                <attr_declarator>
<attr_declarator> ::= <simple_declarator> <attr_raises_expr>
                  |   <simple_declarator> { "," <simple_declarator> }*

These declarations are supported by FIWARE Middleware IDL but not by FIWARE Middleware. Any FIWARE Middleware IDL parser has to inform users about this and it will ignore these declarations.

Repository Identity Related Declarations

The syntax for repository identity related declarations is as follows:

<type_id_dcl> ::= "typeid" <scoped_name> <string_literal>
<type_prefix_dcl> ::= "typeprefix" <scoped_name> <string_literal>

These declarations are supported by FIWARE Middleware IDL but not by FIWARE Middleware. Any FIWARE Middleware IDL parser has to inform users about this and it will ignore these declarations.

Event Declaration

The syntax for event declarations is as follows:

<event> ::= ( <event_dcl> | <event_abs_dcl> | <event_forward_dcl>)
<event_forward_dcl> ::= [ "abstract" ] "eventtype" <identifier>
<event_abs_dcl> ::= "abstract" "eventtype" <identifier>
                    [ <value_inheritance_spec> ]
                    "{" <export>* "}"
<event_dcl> ::= <event_header> "{" <value_element> * "}"
<event_header> ::= [ "custom" ] "eventtype"
                   <identifier> [ <value_inheritance_spec> ]

These declarations are supported by FIWARE Middleware IDL but not by FIWARE Middleware. Any FIWARE Middleware IDL parser has to inform users about this and it will ignore these declarations.

Component Declaration

The syntax for component declarations is as follows:

<component> ::= <component_dcl> | <component_forward_dcl>
<component_forward_dcl> ::= "component" <identifier>
<component_dcl> ::= <component_header> "{" <component_body> "}"
<component_header> ::= "component" <identifier>
                       [ <component_inheritance_spec> ]
                       [ <supported_interface_spec> ]
<supported_interface_spec> ::= "supports" <scoped_name> { "," <scoped_name> }*
<component_inheritance_spec> ::= ":" <scoped_name>
<component_body> ::= <component_export>*
<component_export> ::= <provides_dcl> ";"
                   |   <uses_dcl> ";"
                   |   <emits_dcl> ";"
                   |   <publishes_dcl> ";"
                   |   <consumes_dcl> ";"
                   |   <attr_dcl> ";"
<provides_dcl> ::= "provides" <interface_type> <identifier>
<interface_type> ::= <scoped_name> | "Object"
<uses_dcl> ::= "uses" [ "multiple" ] <interface_type> <identifier>
<emits_dcl> ::= "emits" <scoped_name> <identifier>
<publishes_dcl> ::= "publishes" <scoped_name> <identifier>
<consumes_dcl> ::= "consumes" <scoped_name> <identifier>

These declarations are supported by FIWARE Middleware IDL but not by FIWARE Middleware. Any FIWARE Middleware IDL parser has to inform users about this and it will ignore these declarations.

Home Declaration

The syntax for home declarations is as follows:

<home_dcl> ::= <home_header> <home_body>
<home_header> ::= "home" <identifier>
                  [ <home_inheritance_spec> ]
                  [ <supported_interface_spec> ]
                  "manages" <scoped_name>
                  [ <primary_key_spec> ]
<home_inheritance_spec> ::= ":" <scoped_name>
<primary_key_spec> ::= "primarykey" <scoped_name>
<home_body> ::= "{" <home_export>* "}"
<home_export ::= <export>
             |   <factory_dcl> ";"
             |   <finder_dcl> ";"
<factory_dcl> ::= "factory" <identifier>
                  "(" [ <init_param_decls> ] ")"
                  [ <raises_expr> ]
<finder_dcl> ::= "finder" <identifier>
                 "(" [ <init_param_decls> ] ")"
                 [ <raises_expr> ]

These declarations are supported by FIWARE Middleware IDL but not by FIWARE Middleware. Any FIWARE Middleware IDL parser has to inform users about this and it will ignore these declarations.

Annotation Declaration

An annotation type is a form of aggregated type similar to a structure with members that could be given constant values. FIWARE Middleware IDL annotations are the ones used in future OMG IDL 4.0, whose are similar to the one provided by Java.

An annotation is defined with a header and a body. The syntax is as follows:

<annotation_dcl> ::= <annotation_def> ";"
                 |   <annotation_forward_dcl>
<annotation_def> ::= <annotation_header> "{" <annotation_body> "}"
Annotation Header

The header consists of: - The keyword @annotation, followed by an identifier that is the name given to the annotation. - Optionally a single inheritance specification.

The syntax of an annotation header is as follows:

<annotation_header> ::= "@annotation" <identifier> [<annotation_inheritance_spec>]
<annotation_inheritance_spec> ::= ":" <scoped_name>
Annotation Body

The body contains a list of zero to several member embedded within braces. Each attribute consists of: - The keyword attribute. - The member type, which must be a constant type <const_type>. - The name given to the member. - An optional default value, given by a constant expression <const_expr> prefixed with the keyword default. The constant expression must be compatible with the member type.

The syntax of annotation body is as follows:

<annotation_body> ::= <annotation_member>*
<annotation_member> ::= <const_type> <simple_declarator>
                        [ "default" <const_expr> ] ";"
Annotation Forwarding

Annotations may also be forward-declared, which allow referencing an annotation whose definition is not provided yet.

The syntax of a forwarding annotation is as follows:

<annotation_forward_dcl> ::= "@annotation" <scoped_name>

Annotation Application

An annotation, once its type defined, may be applied using the following syntax:

<annotation_appl> ::= "@" <scoped_name> [ "(" [ <annotation_appl_params> ] ")" ]
<annotation_appl_params> ::= <const_exp>
                        |   <annotation_appl_param> { "," <annotation_appl_param> }*
<annotation_appl_param> ::= <identifier> "=" <const_exp>

Applying an annotation consists in prefixing the element under annotation with: - The annotation name prefixed with a commercial at (@) - Followed by the list of values given to the annotation’s members within parentheses and separated by comma. Each parameter value consist in: - The name of the member - The symbol ‘=’ - A constant expression, whose type must be compatible with the member’s declaration.

Members may be indicated in any order. Members with no default value must be given a value. Members with default value may be omitted. In that case, the member is considered as valued with its default value.

Two shortened forms exist: - In case, there is no member, the annotation application may be as short as just the name of the annotation prefixed by ‘@’ - In case there is only one member, the annotation application may be as short as the name of the annotation prefixed by ‘@’ and followed with the constant value of that unique member within (). The type of the provided constant expression must compatible with the members’ declaration

An annotation may be applied to almost any IDL construct or sub-construct. Applying and annotation consists actually in adding the related meta-data to the element under annotation. Full FIWARE Middleware IDL described in section Appendix B: FIWARE Middleware IDL Grammar shows this.

Built-in annotations

FIWARE Middleware will support some built-in annotations, that any user can use in IDL files.

Member IDs

All members of aggregated types have an integral member ID that uniquely identifies them within their defining type. Because OMG IDL 3.5 has no native syntax for expressing this information, IDs by default are defined implicitly based on the members’ relative declaration order. The first member (which, in a union type, is the discriminator) has ID 0, the second ID 1, the third ID 2, and so on.

As described in OMG IDL for X-Types, these implicit ID assignments can be overridden by using the “ID” annotation interface. The equivalent definition of this type is as follows:

@annotation ID {
    attribute ui32 value;
};
Optional members

The FIWARE Middleware IDL allows to declare a member optional, applying the “Optional” annotation. The definitions is as follows:

@annotation Optional {
    attribute boolean value default true;
};

The CDR marshalling for this optional members is defined in IDL X-Types standard.

Key members

The FIWARE Middleware IDL allows to declare a member as part of the key, applying the “Key” annotation. This will be needed for future pub/sub communication using DDS. The definitions is as follows:

@annotation Key {
    attribute boolean value default true;
};
Oneway functions

The FIWARE Middleware IDL allows to declare a function as oneway method, applying the “Oneway” annotation. The definitions is as follows:

@annotation Oneway {
    attribute boolean value default true;
};
Asynchronous functions

The FIWARE Middleware IDL allows to declare a function as asynchronous method, applying the “Async” annotation. The definitions is as follows:

@annotation Async {
    attribute boolean value default true;
}

IDL Complete Example

This section provides a complete example of a FIWARE Middleware IDL file:

typedef list<i32> accountList;
// @Encrypted annotation applies to map type declaration.
@Encrypted(mode="sha1")
typedef map<string, i32> userAccountMap;

// @CppMapping annotation applies to the namespace
@CppMapping
namespace ThiefBank {

   // @Authentication annotation applies to the service.
   @Authentication(mechanism="login")
   service AccountService {
      // @Security annotation applies to the structure declaration.
      @Security
      struct AccountInfo {
          i32 count;
         string user;
      };

      @Oneway
      void setAccounts(userAccountMap uamap);

      //@Encrypted annotation applies to the parameter "account".
      @Oneway
      void setAccount(string user, @Encrypted i32 account);

      //@Encrypted annotation applies to the return value.
      @Encrypted
      AccountInfo get(string user);

      //@FullEncrypted annotation applies to the operation.
      @FullEncrypted(mode="sha1")
      AccountInfo get_secured(string user);
   };
};

The annotations used in previous example are defined as follows:

@annotation CppMapping {
   attribute boolean value default true;
};

@annotation Authentication {
   attribute string mechanism default "none";
};

@annotation Encrypted {
   attribute string mode default "sha512";
};

@annotation FullEncrypted {
   attribute string mode default "sha512";
};

@annotation Security {
   attribute boolean active default true;
};

Appendix A: Changes from OMG IDL 3.5

This section summarizes in one block all changes applied from OMG IDL 3.5 to the FIWARE Middleware IDL:

Also FIWARE Middleware IDL does not use and support (and therefore ignores) several OMG IDL 3.5 constructs:

Appendix B: FIWARE Middleware IDL Grammar

<specification> ::= <import>* <definition>+
<definition> ::= <type_dcl> ";"
             |   <const_dcl> ";"
             |   <except_dcl> ";"
             |   <interface> ";"
             |   <module> ";"
             |   <value> ";"
             |   <type_id_dcl> ";"
             |   <type_prefix_dcl> ";"
             |   <event> ";"
             |   <component> ";"
             |   <home_dcl> ";"
             |   <annotation_dcl> ";"
             |   <annotation_appl> <definition>
<annotation_dcl> ::= <annotation_def> ";"
                 |   <annotation_forward_dcl>
<annotation_def> ::= <annotation_header> "{" <annotation_body> "}"
<annotation_header> ::= "@annotation" <identifier> [<annotation_inheritance_spec>]
<annotation_inheritance_spec> ::= ":" <scoped_name>
<annotation_body> ::= <annotation_member>*
<annotation_member> ::= <const_type> <simple_declarator>
                        [ "default" <const_expr> ] ";"
<annotation_forward_dcl> ::= "@annotation" <scoped_name>
<annotation_appl> ::= "@" <scoped_name> [ "(" [ <annotation_appl_params> ] ")" ]
<annotation_appl_params> ::= <const_exp>
                        |   <annotation_appl_param> { "," <annotation_appl_param> }*
<annotation_appl_param> ::= <identifier> "=" <const_exp>
<module> ::= ("module" | "namespace") <identifier> "{" <definition> + "}"
<interface> ::= <interface_dcl>
            |   <forward_dcl>
<interface_dcl> ::= <interface_header> "{" <interface_body> "}"
<forward_dcl> ::= [ "abstract" | "local" ] ("interface" | "service") <identifier>
<interface_header> ::= [ "abstract" | "local" ] ("interface" | "service") <identifier>
                       [ <interface_inheritance_spec> ]
<interface_body> ::= <export>*
<export> ::= <type_dcl> ";"
          |   <const_dcl> ";"
          |   <except_dcl> ";"
          |   <attr_dcl> ";"
          |   <op_dcl> ";"
          |   <type_id_dcl> ";"
          |   <type_prefix_dcl> ";"
         |   <annotation_appl> <export>
<interface_inheritance_spec> ::= ":" <interface_name>
                                 { "," <interface_name> }*
<interface_name> ::= <scoped_name>
<scoped_name> ::= <identifier>
            |   "::" <identifier>
            |   <scoped_name> "::" <identifier>
<value> ::= ( <value_dcl> | <value_abs_dcl> | <value_box_dcl> | <value_forward_dcl>)
<value_forward_dcl> ::= [ "abstract" ] "valuetype" <identifier>
<value_box_dcl> ::= "valuetype" <identifier> <type_spec>
<value_abs_dcl> ::= "abstract" "valuetype" <identifier>
                    [ <value_inheritance_spec> ]
                    "{" <export>* "}"
<value_dcl> ::= <value_header> "{" <value_element>* "}"
<value_header> ::= ["custom" ] "valuetype" <identifier>
                   [ <value_inheritance_spec> ]
<value_inheritance_spec> ::= [ ":" [ "truncatable" ] <value_name>
                             { "," <value_name> }* ]
                             [ "supports" <interface_name>
                             { "," <interface_name> }* ]
<value_name> ::= <scoped_name>
<value_element> ::= <export> | <state_member> | <init_dcl>
<state_member> ::= ( "public" | "private" )
                   <type_spec> <declarators> ";"
<init_dcl> ::= "factory" <identifier>
               "(" [ <init_param_decls> ] ")"
               [ <raises_expr> ] ";"
<init_param_decls> ::= <init_param_decl> { "," <init_param_decl> }*
<init_param_decl> ::= <init_param_attribute> <param_type_spec> <simple_declarator>
<init_param_attribute> ::= "in"
<const_dcl> ::= "const" <const_type>
                <identifier> "=" <const_exp>
<const_type> ::= <integer_type>
             |   <char_type>
             |   <wide_char_type>
             |   <boolean_type>
             |   <floating_pt_type>
             |   <string_type>
             |   <wide_string_type>
             |   <fixed_pt_const_type>
             |   <scoped_name>
             |   <octet_type>
<const_exp> ::= <or_expr>
<or_expr> ::= <xor_expr>
           |   <or_expr> "|" <xor_expr>
<xor_expr> ::= <and_expr>
           |   <xor_expr> "^" <and_expr>
<and_expr> ::= <shift_expr>
           |   <and_expr> "&" <shift_expr>
<shift_expr> ::= <add_expr>
             |   <shift_expr> ">>" <add_expr>
             |   <shift_expr> "<<" <add_expr>
<add_expr> ::= <mult_expr>
           |   <add_expr> "+" <mult_expr>
           |   <add_expr> "-" <mult_expr>
<mult_expr> ::= <unary_expr>
            |   <mult_expr> "*" <unary_expr>
            |   <mult_expr> "/" <unary_expr>
            |   <mult_expr> "%" <unary_expr>
<unary_expr> ::= <unary_operator> <primary_expr>
             |   <primary_expr>
<unary_operator> ::= "-"
                 |   "+"
                 |   "~"
<primary_expr> ::= <scoped_name>
               |   <literal>
               |   "(" <const_exp> ")"
<literal> ::= <integer_literal>
          |   <string_literal>
          |   <wide_string_literal>
          |   <character_literal>
          |   <wide_character_literal>
          |   <fixed_pt_literal>
          |   <floating_pt_literal>
          |   <boolean_literal>
<boolean_literal> ::= "TRUE"
                  |   "FALSE"
<positive_int_const> ::= <const_exp>
<type_dcl> ::= "typedef" <type_declarator>
           |   <struct_type>
           |   <union_type>
           |   <enum_type>
           |   "native" <simple_declarator>
           |   <constr_forward_decl>
<type_declarator> ::= <type_spec> <declarators>
<type_spec> ::= <simple_type_spec>
            |   <constr_type_spec>
<simple_type_spec> ::= <base_type_spec>
                   |   <template_type_spec>
                   |   <scoped_name>
<base_type_spec> ::= <floating_pt_type>
                 |   <integer_type>
                 |   <char_type>
                 |   <wide_char_type>
                 |   <boolean_type>
                 |   <octet_type>
                 |   <any_type>
                 |   <object_type>
                 |   <value_base_type>
<template_type_spec> ::= <sequence_type>
                     |   <set_type>
                     |   <map_type>
                     |   <string_type>
                     |   <wide_string_type>
                     |   <fixed_pt_type>
<constr_type_spec> ::= <struct_type>
                   |   <union_type>
                   |   <enum_type>
<declarators> ::= <declarator> { "," <declarator> }*
<declarator> ::= <simple_declarator>
             |   <complex_declarator>
<simple_declarator> ::= <identifier>
<complex_declarator> ::= <array_declarator>
<floating_pt_type> ::= "float"
                   |   "double"
                   |   "long" "double"
                   |   "float32"
                   |   "float64"
                   |   "float128"
<integer_type> ::= <signed_int>
               |   <unsigned_int>
<signed_int> ::= <signed_short_int>
             |   <signed_long_int>
             |   <signed_longlong_int>
<signed_short_int> ::= "short"
                   |   "i16"
<signed_long_int> ::= "long"
                  |    "i32"
<signed_longlong_int> ::= "long" "long"
                      |   "i64"
<unsigned_int> ::= <unsigned_short_int>
               |   <unsigned_long_int>
               |   <unsigned_longlong_int>
<unsigned_short_int> ::= "unsigned" "short"
                     |   "ui16"
<unsigned_long_int> ::= "unsigned" "long"
                    |   "ui32"
<unsigned_longlong_int> ::= "unsigned" "long" "long"
                        |   "ui64"
<char_type> ::= "char"
<wide_char_type> ::= "wchar"
<boolean_type> ::= "boolean"
<octet_type> ::= "octet"
             |   "byte"
<any_type> ::= "any"
<object_type> ::= "Object"
<struct_type> ::= "struct" <identifier> "{" <member_list> "}"
<member_list> ::= <member>+
<member> ::= <type_spec> <declarators> ";"
         |   <annotation_appl> <type_spec> <declarators> ";"
<union_type> ::= "union" <identifier> "switch"
                 "(" <switch_type_spec> ")"
                 "{" <switch_body> "}"
<switch_type_spec> ::= <integer_type>
                   |   <char_type>
                   |   <boolean_type>
                   |   <enum_type>
                   |   <scoped_name>
<switch_body> ::= <case> +
<case> ::= <case_label> + <element_spec> ";"
<case_label> ::= "case" <const_exp> ":"
             |   "default" ":"
<element_spec> ::= <type_spec> <declarator>
               |   <annotation_appl> <type_spec> <declarator>
<enum_type> ::= "enum" <identifier>
                "{" <enumerator> { "," <enumerator> } * "}"
<enumerator> ::= <identifier>
<sequence_type> ::= "sequence" "<" <simple_type_spec> "," <positive_int_const> ">"
                |   "sequence" "<" <simple_type_spec> ">"
                |   "list" "<" <simple_type_spec> "," <positive_int_const> ">"
                |   "list" "<" <simple_type_spec> ">"
<set_type> ::= "set" "<" <simple_type_spec> "," <positive_int_const> ">"
                |   "set" "<" <simple_type_spec> ">"
<map_type> ::= "map" "<" <simple_type_spec> ","
                    <simple_type_spec> "," <positive_int_const> ">"
                |   "map" "<" <simple_type_spec> "," <simple_type_spec> ">"
<string_type> ::= "string" "<" <positive_int_const> ">"
              |   "string"
<wide_string_type> ::= "wstring" "<" <positive_int_const> ">"
                   |   "wstring"
<array_declarator> ::= <identifier> <fixed_array_size>+
<fixed_array_size> ::= "[" <positive_int_const> "]"
<attr_dcl> ::= <readonly_attr_spec>
           |   <attr_spec>
<except_dcl> ::= "exception" <identifier> "{" <member>* "}"
<op_dcl> ::= [ <op_attribute> ] <op_type_spec>
             <identifier> <parameter_dcls>
             [ <raises_expr> ] [ <context_expr> ]
<op_attribute> ::= "oneway"
<op_type_spec> ::= <param_type_spec>
               | "void"
<parameter_dcls> ::= "(" <param_dcl> { "," <param_dcl> } * ")"
                 |   "(" ")"
<param_dcl> ::= [<param_attribute>] <param_type_spec> <simple_declarator>
            |   [<param_attribute>] <annotation_appl>
                <param_type_spec> <simple_declarator>
<param_attribute> ::= "in"
                  |   "out"
                  |   "inout"
<raises_expr> ::= "raises" "(" <scoped_name>
                  { "," <scoped_name> } * ")"
<context_expr> ::= "context" "(" <string_literal>
                   { "," <string_literal> } * ")"
<param_type_spec> ::= <base_type_spec>
                  |   <string_type>
                  |   <wide_string_type>
                  |   <scoped_name>
<fixed_pt_type> ::= "fixed" "<" <positive_int_const> "," <positive_int_const> ">"
<fixed_pt_const_type> ::= "fixed"
<value_base_type> ::= "ValueBase"
<constr_forward_decl> ::= "struct" <identifier>
                      |   "union" <identifier>
<import> ::= "import" <imported_scope> ";"
<imported_scope> ::= <scoped_name> | <string_literal>
<type_id_dcl> ::= "typeid" <scoped_name> <string_literal>
<type_prefix_dcl> ::= "typeprefix" <scoped_name> <string_literal>
<readonly_attr_spec> ::= "readonly" "attribute" <param_type_spec>
                         <readonly_attr_declarator>
<readonly_attr_declarator> ::= <simple_declarator> <raises_expr>
                           |   <simple_declarator>
                               { "," <simple_declarator> }*
<attr_spec> ::= "attribute" <param_type_spec>
                <attr_declarator>
<attr_declarator> ::= <simple_declarator> <attr_raises_expr>
                  |   <simple_declarator>
                      { "," <simple_declarator> }*
<attr_raises_expr> ::= <get_excep_expr> [ <set_excep_expr> ]
                   |   <set_excep_expr>
<get_excep_expr> ::= "getraises" <exception_list>
<set_excep_expr> ::= "setraises" <exception_list>
<exception_list> ::= "(" <scoped_name>
                     { "," <scoped_name> } * ")"
<component> ::= <component_dcl>
            |   <component_forward_dcl>
<component_forward_dcl> ::= "component" <identifier>
<component_dcl> ::= <component_header>
                    "{" <component_body> "}"
<component_header> ::= "component" <identifier>
                       [ <component_inheritance_spec> ]
                       [ <supported_interface_spec> ]
<supported_interface_spec> ::= "supports" <scoped_name>
                               { "," <scoped_name> }*
<component_inheritance_spec> ::= ":" <scoped_name>
<component_body> ::= <component_export>*
<component_export> ::= <provides_dcl> ";"
                   |   <uses_dcl> ";"
                   |   <emits_dcl> ";"
                   |   <publishes_dcl> ";"
                   |   <consumes_dcl> ";"
                   |   <attr_dcl> ";"
<provides_dcl> ::= "provides" <interface_type> <identifier>
<interface_type> ::= <scoped_name>
                 |   "Object"
<uses_dcl> ::= "uses" [ "multiple" ]
               < interface_type> <identifier>
<emits_dcl> ::= "emits" <scoped_name> <identifier>
<publishes_dcl> ::= "publishes" <scoped_name> <identifier>
<consumes_dcl> ::= "consumes" <scoped_name> <identifier>
<home_dcl> ::= <home_header> <home_body>
<home_header> ::= "home" <identifier>
                  [ <home_inheritance_spec> ]
                  [ <supported_interface_spec> ]
                  "manages" <scoped_name>
                  [ <primary_key_spec> ]
<home_inheritance_spec> ::= ":" <scoped_name>
<primary_key_spec> ::= "primarykey" <scoped_name>
<home_body> ::= "{" <home_export>* "}"
<home_export ::= <export>
             |   <factory_dcl> ";"
             |   <finder_dcl> ";"
<factory_dcl> ::= "factory" <identifier>
                  "(" [ <init_param_decls> ] ")"
                  [ <raises_expr> ]
<finder_dcl> ::= "finder" <identifier>
                 "(" [ <init_param_decls> ] ")"
                 [ <raises_expr> ]
<event> ::= ( <event_dcl> | <event_abs_dcl> |
            <event_forward_dcl>)
<event_forward_dcl> ::= [ "abstract" ] "eventtype" <identifier>
<event_abs_dcl> ::= "abstract" "eventtype" <identifie
                    [ <value_inheritance_spec> ]
                    "{" <export>* "}"
<event_dcl> ::= <event_header> "{" <value_element> * "}"
<event_header> ::= [ "custom" ] "eventtype"
                   <identifier> [ <value_inheritance_spec> ]

Appendix C: OMG IDL 3.5 Grammar

<specification> ::= <import>* <definition>+
<definition> ::= <type_dcl> ";"
             |   <const_dcl> ";"
             |   <except_dcl> ";"
             |   <interface> ";"
             |   <module> ";"
             |   <value> ";"
             |   <type_id_dcl> ";"
             |   <type_prefix_dcl> ";"
             |   <event> ";"
             |   <component> ";"
             |   <home_dcl> ";"
<module> ::= "module" <identifier> "{" <definition> + "}"
<interface> ::= <interface_dcl>
            |   <forward_dcl>
<interface_dcl> ::= <interface_header> "{" <interface_body> "}"
<forward_dcl> ::= [ "abstract" | "local" ] "interface" <identifier>
<interface_header> ::= [ "abstract" | "local" ] "interface" <identifier>
                       [ <interface_inheritance_spec> ]
<interface_body> ::= <export>*
<export> ::= <type_dcl> ";"
          |   <const_dcl> ";"
          |   <except_dcl> ";"
          |   <attr_dcl> ";"
          |   <op_dcl> ";"
          |   <type_id_dcl> ";"
          |   <type_prefix_dcl> ";"
<interface_inheritance_spec> ::= ":" <interface_name>
                                 { "," <interface_name> }*
<interface_name> ::= <scoped_name>
<scoped_name> ::= <identifier>
            |   "::" <identifier>
            |   <scoped_name> "::" <identifier>
<value> ::= ( <value_dcl> | <value_abs_dcl> | <value_box_dcl> | <value_forward_dcl>)
<value_forward_dcl> ::= [ "abstract" ] "valuetype" <identifier>
<value_box_dcl> ::= "valuetype" <identifier> <type_spec>
<value_abs_dcl> ::= "abstract" "valuetype" <identifier>
                    [ <value_inheritance_spec> ]
                    "{" <export>* "}"
<value_dcl> ::= <value_header> "{" < value_element>* "}"
<value_header> ::= ["custom" ] "valuetype" <identifier>
                   [ <value_inheritance_spec> ]
<value_inheritance_spec> ::= [ ":" [ "truncatable" ] <value_name>
                             { "," <value_name> }* ]
                             [ "supports" <interface_name>
                             { "," <interface_name> }* ]
<value_name> ::= <scoped_name>
<value_element> ::= <export> | < state_member> | <init_dcl>
<state_member> ::= ( "public" | "private" )
                   <type_spec> <declarators> ";"
<init_dcl> ::= "factory" <identifier>
               "(" [ <init_param_decls> ] ")"
               [ <raises_expr> ] ";"
<init_param_decls> ::= <init_param_decl> { "," <init_param_decl> }*
<init_param_decl> ::= <init_param_attribute> <param_type_spec> <simple_declarator>
<init_param_attribute> ::= "in"
<const_dcl> ::= "const" <const_type>
                <identifier> "=" <const_exp>
<const_type> ::= <integer_type>
             |   <char_type>
             |   <wide_char_type>
             |   <boolean_type>
             |   <floating_pt_type>
             |   <string_type>
             |   <wide_string_type>
             |   <fixed_pt_const_type>
             |   <scoped_name>
             |   <octet_type>
<const_exp> ::= <or_expr>
<or_expr> ::= <xor_expr>
           |   <or_expr> "|" <xor_expr>
<xor_expr> ::= <and_expr>
           |   <xor_expr> "^" <and_expr>
<and_expr> ::= <shift_expr>
           |   <and_expr> "&" <shift_expr>
<shift_expr> ::= <add_expr>
             |   <shift_expr> ">>" <add_expr>
             |   <shift_expr> "<<" <add_expr>
<add_expr> ::= <mult_expr>
           |   <add_expr> "+" <mult_expr>
           |   <add_expr> "-" <mult_expr>
<mult_expr> ::= <unary_expr>
            |   <mult_expr> "*" <unary_expr>
            |   <mult_expr> "/" <unary_expr>
            |   <mult_expr> "%" <unary_expr>
<unary_expr> ::= <unary_operator> <primary_expr>
             |   <primary_expr>
<unary_operator> ::= "-"
                 |   "+"
                 |   "~"
<primary_expr> ::= <scoped_name>
               |   <literal>
               |   "(" <const_exp> ")"
<literal> ::= <integer_literal>
          |   <string_literal>
          |   <wide_string_literal>
          |   <character_literal>
          |   <wide_character_literal>
          |   <fixed_pt_literal>
          |   <floating_pt_literal>
          |   <boolean_literal>
<boolean_literal> ::= "TRUE"
                  |   "FALSE"
<positive_int_const> ::= <const_exp>
<type_dcl> ::= "typedef" <type_declarator>
           |   <struct_type>
           |   <union_type>
           |   <enum_type>
           |   "native" <simple_declarator>
           |   <constr_forward_decl>
<type_declarator> ::= <type_spec> <declarators>
<type_spec> ::= <simple_type_spec>
            |   <constr_type_spec>
<simple_type_spec> ::= <base_type_spec>
                   |   <template_type_spec>
                   |   <scoped_name>
<base_type_spec> ::= <floating_pt_type>
                 |   <integer_type>
                 |   <char_type>
                 |   <wide_char_type>
                 |   <boolean_type>
                 |   <octet_type>
                 |   <any_type>
                 |   <object_type>
                 |   <value_base_type>
<template_type_spec> ::= <sequence_type>
                     |   <string_type>
                     |   <wide_string_type>
                     |   <fixed_pt_type>
<constr_type_spec> ::= <struct_type>
                   |   <union_type>
                   |   <enum_type>
<declarators> ::= <declarator> { "," <declarator> }*
<declarator> ::= <simple_declarator>
             |   <complex_declarator>
<simple_declarator> ::= <identifier>
<complex_declarator> ::= <array_declarator>
<floating_pt_type> ::= "float"
                   |   "double"
                   |   "long" "double"
<integer_type> ::= <signed_int>
               |   <unsigned_int>
<signed_int> ::= <signed_short_int>
             |   <signed_long_int>
             |   <signed_longlong_int>
<signed_short_int> ::= "short"
<signed_long_int> ::= "long"
<signed_longlong_int> ::= "long" "long"
<unsigned_int> ::= <unsigned_short_int>
               |   <unsigned_long_int>
               |   <unsigned_longlong_int>
<unsigned_short_int> ::= "unsigned" "short"
<unsigned_long_int> ::= "unsigned" "long"
<unsigned_longlong_int> ::= "unsigned" "long" "long"
<char_type> ::= "char"
<wide_char_type> ::= "wchar"
<boolean_type> ::= "boolean"
<octet_type> ::= "octet"
<any_type> ::= "any"
<object_type> ::= "Object"
<struct_type> ::= "struct" <identifier> "{" <member_list> "}"
<member_list> ::= <member> +
<member> ::= <type_spec> <declarators> ";"
<union_type> ::= "union" <identifier> "switch"
                 "(" <switch_type_spec> ")"
                 "{" <switch_body> "}"
<switch_type_spec> ::= <integer_type>
                   |   <char_type>
                   |   <boolean_type>
                   |   <enum_type>
                   |   <scoped_name>
<switch_body> ::= <case> +
<case> ::= <case_label> + <element_spec> ";"
<case_label> ::= "case" <const_exp> ":"
             |   "default" ":"
<element_spec> ::= <type_spec> <declarator>
<enum_type> ::= "enum" <identifier>
                "{" <enumerator> { "," <enumerator> } * "}"
<enumerator> ::= <identifier>
<sequence_type> ::= "sequence" "<" <simple_type_spec> "," <positive_int_const> ">"
                |   "sequence" "<" <simple_type_spec> ">"
<string_type> ::= "string" "<" <positive_int_const> ">"
              |   "string"
<wide_string_type> ::= "wstring" "<" <positive_int_const> ">"
                   |   "wstring"
<array_declarator> ::= <identifier> <fixed_array_size>+
<fixed_array_size> ::= "[" <positive_int_const> "]"
<attr_dcl> ::= <readonly_attr_spec>
           |   <attr_spec>
<except_dcl> ::= "exception" <identifier> "{" <member>* "}"
<op_dcl> ::= [ <op_attribute> ] <op_type_spec>
             <identifier> <parameter_dcls>
             [ <raises_expr> ] [ <context_expr> ]
<op_attribute> ::= "oneway"
<op_type_spec> ::= <param_type_spec>
               | "void"
<parameter_dcls> ::= "(" <param_dcl> { "," <param_dcl> } * ")"
                 |   "(" ")"
<param_dcl> ::= <param_attribute> <param_type_spec> <simple_declarator>
<param_attribute> ::= "in"
                  |   "out"
                  |   "inout"
<raises_expr> ::= "raises" "(" <scoped_name>
                  { "," <scoped_name> } * ")"
<context_expr> ::= "context" "(" <string_literal>
                   { "," <string_literal> } * ")"
<param_type_spec> ::= <base_type_spec>
                  |   <string_type>
                  |   <wide_string_type>
                  |   <scoped_name>
<fixed_pt_type> ::= "fixed" "<" <positive_int_const> "," <positive_int_const> ">"
<fixed_pt_const_type> ::= "fixed"
<value_base_type> ::= "ValueBase"
<constr_forward_decl> ::= "struct" <identifier>
                      |   "union" <identifier>
<import> ::= "import" <imported_scope> ";"
<imported_scope> ::= <scoped_name> | <string_literal>
<type_id_dcl> ::= "typeid" <scoped_name> <string_literal>
<type_prefix_dcl> ::= "typeprefix" <scoped_name> <string_literal>
<readonly_attr_spec> ::= "readonly" "attribute" <param_type_spec>
                         <readonly_attr_declarator>
<readonly_attr_declarator> ::= <simple_declarator> <raises_expr>
                           |   <simple_declarator>
                               { "," <simple_declarator> }*
<attr_spec> ::= "attribute" <param_type_spec>
                <attr_declarator>
<attr_declarator> ::= <simple_declarator> <attr_raises_expr>
                  |   <simple_declarator>
                      { "," <simple_declarator> }*
<attr_raises_expr> ::= <get_excep_expr> [ <set_excep_expr> ]
                   |   <set_excep_expr>
<get_excep_expr> ::= "getraises" <exception_list>
<set_excep_expr> ::= "setraises" <exception_list>
<exception_list> ::= "(" <scoped_name>
                     { "," <scoped_name> } * ")"
<component> ::= <component_dcl>
            |   <component_forward_dcl>
<component_forward_dcl> ::= "component" <identifier>
<component_dcl> ::= <component_header>
                    "{" <component_body> "}"
<component_header> ::= "component" <identifier>
                       [ <component_inheritance_spec> ]
                       [ <supported_interface_spec> ]
<supported_interface_spec> ::= "supports" <scoped_name>
                               { "," <scoped_name> }*
<component_inheritance_spec> ::= ":" <scoped_name>
<component_body> ::= <component_export>*
<component_export> ::= <provides_dcl> ";"
                   |   <uses_dcl> ";"
                   |   <emits_dcl> ";"
                   |   <publishes_dcl> ";"
                   |   <consumes_dcl> ";"
                   |   <attr_dcl> ";"
<provides_dcl> ::= "provides" <interface_type> <identifier>
<interface_type> ::= <scoped_name>
                 |   "Object"
<uses_dcl> ::= "uses" [ "multiple" ]
               < interface_type> <identifier>
<emits_dcl> ::= "emits" <scoped_name> <identifier>
<publishes_dcl> ::= "publishes" <scoped_name> <identifier>
<consumes_dcl> ::= "consumes" <scoped_name> <identifier>
<home_dcl> ::= <home_header> <home_body>
<home_header> ::= "home" <identifier>
                  [ <home_inheritance_spec> ]
                  [ <supported_interface_spec> ]
                  "manages" <scoped_name>
                  [ <primary_key_spec> ]
<home_inheritance_spec> ::= ":" <scoped_name>
<primary_key_spec> ::= "primarykey" <scoped_name>
<home_body> ::= "{" <home_export>* "}"
<home_export ::= <export>
             |   <factory_dcl> ";"
             |   <finder_dcl> ";"
<factory_dcl> ::= "factory" <identifier>
                  "(" [ <init_param_decls> ] ")"
                  [ <raises_expr> ]
<finder_dcl> ::= "finder" <identifier>
                 "(" [ <init_param_decls> ] ")"
                 [ <raises_expr> ]
<event> ::= ( <event_dcl> | <event_abs_dcl> |
            <event_forward_dcl>)
<event_forward_dcl> ::= [ "abstract" ] "eventtype" <identifier>
<event_abs_dcl> ::= "abstract" "eventtype" <identifie
                    [ <value_inheritance_spec> ]
                    "{" <export>* "}"
<event_dcl> ::= <event_header> "{" <value_element> * "}"
<event_header> ::= [ "custom" ] "eventtype"
                   <identifier> [ <value_inheritance_spec> ]