org.isam.exehda.services.ox
Interface OXManager

All Known Implementing Classes:
OXManagerClientImpl, OXManagerImpl

public interface OXManager

Author:
frainer

Field Summary
static byte ATT_READ
           
static byte ATT_WRITE
           
static java.lang.String SERVICE_NAME
           
 
Method Summary
 OXHandle createHandle(ObjectId oid)
          Create handle is used to create a new OXHandle for the OX with the given ObjectId.
 OXHandle grantOwnership(OXHandle ox)
          Grant ownership invalidates the ownership of the given OXHandle, allowing a new node to request the ownership of this OXHanlde.
 void realeaseHandle(OXHandle ox)
          Realease handle takes away the given handle from the handle list.
 OXHandle requestOwnership(OXHandle ox)
          requestWnershp grants the ownership of the given OXHandle to the calling HostId as long as that OXHandle is not currently owned by another host.
 OXHandle updateAttributes(OXHandle ox, java.lang.String[] att, byte[] op)
          OXhandle updates the attributes of the given ox.
 

Field Detail

ATT_READ

public static final byte ATT_READ
See Also:
Constant Field Values

ATT_WRITE

public static final byte ATT_WRITE
See Also:
Constant Field Values

SERVICE_NAME

public static final java.lang.String SERVICE_NAME
See Also:
Constant Field Values
Method Detail

createHandle

public OXHandle createHandle(ObjectId oid)
Create handle is used to create a new OXHandle for the OX with the given ObjectId. Wheter a new MasterOXHanlde or a new ProxyOXhandle will be created depends on wheter an OXHandle had already been created for the given OX or not

Parameters:
oid - a ObjectId representing the OX to which the OXHandle to be created will refer
Returns:
a new OXHandle

realeaseHandle

public void realeaseHandle(OXHandle ox)
Realease handle takes away the given handle from the handle list. Only to be uswed when the OX is no longer necessary.

Parameters:
ox - a OXHandle that is to be realeased
Returns:
void

grantOwnership

public OXHandle grantOwnership(OXHandle ox)
                        throws HandleNotFoundException,
                               NotMasterHandleException
Grant ownership invalidates the ownership of the given OXHandle, allowing a new node to request the ownership of this OXHanlde. While the OXHandle ownership is undefined all calls to that handle get queed until a new ownership is requested. To be used when an OXhandle migrates from one node to another.

Parameters:
ox - a OXHandle whose ownership is being granted
Returns:
a OXhandle
HandleNotFoundException
NotMasterHandleException

requestOwnership

public OXHandle requestOwnership(OXHandle ox)
                          throws HandleNotFoundException,
                                 WrongHandleException,
                                 NotMasterHandleException,
                                 WrongOwnershipCodeException
requestWnershp grants the ownership of the given OXHandle to the calling HostId as long as that OXHandle is not currently owned by another host.

Parameters:
ox - a OXHandle whose ownership is beign requested
Returns:
a OXHandle value
HandleNotFoundException
WrongHandleException
NotMasterHandleException
WrongOwnershipCodeException

updateAttributes

public OXHandle updateAttributes(OXHandle ox,
                                 java.lang.String[] att,
                                 byte[] op)
                          throws HandleNotFoundException
OXhandle updates the attributes of the given ox. The attributes to be updated are defined in a String array. What type of update is to be done (read or write) is defined in an byte array.

Parameters:
ox - a OXHanlde whose attributes are to be updated
att - an String[] defining what attributes are to be updated
Returns:
a OXHandle that is the OXHandle passed as parameter with it's attributes updated
HandleNotFoundException