oracle.ifs.server
Class S_LibraryObject


java.lang.Object

  |

  +--oracle.ifs.server.S_LibraryObject

All Implemented Interfaces:
IfsEventHandler, LibraryObjectInterface, Traceable
Direct Known Subclasses:
S_TieLibraryObject

public abstract class S_LibraryObject
extends java.lang.Object
implements IfsEventHandler, LibraryObjectInterface

The S_LibraryObject class is the server side base class for all iFS objects.


Constructor Summary
protected S_LibraryObject(S_LibrarySession session, java.lang.Long classId)
          This constructor is called during object creation (i.e., this Library Object does not yet exist in the database).
protected S_LibraryObject(S_LibrarySession session, S_LibraryObjectData data)
          Construct a S_LibraryObject object.
 
Method Summary
protected  void deriveDefinition(S_LibraryObjectDefinition def)
          Add to the S_LibraryObjectDefinition for this class.
 boolean equals(S_LibraryObject item)
          Compares whether two LibraryObjects are the same IFS object.
protected  void extendedPreFree(OperationState opState, S_LibraryObjectDefinition def)
          operations to be performed before freeing an object.
protected  void extendedPreInsert(OperationState opState, S_LibraryObjectDefinition sdef)
          operations to be performed before creating an object.
protected  void extendedPreUpdate(OperationState opState, S_LibraryObjectDefinition def)
          operations to be performed before updating an object.
 void free(OperationState opState, S_LibraryObjectDefinition def)
          permanently delete an object.
 AttributeValue getAttribute(java.lang.String attr_name)
          return an AttributeValue object that holds the value of the requested attribute.
 AttributeValue getAttributeByUpperCaseName(java.lang.String attr_name)
          Gets the attribute value for the specified attribute.
 java.lang.Long getClassId()
          getClassId - get the object's class ID (a long).
 S_ClassObject getClassObject()
          getClassObject - get the object's ClassObject
 java.lang.Long getId()
          getId - get the object's numeric ID (a long).
 S_LibrarySession getSession()
          getSession - return current S_LibrarySession.
 void handleEvent(IfsEvent event)
          Handles the specified event.
 boolean hasNameAttribute()
          returns true if this object is an instance of a class that has a NAME attribute, and false otherwise.
 boolean isTraced(int channel, int level)
          Gets whether tracing is enabled for the specified channel and level.
 void postEvent(int eventType, int eventStatus)
          Posts an event of the specified type and status.
 void postEvent(int eventType, int eventSubtype, int eventStatus, long longPayload)
          Posts an event of the specified type, subtype, and status.
 java.io.Reader renderAsReader(java.lang.String rendererType, java.lang.String rendererName, java.util.Hashtable options)
          Renders this LibraryObject as a Reader.
 java.io.InputStream renderAsStream(java.lang.String rendererType, java.lang.String rendererName, java.util.Hashtable options)
          Renders this LibraryObject as an InputStream.
 void setAttribute(AttributeValue attr_value)
          set the object's attribute to the specified value.
 void setAttribute(java.lang.String attr_name, AttributeValue attr_value)
          set the object's attribute to the specified value.
 java.lang.String toString()
          If this is an instance of a class that has a name attribute, return getName(); else, return super.toString().
 void trace(int channel, int level, java.lang.String payload)
          Issues a trace request to the trace logger.
 void update(OperationState opState, S_LibraryObjectDefinition def)
          update an object in the context of an Operation.
 

Constructor Detail


S_LibraryObject


protected S_LibraryObject(S_LibrarySession session,
                          S_LibraryObjectData data)
                   throws IfsException
Construct a S_LibraryObject object. This constructor is called for objects that already exist in the database.
Parameters:
session - current S_LibrarySession
data - the object's data

S_LibraryObject


protected S_LibraryObject(S_LibrarySession session,
                          java.lang.Long classId)
                   throws IfsException
This constructor is called during object creation (i.e., this Library Object does not yet exist in the database).
Parameters:
session - current S_LibrarySession
Method Detail

getId


public java.lang.Long getId()
                     throws IfsException
getId - get the object's numeric ID (a long).
Specified by:
getId in interface LibraryObjectInterface
Returns:
the object's Identifier.

getClassId


public java.lang.Long getClassId()
                          throws IfsException
getClassId - get the object's class ID (a long). This is effectively the same as getClassObject().getId();
Returns:
the object's class Identifier.
Throws:
IfsException - if the operation fails

equals


public boolean equals(S_LibraryObject item)
               throws IfsException
Compares whether two LibraryObjects are the same IFS object. The comparison returns true only if the specified object is not null and only if both objects refer to an object that is not freed.
Returns:
true if the objects have the same Id.
Throws:
IfsException - if operation fails.

getClassObject


public final S_ClassObject getClassObject()
                                   throws IfsException
getClassObject - get the object's ClassObject
Returns:
the object's ClassObject

hasNameAttribute


public boolean hasNameAttribute()
                         throws IfsException
returns true if this object is an instance of a class that has a NAME attribute, and false otherwise.
Returns:
true if the object has a NAME attribute.
Throws:
IfsException - if operation fails.

getSession


public S_LibrarySession getSession()
                            throws IfsException
getSession - return current S_LibrarySession.
Returns:
the current LibrarySession
Throws:
IfsException - if operation fails.

toString


public java.lang.String toString()
If this is an instance of a class that has a name attribute, return getName(); else, return super.toString().
Overrides:
toString in class java.lang.Object
Returns:
the name of the object.

getAttribute


public final AttributeValue getAttribute(java.lang.String attr_name)
                                  throws IfsException
return an AttributeValue object that holds the value of the requested attribute.
Parameters:
attr_name - the name of the Attribute
Returns:
the requested AttributeValue
Throws:
IfsException - if operation fails.

getAttributeByUpperCaseName


public final AttributeValue getAttributeByUpperCaseName(java.lang.String attr_name)
                                                 throws IfsException
Gets the attribute value for the specified attribute. Avoids the cost of toUpperCase on the attribute name.
Parameters:
attr_name - the attribute name; must be all upper case
Returns:
the AttributeValue
Throws:
IfsException - if the operation fails

setAttribute


public void setAttribute(java.lang.String attr_name,
                         AttributeValue attr_value)
                  throws IfsException
set the object's attribute to the specified value. The value is set in the object's cache as well as in the iFS server. This variant will set the attribute's name in the AttributeValue to the name argument provided.
Parameters:
attr_name - the name of the Attribute
attr_value - the desired value of the Attribute
Throws:
IfsException - if operation fails.

setAttribute


public void setAttribute(AttributeValue attr_value)
                  throws IfsException
set the object's attribute to the specified value. The value is set in the object's cache as well as in the iFS server.
Parameters:
attr_value - the desired name & value of the Attribute
Throws:
IfsException - if operation fails.

renderAsStream


public final java.io.InputStream renderAsStream(java.lang.String rendererType,
                                                java.lang.String rendererName,
                                                java.util.Hashtable options)
                                         throws IfsException
Renders this LibraryObject as an InputStream.

The rendererType and rendererName together determine which Renderer implementation is to be used as follows:

If rendererName is not null, the Policy named rendererName for the operation specified by rendererType is obtained. The fully-qualified classname of the Renderer is contained in the IMPLEMENTATION attribute of that Policy.

If rendererName is null, the default Policy for this LibraryObject for the operation specified by rendererType is obtained. The fully- qualified classname of the Renderer is contained in the IMPLEMENTATION attribute of that Policy.

The values in the options Hashtable must be serializable.

Parameters:
rendererType - the type of the desired Renderer
rendererName - the name of the desired Renderer
options - any Renderer-specific options
Returns:
the InputStream
Throws:
IfsException - (IFS-30110) if the operation fails

renderAsReader


public final java.io.Reader renderAsReader(java.lang.String rendererType,
                                           java.lang.String rendererName,
                                           java.util.Hashtable options)
                                    throws IfsException
Renders this LibraryObject as a Reader.

The rendererType and rendererName together determine which Renderer implementation is to be used as follows:

If rendererName is not null, the Policy named rendererName for the operation specified by rendererType is obtained. The fully-qualified classname of the Renderer is contained in the IMPLEMENTATION attribute of that Policy.

If rendererName is null, the default Policy for this LibraryObject for the operation specified by rendererType is obtained. The fully- qualified classname of the Renderer is contained in the IMPLEMENTATION attribute of that Policy.

The values in the options Hashtable must be serializable.

Parameters:
rendererType - the type of the desired Renderer
rendererName - the name of the desired Renderer
options - any Renderer-specific options
Returns:
the Reader
Throws:
IfsException - (IFS-30110) if the operation fails

update


public void update(OperationState opState,
                   S_LibraryObjectDefinition def)
            throws IfsException
update an object in the context of an Operation.
Parameters:
opState - Operation state
def - the server-side definition class that holds the attribute changes
Throws:
IfsException - if operation fails.

extendedPreUpdate


protected void extendedPreUpdate(OperationState opState,
                                 S_LibraryObjectDefinition def)
                          throws IfsException
operations to be performed before updating an object. This is overridden by classes that need to perform operations before udpating this object in the database.
Parameters:
opState - Operation state
def - the server-side definition class that holds the attribute changes
Throws:
IfsException - if operation fails.

extendedPreFree


protected void extendedPreFree(OperationState opState,
                               S_LibraryObjectDefinition def)
                        throws IfsException
operations to be performed before freeing an object. This is overridden by classes that need to perform operations before successfully deleting the rows for the freed instance.
Throws:
IfsException - if operation fails.

extendedPreInsert


protected void extendedPreInsert(OperationState opState,
                                 S_LibraryObjectDefinition sdef)
                          throws IfsException
operations to be performed before creating an object. This is overridden by classes that need to perform operations before successfully creating the rows for the new instance.
Throws:
IfsException - if operation fails.

deriveDefinition


protected void deriveDefinition(S_LibraryObjectDefinition def)
                         throws IfsException
Add to the S_LibraryObjectDefinition for this class. This this called by getDefinition() on S_LibraryObject. All classes that extend this should call super.deriveDefinition() before applying any class-specific changes to the S_LibraryObjectDefinition object.
Parameters:
def - the S_LibraryObjectDefinition that contains the definition of the target object.
Throws:
IfsException - if operation fails.

free


public void free(OperationState opState,
                 S_LibraryObjectDefinition def)
          throws IfsException
permanently delete an object.
Throws:
IfsException - if operation fails.

isTraced


public final boolean isTraced(int channel,
                              int level)
                       throws IfsException
Gets whether tracing is enabled for the specified channel and level.
Specified by:
isTraced in interface Traceable
Parameters:
channel - the channel number
level - the level
Returns:
whether tracing is enabled
Throws:
IfsException - (IFS-11201) if the channel is invalid

trace


public final void trace(int channel,
                        int level,
                        java.lang.String payload)
Issues a trace request to the trace logger.
Specified by:
trace in interface Traceable
Parameters:
channel - the channel number
level - the level
payload - a string containing any additional information to be placed in the trace log

postEvent


public final void postEvent(int eventType,
                            int eventStatus)
                     throws IfsException
Posts an event of the specified type and status.
Parameters:
eventType - the event type; must be one of the event type constants enumerated in IfsEvent
eventStatus - the event status; must be one of the event status constants enumerated in IfsEvent
Throws:
IfsException - if the operation fails

postEvent


public final void postEvent(int eventType,
                            int eventSubtype,
                            int eventStatus,
                            long longPayload)
                     throws IfsException
Posts an event of the specified type, subtype, and status.
Parameters:
eventType - the event type; must be one of the event type constants enumerated in IfsEvent
eventSubtype - the event subtype; the meaningful values are eventType variant
eventStatus - the event status; must be one of the event status constants enumerated in IfsEvent
longPayload - the long payload; the meaningful values are eventType variant
Throws:
IfsException - if the operation fails

handleEvent


public void handleEvent(IfsEvent event)
                 throws IfsException
Handles the specified event.
Specified by:
handleEvent in interface IfsEventHandler
Parameters:
event - the event
Throws:
IfsException - if the operation fails