本文整理匯總了Java中com.owera.xaps.dbi.Group類的典型用法代碼示例。如果您正苦於以下問題:Java Group類的具體用法?Java Group怎麽用?Java Group使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Group類屬於com.owera.xaps.dbi包,在下文中一共展示了Group類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: generateFromSyslog
import com.owera.xaps.dbi.Group; //導入依賴的package包/類
public Report<RecordProvisioning> generateFromSyslog(PeriodType periodType, Date start, Date end, List<Unittype> uts, List<Profile> prs, String unitId, Group group)
throws NoAvailableConnectionException, SQLException, IOException {
Map<String, Report<RecordProvisioning>> unitReportMap = generateFromSyslogImpl(periodType, start, end, uts, prs, unitId, group);
Report<RecordProvisioning> endReport = new Report<RecordProvisioning>(RecordProvisioning.class, periodType);
for (Report<RecordProvisioning> report : unitReportMap.values()) {
for (RecordProvisioning record : report.getMap().values()) {
RecordProvisioning endRecord = endReport.getRecord(record.getKey());
if (endRecord == null)
endReport.setRecord(record.getKey(), record);
else
endRecord.add(record);
}
}
return endReport;
}
示例2: generateFromSyslog
import com.owera.xaps.dbi.Group; //導入依賴的package包/類
public Report<RecordVoipCall> generateFromSyslog(PeriodType periodType, Date start, Date end, List<Unittype> uts, List<Profile> prs, String unitId, String line, Group group)
throws NoAvailableConnectionException, SQLException, IOException {
Report<RecordVoipCall> report = new Report<RecordVoipCall>(RecordVoipCall.class, periodType);
logInfo("VoipCallReport", null, uts, prs, start, end);
if (unitId != null)
unitId = "^" + unitId + "$";
List<SyslogEntry> entries = readSyslog(start, end, uts, prs, unitId, line);
Map<String, Unit> unitsInGroup = getUnitsInGroup(group);
for (SyslogEntry entry : entries) {
if (group != null && unitsInGroup.get(entry.getUnitId()) == null)
continue;
addToReport(report, entry, periodType);
}
logger.info(logPrefix + "HardwareReport: Have read " + entries.size() + " rows from syslog, report is now " + report.getMap().size() + " entries");
return report;
}
示例3: getUnitsInGroup
import com.owera.xaps.dbi.Group; //導入依賴的package包/類
public Map<String, Unit> getUnitsInGroup(Group group) throws NoAvailableConnectionException, SQLException {
Map<String, Unit> unitsInGroup = new HashMap<String, Unit>();
if (group != null) {
XAPSUnit xapsUnit = new XAPSUnit(xapsCp, xaps, xaps.getSyslog());
unitsInGroup = xapsUnit.getUnits(group);
}
return unitsInGroup;
}
示例4: generateFromSyslog
import com.owera.xaps.dbi.Group; //導入依賴的package包/類
public Map<String, Report<RecordVoip>> generateFromSyslog(PeriodType periodType, Date start, Date end, List<Unittype> uts, List<Profile> prs, Group group) throws NoAvailableConnectionException,
SQLException, IOException {
logInfo("VoipReport", null, uts, prs, start, end);
Syslog syslog = new Syslog(sysCp, id);
SyslogFilter filter = new SyslogFilter();
filter.setFacility(16); // Only messages from device
filter.setMessage("^QoS|^ua_: reg failed");
filter.setProfiles(prs);
filter.setUnittypes(uts);
filter.setCollectorTmsStart(start);
filter.setCollectorTmsEnd(end);
filter.setFacilityVersion(swVersion);
Map<String, Unit> unitsInGroup = getUnitsInGroup(group);
List<SyslogEntry> entries = syslog.read(filter, xaps);
Map<String, Report<RecordVoip>> unitReportMap = new HashMap<String, Report<RecordVoip>>();
for (SyslogEntry entry : entries) {
if (entry.getUnittypeName() == null || entry.getProfileName() == null)
continue;
if (group != null && unitsInGroup.get(entry.getUnitId()) == null)
continue;
String unitId = entry.getUnitId();
Report<RecordVoip> report = unitReportMap.get(unitId);
if (report == null) {
report = new Report<RecordVoip>(RecordVoip.class, periodType);
unitReportMap.put(unitId, report);
}
Matcher m = qosChannelPattern.matcher(entry.getContent());
String channel = "0";
if (m.matches())
channel = "" + m.group(1);
if (entry.getFacilityVersion() == null || entry.getFacilityVersion().trim().equals(""))
entry.setFacilityVersion("Unknown");
RecordVoip recordTmp = new RecordVoip(entry.getCollectorTimestamp(), periodType, entry.getUnittypeName(), entry.getProfileName(), entry.getFacilityVersion(), channel);
Key key = recordTmp.getKey();
RecordVoip record = report.getRecord(key);
if (record == null)
record = recordTmp;
try {
parseContentAndPopulateRecord(record, entry.getContent(), entry.getCollectorTimestamp());
report.setRecord(key, record);
} catch (SyslogParseException spe) {
// ignore this record
}
}
logger.info(logPrefix + "VoipReport: Have read " + entries.size() + " rows from syslog, " + unitReportMap.size() + " units are mapped");
return unitReportMap;
}
示例5: generateFromSyslog
import com.owera.xaps.dbi.Group; //導入依賴的package包/類
public Map<String, Report<RecordHardware>> generateFromSyslog(PeriodType periodType, Date start, Date end, List<Unittype> uts, List<Profile> prs, Group group)
throws NoAvailableConnectionException, SQLException, IOException {
logInfo("HardwareReport", null, uts, prs, start, end);
Syslog syslog = new Syslog(sysCp, id);
SyslogFilter filter = new SyslogFilter();
filter.setFacility(16); // Only messages from device
filter.setMessage("^Reboot reason|^HW Memory");
filter.setProfiles(prs);
filter.setUnittypes(uts);
filter.setCollectorTmsStart(start);
filter.setCollectorTmsEnd(end);
filter.setFacilityVersion(swVersion);
Map<String, Unit> unitsInGroup = getUnitsInGroup(group);
List<SyslogEntry> entries = syslog.read(filter, xaps);
Map<String, Report<RecordHardware>> unitReportMap = new HashMap<String, Report<RecordHardware>>();
for (SyslogEntry entry : entries) {
String unitId = entry.getUnitId();
if (group != null && unitsInGroup.get(entry.getUnitId()) == null)
continue;
if (unitId == null || unitId.trim().equals(""))
unitId = "Unknown";
String unittypeName = entry.getUnittypeName();
if (unittypeName == null || unittypeName.trim().equals(""))
unittypeName = "Unknown";
String profileName = entry.getProfileName();
if (profileName == null || profileName.trim().equals(""))
profileName = "Unknown";
Report<RecordHardware> report = unitReportMap.get(unitId);
if (report == null) {
report = new Report<RecordHardware>(RecordHardware.class, periodType);
unitReportMap.put(unitId, report);
}
if (entry.getFacilityVersion() == null || entry.getFacilityVersion().trim().equals(""))
entry.setFacilityVersion("Unknown");
RecordHardware recordTmp = new RecordHardware(entry.getCollectorTimestamp(), periodType, unittypeName, profileName, entry.getFacilityVersion());
Key key = recordTmp.getKey();
RecordHardware record = report.getRecord(key);
if (record == null)
record = recordTmp;
try {
parseContentAndPopulateRecord(record, entry.getContent(), entry.getCollectorTimestamp());
report.setRecord(key, record);
} catch (SyslogParseException spe) {
// ignore this record
}
}
logger.info(logPrefix + "HardwareReport: Have read " + entries.size() + " rows from syslog, " + unitReportMap.size() + " units are mapped");
return unitReportMap;
}
示例6: generateGroupReport
import com.owera.xaps.dbi.Group; //導入依賴的package包/類
public Report<RecordGroup> generateGroupReport(PeriodType periodType, Date start, Date end, List<Unittype> uts, Group g) throws NoAvailableConnectionException, SQLException, IOException {
Connection xapsConnection = null;
Connection sysConnection = null;
PreparedStatement ps = null;
ResultSet rs = null;
SQLException sqle = null;
try {
Report<RecordGroup> report = new Report<RecordGroup>(RecordGroup.class, periodType);
xapsConnection = ConnectionProvider.getConnection(xapsCp, true);
logger.info(logPrefix + "Reads from report_group table from " + start + " to " + end);
DynamicStatement ds = selectReportSQL("report_group", periodType, start, end, uts, null);
if (g != null) {
ds.addSqlAndArguments(" and group_name = ?", g.getName());
}
ps = ds.makePreparedStatement(xapsConnection);
rs = ps.executeQuery();
int counter = 0;
while (rs.next()) {
counter++;
start = rs.getTimestamp("timestamp_");
String unittypeName = rs.getString("unit_type_name");
String groupName = rs.getString("group_name");
RecordGroup recordTmp = new RecordGroup(start, periodType, unittypeName, groupName);
Key key = recordTmp.getKey();
RecordGroup record = report.getRecord(key);
if (record == null)
record = recordTmp;
record.getUnitCount().set(rs.getInt("unit_count"));
report.setRecord(key, record);
}
logger.info(logPrefix + "Have read " + counter + " rows, last tms was " + start + ", report is now " + report.getMap().size() + " entries");
return report;
} catch (SQLException sqlex) {
sqle = sqlex;
throw sqlex;
} finally {
if (rs != null)
rs.close();
if (ps != null)
ps.close();
if (xapsConnection != null)
ConnectionProvider.returnConnection(xapsConnection, sqle);
if (sysConnection != null)
ConnectionProvider.returnConnection(sysConnection, sqle);
}
}
示例7: getGroup
import com.owera.xaps.dbi.Group; //導入依賴的package包/類
public Group getGroup() {
return group;
}
示例8: setGroup
import com.owera.xaps.dbi.Group; //導入依賴的package包/類
public void setGroup(Group group) {
this.group = group;
}