001/**
002 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003 *
004 * Copyright (c) 2005 Sun Microsystems Inc. All Rights Reserved
005 *
006 * The contents of this file are subject to the terms
007 * of the Common Development and Distribution License
008 * (the License). You may not use this file except in
009 * compliance with the License.
010 *
011 * You can obtain a copy of the License at
012 * https://opensso.dev.java.net/public/CDDLv1.0.html or
013 * opensso/legal/CDDLv1.0.txt
014 * See the License for the specific language governing
015 * permission and limitations under the License.
016 *
017 * When distributing Covered Code, include this CDDL
018 * Header Notice in each file and include the License file
019 * at opensso/legal/CDDLv1.0.txt.
020 * If applicable, add the following below the CDDL Header,
021 * with the fields enclosed by brackets [] replaced by
022 * your own identifying information:
023 * "Portions Copyrighted [year] [name of copyright owner]"
024 *
025 * $Id: Template.java,v 1.3 2008/06/25 05:41:46 qcheng Exp $
026 *
027 */
028
029package com.iplanet.ums;
030
031import java.io.Serializable;
032
033/**
034 * Represents Template objects in UMS. This is the abstract class for
035 * CreationTemplate for object creation and SearchTemplate for defining
036 * guidelines for searching functionality.
037 * <P>
038 * 
039 * @see CreationTemplate
040 * @see SearchTemplate
041 * @supported.all.api
042 */
043public abstract class Template implements Serializable, Cloneable {
044    /**
045     * Default constructor for deserialization
046     */
047    public Template() {
048    }
049
050    /**
051     * Creates a Template with a name; should be called from a derived class.
052     * 
053     * @param name
054     *            Template name
055     */
056    public Template(String name) {
057        _name = name;
058    }
059
060    /**
061     * Gets the name of the template.
062     * 
063     * @return name of the Template
064     */
065    public String getName() {
066        return _name;
067    }
068
069    /**
070     * Sets the name of the template (for deserialization).
071     * 
072     * @param name
073     *            name of the template
074     */
075    public void setName(String name) {
076        _name = name;
077    }
078
079    /**
080     * Returns a copy of the template.
081     * 
082     * @return a copy of the template
083     */
084    public Object clone() {
085        try {
086            return super.clone();
087        } catch (CloneNotSupportedException ex) {
088            return null;
089        }
090    }
091
092    private String _name = null;
093}