Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* If it is not possible or desirable to put the notice in a particular
* file, then You may include the notice in a location (such as a LICENSE
* file in a relevant directory) where a recipient would be likely to look
* for such a notice.
*
*/
/* ---------------------------------------------------------------------------
* U.S. Government, Department of the Army
* Army Materiel Command
* Research Development Engineering Command
* Communications Electronics Research Development and Engineering Center
* ---------------------------------------------------------------------------
*/
package org.miloss.fgsms.presentation;
import de.laures.cewolf.DatasetProduceException;
import de.laures.cewolf.DatasetProducer;
import java.io.Serializable;
import java.net.URL;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.miloss.fgsms.common.Utility;
import org.miloss.fgsms.services.interfaces.dataaccessservice.GetMessageLogsResponseMsg;
import org.miloss.fgsms.services.interfaces.dataaccessservice.TransactionLog;
import org.apache.log4j.Level;
import org.miloss.fgsms.common.Logger;;
import org.jfree.data.time.Millisecond;
import org.jfree.data.time.TimeSeries;
import org.jfree.data.time.TimeSeriesCollection;
/**
*
* @author AO
*/
public class TransactionLogViewerData implements DatasetProducer, Serializable {
public TransactionLogViewerData() {
}
public TransactionLogViewerData(URL url) {
dasu = url;
}
private URL dasu=null;
private List data=null;
/*
* this is only called from the service profile page
*
@Deprecated
private String GetRenderedData(String URL, int offset, int records, boolean slaFaultsOnly, boolean faultsOnly, HttpSession session, String username, String password, SecurityWrapper c, AuthMode mode_) {
LogHelper.getLog().log(Level.INFO, "fgsmsWEB TransactionLogViewerData, produce rendered data");
String out = "";
try {
DataAccessService_Service das = new DataAccessService_Service(this.getClass().getResource("/META-INF/" + org.miloss.fgsms.common.Constants.DAS_META));
DataAccessService dasport = das.getDASPort();
BindingProvider bpPCS = (BindingProvider) dasport;
Map contextPCS = bpPCS.getRequestContext();
contextPCS.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, dasu.toString());
StubExt sec = (StubExt) bpPCS;
if (mode_ == AuthMode.UsernamePassword) {
sec.setSecurityConfig("fgsms-username-config.xml");
contextPCS.put(BindingProvider.USERNAME_PROPERTY, username);
contextPCS.put(BindingProvider.PASSWORD_PROPERTY, Utility.DE(password));
}
if (mode_ == AuthMode.PKI) {
sec.setSecurityConfig("fgsms-pki-config.xml");
}
GetRecentMessageLogsRequestMsg req1 = new GetRecentMessageLogsRequestMsg();
req1.setClassification(c);
req1.setURL(URL);
req1.setOffset(offset);
req1.setRecords(records);
req1.setSlaViolationsOnly(slaFaultsOnly);
req1.setFaultsOnly(faultsOnly);
GetMessageLogsResponseMsg res = dasport.getRecentMessageLogs(req1);
out += ("Total Records available: " + res.getTotalRecords());
if (res.getLogs() != null
&& res.getLogs().getValue() != null
&& res.getLogs().getValue().getTransactionLog() != null
&& res.getLogs().getValue().getTransactionLog().size() > 0) {
out += ("
"
+ "
Action
"
+ "
Success/Fault
"
+ "
Requestor Identity
"
+ "
Response Time
"
// + "
Request / Response
"
+ "
Timestamp
"
+ "
SLA Violation
"
+ "
Details
");
data = res.getLogs().getValue().getTransactionLog();
// is this needed? no it isn't
//session.setAttribute("fgsms.transactionlog" + URL, data);
boolean colorflag = false;
for (int i = 0; i < res.getLogs().getValue().getTransactionLog().size(); i++) {
out += ("
";
} else {
out += " bgcolor=#DDFFDD>
";
}
int clip = 0;
if (Utility.stringIsNullOrEmpty(res.getLogs().getValue().getTransactionLog().get(i).getAction())) {
out += "NA
";
} else {
out += (res.getLogs().getValue().getTransactionLog().get(i).getAction() + "
");
}
if (!res.getLogs().getValue().getTransactionLog().get(i).isIsFault()) {
out += ("Fault");
} else {
out += ("Success");
}
out += ("
No records were returned.";
}
} catch (SecurityException ex) {
out += ("Access was denied to the requested resource.");
LogHelper.getLog().log(Level.ERROR, "TransactionLogViewer, access denied when error rendering data for user " + username);
} catch (Exception ex) {
Logger.getLogger("fgsms.Web").log(Level.WARN, "Error caught", ex);
out += ("There was an error processing your request. Message: " + ex.getLocalizedMessage());
LogHelper.getLog().log(Level.ERROR, "TransactionLogViewer, error rendering data for user " + username, ex);
}
return out;
}
*/
public String GetRenderedData(GetMessageLogsResponseMsg res)
{
String out = "";
if (res == null)
return out;
try
{
out += ("Total Records available: " + res.getTotalRecords());
if (res.getLogs() != null
&& res.getLogs() != null
&& res.getLogs().getTransactionLog() != null
&& res.getLogs().getTransactionLog().size() > 0) {
out += ("
"
+ "
Action
"
+ "
Success/Fault
"
+ "
Requestor Identity
"
+ "
Response Time
"
// + "
Request / Response
"
+ "
Timestamp
"
+ "
SLA Violation
"
+ "
Details
");
data = res.getLogs().getTransactionLog();
// is this needed? no it isn't
//session.setAttribute("fgsms.transactionlog" + URL, data);
boolean colorflag = false;
for (int i = 0; i < res.getLogs().getTransactionLog().size(); i++) {
out += ("
";
} else {
out += " bgcolor=#DDFFDD>
";
}
int clip = 0;
if (Utility.stringIsNullOrEmpty(res.getLogs().getTransactionLog().get(i).getAction())) {
out += "NA
";
} else {
out += (res.getLogs().getTransactionLog().get(i).getAction() + "
");
}
if (!res.getLogs().getTransactionLog().get(i).isIsFault()) {
out += ("Fault");
} else {
out += ("Success");
}
out += ("