/*
* Copyright 2003 Federal Chancellery Austria
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package at.gv.egovernment.moa.logging;
/**
* Encapsulates contextual information (i.e. per request information) for
* logging purposes.
*
* @author Patrick Peck
* @version $Id$
*/
public class LoggingContext {
/** The name of the node ID system property. */
public static final String NODE_ID_PROPERTY = "moa.node-id";
/** The current transaction ID. */
private String transactionID;
/** The node ID. */
private String nodeID;
/**
* Create a new LoggingContext
.
*
* @param transactionID The transaction ID. May be null
.
*/
public LoggingContext(String transactionID) {
this.transactionID = transactionID;
this.nodeID = System.getProperty(NODE_ID_PROPERTY);
}
/**
* Return the transaction ID.
*
* @return The transaction ID.
*/
public String getTransactionID() {
return transactionID;
}
/**
* Return the node ID.
*
* @return The node ID.
*/
public String getNodeID() {
return nodeID;
}
}