Skip to content

Commit

Permalink
use AppUtils for hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed Apr 3, 2008
1 parent af6d8c3 commit 68b5059
Showing 1 changed file with 11 additions and 10 deletions.
Expand Up @@ -22,17 +22,18 @@
package org.jumpmind.symmetric.model;

import java.io.Serializable;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Date;

import org.jumpmind.symmetric.load.IDataLoaderContext;
import org.jumpmind.symmetric.load.IDataLoaderStatistics;
import org.jumpmind.symmetric.util.AppUtils;

public class IncomingBatchHistory implements Serializable {

private static final long serialVersionUID = 1L;

private static String thisHostName;

public enum Status {
OK, ER, SK;
}
Expand All @@ -43,7 +44,7 @@ public enum Status {

private Status status;

private static String hostName;
private String hostName;

private long byteCount;

Expand Down Expand Up @@ -74,23 +75,19 @@ public enum Status {
private String sqlMessage;

static {
InetAddress address = null;
try {
address = InetAddress.getLocalHost();
hostName = address.getHostName();
} catch (UnknownHostException e) {
hostName = "UNKNOWN";
}
thisHostName = AppUtils.getServerId();
}

public IncomingBatchHistory() {
this.hostName = thisHostName;
}

public IncomingBatchHistory(IDataLoaderContext context) {
batchId = context.getBatchId();
nodeId = context.getNodeId();
status = Status.OK;
startTime = new Date();
this.hostName = thisHostName;
}

public void setValues(IDataLoaderStatistics statistics, boolean isSuccess) {
Expand Down Expand Up @@ -165,6 +162,10 @@ public String getHostName() {
return hostName;
}

public void setHostName(String hostName) {
this.hostName = hostName;
}

public String getNodeId() {
return nodeId;
}
Expand Down

0 comments on commit 68b5059

Please sign in to comment.