001 package com.croftsoft.apps.wyrm.entity; 002 003 import java.security.*; 004 import java.util.*; 005 006 import javax.ejb.*; 007 008 /********************************************************************* 009 * The User Bean. 010 * 011 * @version 012 * 2002-10-31 013 * @since 014 * 2002-09-27 015 * @author 016 * <a href="http://alumni.caltech.edu/~croft">David Wallace Croft</a> 017 *********************************************************************/ 018 019 public abstract class UserBean 020 implements EntityBean 021 ////////////////////////////////////////////////////////////////////// 022 ////////////////////////////////////////////////////////////////////// 023 { 024 025 private static final Random random = new SecureRandom ( ); 026 027 // 028 029 public abstract Long getId ( ); 030 031 public abstract String getUsername ( ); 032 033 public abstract String getPassword ( ); 034 035 public abstract String getFirstName ( ); 036 037 public abstract String getMiddleName ( ); 038 039 public abstract String getLastName ( ); 040 041 public abstract double getCredits ( ); 042 043 public abstract PcLocal getPcLocal ( ); 044 045 // 046 047 public abstract void setId ( Long id ); 048 049 public abstract void setUsername ( String username ); 050 051 public abstract void setPassword ( String password ); 052 053 public abstract void setFirstName ( String firstName ); 054 055 public abstract void setMiddleName ( String middleName ); 056 057 public abstract void setLastName ( String lastName ); 058 059 public abstract void setCredits ( double credits ); 060 061 public abstract void setPcLocal ( PcLocal pcLocal ); 062 063 // 064 065 public abstract Collection ejbSelectUsernames ( ) 066 throws FinderException; 067 068 ////////////////////////////////////////////////////////////////////// 069 ////////////////////////////////////////////////////////////////////// 070 071 public String [ ] ejbHomeGetUsernames ( ) 072 throws FinderException 073 ////////////////////////////////////////////////////////////////////// 074 { 075 return ( String [ ] ) 076 ejbSelectUsernames ( ).toArray ( new String [ 0 ] ); 077 } 078 079 public Long ejbCreate ( String username ) 080 throws CreateException 081 ////////////////////////////////////////////////////////////////////// 082 { 083 setId ( new Long ( random.nextLong ( ) ) ); 084 085 setUsername ( username ); 086 087 return null; 088 } 089 090 public void ejbPostCreate ( String username ) { } 091 092 public void setEntityContext ( EntityContext ctx ) { } 093 094 public void unsetEntityContext ( ) { } 095 096 public void ejbActivate ( ) { } 097 098 public void ejbPassivate ( ) { } 099 100 public void ejbLoad ( ) { } 101 102 public void ejbStore ( ) { } 103 104 public void ejbRemove ( ) { } 105 106 ////////////////////////////////////////////////////////////////////// 107 ////////////////////////////////////////////////////////////////////// 108 }