/** * Create an instance of {@link SecurityWrapper } * */ public SecurityWrapper createSecurityWrapper() { return new SecurityWrapper(); }
protected SecurityWrapper getClassLevelFromDB() { Connection con = Utility.getConfigurationDBConnection(); PreparedStatement com = null; ResultSet rs = null; try { com = con.prepareStatement("select classification, caveat from globalpolicies;"); rs = com.executeQuery(); if (rs.next()) { ClassificationType t = ClassificationType.fromValue(rs.getString(1)); String cav = rs.getString(2); return new SecurityWrapper(t, cav); } else { log.log(Level.ERROR, "unable to determine current classification level, defaulting to UNCLASSIFIED"); return new SecurityWrapper(ClassificationType.U, "None"); } } catch (SQLException ex) { log.log(Level.ERROR, "error determining classification level from config db", ex); log.log(Level.ERROR, "unable to determine current classification level, defaulting to UNCLASSIFIED"); return new SecurityWrapper(ClassificationType.U, "None"); } finally { DBUtils.safeClose(rs); DBUtils.safeClose(com); DBUtils.safeClose(con); } }
public static SecurityWrapper GetClassLevel(boolean pooled) { Connection con = null; SecurityWrapper c = new SecurityWrapper(); if (pooled) { con = Utility.getConfigurationDBConnection(); } else { con = Utility.getConfigurationDB_NONPOOLED_Connection(); } PreparedStatement cmd =null; ResultSet rs = null; try { cmd = con.prepareStatement("select classification,caveat from globalpolicies;"); rs = cmd.executeQuery(); if (rs.next()) { c.setCaveats(rs.getString("caveat")); c.setClassification(ClassificationType.fromValue(rs.getString("classification"))); } } catch (Exception ex) { log.log(Level.WARN,null, ex); } finally { DBUtils.safeClose(rs); DBUtils.safeClose(cmd); DBUtils.safeClose(con); } return c; }
ResultSet results = null; try { SecurityWrapper ret = new SecurityWrapper();
SecurityWrapper wrap = new SecurityWrapper(ClassificationType.fromValue(results.getString("classification")), results.getString("caveat")); ret.setClassification(wrap); comm.execute(); ret.setRecordedMessageCap(1024000); ret.setClassification(new SecurityWrapper(ClassificationType.U, "None")); ret.setAgentsEnabled(true); } catch (SQLException ex) {
ResultSet results = null; PreparedStatement comm = null; SecurityWrapper ret = new SecurityWrapper(); try {
ResultSet results = null; PreparedStatement comm = null; SecurityWrapper ret = new SecurityWrapper(); try {
req.setClassification(new SecurityWrapper(ClassificationType.U, "none")); GetGlobalPolicyResponseMsg servicePolicy = cfg.pcsport.getGlobalPolicy(req); req.setClassification(new SecurityWrapper(ClassificationType.U, "none")); GetGlobalPolicyResponseMsg servicePolicy = cfg.pcsport.getGlobalPolicy(req);
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); comm.execute(); response.getPolicy().setRecordedMessageCap(1024000); response.getPolicy().setClassification(new SecurityWrapper(ClassificationType.U, "")); response.getPolicy().setAgentsEnabled(true); } catch (SQLException ex) {
req.setClassification(new SecurityWrapper(ClassificationType.U, "")); req.setDomainName(domainname); req.setHostname(hostname);