public String toString() { StringBuffer msg = new StringBuffer(); if (this.commandContext != null) { msg.append( this.commandContext.getRequestId()); } msg.append(" ["); //$NON-NLS-1$ if (this.logonInfo != null) { msg.append(this.logonInfo); } else { msg.append( getPrincipal() ); } msg.append("] <"); //$NON-NLS-1$ msg.append( getContext() ); msg.append('.'); msg.append( getActivity() ); msg.append("> "); //$NON-NLS-1$ if (resources != null) { msg.append( Arrays.toString(resources) ); } return msg.toString(); }
public AuditEnitity(AuditMessage msg) { this.context = msg.getContext(); this.activity = msg.getActivity(); this.resources = StringUtil.toString(msg.getResources()); if (msg.getCommandContext() != null) { this.requestId = msg.getCommandContext().getRequestId(); this.principal = msg.getCommandContext().getUserName(); this.vdbName = msg.getCommandContext().getVdbName(); this.vdbVersion = msg.getCommandContext().getVdbVersion(); this.sessionId = msg.getCommandContext().getSession().getSessionId(); this.applicationName = msg.getCommandContext().getSession().getApplicationName(); } else if (msg.getLogonInfo() != null) { this.authType = msg.getLogonInfo().getAuthType(); this.userName = msg.getLogonInfo().getUserName(); this.clientHostName = msg.getLogonInfo().getClientHostName(); this.clientIpAddress = msg.getLogonInfo().getClientIpAddress(); this.clientMac = msg.getLogonInfo().getClientMac(); this.passThrough = msg.getLogonInfo().isPassThrough(); } }