}
}
} catch(Exception e){
+ policyLogger.warn("Error during callTrap" , e);
return "(" + trap + ")";
}
}else{
attrib = getVarbindOID(attrib);
attributes = attributes + "("+ URLEncoder.encode(attrib, "UTF-8")+ ")";
} catch (UnsupportedEncodingException e1) {
- //logger.error("Caused Exception while Encoding Varbind Dictionary Values"+e1);
+ policyLogger.error("Caused Exception while Encoding Varbind Dictionary Values",e1);
}
}
}else{
attrib = getVarbindOID(attrib);
attributes = attributes + "("+ URLEncoder.encode(attrib, "UTF-8")+ ")";
} catch (UnsupportedEncodingException e) {
- //logger.error("Caused Exception while Encoding Varbind Dictionary Values"+e);
+ policyLogger.error("Caused Exception while Encoding Varbind Dictionary Values",e);
}
}
}else{
attrib = getVarbindOID(attrib);
attributes = attributes + "("+ URLEncoder.encode(attrib, "UTF-8") + ")";
} catch (UnsupportedEncodingException e1) {
- //logger.error("Caused Exception while Encoding Varbind Dictionary Values"+e1);
+ policyLogger.error("Caused Exception while Encoding Varbind Dictionary Values",e1);
}
}
}else{
attrib = getVarbindOID(attrib);
attributes = attributes + "("+ URLEncoder.encode(attrib, "UTF-8") + ")";
} catch (UnsupportedEncodingException e) {
- //logger.error("Caused Exception while Encoding Varbind Dictionary Values"+e);
+ policyLogger.error("Caused Exception while Encoding Varbind Dictionary Values",e);
}
}
}
varbindId = (VarbindDictionary) commonclassdao.getEntityItem(VarbindDictionary.class, "varbindName", attrib);
return varbindId.getVarbindOID();
}catch(Exception e){
+ policyLogger.error("Error during retrieving varbindName " + attrib, e);
return attrib;
}
}
try{
description = policy.getDescription().substring(0, policy.getDescription().indexOf("@CreatedBy:"));
}catch(Exception e){
+ policyLogger.error("Error during collecting the description tag info for createClosedLoopFault " + policyNameValue , e);
description = policy.getDescription();
}
policyAdapter.setPolicyDescription(description);
policyAdapter.setGuard(value);
}
if (attributeId.equals("TTLDate") && !value.contains("NA")){
- String newDate = convertDate(value, true);
+ PolicyController controller = new PolicyController();
+ String newDate = controller.convertDate(value);
policyAdapter.setTtlDate(newDate);
}
}
}
- private String convertDate(String dateTTL, boolean portalType) {
- String formateDate = null;
- String[] date;
- String[] parts;
-
- if (portalType){
- parts = dateTTL.split("-");
- formateDate = parts[2] + "-" + parts[1] + "-" + parts[0] + "T05:00:00.000Z";
- } else {
- date = dateTTL.split("T");
- parts = date[0].split("-");
- formateDate = parts[2] + "-" + parts[1] + "-" + parts[0];
- }
- return formateDate;
- }
-
private String readClosedLoopJSONFile(PolicyRestAdapter policyAdapter, PolicyEntity entity) {
ObjectMapper mapper = new ObjectMapper();
try {