|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--asgaard.skid.BeanBroker
BeanBroker is the transparent objectstorage of "Skid". It is th object-oriented interface of the database and maintain all databean-object-instances at runtime within a common access functionality. CREATE, FIND, UPDATE is done completely transparent, the used database is also hidden.
Important: public static BeanBroker THIS
has to be defined
within each VM to guarantie regular behavior within Skid!
To become persistent an Object has to implement RemoteBean
.
SkidBean
Field Summary | |
static java.util.GregorianCalendar |
CALENDAR
|
static java.lang.String |
Dump_Fiele_Name
Name of the Dumpfile |
static byte |
FILTER_EQ
exact the same value "=" |
static byte |
FILTER_GR
greater ">" |
static byte |
FILTER_GR_EQ
greater or equal ">=" |
static byte |
FILTER_NONE
Not used for Search. |
static byte |
FILTER_NOT_EQ
not equal "! |
static byte |
FILTER_SM
smaller "<" |
static byte |
FILTER_SM_EQ
smaller or equal "<=" |
static int |
HISTORY_ALL
All information for the UNDO-mechanism is stored. |
static int |
HISTORY_NONE
No information for the UNDO-mechanism is stored |
static java.lang.String |
HOST
String with the ip-Adress of the Host |
static int |
ID_FAIL
|
static int |
ID_HIGH
|
protected asgaard.utils.log.LogClient |
log
|
SkidMaintain |
maintain
Database Maintainanceobject (Backup, Restore, ...) |
static int |
PUBLIC_ID
|
static RemoteBroker |
THIS
Global pointer to the BeanBroker (one per VM) |
static byte |
TYPE_BEAN
Beantypes: A SkidBean, made persistand by complete storage through serialisation |
static byte |
TYPE_CLASS
Beantypes: Holds Meta-Information about the class |
static byte |
TYPE_HEAVYWEIGHT
Beantypes: A heavyweight-Bean it's content is stored in an extra table |
static byte |
TYPE_LIGHTWEIGHT
Beantypes: A lightweight-Bean made persistance storing only parts of itselfe |
static byte |
UPDATE_ALL
All modifications are done, no difference whether there are changes made or not. |
static byte |
UPDATE_NONE
No Updates are done. |
static byte |
UPDATE_STRONG
Only if the Broker-Version of the Bean has not changed in meantime. |
static byte |
UPDATE_WEAK
Only if there is no newer Bean at the Broker an update is made. |
Constructor Summary | |
BeanBroker(java.lang.String driverClass,
java.lang.String connStr,
java.lang.String connUser,
java.lang.String connPwd,
java.lang.String localDB,
asgaard.utils.log.LogClient log,
byte loglevel,
boolean runLocal,
java.util.ResourceBundle sRes,
long nr,
java.lang.String xKey)
Creating Object-Broker and Establishing connection to the database. |
Method Summary | |
void |
addEvent(RemoteBean producer,
RemoteBean event)
Adding an Event and replicating it to all suscribed Objects. |
boolean |
beanExist(int key)
Returns whether an Bean is available within the Broker or not. |
java.lang.String |
checkUser(java.lang.String userName,
java.lang.String encr)
Checks if the given username exists or not |
protected void |
connectDatabase(java.lang.String driverClass,
java.lang.String connStr,
java.lang.String connUser,
java.lang.String connPwd,
java.lang.String localDB,
boolean runLocal,
java.util.ResourceBundle sRes)
Does the connection to the database and creates it if nessecary. |
protected void |
delEvent()
Deletes all marked Events |
protected void |
delEvent(long deadline)
Deletes all events older than the given time |
static java.lang.String |
encryptPwd(java.lang.String clearPwd)
Encrypts an password for Database connection with the built in key. |
RemoteBean |
getBean(int key)
Searches for a Bean by a given key. |
RemoteBean[] |
getBean(int[] key)
Searches for Beans by a given set of keys. |
int[] |
getBeanKey(java.lang.String aClass,
java.lang.String[] paramName,
java.lang.Object[] searchValue,
byte[] searchOp)
Searches for a Bean by a given key. |
BeanKeyCall |
getBeanKeyCall(java.lang.Class aClass)
Returns the Key-Call-Adapter for a asked Class (represented by it's key). |
BeanKeyCall |
getBeanKeyCall(int pClass)
Returns the Key-Call-Adapter for a asked Class (represented by it's key). |
int |
getClassKey(java.lang.Class aClass)
Class-Key of the Bean, differ between different classes. |
int |
getClassKey(RemoteBean aBean)
Class-Key of the Bean, differ between different classes. |
int |
getClassKey(java.lang.String classname)
Class-Key of the Bean, differ between different classes. |
SkidEvent[] |
getEvent(RemoteBean consumer,
long newer)
Returns the Events for a consumer object which are newer than the given time |
BeanLink[] |
getLink(BeanLinkFilter filter)
Searches for a set of Links using the filter - capabilities of BeanLink . |
BeanLink |
getLink(int from,
int to,
int by)
Searches for a specific Link using it's primary key. |
java.lang.Object[][] |
getTestScript()
Returns the Test-Script for this Class |
java.lang.Object |
getUser(java.lang.Object o,
java.lang.String name,
java.lang.String encr)
Excanges an user with an authorised object (hardcoded) |
java.lang.Object |
getUser(java.lang.String name,
java.lang.String encr)
Excanges an user with an authorised object (hardcoded) |
java.lang.Object |
invokeCall(java.lang.Class beanClass,
java.lang.String name,
java.lang.Object[] args,
java.lang.String[] classnames)
Invokes the called method of the filterinterface. |
boolean |
linkExist(int from,
int to,
int by)
Returns if a specific Key exists, hiding all Exceptions. |
boolean |
logMsg(java.lang.String server,
java.lang.String point,
byte typ,
boolean ok,
java.lang.String msg)
Puts a Message to the LOG-Server if available and returns whether it was sent or not |
java.lang.Object[] |
putBean(RemoteBean aObj)
Puts the Bean into the Chache and saves it do not use manually. |
boolean |
putLink(BeanLink link)
Adds a new Relation between Beans. |
boolean |
putUser(java.lang.Object o)
Excanges an user with an authorised object (hardcoded) |
protected void |
reconnect()
Resonnecting to the database after a timeout |
void |
setEvent(RemoteBean producer,
RemoteBean event,
RemoteBean consumer,
byte fromState,
byte toState)
Changing the State of an specific event. |
void |
suscribeEvent(RemoteBean producer,
RemoteBean event,
RemoteBean consumer)
Adding an Event-Pattern and suscribing this type of event. |
boolean |
testIt(java.lang.Object local_handle)
Performs some Tests on the living Object |
void |
testMode(boolean on)
Switches the test - mode on / off. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static RemoteBroker THIS
public static java.lang.String HOST
public static final byte FILTER_NONE
public static final byte FILTER_EQ
public static final byte FILTER_GR
public static final byte FILTER_GR_EQ
public static final byte FILTER_SM
public static final byte FILTER_SM_EQ
public static final byte FILTER_NOT_EQ
public static final int HISTORY_NONE
public static final int HISTORY_ALL
public static final byte UPDATE_NONE
public static final byte UPDATE_ALL
public static final byte UPDATE_WEAK
public static final byte UPDATE_STRONG
public static final byte TYPE_CLASS
public static final byte TYPE_BEAN
public static final byte TYPE_LIGHTWEIGHT
public static final byte TYPE_HEAVYWEIGHT
public static java.lang.String Dump_Fiele_Name
public static final java.util.GregorianCalendar CALENDAR
public static final int ID_HIGH
public static final int ID_FAIL
public static final int PUBLIC_ID
protected asgaard.utils.log.LogClient log
public SkidMaintain maintain
asgaard.Skid.SkidMaintain
Constructor Detail |
public BeanBroker(java.lang.String driverClass, java.lang.String connStr, java.lang.String connUser, java.lang.String connPwd, java.lang.String localDB, asgaard.utils.log.LogClient log, byte loglevel, boolean runLocal, java.util.ResourceBundle sRes, long nr, java.lang.String xKey) throws java.lang.Exception
driverClass
- zu ladende TreiberklasseconnStr
- Connection-String um an der DB anzumeldenconnUser
- UsernameconnPwd
- Paßwortoutput
- Anzeigelog
- LogClientloglevel
- which statements shall be creatednr
- serialnumberxKey
- encrypted key in HEX-Format, empty keys are invalidDataObjectCollection#DataObjectCollection
,
asgaard.utils.cryptography.IDEA
Method Detail |
public static final java.lang.String encryptPwd(java.lang.String clearPwd)
clearPwd
- clear passwordasgaard.utils.cryptography.IDEA
protected void reconnect() throws java.lang.Exception
protected void connectDatabase(java.lang.String driverClass, java.lang.String connStr, java.lang.String connUser, java.lang.String connPwd, java.lang.String localDB, boolean runLocal, java.util.ResourceBundle sRes) throws java.lang.Exception
public int getClassKey(java.lang.String classname)
classname
- the name of the classpublic int getClassKey(RemoteBean aBean)
aBean
- a Bean asked for the class-idpublic int getClassKey(java.lang.Class aClass)
aClass
- the Bean-Class asked for the class-idpublic java.lang.Object[] putBean(RemoteBean aObj) throws java.lang.Exception
flush
Remark: A System-Object cannot be modified and carries the created-Timestamp 0
aObj
- the calling Beanasgaard.skid.RemoteBean#saveflush
public BeanKeyCall getBeanKeyCall(java.lang.Class aClass) throws java.lang.Exception
classkey
- the id of the classpublic BeanKeyCall getBeanKeyCall(int pClass) throws java.lang.Exception
classkey
- the id of the classpublic int[] getBeanKey(java.lang.String aClass, java.lang.String[] paramName, java.lang.Object[] searchValue, byte[] searchOp) throws SkidException
aClass
- the searched classparamName
- list of the parameter to search forsearchValues
- values to fitsearch-operator
- public RemoteBean getBean(int key) throws java.lang.Exception
key
- the primary key of the objectpublic RemoteBean[] getBean(int[] key) throws java.lang.Exception
key
- the primary key of the objectpublic boolean beanExist(int key)
key
- the unique key of the Beanpublic boolean putLink(BeanLink link) throws java.lang.Exception
link
- one relationpublic BeanLink getLink(int from, int to, int by) throws java.lang.Exception
from
- key of the origin Beanto
- key of the target Beanby
- key of the link-Bean (kind of Link)public BeanLink[] getLink(BeanLinkFilter filter) throws java.lang.Exception
BeanLink
.filter
- the BeanLink used as Filterpublic boolean linkExist(int from, int to, int by)
from
- key of the origin Beanto
- key of the target Beanby
- key of the link-Bean (kind of Link)public void addEvent(RemoteBean producer, RemoteBean event) throws java.lang.Exception
producer
- of the event (not null
)event
- the kond of the event (not null
)public void setEvent(RemoteBean producer, RemoteBean event, RemoteBean consumer, byte fromState, byte toState) throws java.lang.Exception
producer
- of the event (not null
)event
- the kond of the event (not null
)consumer
- of the event (not null
)fromState
- ols State of the eventtoState
- ols State of the eventpublic void suscribeEvent(RemoteBean producer, RemoteBean event, RemoteBean consumer) throws java.lang.Exception
producer
- of the event (not null
)event
- the kond of the event (not null
)consumer
- of the event (not null
)protected void delEvent() throws java.lang.Exception
protected void delEvent(long deadline) throws java.lang.Exception
deadline
- oldest event allowedpublic SkidEvent[] getEvent(RemoteBean consumer, long newer) throws java.lang.Exception
consumer
- of the eventsnewer
- than the given timepublic final java.lang.String checkUser(java.lang.String userName, java.lang.String encr) throws SkidException, java.rmi.RemoteException, java.sql.SQLException
userName
- name of the userencr
- the encrypted password (optional)public final java.lang.Object getUser(java.lang.Object o, java.lang.String name, java.lang.String encr) throws SkidException, java.rmi.RemoteException, java.sql.SQLException
public final java.lang.Object getUser(java.lang.String name, java.lang.String encr) throws SkidException, java.rmi.RemoteException, java.sql.SQLException
public final boolean putUser(java.lang.Object o) throws SkidException, java.rmi.RemoteException, java.sql.SQLException
public java.lang.Object invokeCall(java.lang.Class beanClass, java.lang.String name, java.lang.Object[] args, java.lang.String[] classnames) throws java.lang.Exception
beanClass
- the class which the asked BeanKeyCall object is forname
- the name of the Methodargs
- the ArgumentsMethod.invoke(java.lang.Object, java.lang.Object[])
public java.lang.Object[][] getTestScript()
public void testMode(boolean on)
public boolean testIt(java.lang.Object local_handle)
public boolean logMsg(java.lang.String server, java.lang.String point, byte typ, boolean ok, java.lang.String msg)
server
- The calling Java-Serverclasspoint
- The Method / place where the statement was createdtyp
- The Type of the LOG-Statementok
- Was the ServicePoint passed successfulymsg
- Human redable Message of the StatementLogMsg
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |