com.sap.tc.logging

Class BaseLog

java.lang.Object
  extended by com.sap.tc.logging.ExceptionHandling
      extended by com.sap.tc.logging.BaseLog
All Implemented Interfaces:
IBaseLog, IObjectInfo, Cloneable

public abstract class BaseLog
extends com.sap.tc.logging.ExceptionHandling
implements IBaseLog


Field Summary
static int STATUS_CLOSED
           
static int STATUS_INVALID
           
static int STATUS_OPENED
           
 
Fields inherited from class com.sap.tc.logging.ExceptionHandling
EX_NO_FILTER_EMSG, EX_NO_FORMATTER_EMSG, EX_NO_INSTANCE_EMSG
 
Constructor Summary
BaseLog()
           
 
Method Summary
 void addFilter(IFilter filter)
          Adds another filter that controls messages flow via this log.
protected  Object clone()
           
 void close()
          Closes this log object.
protected abstract  void closeInt()
           
 String getDescription()
           
 String getEncoding()
          Gets the canonical name of the character encoding that is used for this log.
 IFilter getFilter(int index)
          Gets the filter that control messages flow via this log.
 Collection getFilters()
          Gets the filters that control messages flow via this log.
 String getFooter()
          Sets the footer text of this log.
 Formatter getFormatter()
          Gets the formatter that dictates the format of log records in this log.
 String getHeader()
          Gets the header text of this log.
 int getMode()
          Get current working mode
 String getName()
           
 String getPattern()
          Gets the name pattern of this file log.
 String getSource()
          Gets the source name of this file log.
 String getVerInUse()
           
 boolean isClosed()
          Check is this log closed.
 boolean isOpened()
          Check is this log opened.
 void open()
          Open this log object.
protected abstract  void openInt()
           
 void removeFilter(IFilter filter)
          Removes a filter so that it no longer controls messages flow via this log.
 void removeFilters()
          Removes all filters associated with this log.
 void setDescription(String value)
           
 void setEncoding(String encoding)
          Sets the named character encoding to be used for this log.
protected  void setFooter(String value)
           
 void setFormatter(Formatter formatter)
          Sets the formatter that dictates the format of log records in this log.
protected  void setHeader(String value)
           
 void setMode(int mode)
          Set current working mode.
 void setName(String value)
           
 void setPattern(String value)
          Sets the name pattern of this log.
 void setSource(String value)
          Sets the source name of this log.
protected  void setStatus(int status)
           
protected  void setVerInUse(String value)
           
 int status()
          Status of this log object.
 
Methods inherited from class com.sap.tc.logging.ExceptionHandling
getException, getExceptions, handleException, handleException, resetException, throwException
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATUS_INVALID

public static final int STATUS_INVALID
See Also:
Constant Field Values

STATUS_CLOSED

public static final int STATUS_CLOSED
See Also:
Constant Field Values

STATUS_OPENED

public static final int STATUS_OPENED
See Also:
Constant Field Values
Constructor Detail

BaseLog

public BaseLog()
Method Detail

openInt

protected abstract void openInt()
                         throws OpenException
Throws:
OpenException

closeInt

protected abstract void closeInt()
                          throws CloseException
Throws:
CloseException

open

public void open()
          throws OpenException
Description copied from interface: IBaseLog
Open this log object.

Specified by:
open in interface IBaseLog
Throws:
OpenException
See Also:
IBaseLog.open()

close

public void close()
           throws CloseException
Description copied from interface: IBaseLog
Closes this log object.

Specified by:
close in interface IBaseLog
Throws:
CloseException
See Also:
IBaseLog.close()

status

public int status()
Description copied from interface: IBaseLog
Status of this log object.

Specified by:
status in interface IBaseLog
See Also:
IBaseLog.status()

isClosed

public boolean isClosed()
Description copied from interface: IBaseLog
Check is this log closed.

Specified by:
isClosed in interface IBaseLog
See Also:
IBaseLog.isClosed()

isOpened

public boolean isOpened()
Description copied from interface: IBaseLog
Check is this log opened.

Specified by:
isOpened in interface IBaseLog
See Also:
IBaseLog.isOpened()

setPattern

public void setPattern(String value)
Description copied from interface: IBaseLog
Sets the name pattern of this log.

Specified by:
setPattern in interface IBaseLog
See Also:
IBaseLog.setPattern(java.lang.String)

getPattern

public String getPattern()
Description copied from interface: IBaseLog
Gets the name pattern of this file log.

Specified by:
getPattern in interface IBaseLog
Returns:
Name pattern
See Also:
IBaseLog.getPattern()

setSource

public void setSource(String value)
Description copied from interface: IBaseLog
Sets the source name of this log. Source name represent a source where messages will be written, or from where messages will be read. Full source name will be built based on given pattern.

Specified by:
setSource in interface IBaseLog
See Also:
IBaseLog.setSource(java.lang.String)

getSource

public String getSource()
Description copied from interface: IBaseLog
Gets the source name of this file log.

Specified by:
getSource in interface IBaseLog
Returns:
Source name
See Also:
IBaseLog.getSource()

setEncoding

public void setEncoding(String encoding)
Description copied from interface: IBaseLog
Sets the named character encoding to be used for this log. If no character encoding is set the default character encoding is used.

Specified by:
setEncoding in interface IBaseLog
Parameters:
encoding - Name of character encoding
See Also:
IBaseLog.setEncoding(java.lang.String)

getEncoding

public String getEncoding()
Description copied from interface: IBaseLog
Gets the canonical name of the character encoding that is used for this log. If no character encoding is set the default character encoding of the platform is used.

Specified by:
getEncoding in interface IBaseLog
Returns:
Name of character encoding. Can be null.
See Also:
IBaseLog.getEncoding()

setFormatter

public void setFormatter(Formatter formatter)
Description copied from interface: IBaseLog
Sets the formatter that dictates the format of log records in this log.

Specified by:
setFormatter in interface IBaseLog
Parameters:
formatter - - Formatter instance. if formatter == null, default ListFormatter() will be created!
See Also:
IBaseLog.setFormatter(com.sap.tc.logging.Formatter)

getFormatter

public Formatter getFormatter()
Description copied from interface: IBaseLog
Gets the formatter that dictates the format of log records in this log.

Specified by:
getFormatter in interface IBaseLog
Returns:
Formatter
See Also:
IBaseLog.getFormatter()

getFooter

public String getFooter()
Description copied from interface: IBaseLog
Sets the footer text of this log.

Specified by:
getFooter in interface IBaseLog
Returns:
Text which represent footer of this log.
See Also:
IBaseLog.getFooter()

getHeader

public String getHeader()
Description copied from interface: IBaseLog
Gets the header text of this log.

Specified by:
getHeader in interface IBaseLog
Returns:
Text which represent header of this log.
See Also:
IBaseLog.getHeader()

getMode

public int getMode()
Description copied from interface: IBaseLog
Get current working mode

Specified by:
getMode in interface IBaseLog
See Also:
IBaseLog.getMode()

setMode

public void setMode(int mode)
Description copied from interface: IBaseLog
Set current working mode.

Specified by:
setMode in interface IBaseLog
See Also:
com.sap.tc.logging.interfaces.IBaseLog#setMode()

addFilter

public void addFilter(IFilter filter)
Description copied from interface: IBaseLog
Adds another filter that controls messages flow via this log. The results of all filters for a given message are logically anded to determine whether a message is to be processed.

Specified by:
addFilter in interface IBaseLog
Parameters:
filter - New filter
See Also:
IBaseLog.addFilter(com.sap.tc.logging.interfaces.IFilter)

getFilter

public IFilter getFilter(int index)
Description copied from interface: IBaseLog
Gets the filter that control messages flow via this log.

Specified by:
getFilter in interface IBaseLog
Returns:
Instance of IFilter stored on given position / index
See Also:
com.sap.tc.logging.interfaces.IBaseLog#getFilter()

getFilters

public Collection getFilters()
Description copied from interface: IBaseLog
Gets the filters that control messages flow via this log.

Specified by:
getFilters in interface IBaseLog
Returns:
Unmodifiable collection of filters associated with this log
See Also:
IBaseLog.getFilters()

removeFilter

public void removeFilter(IFilter filter)
Description copied from interface: IBaseLog
Removes a filter so that it no longer controls messages flow via this log.

Specified by:
removeFilter in interface IBaseLog
Parameters:
filter - Filter to be removed
See Also:
IBaseLog.removeFilter(com.sap.tc.logging.interfaces.IFilter)

removeFilters

public void removeFilters()
Description copied from interface: IBaseLog
Removes all filters associated with this log.

Specified by:
removeFilters in interface IBaseLog
See Also:
IBaseLog.removeFilters()

setName

public void setName(String value)
See Also:
com.sap.tc.logging.interfaces.IObjectInfo#setName(java.lang.String)

getName

public String getName()
Specified by:
getName in interface IObjectInfo
See Also:
IObjectInfo.getName()

setDescription

public void setDescription(String value)
See Also:
com.sap.tc.logging.interfaces.IObjectInfo#setDescription(java.lang.String)

getDescription

public String getDescription()
Specified by:
getDescription in interface IObjectInfo
See Also:
IObjectInfo.getDescription()

getVerInUse

public String getVerInUse()
Specified by:
getVerInUse in interface IObjectInfo
See Also:
IObjectInfo.getVerInUse()

setStatus

protected void setStatus(int status)

setHeader

protected void setHeader(String value)

setFooter

protected void setFooter(String value)

setVerInUse

protected void setVerInUse(String value)

clone

protected Object clone()
                throws CloneNotSupportedException
Overrides:
clone in class Object
Throws:
CloneNotSupportedException
Access Rights

This class can be accessed from:


SC DC
[sap.com] FRAMEWORK [sap.com] tc/ddic/ddicruntime
[sap.com] ENGINEAPI [sap.com] tc/logging
[sap.com] ENGFACADE [sap.com] tc/bl/logging/api
[sap.com] CORE-TOOLS [sap.com] com.sap.engine.client.lib
[sap.com] BRMS-FACADE [sap.com] tc/brms/facade


Copyright 2010 SAP AG Complete Copyright Notice