degu.model.filestorage.ejb
Class FileStorageBean

java.lang.Object
  extended by degu.model.filestorage.ejb.FileStorageBean
All Implemented Interfaces:
java.io.Serializable, javax.ejb.EnterpriseBean, javax.ejb.EntityBean

public class FileStorageBean
extends java.lang.Object
implements javax.ejb.EntityBean

Entity Bean wich represents a file

See Also:
Serialized Form

Field Summary
private  javax.ejb.EntityContext ctx
           
private  java.lang.String id
           
private  java.io.File STORAGE_DIR
           
 
Constructor Summary
FileStorageBean()
           
 
Method Summary
 void ejbActivate()
           
 java.lang.String ejbCreateFromByteArray(java.lang.String id, byte[] data)
          Create method
 java.lang.String ejbCreateFromInputStream(java.lang.String id, java.io.InputStream is)
          Create method
 java.lang.String ejbFindByPrimaryKey(java.lang.String primaryKey)
           
 boolean ejbHomeCheckAvailability(java.lang.String id)
          Home method
 int ejbHomeGetFileCount()
          Home method
 void ejbLoad()
           
 void ejbPassivate()
           
 void ejbPostCreateFromByteArray(java.lang.String id, byte[] data)
          Post Create method
 void ejbPostCreateFromInputStream(java.lang.String id, java.io.InputStream is)
          Post Create method
 void ejbRemove()
           
 void ejbStore()
           
 byte[] getFileAsByteArray()
          Business method
 java.io.InputStream getFileAsInputStream()
          Business method
 java.lang.String getId()
           
 void setEntityContext(javax.ejb.EntityContext ctx)
           
 void unsetEntityContext()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

private java.lang.String id

STORAGE_DIR

private java.io.File STORAGE_DIR

ctx

private javax.ejb.EntityContext ctx
Constructor Detail

FileStorageBean

public FileStorageBean()
Method Detail

setEntityContext

public void setEntityContext(javax.ejb.EntityContext ctx)
                      throws javax.ejb.EJBException,
                             java.rmi.RemoteException
Specified by:
setEntityContext in interface javax.ejb.EntityBean
Throws:
javax.ejb.EJBException
java.rmi.RemoteException

unsetEntityContext

public void unsetEntityContext()
                        throws javax.ejb.EJBException,
                               java.rmi.RemoteException
Specified by:
unsetEntityContext in interface javax.ejb.EntityBean
Throws:
javax.ejb.EJBException
java.rmi.RemoteException

ejbRemove

public void ejbRemove()
               throws javax.ejb.RemoveException,
                      javax.ejb.EJBException,
                      java.rmi.RemoteException
Specified by:
ejbRemove in interface javax.ejb.EntityBean
Throws:
javax.ejb.RemoveException
javax.ejb.EJBException
java.rmi.RemoteException

ejbActivate

public void ejbActivate()
                 throws javax.ejb.EJBException,
                        java.rmi.RemoteException
Specified by:
ejbActivate in interface javax.ejb.EntityBean
Throws:
javax.ejb.EJBException
java.rmi.RemoteException

ejbPassivate

public void ejbPassivate()
                  throws javax.ejb.EJBException,
                         java.rmi.RemoteException
Specified by:
ejbPassivate in interface javax.ejb.EntityBean
Throws:
javax.ejb.EJBException
java.rmi.RemoteException

ejbLoad

public void ejbLoad()
             throws javax.ejb.EJBException,
                    java.rmi.RemoteException
Specified by:
ejbLoad in interface javax.ejb.EntityBean
Throws:
javax.ejb.EJBException
java.rmi.RemoteException

ejbStore

public void ejbStore()
              throws javax.ejb.EJBException,
                     java.rmi.RemoteException
Specified by:
ejbStore in interface javax.ejb.EntityBean
Throws:
javax.ejb.EJBException
java.rmi.RemoteException

ejbCreateFromByteArray

public java.lang.String ejbCreateFromByteArray(java.lang.String id,
                                               byte[] data)
                                        throws javax.ejb.CreateException
Create method

Throws:
javax.ejb.CreateException

ejbPostCreateFromByteArray

public void ejbPostCreateFromByteArray(java.lang.String id,
                                       byte[] data)
                                throws javax.ejb.CreateException
Post Create method

Throws:
javax.ejb.CreateException

getId

public java.lang.String getId()

ejbFindByPrimaryKey

public java.lang.String ejbFindByPrimaryKey(java.lang.String primaryKey)
                                     throws javax.ejb.FinderException
Throws:
javax.ejb.FinderException

getFileAsInputStream

public java.io.InputStream getFileAsInputStream()
Business method


getFileAsByteArray

public byte[] getFileAsByteArray()
Business method


ejbHomeGetFileCount

public int ejbHomeGetFileCount()
Home method


ejbCreateFromInputStream

public java.lang.String ejbCreateFromInputStream(java.lang.String id,
                                                 java.io.InputStream is)
                                          throws javax.ejb.CreateException
Create method

Throws:
javax.ejb.CreateException

ejbPostCreateFromInputStream

public void ejbPostCreateFromInputStream(java.lang.String id,
                                         java.io.InputStream is)
                                  throws javax.ejb.CreateException
Post Create method

Throws:
javax.ejb.CreateException

ejbHomeCheckAvailability

public boolean ejbHomeCheckAvailability(java.lang.String id)
Home method