1 /*
   2  * CDDL HEADER START
   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License, Version 1.0 only
   6  * (the "License").  You may not use this file except in compliance
   7  * with the License.
   8  *
   9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  10  * or http://www.opensolaris.org/os/licensing.
  11  * See the License for the specific language governing permissions
  12  * and limitations under the License.
  13  *
  14  * When distributing Covered Code, include this CDDL HEADER in each
  15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16  * If applicable, add the following below this CDDL HEADER, with the
  17  * fields enclosed by brackets "[]" replaced with your own identifying
  18  * information: Portions Copyright [yyyy] [name of copyright owner]
  19  *
  20  * CDDL HEADER END
  21  */
  22 /*
  23  * ident        "%Z%%M% %I%     %E% SMI"
  24  *
  25  * Copyright 2001-2002 Sun Microsystems, Inc.  All rights reserved.
  26  * Use is subject to license terms.
  27  */
  28 
  29 package com.sun.dhcpmgr.data;
  30 
  31 import java.io.Serializable;
  32 import java.util.Date;
  33 
  34 /**
  35  * This class defines the header for the export file.
  36  */
  37 public class ExportHeader implements Serializable {
  38 
  39     /**
  40      * The name of the server from which the data originated.
  41      */
  42     private String server;
  43     /**
  44      * Date of export
  45      */
  46     private Date date;
  47     /**
  48      * User who requested export
  49      */
  50     private String user;
  51     /**
  52      * Number of records in this file.
  53      */
  54     private int recCount;
  55     /**
  56      * Networks exported in this file
  57      */
  58     private Network [] networks;
  59 
  60     // Serialization id for this class
  61     static final long serialVersionUID = -3581829760827739278L;
  62 
  63     /**
  64      * Simple constructor.
  65      * @param server name of the server from which the server was exported
  66      * @param user name of the user who performed the export
  67      * @param recCount number of records which will be exported
  68      * @param networks list of networks exported
  69      */
  70     public ExportHeader(String server, String user, int recCount,
  71             Network [] networks) {
  72 
  73         this.server = server;
  74         this.user = user;
  75         this.recCount = recCount;
  76         this.networks = networks;
  77         date = new Date();
  78 
  79     } // constructor
  80 
  81     /**
  82      * Get the server value.
  83      * @return returns the server name
  84      */
  85     public String getServer() {
  86 
  87         return server;
  88 
  89     } // getServer
  90 
  91     /**
  92      * Retrieve exporting user name
  93      * @return name of user
  94      */
  95     public String getUser() {
  96         return user;
  97     }
  98 
  99     /**
 100      * Retrieve date of export
 101      * @return date & time of export
 102      */
 103     public Date getDate() {
 104         return date;
 105     }
 106 
 107     /**
 108      * Retrieve the number of records in the file.
 109      * @return the number of records contained.
 110      */
 111     public int getRecCount() {
 112         return recCount;
 113     }
 114 
 115     /**
 116      * Retrieve the list of networks which are exported in this file.
 117      * @return An array of networks
 118      */
 119     public Network [] getNetworks() {
 120         return networks;
 121     }
 122 } // ExportHeader