8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster/**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The contents of this file are subject to the terms
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * of the Common Development and Distribution License
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * (the License). You may not use this file except in
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * compliance with the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * You can obtain a copy of the License at
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * https://opensso.dev.java.net/public/CDDLv1.0.html or
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * opensso/legal/CDDLv1.0.txt
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * See the License for the specific language governing
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * permission and limitations under the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * When distributing Covered Code, include this CDDL
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Header Notice in each file and include the License file
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * at opensso/legal/CDDLv1.0.txt.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * If applicable, add the following below the CDDL Header,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * with the fields enclosed by brackets [] replaced by
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * your own identifying information:
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * "Portions Copyrighted [year] [name of copyright owner]"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * $Id: LogReadHandler.java,v 1.4 2008/06/25 05:43:36 qcheng Exp $
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterpackage com.sun.identity.log.handlers;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport java.io.IOException;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport java.util.Set;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster/**LogReadHandler interface provides methods that must be present
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * in each log read handler to read a log file. The LogReader knows
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * only these methods and will call one of these as required.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster **/
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterpublic interface LogReadHandler {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * LogReader calls this method method. It collects header, records,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * applies query (if any), sorts (if asked) the records on field, checks
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * the max records to return, collects all the recods and returns.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param fileName is complete filename with path
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param qry is user specified qury chriteria with sorting requirement
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param sourceData it specifies whether return data should be original
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * data received by logger (source) or formatted data as in file.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return all the matched records with query
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @throws IOException if it fails to read log records.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @throws NoSuchFieldException if it fails to retrieve the name of field.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @throws IllegalArgumentException if query has wrong value.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @throws RuntimeException if it fails to retrieve log record.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @throws Exception if it fails any of operation.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public String [][] logRecRead(
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String fileName,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster com.sun.identity.log.LogQuery qry,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster boolean sourceData
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ) throws IOException, NoSuchFieldException, IllegalArgumentException,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster RuntimeException, Exception;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * LogReader calls this method method. It collects header, records,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * applies query (if any), sorts (if asked) the records on field, checks
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * the max records to return, collects all the recods and returns.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param fileNames is a Set of filenames complete with path
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param qry is user specified qury chriteria with sorting requirement
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param sourceData it specifies whether return data should be original
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * data received by logger (source) or formatted data as in file.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return all the matched records with query
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @throws IOException if it fails to read log records.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @throws NoSuchFieldException if it fails to retrieve the name of field.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @throws IllegalArgumentException if query has wrong value.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @throws RuntimeException if it fails to retrieve log record.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @throws Exception if it fails any of operation.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public String [][] logRecRead(
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Set fileNames,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster com.sun.identity.log.LogQuery qry,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster boolean sourceData
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ) throws IOException, NoSuchFieldException, IllegalArgumentException,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster RuntimeException, Exception;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster}