/*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * (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.mozilla.org/MPL/>.
 * 
 * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
 * WARRANTY OF ANY KIND, either express or implied. See the License for the specific
 * language governing rights and limitations under the License.
 * 
 * The Original Code is the Venice Web Communities System.
 * 
 * The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
 * for Silverwrist Design Studios.  Portions created by Eric J. Bowersox are
 * Copyright (C) 2002-03 Eric J. Bowersox/Silverwrist Design Studios.  All Rights Reserved.
 * 
 * Contributor(s): 
 */
package com.silverwrist.dynamo.iface;

/**
 * An interface which is used to create new audit records for insertion into the database.  The new audit records
 * have all their basic data items filled in, but none of their optional properties, and are not written to the
 * database until their {@link com.silverwrist.dynamo.iface.AuditRecordCompose#write() write()} method is called.
 *
 * @author Eric J. Bowersox &lt;erbo@silcom.com&gt;
 * @version X
 */
public interface AuditRecordFactory
{
  /**
   * Creates a new audit record.
   *
   * @param r The current {@link com.silverwrist.dynamo.iface.Request Request} we are processing.
   * @param user The user that has perfomed the request.
   * @param namespace The namespace URI of the audit record type to be written.
   * @param name The name of the audit record type to be written.
   * @return The new audit record.
   */
  public AuditRecordCompose createAuditRecord(Request r, DynamoUser user, String namespace, String name);

  /**
   * Creates a new audit record.
   *
   * @param r The current {@link com.silverwrist.dynamo.iface.Request Request} we are processing.
   * @param user The user that has perfomed the request.
   * @param subid The subidentifier value for this audit record.
   * @param namespace The namespace URI of the audit record type to be written.
   * @param name The name of the audit record type to be written.
   * @return The new audit record.
   */
  public AuditRecordCompose createAuditRecord(Request r, DynamoUser user, int subid, String namespace,
					      String name);

  /**
   * Creates a new "system-level" audit record, which is normally used only for system-level events.
   *
   * @param namespace The namespace URI of the audit record type to be written.
   * @param name The name of the audit record type to be written.
   * @return The new audit record.
   */
  public AuditRecordCompose createSystemAuditRecord(String namespace, String name);

} // end interface AuditRecordFactory
