Nitido Inc.

com.nitido.nimx.services.eventmonitor.log4j
Class EventMonitorServiceImpl

java.lang.Object
  extended by com.nitido.nim.NiMKernelService
      extended by com.nitido.nim.EventMonitorService
          extended by com.nitido.nimx.services.eventmonitor.log4j.EventMonitorServiceImpl
All Implemented Interfaces:
NiMConstants

public class EventMonitorServiceImpl
extends EventMonitorService

This class implements the EventMonitorService such that application level events are placed in a file on the local file system of the running node using log4j as the underlying library for writting the log messages.


Field Summary
static java.lang.String CONF_KEY_PREFIX
          The configuration key prefix for the mapping settings from a user space key to a LDAP attribute name.
static java.lang.String EVENTSTR_LOG_EVENT
          The name of the logEvent request
static int LEN_CONF_KEY_PREFIX
          The length of the string CONF_KEY_PREFIX.
static java.lang.String LOG_CAT_PREFIX
          Category prefix used by NiM for loging application level events.
static java.lang.String PREFIX_LOG4J
          Just the string "log4j.".
 
Fields inherited from interface com.nitido.nim.NiMConstants
ACTION_CREATE_NUGGET, ACTION_CREATE_NUGGET_BY_NAME, ACTION_CRED_SPACE_ADD, ACTION_CRED_SPACE_GET_KEYS, ACTION_CRED_SPACE_GET_KEYS_START_WITH, ACTION_CRED_SPACE_GET_VALUE, ACTION_CRED_SPACE_GET_VALUES, ACTION_CRED_SPACE_MODIFY, ACTION_CRED_SPACE_REMOVE_VALUE, ACTION_CRED_SPACE_REMOVE_VALUES, ACTION_CRED_SPACE_REPLACE, ACTION_DEPROVISION_ENTITY, ACTION_ENTITY_CHANGE_CRED, ACTION_LOG_EVENT, ACTION_PROVISION_ENTITY, ACTION_USER_SPACE_ADD, ACTION_USER_SPACE_GET_KEYS, ACTION_USER_SPACE_GET_KEYS_START_WITH, ACTION_USER_SPACE_GET_VALUE, ACTION_USER_SPACE_GET_VALUES, ACTION_USER_SPACE_MODIFY, ACTION_USER_SPACE_REMOVE_VALUE, ACTION_USER_SPACE_REMOVE_VALUES, ACTION_USER_SPACE_REPLACE, CONF_PREFIX_SECURITY_ACCESS, CONF_PREFIX_SECURITY_ALLOW, CONF_PREFIX_SECURITY_ASSIGN, CONF_PREFIX_SECURITY_RESOURCE, PARAM_CHANGE_CRED, PARAM_DEPROVISION_CREDENTIAL, PARAM_EVENT_NAME, PARAM_MODIFIER_CONTAINER, PARAM_NUGGET_CREATE_CRED, PARAM_NUGGET_NAME, PARAM_NUGGET_SETTINGS, PARAM_NUGGET_TYPE, PARAM_PROVISION_DESCRIPTOR, PARAM_SPACE_KEY, PARAM_SPACE_KEYS_START_WITH, PARAM_SPACE_VALUE, PREFIX_ACCESS_CLASS_IN_PACKAGE
 
Constructor Summary
EventMonitorServiceImpl(NiMKernelServiceVisa visa)
          This class constructor is used by NiMKernel to instantiate a new EventMonitorService
 
Method Summary
protected  void init(NiMKernel kernel, ConfigurationService confService)
          This method is used by the NiMKernel to initialize the EventMonitor service.
 void logEvent(java.lang.String eventName, java.lang.String msg, Credential credential)
          This method is used to log the given message for the given event name.
 boolean needToLogEvent(java.lang.String eventName, Credential credential)
          This method indicates whether the given event needs to be logged.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG_CAT_PREFIX

public static final java.lang.String LOG_CAT_PREFIX
Category prefix used by NiM for loging application level events. This is a protected member because it is used by this EventMonitorService implementation only.

See Also:
Constant Field Values

EVENTSTR_LOG_EVENT

public static final java.lang.String EVENTSTR_LOG_EVENT
The name of the logEvent request

See Also:
Constant Field Values

CONF_KEY_PREFIX

public static final java.lang.String CONF_KEY_PREFIX
The configuration key prefix for the mapping settings from a user space key to a LDAP attribute name.

See Also:
Constant Field Values

LEN_CONF_KEY_PREFIX

public static final int LEN_CONF_KEY_PREFIX
The length of the string CONF_KEY_PREFIX.


PREFIX_LOG4J

public static final java.lang.String PREFIX_LOG4J
Just the string "log4j.".

See Also:
Constant Field Values
Constructor Detail

EventMonitorServiceImpl

public EventMonitorServiceImpl(NiMKernelServiceVisa visa)
This class constructor is used by NiMKernel to instantiate a new EventMonitorService

Parameters:
visa - Reference to the NiMKernelServiceVisa object required to instantiate the service. This parameter is required to ensure that only the NiMkernel can instantiate a reference to this service.
Method Detail

init

protected void init(NiMKernel kernel,
                    ConfigurationService confService)
             throws InitializationFailedException,
                    NiMException
This method is used by the NiMKernel to initialize the EventMonitor service.

Specified by:
init in class EventMonitorService
Parameters:
kernel - Reference to the kernel that instantiated this service.
confService - Reference to the ConfigurationService
Throws:
InitializationFailedException - If unable to initialize the service. This exception is never thrown by this service implementation.
NiMException - If unable to establish a connection with the underlying log service. This exception is never thrown by this service implementation.

logEvent

public void logEvent(java.lang.String eventName,
                     java.lang.String msg,
                     Credential credential)
This method is used to log the given message for the given event name. The given credential is used to verify that the entity has permission to log the event. If this credential is not entitled to perform the requested operation, the event will not be logged. The given event message will be logged to the local filesystem according to the provided log4j configuration.

Specified by:
logEvent in class EventMonitorService
Parameters:
eventName - The name of the event to be logged.
msg - The message associated with the event being logged
credential - The credential of the user logging the event.

needToLogEvent

public boolean needToLogEvent(java.lang.String eventName,
                              Credential credential)
This method indicates whether the given event needs to be logged.

The creation of the log message can consume a significant amount of time, a developer can first call this method to determine whether the corresponding log message is to be logged.

Specified by:
needToLogEvent in class EventMonitorService
Parameters:
eventName - The name that uniquely identifies the event to be logged.
credential - The credential of the user logging the event
Returns:
True if the event needs to be "logged" otherwise it returns false.

Nitido NiM 2.5 Java API

These JavaDoc pages are generated for release/nim_2_5-2.5.44

Copyright © 1999-2009 Nitido Inc.    Proprietary and Confidential.    All Rights Reserved.