* ============LICENSE_START=======================================================
* ONAP-XACML
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import javax.persistence.Persistence;
import javax.persistence.Query;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.eclipse.persistence.config.PersistenceUnitProperties;
+import org.onap.policy.common.logging.flexlogger.FlexLogger;
+import org.onap.policy.common.logging.flexlogger.Logger;
import com.att.research.xacml.api.Attribute;
import com.att.research.xacml.api.AttributeValue;
public static final String DEFAULT_DESCRIPTION = "PIP for retrieving Operations History from DB";
public static final String DEFAULT_ISSUER = "org:onap:xacml:guard:historydb";
- private static final Log LOGGER= LogFactory.getLog(OperationHistoryEngine.class);
+ private static final Logger LOGGER= FlexLogger.getLogger(OperationHistoryEngine.class);
private static final PIPRequest PIP_REQUEST_ACTOR = new StdPIPRequest(
XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,
XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,
new IdentifierImpl("target"),
XACML.ID_DATATYPE_STRING);
+
+ public OperationHistoryEngine() {
+ super();
+ }
private void addIntegerAttribute(StdMutablePIPResponse stdPIPResponse, Identifier category, Identifier attributeId, int value, PIPRequest pipRequest) {
AttributeValue<BigInteger> attributeValue = null;
}
}
- public OperationHistoryEngine() {
- super();
- }
-
@Override
public Collection<PIPRequest> attributesRequired() {
return new ArrayList<>();
// Validating Time Units to prevent SQL Injection.
private static boolean validTimeUnits(String timeUnits) {
- return (timeUnits.equalsIgnoreCase("minute") || timeUnits.equalsIgnoreCase("hour") || timeUnits.equalsIgnoreCase("day")
- || timeUnits.equalsIgnoreCase("week") || timeUnits.equalsIgnoreCase("month")||timeUnits.equalsIgnoreCase("year"))?
+ return ("minute".equalsIgnoreCase(timeUnits) || "hour".equalsIgnoreCase(timeUnits) || "day".equalsIgnoreCase(timeUnits)
+ || "week".equalsIgnoreCase(timeUnits) || "month".equalsIgnoreCase(timeUnits)|| "year".equalsIgnoreCase(timeUnits))?
true: false;
}
}