/** * Create an instance of {@link GetGlobalPolicyResponseMsg } * */ public GetGlobalPolicyResponseMsg createGetGlobalPolicyResponseMsg() { return new GetGlobalPolicyResponseMsg(); }
ResultSet results = null; boolean foundPolicy = false; GetGlobalPolicyResponseMsg response = new GetGlobalPolicyResponseMsg(); try { response.setPolicy(new GlobalPolicy()); response.getPolicy().setPolicyRefreshRate(df.newDuration(results.getLong("PolicyRefreshRate"))); response.getPolicy().setRecordedMessageCap(results.getInt("RecordedMessageCap")); SecurityWrapper wrap = new SecurityWrapper(ClassificationType.fromValue(results.getString("classification")), results.getString("caveat")); response.setClassification(wrap); response.getPolicy().setAgentsEnabled(results.getBoolean("agentsenable")); foundPolicy = true; comm.setString(4, ""); comm.execute(); response.getPolicy().setRecordedMessageCap(1024000); response.getPolicy().setClassification(new SecurityWrapper(ClassificationType.U, "")); response.getPolicy().setAgentsEnabled(true); } catch (SQLException ex) { log.log(Level.ERROR, "error setting global policy", ex); if (d != null && d.getKeyNameValue() != null) { try { response.getPolicy().setUDDIPublishRate(df.newDuration(Long.parseLong(d.getKeyNameValue().getPropertyValue()))); } catch (Exception ex) { response.getPolicy().setUDDIPublishRate(df.newDuration(30 * 60 * 100));
public static SecurityWrapper GetCurrentSecurityLevel(ProxyLoader pl, ServletContext app, HttpServletRequest request, HttpServletResponse response) throws Exception { if (pl == null) { pl = ProxyLoader.getInstance(app); } PCS pcs = pl.GetPCS(app, request, response); GetGlobalPolicyResponseMsg globalPolicy = pcs.getGlobalPolicy(new GetGlobalPolicyRequestMsg()); return globalPolicy.getClassification(); }
private SecurityWrapper getCurrentOperatingClassificationLevel() { try { SecurityWrapper t = getGlobalPolicyFromDB().getClassification(); log.log(Level.INFO, "PCS, current security classification is " + Utility.ICMClassificationToString(t.getClassification()) + " " + t.getCaveats()); return t; } catch (Exception ex) { log.log(Level.ERROR, "Unable to determine current classification level. Is the database available?", ex); } throw new IllegalAccessError(); }