com.bristle.javalib.security
Class SecurableObject

java.lang.Object
  extended by com.bristle.javalib.security.SecurableObject
All Implemented Interfaces:
Securable

public class SecurableObject
extends Object
implements Securable

This class is a simple object that implements the Securable interface.

Usage:

   - The typical scenarios for using this class are:
     - To create a Securable from a set of properties that describe it:
           Securable securable = new SecurableObject
                                   (strDataSource, intClassId, intId);

Assumptions:
Effects:
       - None.
Anticipated Changes:
Notes:
Implementation Notes:
Portability Issues:
Revision History:
   $Log$


Field Summary
private  int m_intClassId
           
private  int m_intId
           
private  int m_intNullClassId
           
private  int m_intNullId
           
private  String m_strDataSource
           
private static long serialVersionUID
          This number identifies the version of the class definition, used for serialized instances.
private static SecurableObject st_CLASS_OF_OBJECTS
           
private static int st_intDefaultNullClassId
           
private static int st_intDefaultNullId
           
 
Constructor Summary
SecurableObject()
          Constructor.
SecurableObject(String strDataSource, int intClassId, int intId)
          Constructor.
 
Method Summary
 int getClassId()
          Get the unique id of the class of objects
 String getDataSource()
          Get the data source, typically a DB table name, of the object, for use in determining whether the current user has access to it.
static int getDefaultNullClassId()
          Get the default value for NullClassId.
static int getDefaultNullId()
          Get the default value for NullId.
 int getId()
          Get the unique id
 int getNullClassId()
          Get the value that indicates a null class id
 int getNullId()
          Get the value that indicates a null id
 Securable getSecurableCLASS_OF_OBJECTS()
           
static SecurableObject getStaticCLASS_OF_OBJECTS()
          Get the special instance that indicates the class of objects instead of any one particular instance, without requiring an instance to be created.
 void setClassId(int intVal)
          Set the id of the class of objects.
 void setDataSource(String strVal)
          Set the data source, typically a DB table name, of the object.
 void setId(int intVal)
          Set the id.
 void setNullClassId(int intVal)
          Set the value that indicates a null id of the class of objects.
 void setNullId(int intVal)
          Set the value that indicates a null id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

st_CLASS_OF_OBJECTS

private static final SecurableObject st_CLASS_OF_OBJECTS

st_intDefaultNullClassId

private static final int st_intDefaultNullClassId
See Also:
Constant Field Values

st_intDefaultNullId

private static final int st_intDefaultNullId
See Also:
Constant Field Values

m_strDataSource

private String m_strDataSource

m_intNullClassId

private int m_intNullClassId

m_intClassId

private int m_intClassId

m_intNullId

private int m_intNullId

m_intId

private int m_intId

serialVersionUID

private static final long serialVersionUID
This number identifies the version of the class definition, used for serialized instances. Be sure to increment it when adding/modifying instance variable definitions or making any other change to the class definition. Omitting this declaration causes a compiler warning for any class that implements java.io.Serializable.

See Also:
Constant Field Values
Constructor Detail

SecurableObject

public SecurableObject()
Constructor.


SecurableObject

public SecurableObject(String strDataSource,
                       int intClassId,
                       int intId)
Constructor.

Parameters:
strDataSource - The data source
intClassId - The class id
intId - The object id
Method Detail

getStaticCLASS_OF_OBJECTS

public static SecurableObject getStaticCLASS_OF_OBJECTS()
Get the special instance that indicates the class of objects instead of any one particular instance, without requiring an instance to be created. Note: This method exists as a convenience for code that doesn't want to create an instance before calling. Can't simply make getSecurableCLASS_OF_OBJECTS() static because Securable can't enforce the existence of a static method.

Returns:
The special instance.

getSecurableCLASS_OF_OBJECTS

public Securable getSecurableCLASS_OF_OBJECTS()
Specified by:
getSecurableCLASS_OF_OBJECTS in interface Securable
See Also:
Securable.getSecurableCLASS_OF_OBJECTS()

getDataSource

public String getDataSource()
Description copied from interface: Securable
Get the data source, typically a DB table name, of the object, for use in determining whether the current user has access to it.

Specified by:
getDataSource in interface Securable
Returns:
The data source
See Also:
Securable.getDataSource()

setDataSource

public void setDataSource(String strVal)
Set the data source, typically a DB table name, of the object.

Parameters:
strVal - The value to set.

getClassId

public int getClassId()
Description copied from interface: Securable
Get the unique id of the class of objects

Specified by:
getClassId in interface Securable
Returns:
The unique class id
See Also:
Securable.getClassId()

setClassId

public void setClassId(int intVal)
Set the id of the class of objects.

Parameters:
intVal - The value to set.

getNullClassId

public int getNullClassId()
Description copied from interface: Securable
Get the value that indicates a null class id

Specified by:
getNullClassId in interface Securable
Returns:
The null class id
See Also:
Securable.getNullClassId()

setNullClassId

public void setNullClassId(int intVal)
Set the value that indicates a null id of the class of objects.

Parameters:
intVal - The value to set.

getDefaultNullClassId

public static int getDefaultNullClassId()
Get the default value for NullClassId.

Returns:
The default value.

getId

public int getId()
Description copied from interface: Securable
Get the unique id

Specified by:
getId in interface Securable
Returns:
The unique id
See Also:
Securable.getId()

setId

public void setId(int intVal)
Set the id.

Parameters:
intVal - The value to set.

getNullId

public int getNullId()
Description copied from interface: Securable
Get the value that indicates a null id

Specified by:
getNullId in interface Securable
Returns:
The null id
See Also:
Securable.getNullId()

setNullId

public void setNullId(int intVal)
Set the value that indicates a null id.

Parameters:
intVal - The value to set.

getDefaultNullId

public static int getDefaultNullId()
Get the default value for NullId.

Returns:
The default value.