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

Release 3.2.51

parent 7f5e9d2c
/*-
* =================================LICENSE_START=================================
* IND2UCE
* %%
* Copyright (C) 2017 Fraunhofer IESE (www.iese.fraunhofer.de)
* %%
* 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.
* See the License for the specific language governing permissions and
* limitations under the License.
* =================================LICENSE_END=================================
*/
package de.fraunhofer.iese.ind2uce.api.policy;
public interface IPolicyValidator {
public boolean validateXMLSchema(String policyString) throws InvalidPolicyException;
boolean checkPolicySolution(Policy p) throws InvalidPolicyException;
}
/*-
* =================================LICENSE_START=================================
* IND2UCE
* %%
* Copyright (C) 2017 Fraunhofer IESE (www.iese.fraunhofer.de)
* %%
* 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.
* See the License for the specific language governing permissions and
* limitations under the License.
* =================================LICENSE_END=================================
*/
package de.fraunhofer.iese.ind2uce.api.policy;
public interface ITimerValidator {
public boolean validateXMLSchema(String timerString) throws InvalidTimerException;
boolean checkTimerSolution(Timer t) throws InvalidTimerException;
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* =================================LICENSE_START================================= * =================================LICENSE_START=================================
* IND2UCE * IND2UCE
* %% * %%
* Copyright (C) 2016 Fraunhofer IESE (www.iese.fraunhofer.de) * Copyright (C) 2017 Fraunhofer IESE (www.iese.fraunhofer.de)
* %% * %%
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -17,43 +17,16 @@ ...@@ -17,43 +17,16 @@
* limitations under the License. * limitations under the License.
* =================================LICENSE_END================================= * =================================LICENSE_END=================================
*/ */
package de.fraunhofer.iese.ind2uce.api.policy;
/** public class InvalidPolicyException extends Exception {
*
*/
package de.fraunhofer.iese.ind2uce.api.common;
/**
* Roles fpr the PMP.
*
* @author Bernd Peltzer-Bartels
*/
public enum Ind2uceRole {
SOLUTION_DEVELOPER("Developer"), ADMINISTRATOR("Admin"), public InvalidPolicyException(String string, Exception e) {
/** super(string, e);
* This role is not stored with user. It' for components, only.
*/
PDP("PDP"), CLIENT("CLIENT");
private final String text;
private Ind2uceRole(final String text) {
this.text = text;
} }
/** public InvalidPolicyException(String string) {
* To spring role. super(string);
*
* @return the string
*/
public String toSpringRole() {
return "ROLE_" + this.name();
} }
@Override
public String toString() {
return this.text;
}
} }
/*-
* =================================LICENSE_START=================================
* IND2UCE
* %%
* Copyright (C) 2017 Fraunhofer IESE (www.iese.fraunhofer.de)
* %%
* 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.
* See the License for the specific language governing permissions and
* limitations under the License.
* =================================LICENSE_END=================================
*/
package de.fraunhofer.iese.ind2uce.api.policy;
public class InvalidTimerException extends Exception {
public InvalidTimerException(String string, Exception e) {
super(string, e);
}
public InvalidTimerException(String string) {
super(string);
}
}
...@@ -151,7 +151,7 @@ public class PipRequest<T> extends Ind2uceEntity implements ParameterListProvide ...@@ -151,7 +151,7 @@ public class PipRequest<T> extends Ind2uceEntity implements ParameterListProvide
return false; return false;
} }
} catch (final NullPointerException e) { } catch (final NullPointerException e) {
String msg = "Param: " + curParam.getName() + " is NOT present."; final String msg = "Param: " + curParam.getName() + " is NOT present.";
LOG.debug(msg); LOG.debug(msg);
LOG.trace(msg, e); LOG.trace(msg, e);
return false; return false;
......
This diff is collapsed.
/*-
* =================================LICENSE_START=================================
* IND2UCE
* %%
* Copyright (C) 2016 Fraunhofer IESE (www.iese.fraunhofer.de)
* %%
* 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.
* See the License for the specific language governing permissions and
* limitations under the License.
* =================================LICENSE_END=================================
*/
package de.fraunhofer.iese.ind2uce.api.policy;
/**
* The Class TimerValidator.
*/
public class TimerValidator implements ITimerValidator {
private static final ITimerValidator TIMER_VALIDATOR_46 = new TimerValidator46();
@Override
public boolean validateXMLSchema(String timer) throws InvalidTimerException {
if (timer == null) {
throw new InvalidTimerException("Timer must not be null");
}
if (timer.contains("http://www.iese.fraunhofer.de/ind2uce/3.2.46/ind2uceLanguageTimer")) {
return TIMER_VALIDATOR_46.validateXMLSchema(timer);
}
throw new InvalidTimerException("Unsupported timer version");
}
@Override
public boolean checkTimerSolution(Timer timer) throws InvalidTimerException {
if (timer == null) {
throw new InvalidTimerException("Timer must not be null");
}
if (timer.getXml().contains("http://www.iese.fraunhofer.de/ind2uce/3.2.46/ind2uceLanguageTimer")) {
return TIMER_VALIDATOR_46.checkTimerSolution(timer);
}
throw new InvalidTimerException("Unsupported timer version");
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment