Commit fbb2a21c authored by Raj Shah's avatar Raj Shah
Browse files

Release 3.2.51

parent 7f5e9d2c
......@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
......@@ -75,11 +75,6 @@ public class AndroidLogger implements Logger {
*/
private static final int OFF_LEVEL = Integer.MAX_VALUE;
/**
* The Constant PLACEHOLDER.
*/
private static final String PLACEHOLDER = "\\{\\}";
/**
* The name.
*/
......@@ -88,7 +83,7 @@ public class AndroidLogger implements Logger {
/**
* The android logger.
*/
private Class<?> androidLogger;
private Class<?> androidLoggerClass;
/**
* The trace.
......@@ -130,15 +125,15 @@ public class AndroidLogger implements Logger {
this.name = name;
this.logLevel = logLevel;
try {
this.androidLogger = Class.forName("android.util.Log");
this.trace = this.androidLogger.getMethod("v", String.class, String.class);
this.debug = this.androidLogger.getMethod("d", String.class, String.class);
this.info = this.androidLogger.getMethod("i", String.class, String.class);
this.warn = this.androidLogger.getMethod("w", String.class, String.class);
this.error = this.androidLogger.getMethod("e", String.class, String.class);
this.androidLoggerClass = Class.forName("android.util.Log");
this.trace = this.androidLoggerClass.getMethod("v", String.class, String.class);
this.debug = this.androidLoggerClass.getMethod("d", String.class, String.class);
this.info = this.androidLoggerClass.getMethod("i", String.class, String.class);
this.warn = this.androidLoggerClass.getMethod("w", String.class, String.class);
this.error = this.androidLoggerClass.getMethod("e", String.class, String.class);
} catch (ClassNotFoundException | NoSuchMethodException | SecurityException | IllegalArgumentException e) {
System.err.println("androidLoggerClass not found!");
e.printStackTrace();
System.err.println("androidLoggerClass not found!"); // NOSONAR
e.printStackTrace();// NOSONAR
}
}
......@@ -149,11 +144,7 @@ public class AndroidLogger implements Logger {
* @return true, if successful
*/
private boolean checkLogLevel(LogLevel logLevel) {
if (this.getLogLevelValue(this.logLevel) <= this.getLogLevelValue(logLevel)) {
return true;
} else {
return false;
}
return (this.getLogLevelValue(this.logLevel) <= this.getLogLevelValue(logLevel));
}
/*
......@@ -165,7 +156,7 @@ public class AndroidLogger implements Logger {
try {
this.debug.invoke(null, this.shortenName(this.name), msg);
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
e.printStackTrace();
e.printStackTrace();// NOSONAR
}
}
......@@ -221,7 +212,7 @@ public class AndroidLogger implements Logger {
this.debug.invoke(null, this.shortenName(this.name), msg);
}
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
e.printStackTrace();
e.printStackTrace();// NOSONAR
}
}
......@@ -271,7 +262,7 @@ public class AndroidLogger implements Logger {
try {
this.error.invoke(null, this.shortenName(this.name), msg);
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
e.printStackTrace();
e.printStackTrace();// NOSONAR
}
}
......@@ -327,7 +318,7 @@ public class AndroidLogger implements Logger {
this.error.invoke(null, this.shortenName(this.name), msg);
}
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
e.printStackTrace();
e.printStackTrace();// NOSONAR
}
}
......@@ -420,7 +411,7 @@ public class AndroidLogger implements Logger {
try {
this.info.invoke(null, this.shortenName(this.name), msg);
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
e.printStackTrace();
e.printStackTrace();// NOSONAR
}
}
......@@ -476,7 +467,7 @@ public class AndroidLogger implements Logger {
this.info.invoke(null, this.shortenName(this.name), msg);
}
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
e.printStackTrace();
e.printStackTrace();// NOSONAR
}
}
......@@ -652,7 +643,7 @@ public class AndroidLogger implements Logger {
try {
this.trace.invoke(null, this.shortenName(this.name), msg);
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
e.printStackTrace();
e.printStackTrace();// NOSONAR
}
}
......@@ -708,7 +699,7 @@ public class AndroidLogger implements Logger {
this.trace.invoke(null, this.shortenName(this.name), msg);
}
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
e.printStackTrace();
e.printStackTrace();// NOSONAR
}
}
......@@ -758,7 +749,7 @@ public class AndroidLogger implements Logger {
try {
this.warn.invoke(null, this.shortenName(this.name), msg);
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
e.printStackTrace();
e.printStackTrace();// NOSONAR
}
}
......@@ -814,7 +805,7 @@ public class AndroidLogger implements Logger {
this.warn.invoke(null, this.shortenName(this.name), msg);
}
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
e.printStackTrace();
e.printStackTrace();// NOSONAR
}
}
......
......@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
......@@ -88,7 +88,7 @@ public class LoggerFactory {
/**
* The used logger.
*/
public static LoggerFramework usedLogger = LoggerFramework.LOGBACK;
private static LoggerFramework usedLogger = LoggerFramework.LOGBACK;
/**
* The current log level.
......@@ -127,7 +127,7 @@ public class LoggerFactory {
}
} catch (ClassNotFoundException | NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
e.printStackTrace();
e.printStackTrace();// NOSONAR
}
try {
......@@ -138,7 +138,7 @@ public class LoggerFactory {
return androidLogger;
} catch (ClassNotFoundException | SecurityException | IllegalArgumentException e) {
// do nothing on purpose
e.printStackTrace();
e.printStackTrace();// NOSONAR
}
LoggerFactory.usedLogger = LoggerFramework.STDOUT;
......@@ -193,11 +193,11 @@ public class LoggerFactory {
break;
}
} catch (ClassNotFoundException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) {
e.printStackTrace();
e.printStackTrace();// NOSONAR
return false;
}
} else {
System.err.println("LoggerFramework not supported");
System.err.println("LoggerFramework not supported");// NOSONAR
return false;
}
return true;
......
......@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
......@@ -463,7 +463,7 @@ public class SysoutLogger implements Logger {
public void log(LogLevel level, String msg) {
final DateFormat dateFormat = new SimpleDateFormat("dd.MM.YYYY HH:mm:ss");
final Date date = new Date();
System.out.println("[" + dateFormat.format(date) + "][" + this.name + "][" + String.format("%5s", level) + "] " + msg);
System.out.println("[" + dateFormat.format(date) + "][" + this.name + "][" + String.format("%5s", level) + "] " + msg);// NOSONAR
}
/**
......
<policy xmlns="http://www.iese.fhg.de/ind2uce/1.0/enforcementLanguage"
xmlns:tns="http://www.iese.fhg.de/ind2uce/1.0/enforcementLanguage"
xmlns:a="http://www.iese.fhg.de/ind2uce/1.0/action" xmlns:e="http://www.iese.fhg.de/ind2uce/1.0/event"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.iese.fhg.de/ind2uce/1.0/enforcementLanguage
enforcementLanguage-FhG.xsd http://www.iese.fhg.de/ind2uce/1.0/action action-FhG.xsd http://www.iese.fhg.de/ind2uce/1.0/event
event-FhG.xsd http://www.master-fp7.eu/mcalculus.xsd mcalculus.xsd"
description="description" name="FireAlarm">
<preventiveMechanism name="ACPfire_23115018">
<timestep amount="3" unit="SECONDS" />
<trigger action="SmartIntegoMessage" isTry="false">
<paramMatch name="msgType" value="14" />
</trigger>
<condition>
<within amount="7" unit="SECONDS">
<eventMatch action="EnoceanTelegram" >
<paramMatch name="RadioTelegram" value="true" />
<paramMatch name="RPS" value="true" />
<paramMatch name="RORG" value="f6" />
<paramMatch name="ID" value="180080e" />
<paramMatch name="data" value="30" />
</eventMatch>
</within>
</condition>
<authorizationAction name="default">
<allow>
<executeAction name="SmartIntegoAction">
<parameter name="action" value="ShortTermActivation" />
<parameter name="duration" value="1" />
</executeAction>
</allow>
</authorizationAction>
</preventiveMechanism>
<preventiveMechanism name="Enocean_20395081">
<timestep amount="30000" unit="SECONDS" />
<trigger action="EnoceanTelegram" isTry="false">
<paramMatch name="RadioTelegram" value="true" />
<paramMatch name="RPS" value="true" />
<paramMatch name="RORG" value="f6" />
<paramMatch name="ID" value="180080e" />
<paramMatch name="data" value="30" />
</trigger>
<condition>
<true />
</condition>
<authorizationAction name="default">
<allow>
<executeAction name="EnoceanAction">
<parameter name="action" value="ToggleSwitch" />
<parameter name="destination" value="0x01038be3" />
<parameter name="switchOn" value="true" />
</executeAction>
<executeAction name="NestAlarmSender">
<parameter name="type" value="fire" />
</executeAction>
</allow>
</authorizationAction>
</preventiveMechanism>
<detectiveMechanism name="EnoceanDeactivate_59495885">
<timestep amount="3" unit="SECONDS" />
<condition>
<before amount="8" unit="MINUTES">
<eventMatch action="EnoceanTelegram" >
<paramMatch name="RadioTelegram" value="true" />
<paramMatch name="RPS" value="true" />
<paramMatch name="RORG" value="f6" />
<paramMatch name="ID" value="180080e" />
<paramMatch name="data" value="30" />
</eventMatch>
</before>
</condition>
<executeAction name="EnoceanAction">
<parameter name="action" value="ToggleSwitch" />
<parameter name="destination" value="0x01038be3" />
<parameter name="switchOn" value="false" />
</executeAction>
</detectiveMechanism>
</policy>
\ No newline at end of file
<policy id="urn:policy:b0:FireAlarm" name="FireAlarm"
description=""
xmlns="http://www.iese.fraunhofer.de/ind2uce/3.2.46/ind2uceLanguage"
xmlns:tns="http://www.iese.fraunhofer.de/ind2uce/3.2.46/ind2uceLanguage"
xmlns:parameter="http://www.iese.fraunhofer.de/ind2uce/3.2.46/parameter"
xmlns:pip="http://www.iese.fraunhofer.de/ind2uce/3.2.46/pip"
xmlns:function="http://www.iese.fraunhofer.de/ind2uce/3.2.46/function"
xmlns:event="http://www.iese.fraunhofer.de/ind2uce/3.2.46/event"
xmlns:constant="http://www.iese.fraunhofer.de/ind2uce/3.2.46/constant"
xmlns:variable="http://www.iese.fraunhofer.de/ind2uce/3.2.46/variable"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- <timer cron="*/3 * * * * *"> -->
<!-- <fireEvent action="urn:action:b0:blubb" /> -->
<!-- </timer> -->
<mechanism event="urn:action:b0:SmartIntegoMessage">
<if>
<and>
<equals>
<event:number eventParameter="msgType" default="0" />
<constant:number value="14" />
</equals>
<greaterEqual>
<count>
<eventOccurrence event="urn:action:b0:EnoceanTelegram">
<parameter:boolean name="RadioTelegram" value="true" />
<parameter:boolean name="RPS" value="true" />
<parameter:string name="RORG" value="f6" />
<parameter:string name="ID" value="180080e" />
<parameter:string name="data" value="30" />
</eventOccurrence>
<start time="*.*.* *:*:-7" />
</count>
<constant:number value="1" />
</greaterEqual>
</and>
<then>
<execute action="urn:action:b0:SmartIntegoAction">
<parameter:string name="action" value="ShortTermActivation" />
<parameter:number name="duration" value="1" />
</execute>
</then>
</if>
</mechanism>
<mechanism event="urn:action:b0:EnoceanTelegram">
<if>
<and>
<event:boolean eventParameter="RadioTelegram" default="false" />
<event:boolean eventParameter="RPS" default="false" />
<equals>
<event:string eventParameter="RORG" default="" />
<constant:string value="f6" />
</equals>
<equals>
<event:string eventParameter="ID" default="" />
<constant:string value="180080e" />
</equals>
<equals>
<event:string eventParameter="data" default="" />
<constant:string value="30" />
</equals>
</and>
<then>
<execute action="urn:action:b0:EnoceanAction">
<parameter:string name="action" value="ToggleSwitch" />
<parameter:string name="destination" value="0x01038be3" />
<parameter:string name="switchOn" value="true" />
</execute>
<execute action="urn:action:b0:NestAlarmSender">
<parameter:string name="type" value="fire" />
</execute>
</then>
</if>
</mechanism>
<mechanism event="urn:action:b0:blubb">
<if>
<greaterEqual>
<count>
<eventOccurrence event="urn:action:b0:EnoceanTelegram">
<parameter:boolean name="RadioTelegram" value="true" />
<parameter:boolean name="RPS" value="true" />
<parameter:string name="RORG" value="f6" />
<parameter:string name="ID" value="180080e" />
<parameter:string name="data" value="30" />
</eventOccurrence>
<start time="*.*.* *:-8:*" />
<end time="*.*.* *:-8:*" />
</count>
<constant:number value="1" />
</greaterEqual>
<then>
<execute action="urn:action:b0:EnoceanAction">
<parameter:string name="action" value="ToggleSwitch" />
<parameter:string name="destination" value="0x01038be3" />
<parameter:boolean name="switchOn" value="false" />
</execute>
</then>
</if>
</mechanism>
</policy>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.iese.fraunhofer.de/ind2uce/3.2.46/constant" xmlns:tns="http://www.iese.fraunhofer.de/ind2uce/3.2.46/constant"
elementFormDefault="qualified">
<complexType name="ConstantStringType">
<attribute name="value" type="string" use="required" />
</complexType>
<complexType name="ConstantNumberType">
<attribute name="value" type="double" use="required" />
</complexType>
<complexType name="ConstantListType">
<attribute name="value" use="required">
<simpleType>
<restriction base="string">
<!-- comma seperated array, e.g., [1,2.0,'adf'] String in '', floating point with x.y -->
<pattern value="\[([0-9](\.([0-9])+){0,1}|&quot;[A-Za-z0-9()+,-.=@;$_!*]*&quot;)(\s*,\s*([0-9](\.([0-9])+){0,1}|&quot;[A-Za-z0-9()+,-.=@;$_!*]*&quot;)+)*\]|\[\]"></pattern>
</restriction>
</simpleType>
</attribute>
</complexType>
<element name="string" type="tns:ConstantStringType" />
<element name="number" type="tns:ConstantNumberType" />
<element name="object" type="tns:ConstantStringType" />
<element name="list" type="tns:ConstantListType" />
<element name="true" />
<element name="false" />
<group name="ConstantGroup">
<choice>
<element ref="tns:string" />
<element ref="tns:number" />
<element ref="tns:object" />
<element ref="tns:list" />
<element ref="tns:true" />
<element ref="tns:false" />
</choice>
</group>
</schema>
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.iese.fraunhofer.de/ind2uce/3.2.46/event" xmlns:tns="http://www.iese.fraunhofer.de/ind2uce/3.2.46/event"
elementFormDefault="qualified">
<complexType name="EventStringType">
<attribute name="eventParameter" type="string" use="required" />
<attribute name="default" type="string" use="required" />
<attribute name="jsonPathQuery" type="string" use="optional" />
</complexType>
<complexType name="EventBoolType">
<attribute name="eventParameter" type="string" use="required" />
<attribute name="default" type="boolean" use="required" />
<attribute name="jsonPathQuery" type="string" use="optional" />
</complexType>
<complexType name="EventNumberType">
<attribute name="eventParameter" type="string" use="required" />
<attribute name="default" type="double" use="required" />
<attribute name="jsonPathQuery" type="string" use="optional" />
</complexType>
<complexType name="EventObjectType">
<attribute name="eventParameter" type="string" use="required" />
<attribute name="default" type="string" use="required" />
<attribute name="jsonPathQuery" type="string" use="optional" />
</complexType>
<complexType name="EventListType">
<attribute name="eventParameter" type="string" use="required" />
<attribute name="default" use="required">
<simpleType>
<restriction base="string">
<!-- comma seperated array, e.g., [1,2.0,'adf'] String in '', floating point with x.y -->
<pattern value="\[([0-9](\.([0-9])+){0,1}|&quot;[A-Za-z0-9()+,-.=@;$_!*]*&quot;)(\s*,\s*([0-9](\.([0-9])+){0,1}|&quot;[A-Za-z0-9()+,-.=@;$_!*]*&quot;)+)*\]|\[\]"></pattern>
</restriction>
</simpleType>
</attribute>
<attribute name="jsonPathQuery" type="string" use="optional" />
</complexType>
<element name="string" type="tns:EventStringType" />
<element name="boolean" type="tns:EventBoolType" />
<element name="number" type="tns:EventNumberType" />
<element name="object" type="tns:EventObjectType" />
<element name="list" type="tns:EventListType" />
<group name="eventGroup">
<choice>
<element ref="tns:string" />
<element ref="tns:number" />
<element ref="tns:boolean" />
<element ref="tns:object" />
<element ref="tns:list" />
</choice>
</group>
</schema>
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.iese.fraunhofer.de/ind2uce/3.2.46/ind2uceLanguage" xmlns:tns="http://www.iese.fraunhofer.de/ind2uce/3.2.46/ind2uceLanguage"
xmlns:parameter="http://www.iese.fraunhofer.de/ind2uce/3.2.46/parameter" xmlns:constant="http://www.iese.fraunhofer.de/ind2uce/3.2.46/constant" xmlns:event="http://www.iese.fraunhofer.de/ind2uce/3.2.46/event"
xmlns:pip="http://www.iese.fraunhofer.de/ind2uce/3.2.46/pip" xmlns:variable="http://www.iese.fraunhofer.de/ind2uce/3.2.46/variable" xmlns:variableDeclaration="http://www.iese.fraunhofer.de/ind2uce/3.2.46/variableDeclaration"
elementFormDefault="qualified">
<import namespace="http://www.iese.fraunhofer.de/ind2uce/3.2.46/parameter" schemaLocation="ind2uceParameter.xsd" />
<import namespace="http://www.iese.fraunhofer.de/ind2uce/3.2.46/constant" schemaLocation="ind2uceConstant.xsd" />
<import namespace="http://www.iese.fraunhofer.de/ind2uce/3.2.46/event" schemaLocation="ind2uceEvent.xsd" />
<import namespace="http://www.iese.fraunhofer.de/ind2uce/3.2.46/pip" schemaLocation="ind2ucePIP.xsd" />
<import namespace="http://www.iese.fraunhofer.de/ind2uce/3.2.46/variable" schemaLocation="ind2uceVariable.xsd" />
<import namespace="http://www.iese.fraunhofer.de/ind2uce/3.2.46/variableDeclaration" schemaLocation="ind2uceVariableDeclaration.xsd" />
<!-- Groups -->
<group name="FunctionGroup">
<choice>
<group ref="tns:BooleanFunctionGroup" />
<group ref="tns:NumberFunctionGroup" />
<group ref="tns:StringFunctionGroup" />
</choice>
</group>
<group name="BooleanFunctionGroup">
<choice>
<element name="less" type="tns:FunctionNumberType" />
<element name="lessEqual" type="tns:FunctionNumberType" />
<element name="greater" type="tns:FunctionNumberType" />
<element name="greaterEqual" type="tns:FunctionNumberType" />
<element name="equals" type="tns:FunctionEqualsType" />
<element name="eventHasParameter" type="tns:FunctionEventHasParameterType" />
<element name="regex" type="tns:FunctionRegexType" />
<element name="contains" type="tns:FunctionContainsType" />
<element name="and" type="tns:FunctionAndType" />
<element name="or" type="tns:FunctionOrType" />
<element name="not" type="tns:FunctionNotType" />
<element name="xor" type="tns:FunctionXorType" />
<element name="implies" type="tns:FunctionImpliesType" />
<element name="valueChanged" type="tns:FunctionValueChangedType" />
<element name="valueUnchanged" type="tns:FunctionValueUnchangedType" />
<element name="execute" type="tns:FunctionExecuteType" />
<element name="continuousOccurrence" type="tns:FunctionContinuousOccurrenceType" />
</choice>
</group>
<group name="NumberFunctionGroup">
<choice>
<element name="size" type="tns:FunctionSizeType" />
<element name="plus" type="tns:FunctionNumberType" />
<element name="minus" type="tns:FunctionNumberType" />
<element name="multiply" type="tns:FunctionNumberType" />
<element name="divide" type="tns:FunctionNumberType" />
<element name="count" type="tns:FunctionCountType" />
</choice>
</group>
<group name="StringFunctionGroup">
<choice>
<element name="concat" type="tns:FunctionConcatType" />
</choice>
</group>
<group name="StringGroup">
<choice>
<group ref="event:eventGroup" />
<group ref="pip:pipGroup" />
<group ref="tns:FunctionGroup" />
<group ref="constant:ConstantGroup" />
<group ref="variable:ReferenceVariableGroup" />
</choice>
</group>
<group name="BooleanGroup">
<choice>
<element ref="constant:true" />
<element ref="constant:false" />
<element ref="pip:boolean" />
<element ref="event:boolean" />
<element ref="variable:boolean" />