本文整理了Java中org.wso2.carbon.bam.common.dataobjects.dimensions.YearDimension
类的一些代码示例,展示了YearDimension
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YearDimension
类的具体详情如下:
包路径:org.wso2.carbon.bam.common.dataobjects.dimensions.YearDimension
类名称:YearDimension
暂无
代码示例来源:origin: org.wso2.carbon/org.wso2.carbon.bam.common
public YearDimension getYearDimensionFromId(int yearId) throws BAMException {
YearDimension yd = null;
try {
YearDim[] ydArr = summaryGenerationDSStub.getYearDimFromId(yearId);
if (ydArr != null && ydArr[0] != null) {
yd = new YearDimension();
populateYearDimension(yd, ydArr[0]);
}
} catch (Exception e) {
throw new BAMException("getYearDimFromId failed", e);
}
return yd;
}
代码示例来源:origin: org.wso2.carbon/org.wso2.carbon.bam.common
private void populateYearDimension(YearDimension yd, YearDim tyd) {
yd.setId(Integer.parseInt(tyd.getBamId()));
yd.setYear(Integer.parseInt(tyd.getYearNo()));
yd.setStartTimestamp(tyd.getStartTime());
}
代码示例来源:origin: org.wso2.carbon/org.wso2.carbon.bam.core
protected void summarizeYearly(BAMCalendar loYear, BAMCalendar hiYear) {
try {
SummaryPersistenceManager spm = SummaryPersistenceManager.getInstance();
YearDimension md = spm.getYearDimension(loYear);
if (md == null) {
spm.addYearDimension(loYear);
md = spm.getYearDimension(loYear);
}
SummaryStatistic stat = spm.getServerStatYearlySummary(this.getServer().getId(), loYear, hiYear);
if (stat != null) {
stat.setTypeId(this.getServer().getId());
stat.setTimeDimensionId(md.getId());
SummaryPersistenceManager.getInstance().addServerStatYearlySummary(stat);
}
} catch (BAMException e) {
if (log.isErrorEnabled()) {
log.error("Error while running yearly summary generator for server: " + this.getServer().getServerURL(), e);
}
}
}
代码示例来源:origin: org.wso2.carbon/org.wso2.carbon.bam.core
public QuarterDimension getQuarterDimension(Calendar quater) throws BAMException {
SummaryDimensionDSClient summaryDimension = null;
try {
summaryDimension = BAMUtil.getSummaryDimensionDSClient();
BAMCalendar bamQuater = BAMCalendar.getInstance(quater);
YearDimension yd = getYearDimension(quater);
if (yd == null)
return null;
return summaryDimension.getQuarterDimension(bamQuater.get(BAMCalendar.QUATER), yd.getId());
} catch (Exception e) {
throw new BAMException("Retrieving quarter dimension failed for timestamp "
+ BAMCalendar.getInstance(quater).getBAMTimestamp(), e);
} finally {
if (summaryDimension != null) {
summaryDimension.cleanup();
}
}
}
代码示例来源:origin: org.wso2.carbon/org.wso2.carbon.bam.core
protected void summarizeYearly(BAMCalendar loYear, BAMCalendar hiYear) {
try {
SummaryPersistenceManager spm = SummaryPersistenceManager.getInstance();
YearDimension qd = spm.getYearDimension(loYear);
if (qd == null) {
spm.addYearDimension(loYear);
qd = spm.getYearDimension(loYear);
}
SummaryStatistic stat = spm.getServiceStatYearlySummary(this.getService().getId(), loYear, hiYear);
if (stat != null) {
stat.setTypeId(this.getService().getId());
stat.setTimeDimensionId(qd.getId());
SummaryPersistenceManager.getInstance().addServiceStatYearlySummary(stat);
}
} catch (BAMException e) {
if (log.isErrorEnabled()) {
log.error("Error while running yearly summary generator for service: " + getService().getName()
+ " of server: " + getServer().getServerURL(), e);
}
}
}
代码示例来源:origin: org.wso2.carbon/org.wso2.carbon.bam.common
public YearDimension getYearDimension(int year) throws BAMException {
YearDimension yd = null;
try {
YearDim[] ydArr = summaryGenerationDSStub.getYearDim(year);
if (ydArr != null && ydArr[0] != null) {
yd = new YearDimension();
populateYearDimension(yd, ydArr[0]);
}
} catch (Exception e) {
throw new BAMException("getYearDim failed", e);
}
return yd;
}
代码示例来源:origin: org.wso2.carbon/org.wso2.carbon.bam.core
protected void summarizeYearly(BAMCalendar loYear, BAMCalendar hiYear) {
try {
SummaryPersistenceManager spm = SummaryPersistenceManager.getInstance();
YearDimension qd = spm.getYearDimension(loYear);
if (qd == null) {
spm.addYearDimension(loYear);
qd = spm.getYearDimension(loYear);
}
SummaryStatistic stat = spm.getOperationStatYearlySummary(this.getOperation().getOperationID(), loYear, hiYear);
if (stat != null) {
stat.setTypeId(this.getOperation().getOperationID());
stat.setTimeDimensionId(qd.getId());
SummaryPersistenceManager.getInstance().addOperationStatYearlySummary(stat);
}
} catch (BAMException e) {
if (log.isErrorEnabled()) {
log.error("Error while running yearly summary generator for operation: " + getOperation().getName()
+ " of service: " + getService().getName() + " of server: " + getServer().getServerURL(), e);
}
}
}
代码示例来源:origin: org.wso2.carbon/org.wso2.carbon.bam.core
public void addQuarterDimension(BAMCalendar startTime) throws BAMException {
SummaryDimensionDSClient summaryDimension = null;
try {
summaryDimension = BAMUtil.getSummaryDimensionDSClient();
YearDimension yd = this.getYearDimension(startTime);
if (yd == null) {
addYearDimension(startTime);
yd = this.getYearDimension(startTime);
}
if (yd == null) {
throw new BAMException("Adding year dimension failed: " + startTime.getBAMTimestamp());
}
summaryDimension.addQuarterDimension(BAMCalendar.getQuarter(startTime), null, yd.getId());
} catch (Exception e) {
throw new BAMException("Adding quarter dimension failed: " + startTime.getBAMTimestamp(), e);
} finally {
if (summaryDimension != null) {
summaryDimension.cleanup();
}
}
}
代码示例来源:origin: org.wso2.carbon/org.wso2.carbon.bam.core
protected void summarizeYearly(BAMCalendar loYear, BAMCalendar hiYear) {
try {
SummaryPersistenceManager spm = SummaryPersistenceManager.getInstance();
YearDimension qd = spm.getYearDimension(loYear);
if (qd == null) {
spm.addYearDimension(loYear);
qd = spm.getYearDimension(loYear);
}
MediationSummaryStatistic stat = spm.getSequenceStatYearlySummary(getServer().getId(),
getSequence().getName(), getSequence().getDirection(), loYear, hiYear);
stat.setName(getSequence().getName());
stat.setTimeDimensionId(qd.getId());
stat.setServerId(getServer().getId());
stat.setDirection(getSequence().getDirection());
SummaryPersistenceManager.getInstance().addSequenceStatYearlySummary(stat);
} catch (BAMException e) {
if (log.isErrorEnabled()) {
log.error("Error while running yearly summary generator for operaion: " + getSequence()
+ " of server: " + getServer().getServerURL(), e);
}
}
}
代码示例来源:origin: org.wso2.carbon/org.wso2.carbon.bam.core
protected void summarizeYearly(BAMCalendar loYear, BAMCalendar hiYear) {
try {
SummaryPersistenceManager spm = SummaryPersistenceManager.getInstance();
YearDimension qd = spm.getYearDimension(loYear);
if (qd == null) {
spm.addYearDimension(loYear);
qd = spm.getYearDimension(loYear);
}
MediationSummaryStatistic stat = spm.getEndpointStatYearlySummary(getServer().getId(),
getEndpoint().getName(), getEndpoint().getDirection(), loYear, hiYear);
stat.setName(getEndpoint().getName());
stat.setTimeDimensionId(qd.getId());
stat.setServerId(getServer().getId());
stat.setDirection(getEndpoint().getDirection());
SummaryPersistenceManager.getInstance().addEndpointStatYearlySummary(stat);
} catch (BAMException e) {
if (log.isErrorEnabled()) {
log.error("Error while running yearly summary generator for endpoint: " + getEndpoint()
+ " of server: " + getServer().getServerURL(), e);
}
}
}
代码示例来源:origin: org.wso2.carbon/org.wso2.carbon.bam.core
protected void summarizeYearly(BAMCalendar loYear, BAMCalendar hiYear) {
try {
SummaryPersistenceManager spm = SummaryPersistenceManager.getInstance();
YearDimension qd = spm.getYearDimension(loYear);
if (qd == null) {
spm.addYearDimension(loYear);
qd = spm.getYearDimension(loYear);
}
MediationSummaryStatistic stat = spm.getProxyServiceStatYearlySummary(getServer().getId(),
getProxyService().getName(), getProxyService().getDirection(), loYear, hiYear);
stat.setName(getProxyService().getName());
stat.setTimeDimensionId(qd.getId());
stat.setServerId(getServer().getId());
stat.setDirection(getProxyService().getDirection());
SummaryPersistenceManager.getInstance().addProxyServiceStatYearlySummary(stat);
} catch (BAMException e) {
if (log.isErrorEnabled()) {
log.error("Error while running yearly summary generator for operaion: " + getProxyService()
+ " of server: " + getServer().getServerURL(), e);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!