head	1.6;
access;
symbols
	dlr:1.1.1
	HELM_PEER_PORT_BRANCH:1.1.1.1;
locks; strict;
comment	@# @;


1.6
date	2001.03.07.01.14.51;	author lucas;	state dead;
branches;
next	1.5;

1.5
date	2001.02.26.20.21.18;	author dlr;	state Exp;
branches;
next	1.4;

1.4
date	2001.02.24.04.04.51;	author dlr;	state Exp;
branches;
next	1.3;

1.3
date	2001.02.22.02.12.54;	author leonardr;	state Exp;
branches;
next	1.2;

1.2
date	2001.02.21.03.02.28;	author edk;	state Exp;
branches;
next	1.1;

1.1
date	2001.01.28.01.18.25;	author dlr;	state dead;
branches
	1.1.1.1
	1.1.2.1;
next	;

1.1.1.1
date	2001.02.21.00.33.08;	author dlr;	state Exp;
branches;
next	;

1.1.2.1
date	2001.01.28.01.18.25;	author dlr;	state Exp;
branches;
next	1.1.2.2;

1.1.2.2
date	2001.01.31.02.16.25;	author dlr;	state Exp;
branches;
next	1.1.2.3;

1.1.2.3
date	2001.01.31.02.52.36;	author dlr;	state Exp;
branches;
next	1.1.2.4;

1.1.2.4
date	2001.02.01.21.09.34;	author leonardr;	state Exp;
branches;
next	1.1.2.5;

1.1.2.5
date	2001.02.01.21.52.44;	author dlr;	state Exp;
branches;
next	1.1.2.6;

1.1.2.6
date	2001.02.15.20.50.39;	author leonardr;	state Exp;
branches;
next	1.1.2.7;

1.1.2.7
date	2001.02.16.03.01.33;	author dlr;	state Exp;
branches;
next	;


desc
@@


1.6
log
@Deprecated by Torque changes. -dlr
@
text
@/* ================================================================
 * Copyright (c) 2000-2001 CollabNet.  All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 * 
 * 1. Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 * 
 * 2. Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * 
 * 3. The end-user documentation included with the redistribution, if
 * any, must include the following acknowlegement: "This product includes
 * software developed by CollabNet (http://www.collab.net/)."
 * Alternately, this acknowlegement may appear in the software itself, if
 * and wherever such third-party acknowlegements normally appear.
 * 
 * 4. The hosted project names must not be used to endorse or promote
 * products derived from this software without prior written
 * permission. For written permission, please contact info@@collab.net.
 * 
 * 5. Products derived from this software may not use the "Tigris" name
 * nor may "Tigris" appear in their names without prior written
 * permission of CollabNet.
 * 
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL COLLABNET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * ====================================================================
 * 
 * This software consists of voluntary contributions made by many
 * individuals on behalf of CollabNet.
 */

package org.tigris.helm.om.peer;

import java.util.*;

import org.apache.turbine.om.SimpleKey;
import org.apache.turbine.om.NumberKey;
import org.apache.turbine.util.db.Criteria;

import org.tigris.helm.om.base.*;
import org.tigris.helm.DoesNotExist;
import org.tigris.helm.om.*;
import org.tigris.helm.tool.PeerTool;

/**
 * Extension of generated Peer BaseRolePeer.
 *
 * @@author <a href="mailto:leonardr@@collab.net">Leonard Richardson</a>
 * @@author <a href="mailto:dlr@@collab.net">Daniel Rall</a>
 * @@version $Id: RolePeer.java,v 1.5 2001/02/26 20:21:18 dlr Exp $
 */
public class RolePeer extends BaseRolePeer
{
    /**
     * @@param id The database key of the role.
     */
    public static Role getInstance(String id)
        throws Exception
    {
        return retrieveByPK(new NumberKey(id));
    }

    /**
     * @@param name The name of the role.
     */
    public static Role getInstanceByName(String name)
        throws DoesNotExist, Exception
    {
        Criteria c = new Criteria()
            .add(RolePeer.NAME, name);
        return (Role)PeerTool.getFirstBO(RolePeer.doSelect(c),
                                         "Role named " + name);
    }

    /**
     * Returns all the roles on the site of the specified type.
     * @@param type The type of role to get.
     */
    public static List getRolesForType(String type)
        throws Exception
    {
        Criteria c = new Criteria().add(TYPE, type);
        return doSelect(c);
    }

}
@


1.5
log
@Changes to keep in step with the latest Torque-generated code.
@
text
@d65 1
a65 1
 * @@version $Id: RolePeer.java,v 1.4 2001/02/24 04:04:51 dlr Exp $
@


1.4
log
@Sync'd with latest Turbine changes.  Mostly this consists of the use of the new SimpleKey class to handle primary database keys.
@
text
@d52 1
d65 1
a65 1
 * @@version $Id: RolePeer.java,v 1.3 2001/02/22 02:12:54 leonardr Exp $
d75 1
a75 1
        return retrieveByPK(new SimpleKey(id));
@


1.3
log
@Begone!
@
text
@d51 1
d64 1
a64 1
 * @@version $Id: RolePeer.java,v 1.2 2001/02/21 03:02:28 edk Exp $
d74 1
a74 1
        return retrieveByPK(Integer.parseInt(id));
@


1.2
log
@adding files from the branch to the head
@
text
@d63 1
a63 1
 * @@version $Id: RolePeer.java,v 1.1.1.1 2001/02/21 00:33:08 dlr Exp $
a66 3
    public static final String DESCRIPTION = "description";
    public static final String REQUESTABLE = "requestable";

@


1.1
log
@file RolePeer.java was initially added on branch HELM_PEER_PORT_BRANCH.
@
text
@d1 102
@


1.1.1.1
log
@Replacing the HEAD with the HELM_PEER_PORT_BRANCH.
@
text
@a0 102
/* ================================================================
 * Copyright (c) 2000-2001 CollabNet.  All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 * 
 * 1. Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 * 
 * 2. Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * 
 * 3. The end-user documentation included with the redistribution, if
 * any, must include the following acknowlegement: "This product includes
 * software developed by CollabNet (http://www.collab.net/)."
 * Alternately, this acknowlegement may appear in the software itself, if
 * and wherever such third-party acknowlegements normally appear.
 * 
 * 4. The hosted project names must not be used to endorse or promote
 * products derived from this software without prior written
 * permission. For written permission, please contact info@@collab.net.
 * 
 * 5. Products derived from this software may not use the "Tigris" name
 * nor may "Tigris" appear in their names without prior written
 * permission of CollabNet.
 * 
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL COLLABNET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * ====================================================================
 * 
 * This software consists of voluntary contributions made by many
 * individuals on behalf of CollabNet.
 */

package org.tigris.helm.om.peer;

import java.util.*;

import org.apache.turbine.util.db.Criteria;

import org.tigris.helm.om.base.*;
import org.tigris.helm.DoesNotExist;
import org.tigris.helm.om.*;
import org.tigris.helm.tool.PeerTool;

/**
 * Extension of generated Peer BaseRolePeer.
 *
 * @@author <a href="mailto:leonardr@@collab.net">Leonard Richardson</a>
 * @@author <a href="mailto:dlr@@collab.net">Daniel Rall</a>
 * @@version $Id: RolePeer.java,v 1.1.2.7 2001/02/16 03:01:33 dlr Exp $
 */
public class RolePeer extends BaseRolePeer
{
    public static final String DESCRIPTION = "description";
    public static final String REQUESTABLE = "requestable";

    /**
     * @@param id The database key of the role.
     */
    public static Role getInstance(String id)
        throws Exception
    {
        return retrieveByPK(Integer.parseInt(id));
    }

    /**
     * @@param name The name of the role.
     */
    public static Role getInstanceByName(String name)
        throws DoesNotExist, Exception
    {
        Criteria c = new Criteria()
            .add(RolePeer.NAME, name);
        return (Role)PeerTool.getFirstBO(RolePeer.doSelect(c),
                                         "Role named " + name);
    }

    /**
     * Returns all the roles on the site of the specified type.
     * @@param type The type of role to get.
     */
    public static List getRolesForType(String type)
        throws Exception
    {
        Criteria c = new Criteria().add(TYPE, type);
        return doSelect(c);
    }

}
@


1.1.2.1
log
@Classes ported to the Turbine Peer system. -dlr and leonardr
@
text
@a0 81
/* ================================================================
 * Copyright (c) 2001 CollabNet.  All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 * 
 * 1. Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 * 
 * 2. Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * 
 * 3. The end-user documentation included with the redistribution, if
 * any, must include the following acknowlegement: "This product includes
 * software developed by CollabNet (http://www.collab.net/)."
 * Alternately, this acknowlegement may appear in the software itself, if
 * and wherever such third-party acknowlegements normally appear.
 * 
 * 4. The hosted project names must not be used to endorse or promote
 * products derived from this software without prior written
 * permission. For written permission, please contact info@@collab.net.
 * 
 * 5. Products derived from this software may not use the "Tigris" name
 * nor may "Tigris" appear in their names without prior written
 * permission of CollabNet.
 * 
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL COLLABNET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * ====================================================================
 * 
 * This software consists of voluntary contributions made by many
 * individuals on behalf of CollabNet.
 */

package org.tigris.helm.om.peer;

import org.apache.turbine.util.db.Criteria;

import org.tigris.helm.DoesNotExist;
import org.tigris.helm.om.*;
import org.tigris.helm.tool.PeerTool;

/**
 * Extension of generated Peer BaseRolePeer.
 *
 * @@author <a href="mailto:leonardr@@collab.net">Leonard Richardson</a>
 */
public class RolePeer extends BaseRolePeer
{
    public static final String PROJECT_ROLE = "Project";
    public static final String DOMAIN_ROLE = "Domain";
    public static final String HOST_ROLE = "Host";

    public static final String DESCRIPTION = "description";
    public static final String REQUESTABLE = "requestable";

    /**
     * @@param name The name of the role.
     */
    public static Role getInstanceByName(String name)
        throws DoesNotExist, Exception
    {
        Criteria c = new Criteria()
            .add(RolePeer.NAME, name);
        return (Role)PeerTool.getFirstBO(RolePeer.doSelect(c),
                                         "Role named " + name);
    }

}
@


1.1.2.2
log
@Moved constants to the RoleType interface.
@
text
@d62 4
@


1.1.2.3
log
@Added getInstance() method.
@
text
@a58 2
 * @@author <a href="mailto:dlr@@collab.net">Daniel Rall</a>
 * @@version $Id: $
a63 9

    /**
     * @@param id The database key of the role.
     */
    public static Role getInstance(String id)
        throws Exception
    {
        return retrieveByPK(Integer.parseInt(id));
    }
@


1.1.2.4
log
@Added methods of getting roles.
@
text
@a48 2
import java.util.*;

d60 1
a60 1
 * @@version $Id: RolePeer.java,v 1.1.2.3 2001/01/31 02:52:36 dlr Exp $
a66 4
    public static String HOST_TYPE = "Host";
    public static String DOMAIN_TYPE = "Domain";
    public static String PROJECT_TYPE = "Project";

a85 11
    }

    /**
     * Returns all the roles on the site of the specified type.
     * @@param type The type of role to get.
     */
    public static List getRolesForType(String type)
        throws Exception
    {
        Criteria c = new Criteria().add(TYPE, type);
        return doSelect(c);
@


1.1.2.5
log
@Removed YET MORE redundant constants.
@
text
@d62 1
a62 1
 * @@version $Id: RolePeer.java,v 1.1.2.4 2001/02/01 21:09:34 leonardr Exp $
d68 4
@


1.1.2.6
log
@Normalized copyright dates.
@
text
@d2 1
a2 1
 * Copyright (c) 2000-2001 CollabNet.  All rights reserved.
d62 1
a62 1
 * @@version $Id: RolePeer.java,v 1.1.2.5 2001/02/01 21:52:44 dlr Exp $
@


1.1.2.7
log
@Added new imports necessitated by Torque.
@
text
@a52 1
import org.tigris.helm.om.base.*;
d62 1
a62 1
 * @@version $Id: RolePeer.java,v 1.1.2.6 2001/02/15 20:50:39 leonardr Exp $
@


