Skip to content
GitLab
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
TDL Open Source
TOP IDE
Compare revisions
30ecb3b30a4ccf4b6365211344e1b5c9850c9f93...c345caf414cd85fa0d024cea76695ff00386d5f3
Hide whitespace changes
Inline
Side-by-side
plugins/org.etsi.mts.tdl.execution.java.runtime/src/org/etsi/mts/tdl/execution/java/rt/core/ValueImpl.java
View file @
c345caf4
...
@@ -7,12 +7,11 @@ import java.util.List;
...
@@ -7,12 +7,11 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
import
org.etsi.mts.tdl.execution.java.tri.Data
;
import
org.etsi.mts.tdl.execution.java.tri.Data
;
import
org.etsi.mts.tdl.execution.java.tri.ElementAnnotation
;
import
org.etsi.mts.tdl.execution.java.tri.Mapping
;
import
org.etsi.mts.tdl.execution.java.tri.Mapping
;
import
org.etsi.mts.tdl.execution.java.tri.Type
;
import
org.etsi.mts.tdl.execution.java.tri.Type
;
import
org.etsi.mts.tdl.execution.java.tri.Value
;
import
org.etsi.mts.tdl.execution.java.tri.Value
;
public
class
ValueImpl
extends
Value
implements
TriImpl
<
ValueImpl
,
Data
<
Type
,
Value
>>
{
public
class
ValueImpl
extends
NamedElementImpl
implements
Value
,
TriImpl
<
ValueImpl
,
Data
<
Type
,
Value
>>
{
private
TypeImpl
type
;
private
TypeImpl
type
;
private
boolean
collection
=
false
;
private
boolean
collection
=
false
;
...
@@ -23,14 +22,14 @@ public class ValueImpl extends Value implements TriImpl<ValueImpl, Data<Type, Va
...
@@ -23,14 +22,14 @@ public class ValueImpl extends Value implements TriImpl<ValueImpl, Data<Type, Va
private
List
<
Data
<
Type
,
Value
>>
items
=
new
ArrayList
<
Data
<
Type
,
Value
>>();
private
List
<
Data
<
Type
,
Value
>>
items
=
new
ArrayList
<
Data
<
Type
,
Value
>>();
private
MappingImpl
mapping
;
private
MappingImpl
mapping
;
public
ValueImpl
()
{
public
ValueImpl
()
{
}
}
public
ValueImpl
(
TypeImpl
type
)
{
public
ValueImpl
(
TypeImpl
type
)
{
this
.
type
=
type
;
this
.
type
=
type
;
}
}
public
ValueImpl
setType
(
TypeImpl
type
)
{
public
ValueImpl
setType
(
TypeImpl
type
)
{
this
.
type
=
type
;
this
.
type
=
type
;
return
this
;
return
this
;
...
@@ -75,7 +74,7 @@ public class ValueImpl extends Value implements TriImpl<ValueImpl, Data<Type, Va
...
@@ -75,7 +74,7 @@ public class ValueImpl extends Value implements TriImpl<ValueImpl, Data<Type, Va
this
.
value
=
value
;
this
.
value
=
value
;
return
this
;
return
this
;
}
}
@Override
@Override
public
Collection
<
String
>
getParameters
()
{
public
Collection
<
String
>
getParameters
()
{
return
this
.
parameters
.
keySet
();
return
this
.
parameters
.
keySet
();
...
@@ -110,18 +109,18 @@ public class ValueImpl extends Value implements TriImpl<ValueImpl, Data<Type, Va
...
@@ -110,18 +109,18 @@ public class ValueImpl extends Value implements TriImpl<ValueImpl, Data<Type, Va
@Override
@Override
public
ValueImpl
setName
(
String
name
,
String
qualifiedName
)
{
public
ValueImpl
setName
(
String
name
,
String
qualifiedName
)
{
this
.
name
=
name
;
this
.
name
=
name
;
this
.
q
ualifiedName
=
qualifiedName
;
this
.
setQ
ualifiedName
(
qualifiedName
)
;
return
this
;
return
this
;
}
}
@Override
@Override
public
ValueImpl
addAnnotation
(
String
key
,
String
value
)
{
public
ValueImpl
addAnnotation
(
String
key
,
String
value
)
{
this
.
annotations
.
add
(
new
Element
Annotation
(
key
,
value
)
)
;
super
.
add
Annotation
(
key
,
value
);
return
this
;
return
this
;
}
}
public
Data
<
Type
,
Value
>
asData
()
{
public
Data
<
Type
,
Value
>
asData
()
{
return
new
Data
<
Type
,
Value
>(
type
,
this
);
return
new
Data
Impl
<
Type
,
Value
>(
type
,
this
);
}
}
}
}
plugins/org.etsi.mts.tdl.execution.java.runtime/src/org/etsi/mts/tdl/execution/java/rt/core/VerdictImpl.java
0 → 100644
View file @
c345caf4
package
org.etsi.mts.tdl.execution.java.rt.core
;
import
org.etsi.mts.tdl.execution.java.tri.Verdict
;
public
class
VerdictImpl
extends
NamedElementImpl
implements
Verdict
{
/**
* Verdict instance predefined in TDL.
*/
public
static
VerdictImpl
pass
=
new
VerdictImpl
(
"pass"
),
fail
=
new
VerdictImpl
(
"fail"
),
inconclusive
=
new
VerdictImpl
(
"inconclusive"
);
public
VerdictImpl
(
String
name
)
{
super
(
name
,
null
);
}
}
plugins/org.etsi.mts.tdl.execution.java.runtime/src/org/etsi/mts/tdl/execution/java/rt/data/AcceptedType.java
deleted
100644 → 0
View file @
30ecb3b3
package
org.etsi.mts.tdl.execution.java.rt.data
;
import
java.lang.annotation.ElementType
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
import
java.lang.annotation.Target
;
/**
* HTTP Accept header value usable on String fields.
* XXX who dis?
*/
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Target
(
ElementType
.
FIELD
)
public
@interface
AcceptedType
{
}
plugins/org.etsi.mts.tdl.execution.java.runtime/src/org/etsi/mts/tdl/execution/java/tri/Argument.java
View file @
c345caf4
...
@@ -4,23 +4,10 @@ package org.etsi.mts.tdl.execution.java.tri;
...
@@ -4,23 +4,10 @@ package org.etsi.mts.tdl.execution.java.tri;
* Extends {@link Data Data} to provide name of a parameter. The argument is
* Extends {@link Data Data} to provide name of a parameter. The argument is
* specified using <code>type</code> and <code>value</code>.
* specified using <code>type</code> and <code>value</code>.
*/
*/
public
class
Argument
<
T
,
V
>
extends
Data
<
T
,
V
>
{
public
interface
Argument
<
T
,
V
>
extends
Data
<
T
,
V
>
{
/**
/**
* Name of the parameter as specified in TDL model.
* Name of the parameter as specified in TDL model.
*/
*/
private
String
parameterName
;
String
getParameterName
();
public
Argument
(
T
type
,
V
value
,
String
parameterName
)
{
super
(
type
,
value
);
this
.
parameterName
=
parameterName
;
}
public
Argument
(
Data
<
T
,
V
>
data
,
String
parameterName
)
{
super
(
data
.
getType
(),
data
.
getValue
());
this
.
parameterName
=
parameterName
;
}
public
String
getParameterName
()
{
return
parameterName
;
}
}
}
plugins/org.etsi.mts.tdl.execution.java.runtime/src/org/etsi/mts/tdl/execution/java/tri/Connection.java
View file @
c345caf4
...
@@ -4,23 +4,10 @@ package org.etsi.mts.tdl.execution.java.tri;
...
@@ -4,23 +4,10 @@ package org.etsi.mts.tdl.execution.java.tri;
* Encapsulation of connected <code>GateReference</code>s.
* Encapsulation of connected <code>GateReference</code>s.
*
*
*/
*/
public
class
Connection
extends
Element
{
public
interface
Connection
extends
Element
{
/**
/**
* The end-points of this connection as specified in TDL model.
* The end-points of this connection as specified in TDL model.
*/
*/
public
final
GateReference
[]
endPoints
=
new
GateReference
[
2
];
GateReference
[]
getEndPoints
();
public
Connection
(
String
name
,
GateReference
sourceGate
,
GateReference
targetGate
)
{
super
(
name
);
endPoints
[
0
]
=
sourceGate
;
endPoints
[
1
]
=
targetGate
;
}
@Override
public
String
toString
()
{
if
(
name
!=
null
)
return
name
;
return
endPoints
[
0
].
toString
()
+
" :: "
+
endPoints
[
1
].
toString
();
}
}
}
plugins/org.etsi.mts.tdl.execution.java.runtime/src/org/etsi/mts/tdl/execution/java/tri/Data.java
View file @
c345caf4
...
@@ -3,41 +3,17 @@ package org.etsi.mts.tdl.execution.java.tri;
...
@@ -3,41 +3,17 @@ package org.etsi.mts.tdl.execution.java.tri;
/**
/**
* Encapsulation of type and value. The objects are resolved using TDL data
* Encapsulation of type and value. The objects are resolved using TDL data
* mappings.
* mappings.
* <p>
* In Java environment the <code>type</code> is a Java class and
* <code>value</code> is an object of that class or a lambda expression that
* returns such object.
*/
*/
public
class
Data
<
T
,
V
>
{
public
interface
Data
<
T
,
V
>
{
/**
* The type information in environment specific form that can be used to decode
* incoming data. For example, an annotated class.
*/
private
T
type
;
/**
/**
* The decoded value of the data that matches the type.
* The decoded value of the data that matches the type.
*/
*/
private
V
value
;
V
getValue
();
public
Data
(
T
type
,
V
value
)
{
this
.
type
=
type
;
this
.
value
=
value
;
}
/**
* @see #value
*/
public
V
getValue
()
{
return
value
;
}
/**
/**
* @see #type
* The type information in environment specific form that can be used to decode
* incoming data. For example, an annotated class.
*/
*/
public
T
getType
()
{
T
getType
();
return
type
;
}
}
}
plugins/org.etsi.mts.tdl.execution.java.runtime/src/org/etsi/mts/tdl/execution/java/tri/Element.java
View file @
c345caf4
package
org.etsi.mts.tdl.execution.java.tri
;
package
org.etsi.mts.tdl.execution.java.tri
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -10,25 +9,16 @@ import java.util.List;
...
@@ -10,25 +9,16 @@ import java.util.List;
* meta-class.
* meta-class.
*
*
*/
*/
public
class
Element
{
public
interface
Element
{
/**
/**
* The name of the element as specified in TDL model.
* The name of the element as specified in TDL model.
*/
*/
protected
String
n
ame
;
String
getN
ame
()
;
/**
/**
* The annotations assigned to the element as specified in TDL model.
* The annotations assigned to the element as specified in TDL model.
*/
*/
public
List
<
ElementAnnotation
>
annotations
=
new
ArrayList
<
ElementAnnotation
>();
List
<
ElementAnnotation
>
getAnnotations
();
public
Element
()
{
}
public
Element
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getName
()
{
return
name
;
}
}
}
plugins/org.etsi.mts.tdl.execution.java.runtime/src/org/etsi/mts/tdl/execution/java/tri/ElementAnnotation.java
View file @
c345caf4
...
@@ -3,15 +3,16 @@ package org.etsi.mts.tdl.execution.java.tri;
...
@@ -3,15 +3,16 @@ package org.etsi.mts.tdl.execution.java.tri;
/**
/**
* Annotation as specified in TDL model.
* Annotation as specified in TDL model.
*/
*/
public
class
ElementAnnotation
{
public
interface
ElementAnnotation
{
/**
* Key of the annotation.
*/
String
getKey
();
/**
/**
*
Key and v
alue of the annotation.
*
V
alue of the annotation.
*/
*/
public
String
key
,
v
alue
;
String
getV
alue
()
;
public
ElementAnnotation
(
String
key
,
String
value
)
{
this
.
key
=
key
;
this
.
value
=
value
;
}
}
}
plugins/org.etsi.mts.tdl.execution.java.runtime/src/org/etsi/mts/tdl/execution/java/tri/GateReference.java
View file @
c345caf4
...
@@ -12,36 +12,18 @@ package org.etsi.mts.tdl.execution.java.tri;
...
@@ -12,36 +12,18 @@ package org.etsi.mts.tdl.execution.java.tri;
* </ul>
* </ul>
*
*
*/
*/
public
class
GateReference
{
public
interface
GateReference
{
public
Element
gate
;
public
Element
gateType
;
public
Element
component
;
public
Element
componentType
;
public
ComponentInstanceRole
role
;
public
GateReference
(
Element
gate
,
Element
gateType
,
Element
component
,
Element
componentType
,
Element
getGate
();
ComponentInstanceRole
role
)
{
this
.
gate
=
gate
;
this
.
gateType
=
gateType
;
this
.
component
=
component
;
this
.
componentType
=
componentType
;
this
.
role
=
role
;
}
@Override
NamedElement
getGateType
();
public
int
hashCode
()
{
return
gate
.
hashCode
()
<<
8
+
gateType
.
hashCode
()
<<
6
+
component
.
hashCode
()
<<
4
GateTypeKind
getGateTypeKind
();
+
componentType
.
hashCode
()
<<
2
+
role
.
hashCode
();
}
@Override
Element
getComponent
();
public
boolean
equals
(
Object
obj
)
{
if
(
obj
instanceof
GateReference
)
{
NamedElement
getComponentType
();
GateReference
gr
=
(
GateReference
)
obj
;
return
gate
.
equals
(
gr
.
gate
)
&&
gateType
.
equals
(
gr
.
gateType
)
&&
component
.
equals
(
gr
.
component
)
ComponentInstanceRole
getComponentRole
();
&&
componentType
.
equals
(
gr
.
componentType
)
&&
role
.
equals
(
gr
.
role
);
}
return
super
.
equals
(
obj
);
}
}
}
\ No newline at end of file
plugins/org.etsi.mts.tdl.execution.java.runtime/src/org/etsi/mts/tdl/execution/java/tri/Mapping.java
View file @
c345caf4
...
@@ -4,14 +4,14 @@ package org.etsi.mts.tdl.execution.java.tri;
...
@@ -4,14 +4,14 @@ package org.etsi.mts.tdl.execution.java.tri;
* Representation of a TDL model element of class <i>DataResourceMapping</i>,
* Representation of a TDL model element of class <i>DataResourceMapping</i>,
* <i>DataElementMapping</i> or <i>ParameterMapping</i>.
* <i>DataElementMapping</i> or <i>ParameterMapping</i>.
*/
*/
public
abstract
class
Mapping
extends
Element
{
public
interface
Mapping
extends
Element
{
/**
/**
* Get the name applied to the associated <i>DataResourceMapping</i> element
* Get the name applied to the associated <i>DataResourceMapping</i> element
* using the predefined <i>MappingName</i> annotation.
* using the predefined <i>MappingName</i> annotation.
*
*
* @return A distinctive name for this mapping.
* @return A distinctive name for this mapping.
*/
*/
public
abstract
String
getMappingName
();
String
getMappingName
();
/**
/**
* If this is a resource mapping.
* If this is a resource mapping.
...
@@ -19,7 +19,7 @@ public abstract class Mapping extends Element {
...
@@ -19,7 +19,7 @@ public abstract class Mapping extends Element {
* @return <b>true</b> if this type represents a <i>DataResourceMapping</i>
* @return <b>true</b> if this type represents a <i>DataResourceMapping</i>
* element.
* element.
*/
*/
public
abstract
boolean
isResource
();
boolean
isResource
();
/**
/**
* If this is a parameter mapping.
* If this is a parameter mapping.
...
@@ -27,14 +27,14 @@ public abstract class Mapping extends Element {
...
@@ -27,14 +27,14 @@ public abstract class Mapping extends Element {
* @return <b>true</b> if this type represents a <i>ParameterMapping</i>
* @return <b>true</b> if this type represents a <i>ParameterMapping</i>
* element.
* element.
*/
*/
public
abstract
boolean
isParameter
();
boolean
isParameter
();
/**
/**
* Get the type-sepcific URI for this mapping.
* Get the type-sepcific URI for this mapping.
*
*
* @return The URI of this mapping as specified in corresponding model element.
* @return The URI of this mapping as specified in corresponding model element.
*/
*/
public
abstract
String
getUri
();
String
getUri
();
/**
/**
* Get the resource mapping for this data mapping.
* Get the resource mapping for this data mapping.
...
@@ -43,7 +43,7 @@ public abstract class Mapping extends Element {
...
@@ -43,7 +43,7 @@ public abstract class Mapping extends Element {
* element referenced by the associated <i>DataElementMapping</i>
* element referenced by the associated <i>DataElementMapping</i>
* element.
* element.
*/
*/
public
abstract
Mapping
getResource
();
Mapping
getResource
();
/**
/**
* Get the parameter mappings of this data mapping.
* Get the parameter mappings of this data mapping.
...
@@ -54,6 +54,6 @@ public abstract class Mapping extends Element {
...
@@ -54,6 +54,6 @@ public abstract class Mapping extends Element {
* @return A <code>Mapping</code> representing a <i>ParameterMapping</i>
* @return A <code>Mapping</code> representing a <i>ParameterMapping</i>
* element.
* element.
*/
*/
public
abstract
Mapping
getParameter
(
String
parameterName
);
Mapping
getParameter
(
String
parameterName
);
}
}
plugins/org.etsi.mts.tdl.execution.java.runtime/src/org/etsi/mts/tdl/execution/java/tri/NamedElement.java
View file @
c345caf4
...
@@ -5,21 +5,10 @@ package org.etsi.mts.tdl.execution.java.tri;
...
@@ -5,21 +5,10 @@ package org.etsi.mts.tdl.execution.java.tri;
* in TDL.
* in TDL.
*
*
*/
*/
public
class
NamedElement
extends
Element
{
public
interface
NamedElement
extends
Element
{
/**
/**
* The qualified name of the element as specified in TDL model.
* The qualified name of the element as specified in TDL model.
*/
*/
protected
String
qualifiedName
;
String
getQualifiedName
();
public
NamedElement
()
{
}
public
NamedElement
(
String
name
,
String
qualifiedName
)
{
super
(
name
);
this
.
qualifiedName
=
qualifiedName
;
}
public
String
getQualifiedName
()
{
return
qualifiedName
;
}
}
}
plugins/org.etsi.mts.tdl.execution.java.runtime/src/org/etsi/mts/tdl/execution/java/tri/Parameter.java
0 → 100644
View file @
c345caf4
package
org.etsi.mts.tdl.execution.java.tri
;
/**
* Representation of a TDL model element of class <i>Parameter</i> and its
* sub-classes.
*/
public
interface
Parameter
<
T
>
extends
Element
{
T
getType
();
}
plugins/org.etsi.mts.tdl.execution.java.runtime/src/org/etsi/mts/tdl/execution/java/tri/PredefinedFunctions.java
View file @
c345caf4
package
org.etsi.mts.tdl.execution.java.tri
;
package
org.etsi.mts.tdl.execution.java.tri
;
import
java.util.Colle
ction
;
public
interface
PredefinedFun
ction
s
{
import
com.google.inject.Inject
;
boolean
equals
(
Data
<?,
?>
d0
,
Data
<?,
?>
d1
)
;
/**
boolean
notEquals
(
Data
<?,
?>
d0
,
Data
<?,
?>
d1
);
* Default implementation of predefined functions specified in TDL.
*/
public
class
PredefinedFunctions
{
public
RuntimeHelper
helper
;
boolean
and
(
boolean
b0
,
boolean
b1
)
;
@Inject
boolean
or
(
boolean
b0
,
boolean
b1
);
public
PredefinedFunctions
(
RuntimeHelper
helper
)
{
this
.
helper
=
helper
;
}
public
boolean
equals
(
Data
<?,
?>
d0
,
Data
<?,
?>
d1
)
{
boolean
xor
(
boolean
b0
,
boolean
b1
);
return
helper
.
equals
(
d0
.
getValue
(),
d1
.
getValue
());
}
public
boolean
notEquals
(
Data
<?,
?>
d0
,
Data
<?,
?>
d1
)
{
boolean
not
(
boolean
b
);
return
!
equals
(
d0
,
d1
);
}
public
boolean
and
(
boolean
b0
,
boolean
b1
)
{
boolean
lt
(
int
i0
,
int
i1
);
return
b0
&&
b1
;
}
public
boolean
or
(
boolean
b0
,
boolean
b1
)
{
boolean
gt
(
int
i0
,
int
i1
);
return
b0
||
b1
;
}
public
boolean
xor
(
boolean
b0
,
boolean
b1
)
{
boolean
lteq
(
int
i0
,
int
i1
);
return
b0
^
b1
;
}
public
boolean
not
(
boolean
b
)
{
boolean
gteq
(
int
i0
,
int
i1
);
return
!
b
;
}
public
boolean
lt
(
int
i0
,
int
i1
)
{
boolean
lt
(
long
i0
,
long
i1
);
return
i0
<
i1
;
}
public
boolean
gt
(
int
i0
,
int
i1
)
{
boolean
gt
(
long
i0
,
long
i1
);
return
i0
>
i1
;
}
public
boolean
lteq
(
int
i0
,
int
i1
)
{
boolean
lteq
(
long
i0
,
long
i1
);
return
i0
<=
i1
;
}
public
boolean
gteq
(
int
i0
,
int
i1
)
{
boolean
gteq
(
long
i0
,
long
i1
);
return
i0
>=
i1
;
}
public
boolean
lt
(
long
i0
,
long
i1
)
{
int
plus
(
int
i0
,
int
i1
);
return
i0
<
i1
;
}
public
boolean
gt
(
long
i0
,
long
i1
)
{
int
minus
(
int
i0
,
int
i1
);
return
i0
>
i1
;
}
public
boolean
lteq
(
long
i0
,
long
i1
)
{
int
multiply
(
int
i0
,
int
i1
);
return
i0
<=
i1
;
}
public
boolean
gteq
(
long
i0
,
long
i1
)
{
int
divide
(
int
i0
,
int
i1
);
return
i0
>=
i1
;
}
public
int
plus
(
int
i0
,
int
i1
)
{
int
mod
(
int
i0
,
int
i1
);
return
i0
+
i1
;
}
public
int
minus
(
int
i0
,
int
i1
)
{
long
plus
(
long
i0
,
long
i1
);
return
i0
-
i1
;
}
public
int
multiply
(
int
i0
,
int
i1
)
{
long
minus
(
long
i0
,
long
i1
);
return
i0
*
i1
;
}
public
int
divide
(
int
i0
,
int
i1
)
{
long
multiply
(
long
i0
,
long
i1
);
return
i0
/
i1
;
}
public
int
mod
(
int
i0
,
int
i1
)
{
long
divide
(
long
i0
,
long
i1
);
return
i0
%
i1
;
}
public
long
plus
(
long
i0
,
long
i1
)
{
long
mod
(
long
i0
,
long
i1
);
return
i0
+
i1
;
}
public
long
minus
(
long
i0
,
long
i1
)
{
return
i0
-
i1
;
}
public
long
multiply
(
long
i0
,
long
i1
)
{
return
i0
*
i1
;
}
public
long
divide
(
long
i0
,
long
i1
)
{
return
i0
/
i1
;
}
public
long
mod
(
long
i0
,
long
i1
)
{
return
i0
%
i1
;
}
/**
/**
* @param collection An object that a CollectionDataInstance is mapped to.
* @param collection An object that a CollectionDataInstance is mapped to.
*/
*/
public
int
size
(
Data
<?,
Collection
<?>>
collection
)
{
int
size
(
Data
<?,
?>
collection
);
return
collection
.
getValue
().
size
();
}
}
}
\ No newline at end of file
plugins/org.etsi.mts.tdl.execution.java.runtime/src/org/etsi/mts/tdl/execution/java/tri/Procedure.java
View file @
c345caf4
package
org.etsi.mts.tdl.execution.java.tri
;
package
org.etsi.mts.tdl.execution.java.tri
;
import
java.util.
function.Consumer
;
import
java.util.
List
;
/**
/**
* Encapsulation of procedure signature as specified in TDL model that may
* Encapsulation of procedure signature as specified in TDL model .
* optionally be mapped to a method that implements the calling of the
* procedure.
*/
*/
public
class
Procedure
extends
NamedElement
{
public
interface
Procedure
extends
NamedElement
{
/**
* Get the parameters with <i>ParameterKind::In</i>.
*/
List
<
Parameter
>
getIn
();
/**
* Get the parameters with <i>ParameterKind::Out</i>.
*/
List
<
Parameter
>
getOut
();
/**
/**
* Optional function that implements this procedure call.
* Get the parameters with <i>ParameterKind::Exception</i>.
* <p>
* The function parameters must match the order and types of parameters of the
* procedure call. That is, for each parameter of a procedure call, a method
* parameter must exist such that the procedure call parameter type is mapped to
* the method parameter type (or class).
*/
*/
public
Consumer
<
Object
[]>
func
tion
;
List
<
Parameter
>
getExcep
tion
()
;
}
}
\ No newline at end of file
plugins/org.etsi.mts.tdl.execution.java.runtime/src/org/etsi/mts/tdl/execution/java/tri/ProviderModule.java
View file @
c345caf4
...
@@ -26,11 +26,5 @@ public interface ProviderModule extends com.google.inject.Module {
...
@@ -26,11 +26,5 @@ public interface ProviderModule extends com.google.inject.Module {
@Provides
@Provides
@Singleton
@Singleton
default
PredefinedFunctions
providePredefinedFunctions
(
RuntimeHelper
helper
)
{
PredefinedFunctions
providePredefinedFunctions
();
return
new
PredefinedFunctions
(
helper
);
}
@Provides
@Singleton
RuntimeHelper
provideRuntimeHelper
();
}
}
plugins/org.etsi.mts.tdl.execution.java.runtime/src/org/etsi/mts/tdl/execution/java/tri/RuntimeHelper.java
deleted
100644 → 0
View file @
30ecb3b3
package
org.etsi.mts.tdl.execution.java.tri
;
/**
* Helper functions to provide environment specific implementation for various
* operations.
*/
public
interface
RuntimeHelper
{
/**
* Compare two objects. Can be used to implement deep equals operation for
* {@link Data Data} objects.
*
* @return <code>True</code> if objects are equal.
*/
boolean
equals
(
Object
o0
,
Object
o1
);
/**
* Create a copy of an object. Can be used to implement deep clone of
* {@link Data Data} objects.
*/
<
T
>
T
clone
(
T
object
);
}
plugins/org.etsi.mts.tdl.execution.java.runtime/src/org/etsi/mts/tdl/execution/java/tri/StopException.java
View file @
c345caf4
...
@@ -13,22 +13,19 @@ package org.etsi.mts.tdl.execution.java.tri;
...
@@ -13,22 +13,19 @@ package org.etsi.mts.tdl.execution.java.tri;
*
*
*/
*/
@SuppressWarnings
(
"serial"
)
@SuppressWarnings
(
"serial"
)
public
class
StopException
extends
Exception
{
public
abstract
class
StopException
extends
Exception
{
/**
* Optional final verdict.
*/
private
Verdict
verdict
;
public
StopException
(
String
message
)
{
public
StopException
(
String
message
)
{
super
(
message
);
super
(
message
);
}
}
public
StopException
(
String
message
,
Verdict
verdict
)
{
@Override
super
(
m
essage
);
public
String
getM
essage
()
{
this
.
verdict
=
verdict
;
return
super
.
getMessage
()
;
}
}
public
Verdict
getVerdict
()
{
/**
return
verdict
;
* Optional final verdict.
}
*/
public
abstract
Verdict
getVerdict
();
}
}
plugins/org.etsi.mts.tdl.execution.java.runtime/src/org/etsi/mts/tdl/execution/java/tri/SystemAdapter.java
View file @
c345caf4
...
@@ -101,4 +101,8 @@ public interface SystemAdapter {
...
@@ -101,4 +101,8 @@ public interface SystemAdapter {
*/
*/
void
replyCall
(
Procedure
operation
,
Data
reply
,
Data
exception
,
Connection
connection
);
void
replyCall
(
Procedure
operation
,
Data
reply
,
Data
exception
,
Connection
connection
);
/**
* XXX do we need this?
*/
Data
callFunction
(
NamedElement
function
,
Argument
[]
arguments
);
}
}
plugins/org.etsi.mts.tdl.execution.java.runtime/src/org/etsi/mts/tdl/execution/java/tri/Type.java
View file @
c345caf4
...
@@ -7,7 +7,7 @@ import java.util.List;
...
@@ -7,7 +7,7 @@ import java.util.List;
* Representation of a TDL model element of class <i>DataType</i> and its
* Representation of a TDL model element of class <i>DataType</i> and its
* sub-classes.
* sub-classes.
*/
*/
public
abstract
class
Type
extends
NamedElement
{
public
interface
Type
extends
NamedElement
{
/**
/**
* If this type is a structure.
* If this type is a structure.
...
@@ -15,7 +15,7 @@ public abstract class Type extends NamedElement {
...
@@ -15,7 +15,7 @@ public abstract class Type extends NamedElement {
* @return <b>true</b> if this type represents a <i>StructureDataType</i>
* @return <b>true</b> if this type represents a <i>StructureDataType</i>
* element.
* element.
*/
*/
public
abstract
boolean
isStructure
();
boolean
isStructure
();
/**
/**
* If this type is a collection.
* If this type is a collection.
...
@@ -23,14 +23,14 @@ public abstract class Type extends NamedElement {
...
@@ -23,14 +23,14 @@ public abstract class Type extends NamedElement {
* @return <b>true</b> if this type represents a <i>CollectionDataType</i>
* @return <b>true</b> if this type represents a <i>CollectionDataType</i>
* element.
* element.
*/
*/
public
abstract
boolean
isCollection
();
boolean
isCollection
();
/**
/**
* If this type is an enum.
* If this type is an enum.
*
*
* @return <b>true</b> if this type represents a <i>EnumDataType</i> element.
* @return <b>true</b> if this type represents a <i>EnumDataType</i> element.
*/
*/
public
abstract
boolean
isEnum
();
boolean
isEnum
();
/**
/**
* Get the data mapping chosen for the runtime. The mapping that is chosen is
* Get the data mapping chosen for the runtime. The mapping that is chosen is
...
@@ -39,7 +39,7 @@ public abstract class Type extends NamedElement {
...
@@ -39,7 +39,7 @@ public abstract class Type extends NamedElement {
* @return A <code>Mapping</code> representing a <i>DataElementMapping</i>
* @return A <code>Mapping</code> representing a <i>DataElementMapping</i>
* element.
* element.
*/
*/
public
abstract
Mapping
getMapping
();
Mapping
getMapping
();
/**
/**
* Get the names of members of this structured type. Includes all inherited
* Get the names of members of this structured type. Includes all inherited
...
@@ -48,7 +48,7 @@ public abstract class Type extends NamedElement {
...
@@ -48,7 +48,7 @@ public abstract class Type extends NamedElement {
* @return Collection of names from the <i>Member</i> elements contained or
* @return Collection of names from the <i>Member</i> elements contained or
* inherited in the corresponding <i>StructuredDataType</i> element.
* inherited in the corresponding <i>StructuredDataType</i> element.
*/
*/
public
abstract
Collection
<
String
>
getParameters
();
Collection
<
String
>
getParameters
();
/**
/**
* Get the type of a parameter.
* Get the type of a parameter.
...
@@ -59,7 +59,7 @@ public abstract class Type extends NamedElement {
...
@@ -59,7 +59,7 @@ public abstract class Type extends NamedElement {
* <i>DataType</i> of the <i>Member</i> element corresponding to the
* <i>DataType</i> of the <i>Member</i> element corresponding to the
* parameter.
* parameter.
*/
*/
public
abstract
Type
getParameter
(
String
parameterName
);
Type
getParameter
(
String
parameterName
);
/**
/**
* Get the type of items of this collection type.
* Get the type of items of this collection type.
...
@@ -67,7 +67,7 @@ public abstract class Type extends NamedElement {
...
@@ -67,7 +67,7 @@ public abstract class Type extends NamedElement {
* @return The <code>Type</code> of the items contained in a collection of this
* @return The <code>Type</code> of the items contained in a collection of this
* <code>Type</code>.
* <code>Type</code>.
*/
*/
public
abstract
Type
getItemType
();
Type
getItemType
();
/**
/**
* Get the literal values of this enumerated type.
* Get the literal values of this enumerated type.
...
@@ -76,5 +76,5 @@ public abstract class Type extends NamedElement {
...
@@ -76,5 +76,5 @@ public abstract class Type extends NamedElement {
* <i>SimpleDataInstance</i> elements contained in the corresponding
* <i>SimpleDataInstance</i> elements contained in the corresponding
* <i>EnumDataType</i> element.
* <i>EnumDataType</i> element.
*/
*/
public
abstract
List
<
Data
<
Type
,
Value
>>
getEnumLiterals
();
List
<
Data
<
Type
,
Value
>>
getEnumLiterals
();
}
}
plugins/org.etsi.mts.tdl.execution.java.runtime/src/org/etsi/mts/tdl/execution/java/tri/Value.java
View file @
c345caf4
...
@@ -7,14 +7,14 @@ import java.util.List;
...
@@ -7,14 +7,14 @@ import java.util.List;
* Representation of a TDL model element of class <i>DataInstance</i> or
* Representation of a TDL model element of class <i>DataInstance</i> or
* <i>DataUse</i> and their sub-classes.
* <i>DataUse</i> and their sub-classes.
*/
*/
public
abstract
class
Value
extends
NamedElement
{
public
interface
Value
extends
NamedElement
{
/**
/**
* If this value is a structure.
* If this value is a structure.
*
*
* @return <b>true</b> if the type of this value represents a
* @return <b>true</b> if the type of this value represents a
* <i>StructureDataType</i> element.
* <i>StructureDataType</i> element.
*/
*/
public
abstract
boolean
isStructure
();
boolean
isStructure
();
/**
/**
* If this value is a collection.
* If this value is a collection.
...
@@ -22,7 +22,7 @@ public abstract class Value extends NamedElement {
...
@@ -22,7 +22,7 @@ public abstract class Value extends NamedElement {
* @return <b>true</b> if the type of this value represents a
* @return <b>true</b> if the type of this value represents a
* <i>CollectionDataType</i> element.
* <i>CollectionDataType</i> element.
*/
*/
public
abstract
boolean
isCollection
();
boolean
isCollection
();
/**
/**
* Get the data mapping chosen for the runtime. The mapping that is chosen is
* Get the data mapping chosen for the runtime. The mapping that is chosen is
...
@@ -31,7 +31,7 @@ public abstract class Value extends NamedElement {
...
@@ -31,7 +31,7 @@ public abstract class Value extends NamedElement {
* @return A <code>Mapping</code> representing a <i>DataElementMapping</i>
* @return A <code>Mapping</code> representing a <i>DataElementMapping</i>
* element.
* element.
*/
*/
public
abstract
Mapping
getMapping
();
Mapping
getMapping
();
/**
/**
* Get the primitive or special value of this value object.
* Get the primitive or special value of this value object.
...
@@ -39,7 +39,7 @@ public abstract class Value extends NamedElement {
...
@@ -39,7 +39,7 @@ public abstract class Value extends NamedElement {
* @return A <code>String</code>, a <code>Boolean</code> or any other boxed
* @return A <code>String</code>, a <code>Boolean</code> or any other boxed
* primitive value or an instance of {@link SpecialValue SpecialValue}.
* primitive value or an instance of {@link SpecialValue SpecialValue}.
*/
*/
public
abstract
Object
getValue
();
Object
getValue
();
/**
/**
* Get the names of members of the structured type of this value. Only returns
* Get the names of members of the structured type of this value. Only returns
...
@@ -49,7 +49,7 @@ public abstract class Value extends NamedElement {
...
@@ -49,7 +49,7 @@ public abstract class Value extends NamedElement {
* <i>ParameterBinding</i> elements contained in the corresponding
* <i>ParameterBinding</i> elements contained in the corresponding
* <i>DataInstance</i> or <i>DataUse</i> element.
* <i>DataInstance</i> or <i>DataUse</i> element.
*/
*/
public
abstract
Collection
<
String
>
getParameters
();
Collection
<
String
>
getParameters
();
/**
/**
* Get the value data of a parameter.
* Get the value data of a parameter.
...
@@ -59,7 +59,7 @@ public abstract class Value extends NamedElement {
...
@@ -59,7 +59,7 @@ public abstract class Value extends NamedElement {
* @return The <code>Value</code> of the parameter wrapped in <code>Data</code>
* @return The <code>Value</code> of the parameter wrapped in <code>Data</code>
* object.
* object.
*/
*/
public
abstract
Data
<
Type
,
Value
>
getParameter
(
String
parameterName
);
Data
<
Type
,
Value
>
getParameter
(
String
parameterName
);
/**
/**
* Get the values contained in this collection value.
* Get the values contained in this collection value.
...
@@ -67,5 +67,5 @@ public abstract class Value extends NamedElement {
...
@@ -67,5 +67,5 @@ public abstract class Value extends NamedElement {
* @return The <code>Value</code>s of the items wrapped in <code>Data</code>
* @return The <code>Value</code>s of the items wrapped in <code>Data</code>
* objects.
* objects.
*/
*/
public
abstract
List
<
Data
<
Type
,
Value
>>
getItems
();
List
<
Data
<
Type
,
Value
>>
getItems
();
}
}
Prev
1
2
3
Next