Commit a4521729 authored by Matt Tucker's avatar Matt Tucker Committed by matt

Initial check-in.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@37 b35dd754-fafc-0310-a699-88a17e54d16e
parent 0e256840
#
# $RCSfile$
# $Revision$
# $Date$
#
#
# Directory where the jar files will be deployed (see the deployjar task)
#
deploy.jar.dir=
#
# Directory where the installer messenger.iap_xml file is located.
# Example: d:\\cvs\\xmpp\\chat\\build\\installer (win paths must have \\)
# Note: Do not put a trailing "\" at the end!
#
installer.new.path=
\ No newline at end of file
<?xml version="1.0"?>
<!--
$RCSfile$
$Revision$
$Date$
LICENSE INFO HERE
-->
<!--
Build Requirements:
* Ant 1.6 (including optional tasks)
* JDK 1.5
* jUnit in your Ant or Java classpath
-->
<project name="Messenger XMPP Server" default="all" basedir="..">
<description>
Jive Messenger build script.
</description>
<!-- ======================================================================================= -->
<!-- GLOBAL PROPERTIES -->
<!-- ======================================================================================= -->
<property file="${basedir}/build/build.properties" />
<property name="src.dir" value="${basedir}/src" />
<property name="src.java.dir" value="${src.dir}/java" />
<property name="src.i18n.dir" value="${src.dir}/i18n" />
<property name="lib.build.dir" value="${basedir}/build/lib" />
<property name="lib.merge.dir" value="${lib.build.dir}/merge" />
<property name="target.dir" value="${basedir}/target" />
<property name="compile.dir" value="${basedir}/target/classes" />
<property name="jar.name" value="messengerd.jar" />
<property name="jar.dest.dir" value="${target.dir}/lib" />
<property name="javadoc.dir" value="${basedir}/target/javadoc" />
<property name="jspc.dest.dir" value="${target.dir}/jspc" />
<property name="jspc.java.dest.dir" value="${target.dir}/jspc/java" />
<property name="jspc.classes.dest.dir" value="${target.dir}/jspc/classes" />
<property name="release.dest.dir" value="${target.dir}/release" />
<!-- ======================================================================================= -->
<!-- PATHs / PATTERNSETs -->
<!-- ======================================================================================= -->
<path id="javadoc.dependencies">
<fileset dir="${lib.build.dir}" includes="*.jar" />
</path>
<path id="compile.dependencies">
<path refid="javadoc.dependencies" />
<fileset dir="${lib.merge.dir}" includes="*.jar" />
</path>
<patternset id="compile.sources">
<include name="**/*.java" />
</patternset>
<!-- ======================================================================================= -->
<!-- TARGETs -->
<!-- ======================================================================================= -->
<!-- all =================================================================================== -->
<target name="all" depends="war" description="Calls 'war' target" />
<!-- init ================================================================================== -->
<target name="init">
<!-- Check for min build requirements -->
<!-- TODO - this doesn't work for some reason -->
<condition property="ant.not.ok" value="true"><not><contains string="${ant.version}" substring="1.6" /></not></condition>
<condition property="java.not.ok" value="true"><not><contains string="${ant.java.version}" substring="1.5" /></not></condition>
<fail if="${ant.not.ok}" message="Must use Ant 1.6.x to build Jive Messenger" />
<fail if="${java.not.ok}" message="Must use JDK 1.5.x to build Jive Messenger" />
<tstamp />
<mkdir dir="${target.dir}" />
</target>
<!-- compile =============================================================================== -->
<target name="compile" depends="init" description="Compiles Messenger app code">
<mkdir dir="${compile.dir}" />
<javac
destdir="${compile.dir}"
includeAntRuntime="no"
debug="on"
>
<src path="${src.java.dir}" />
<patternset refid="compile.sources" />
<classpath>
<path refid="compile.dependencies" />
</classpath>
</javac>
</target>
<!-- jar =================================================================================== -->
<target name="jar" depends="compile" description="Produces a JAR of Messenger app code">
<mkdir dir="${jar.dest.dir}" />
<jar jarfile="${jar.dest.dir}/${jar.name}">
<fileset dir="${compile.dir}" includes="**/*.class" />
<fileset dir="${src.i18n.dir}" includes="*.properties" />
<zipgroupfileset dir="${lib.merge.dir}" includes="*.jar"/>
<manifest>
<attribute name="Main-Class" value="org.jivesoftware.SplashScreen"/>
<attribute name="Built-By" value="Jive Software"/>
</manifest>
</jar>
</target>
<!-- war =================================================================================== -->
<target name="war" description="Creates a WAR of the Messenger app">
</target>
<!-- javadoc =============================================================================== -->
<target name="javadoc" description="Produces Messenger Javadocs">
</target>
<!-- jspc ================================================================================== -->
<target name="jspc" description="Compiles all JSP pages in the admin console">
<mkdir dir="${jspc.dest.dir}" />
<mkdir dir="${jspc.java.dest.dir}" />
<mkdir dir="${jspc.classes.dest.dir}" />
<!--
<jspc srcdir="${src.admin.dir}"
destdir="${out.jspc.java.dir}"
package="com.jivesoftware.messenger.admin"
webinc="${out.jspc.webinf.dir}/web.tmp.xml">
<include name="**/*.jsp" />
<exclude name="error.jsp" />
<exclude name="header.jsp" />
<exclude name="footer.jsp" />
<exclude name="title.jsp" />
<exclude name="title-browser.jsp" />
<exclude name="breadcrumbs.jsp" />
<exclude name="workgroup-agents.jsp" />
<exclude name="session-row.jsp" />
<exclude name="setup-env-check.jsp" />
<exclude name="setup-header.jsp" />
<exclude name="setup-footer.jsp" />
<exclude name="upgrade/index.jsp" />
<classpath>
<pathelement path="${out.classes.dir}"/>
<path refid="compile.dependencies"/>
<path refid="compile.web.dependencies"/>
</classpath>
</jspc>
-->
</target>
<!-- jspcjar =============================================================================== -->
<target name="jspcjar" description="Creates a JAR of generated JSP files">
</target>
<!-- release =============================================================================== -->
<target name="release" description="Creates a distribution">
</target>
<!-- test ================================================================================== -->
<target name="test" description="Runs test cases">
</target>
<!-- clean ================================================================================= -->
<target name="clean" description="Cleans up all build-generated output">
<delete dir="${target.dir}" />
</target>
</project>
Name | Version
---------------------------------------------
hsqldb.jar |
mysql.jar | 3.0.15
postgres.jar | 7.4 version 215
ant.jar | Jetty 5.0.0
jetty.jar | ^
jasper-compiler.jar | |
jasper-runtime.jar | |
servlets.jar | -
wls_stax.jar | Downloaded 10/19/2004
dom4j.jar | 1.5
\ No newline at end of file
-- $RCSfile$
-- $Revision$
-- $Date$
CREATE TABLE jiveUser (
userID INTEGER NOT NULL,
password VARCHAR(32) NOT NULL,
name VARCHAR(100),
nameVisible INTEGER NOT NULL,
email VARCHAR(100),
emailVisible INTEGER NOT NULL,
creationDate CHAR(15) NOT NULL,
modificationDate CHAR(15) NOT NULL,
CONSTRAINT jiveUser_pk PRIMARY KEY (userID)
);
CREATE INDEX jiveUsr_cDate_idx ON jiveUser (creationDate ASC);
CREATE TABLE jiveUserProp (
userID INTEGER NOT NULL,
name VARCHAR(100) NOT NULL,
propValue VARCHAR(2000) NOT NULL,
CONSTRAINT jiveUsrProp_pk PRIMARY KEY (userID, name)
);
CREATE TABLE jivePrivate (
userID INTEGER NOT NULL,
name VARCHAR(100) NOT NULL,
namespace VARCHAR(200) NOT NULL,
value LONG VARCHAR NOT NULL,
CONSTRAINT JivePrivate_pk PRIMARY KEY (userID, name, namespace)
);
CREATE TABLE jiveOffline (
userID INTEGER NOT NULL,
messageID INTEGER NOT NULL,
creationDate CHAR(15) NOT NULL,
messageSize INTEGER NOT NULL,
message LONG VARCHAR NOT NULL,
CONSTRAINT jiveOffline_pk PRIMARY KEY (userID, messageID)
);
CREATE TABLE jiveRoster (
rosterID INTEGER NOT NULL,
userID INTEGER NOT NULL,
jid VARCHAR(2000) NOT NULL,
sub INTEGER NOT NULL,
ask INTEGER NOT NULL,
recv INTEGER NOT NULL,
nick VARCHAR(255),
CONSTRAINT jiveRoster_pk PRIMARY KEY (rosterID)
);
CREATE INDEX jiveR_userid_idx ON jiveRoster (userID ASC);
CREATE TABLE jiveRosterGroups (
rosterID INTEGER NOT NULL,
rank INTEGER NOT NULL,
groupName VARCHAR(255) NOT NULL,
CONSTRAINT jiveRoGrps_pk PRIMARY KEY (rosterID, rank)
);
CREATE INDEX jiveRoGrps_rid_idx ON jiveRosterGroups (rosterID ASC);
CREATE TABLE jiveVCard (
userID INTEGER NOT NULL,
name VARCHAR(100) NOT NULL,
propValue VARCHAR(2000) NOT NULL,
CONSTRAINT JiveVCard_pk PRIMARY KEY (userID, name)
);
CREATE TABLE jiveDomain (
domainID INTEGER NOT NULL,
name VARCHAR(100) UNIQUE NOT NULL,
description VARCHAR(255),
creationDate CHAR(15) NOT NULL,
modificationDate CHAR(15) NOT NULL,
CONSTRAINT jiveDomain_pk PRIMARY KEY (domainID)
);
CREATE TABLE jiveChatbot (
chatbotID INTEGER NOT NULL,
description VARCHAR(255),
creationDate CHAR(15) NOT NULL,
modificationDate CHAR(15) NOT NULL,
CONSTRAINT jiveChatbot_pk PRIMARY KEY (chatbotID)
);
CREATE TABLE jiveUserID (
username VARCHAR(30) UNIQUE NOT NULL,
domainID INTEGER NOT NULL,
objectType INTEGER NOT NULL,
objectID INTEGER NOT NULL,
CONSTRAINT jiveUserID_pk PRIMARY KEY (username, domainID)
);
CREATE INDEX jiveUsrID_obj_idx ON jiveUserID (objectType, objectID);
CREATE TABLE jiveGroup (
groupID INTEGER NOT NULL,
name VARCHAR(50) NOT NULL,
description VARCHAR(255),
creationDate CHAR(15) NOT NULL,
modificationDate CHAR(15) NOT NULL,
CONSTRAINT jiveGroup_pk PRIMARY KEY (groupID)
);
CREATE INDEX jiveGrp_cDate_idx ON jiveGroup (creationDate ASC);
CREATE INDEX jiveGrp_name_idx ON jiveGroup (name);
CREATE TABLE jiveGroupProp (
groupID INTEGER NOT NULL,
name VARCHAR(100) NOT NULL,
propValue VARCHAR(2000) NOT NULL,
CONSTRAINT jiveGrpProp_pk PRIMARY KEY (groupID, name)
);
CREATE TABLE jiveGroupUser (
groupID INTEGER NOT NULL,
userID INTEGER NOT NULL,
administrator INTEGER NOT NULL,
CONSTRAINT jiveGrpUser PRIMARY KEY (groupID, userID, administrator)
);
CREATE TABLE jiveID (
idType INTEGER NOT NULL,
id INTEGER NOT NULL,
CONSTRAINT jiveID_pk PRIMARY KEY (idType)
);
-- MUC tables
CREATE TABLE mucRoom (
roomID INTEGER NOT NULL,
name VARCHAR(50) NULL,
description VARCHAR(255),
canChangeSubject INTEGER NOT NULL,
maxUsers INTEGER NOT NULL,
publicRoom INTEGER NOT NULL,
moderated INTEGER NOT NULL,
invitationRequired INTEGER NOT NULL,
canInvite INTEGER NOT NULL,
passwordProtected INTEGER NOT NULL,
password VARCHAR(50) NULL,
canDiscoverJID INTEGER NOT NULL,
logEnabled INTEGER NOT NULL,
subject VARCHAR(100) NULL,
rolesToBroadcast INTEGER NOT NULL,
inMemory INTEGER NOT NULL,
CONSTRAINT mucRoom_pk PRIMARY KEY (name)
);
CREATE INDEX mucRoom_roomid_idx ON mucRoom (roomID);
CREATE TABLE mucAffiliation (
roomID INTEGER NOT NULL,
jid VARCHAR(2000) NOT NULL,
affiliation INTEGER NOT NULL,
CONSTRAINT mucAffiliation_pk PRIMARY KEY (roomID, jid)
);
CREATE TABLE mucMember (
roomID INTEGER NOT NULL,
jid VARCHAR(2000) NOT NULL,
nickname VARCHAR(255) NULL,
CONSTRAINT mucMember_pk PRIMARY KEY (roomID, jid)
);
CREATE TABLE mucConversationLog (
roomID INTEGER NOT NULL,
sender VARCHAR(2000) NOT NULL,
nickname VARCHAR(255) NULL,
time CHAR(15) NOT NULL,
subject VARCHAR(255) NULL,
body LONG VARCHAR NULL
);
-- Finally, insert default table values
INSERT INTO jiveID (idType, id) VALUES (0, 1);
INSERT INTO jiveID (idType, id) VALUES (1, 1);
INSERT INTO jiveID (idType, id) VALUES (2, 1);
INSERT INTO jiveID (idType, id) VALUES (3, 2);
INSERT INTO jiveID (idType, id) VALUES (4, 1);
INSERT INTO jiveID (idType, id) VALUES (13, 1);
INSERT INTO jiveID (idType, id) VALUES (14, 2);
INSERT INTO jiveID (idType, id) VALUES (18, 1);
INSERT INTO jiveID (idType, id) VALUES (19, 1);
insert INTO jiveID (idType, id) VALUES (23, 1);
-- Entry for admin user -- password is "admin"
INSERT INTO jiveUserID (username, domainID, objectType, objectID) VALUES ('admin', 1, 0, 1);
INSERT INTO jiveUser (userID, name, password, email, emailVisible, nameVisible, creationDate, modificationDate)
VALUES (1, 'Administrator', 'admin', 'admin@example.com', 1, 1, '0', '0');
-- Make the administrator an admin member of the Administrators group
INSERT INTO jiveGroup (groupID, name, description, creationDate, modificationDate)
VALUES (1, 'Administrators', 'Messenger Server administrators', '0', '0');
INSERT INTO jiveGroupUser (groupID, userID, administrator) VALUES (1, 1, 1);
// $RCSfile$
// $Revision$
// $Date$
CREATE TABLE jiveUser (
userID BIGINT NOT NULL,
password VARCHAR(32) NOT NULL,
name VARCHAR(100),
nameVisible INTEGER NOT NULL,
email VARCHAR(100),
emailVisible INTEGER NOT NULL,
creationDate VARCHAR(15) NOT NULL,
modificationDate VARCHAR(15) NOT NULL,
CONSTRAINT jiveUser_pk PRIMARY KEY (userID)
);
CREATE INDEX jiveUser_cDate_idx ON jiveUser (creationDate);
CREATE TABLE jiveUserProp (
userID BIGINT NOT NULL,
name VARCHAR(100) NOT NULL,
propValue VARCHAR(4000) NOT NULL,
CONSTRAINT jiveUserProp_pk PRIMARY KEY (userID, name)
);
CREATE TABLE jivePrivate (
userID BIGINT NOT NULL,
name VARCHAR(100) NOT NULL,
namespace VARCHAR(200) NOT NULL,
value LONGVARCHAR NOT NULL,
CONSTRAINT jivePrivate_pk PRIMARY KEY (userID, name, namespace)
);
CREATE TABLE jiveOffline (
userID BIGINT NOT NULL,
messageID BIGINT NOT NULL,
creationDate VARCHAR(15) NOT NULL,
messageSize INTEGER NOT NULL,
message LONGVARCHAR NOT NULL,
CONSTRAINT jiveOffline_pk PRIMARY KEY (userID, messageID)
);
CREATE TABLE jiveRoster (
rosterID BIGINT NOT NULL,
userID BIGINT NOT NULL,
jid VARCHAR(3071) NOT NULL,
sub INTEGER NOT NULL,
ask INTEGER NOT NULL,
recv INTEGER NOT NULL,
nick VARCHAR(255),
CONSTRAINT jiveRoster_pk PRIMARY KEY (rosterID)
);
CREATE INDEX jiveRoster_userid_idx ON jiveRoster (userID);
CREATE TABLE jiveRosterGroups (
rosterID BIGINT NOT NULL,
rank INTEGER NOT NULL,
groupName VARCHAR(255) NOT NULL,
CONSTRAINT jiveRosterGroups_pk PRIMARY KEY (rosterID, rank)
);
CREATE INDEX jiveRosterGroup_rosterid_idx ON jiveRosterGroups (rosterID);
CREATE TABLE jiveVCard (
userID BIGINT NOT NULL,
name VARCHAR(100) NOT NULL,
propValue VARCHAR(4000) NOT NULL,
CONSTRAINT jiveVCard_pk PRIMARY KEY (userID, name)
);
CREATE TABLE jiveDomain (
domainID BIGINT NOT NULL,
name VARCHAR(100) NOT NULL,
description VARCHAR(255),
creationDate VARCHAR(15) NOT NULL,
modificationDate VARCHAR(15) NOT NULL,
CONSTRAINT jiveDomain_pk PRIMARY KEY (domainID),
CONSTRAINT jiveDomain_name UNIQUE (name)
);
CREATE TABLE jiveChatbot (
chatbotID BIGINT NOT NULL,
description VARCHAR(255),
creationDate VARCHAR(15) NOT NULL,
modificationDate VARCHAR(15) NOT NULL,
CONSTRAINT jiveChatbot_pk PRIMARY KEY (chatbotID)
);
CREATE TABLE jiveUserID (
username VARCHAR(30) NOT NULL,
domainID BIGINT NOT NULL,
objectType INTEGER NOT NULL,
objectID BIGINT NOT NULL,
CONSTRAINT jiveUserID_pk PRIMARY KEY (username, domainID),
CONSTRAINT jiveUserID_username UNIQUE (username)
);
CREATE INDEX jiveUserID_object_idx ON jiveUserID (objectType, objectID);
CREATE TABLE jiveGroup (
groupID BIGINT NOT NULL,
name VARCHAR(50) NOT NULL,
description VARCHAR(255),
creationDate VARCHAR(15) NOT NULL,
modificationDate VARCHAR(15) NOT NULL,
CONSTRAINT jiveGroup_pk PRIMARY KEY (groupID)
);
CREATE INDEX jiveGroup_cDate_idx ON jiveGroup (creationDate);
CREATE INDEX jiveGroup_name_idx ON jiveGroup (name);
CREATE TABLE jiveGroupProp (
groupID BIGINT NOT NULL,
name VARCHAR(100) NOT NULL,
propValue VARCHAR(4000) NOT NULL,
CONSTRAINT jiveGroupProp_pk PRIMARY KEY (groupID, name)
);
CREATE TABLE jiveGroupUser (
groupID BIGINT NOT NULL,
userID BIGINT NOT NULL,
administrator INTEGER NOT NULL,
CONSTRAINT jiveGroupUser_pk PRIMARY KEY (groupID, userID, administrator)
);
CREATE TABLE jiveID (
idType INTEGER NOT NULL,
id BIGINT NOT NULL,
CONSTRAINT jiveID_pk PRIMARY KEY (idType)
);
// MUC Tables
CREATE TABLE mucRoom (
roomID BIGINT NOT NULL,
name VARCHAR(50) NULL,
description VARCHAR(255),
canChangeSubject INTEGER NOT NULL,
maxUsers INTEGER NOT NULL,
publicRoom INTEGER NOT NULL,
moderated INTEGER NOT NULL,
invitationRequired INTEGER NOT NULL,
canInvite INTEGER NOT NULL,
passwordProtected INTEGER NOT NULL,
password VARCHAR(50) NULL,
canDiscoverJID INTEGER NOT NULL,
logEnabled INTEGER NOT NULL,
subject VARCHAR(100) NULL,
rolesToBroadcast INTEGER NOT NULL,
inMemory INTEGER NOT NULL,
PRIMARY KEY (name)
);
CREATE INDEX mucRoom_roomid_idx ON mucRoom(roomID);
CREATE TABLE mucAffiliation (
roomID BIGINT NOT NULL,
jid VARCHAR(3071) NOT NULL,
affiliation INTEGER NOT NULL,
PRIMARY KEY (roomID, jid)
);
CREATE TABLE mucMember (
roomID BIGINT NOT NULL,
jid VARCHAR(3071) NOT NULL,
nickname VARCHAR(255) NULL,
PRIMARY KEY (roomID, jid)
);
CREATE TABLE mucConversationLog (
roomID BIGINT NOT NULL,
sender VARCHAR(3071) NOT NULL,
nickname VARCHAR(255) NULL,
time CHAR(15) NOT NULL,
subject VARCHAR(255) NULL,
body LONGVARCHAR NULL
);
// Finally, insert default table values.
// Unique ID entry for user, group
// The User ID entry starts at 2 (after admin user entry).
INSERT INTO jiveID (idType, id) VALUES (0, 1);
INSERT INTO jiveID (idType, id) VALUES (1, 1);
INSERT INTO jiveID (idType, id) VALUES (2, 1);
INSERT INTO jiveID (idType, id) VALUES (3, 2);
INSERT INTO jiveID (idType, id) VALUES (4, 2);
INSERT INTO jiveID (idType, id) VALUES (13, 1);
INSERT INTO jiveID (idType, id) VALUES (14, 2);
INSERT INTO jiveID (idType, id) VALUES (18, 1);
INSERT INTO jiveID (idType, id) VALUES (19, 1);
INSERT INTO jiveID (idType, id) VALUES (23, 1);
// Entry for admin user -- password is "admin"
INSERT INTO jiveUserID (username, domainID, objectType, objectID) VALUES ('admin', 1, 0, 1);
INSERT INTO jiveUser (userID, name, password, email, emailVisible, nameVisible, creationDate, modificationDate)
VALUES (1, 'Administrator', 'admin', 'admin@example.com', 1, 1, '0', '0');
// Make the administrator an admin member of the Administrators group
INSERT INTO jiveGroup (groupID, name, description, creationDate, modificationDate)
VALUES (1, 'Administrators', 'Messenger Server administrators', '0', '0');
INSERT INTO jiveGroupUser (groupID, userID, administrator) VALUES (1, 1, 1);
# $RCSfile$
# $Revision$
# $Date$
CREATE TABLE jiveUser (
userID BIGINT NOT NULL,
password VARCHAR(32) NOT NULL,
name VARCHAR(100),
nameVisible TINYINT NOT NULL,
email VARCHAR(100),
emailVisible TINYINT NOT NULL,
creationDate CHAR(15) NOT NULL,
modificationDate CHAR(15) NOT NULL,
PRIMARY KEY (userID),
INDEX jiveUser_cDate_idx (creationDate)
);
CREATE TABLE jiveUserProp (
userID BIGINT NOT NULL,
name VARCHAR(100) NOT NULL,
propValue TEXT NOT NULL,
PRIMARY KEY (userID, name)
);
CREATE TABLE jivePrivate (
userID BIGINT NOT NULL,
name VARCHAR(100) NOT NULL,
namespace VARCHAR(200) NOT NULL,
value TEXT NOT NULL,
PRIMARY KEY (userID, name, namespace)
);
CREATE TABLE jiveOffline (
userID BIGINT NOT NULL,
messageID BIGINT NOT NULL,
creationDate CHAR(15) NOT NULL,
messageSize INTEGER NOT NULL,
message TEXT NOT NULL,
PRIMARY KEY (userID, messageID)
);
CREATE TABLE jiveRoster (
rosterID BIGINT NOT NULL,
userID BIGINT NOT NULL,
jid TEXT NOT NULL,
sub TINYINT NOT NULL,
ask TINYINT NOT NULL,
recv TINYINT NOT NULL,
nick VARCHAR(255),
PRIMARY KEY (rosterID),
INDEX jiveRoster_userid_idx (userID)
);
CREATE TABLE jiveRosterGroups (
rosterID BIGINT NOT NULL,
rank TINYINT NOT NULL,
groupName VARCHAR(255) NOT NULL,
PRIMARY KEY (rosterID, rank),
INDEX jiveRosterGroup_rosterid_idx (rosterID)
);
CREATE TABLE jiveVCard (
userID BIGINT NOT NULL,
name VARCHAR(100) NOT NULL,
propValue TEXT NOT NULL,
PRIMARY KEY (userID, name)
);
CREATE TABLE jiveDomain (
domainID BIGINT NOT NULL,
name VARCHAR(100) UNIQUE NOT NULL,
description VARCHAR(255),
creationDate CHAR(15) NOT NULL,
modificationDate CHAR(15) NOT NULL,
PRIMARY KEY (domainID)
);
CREATE TABLE jiveChatbot (
chatbotID BIGINT NOT NULL,
description VARCHAR(255),
creationDate CHAR(15) NOT NULL,
modificationDate CHAR(15) NOT NULL,
PRIMARY KEY (chatbotID)
);
CREATE TABLE jiveUserID (
username VARCHAR(30) UNIQUE NOT NULL,
domainID BIGINT NOT NULL,
objectType INTEGER NOT NULL,
objectID BIGINT NOT NULL,
PRIMARY KEY (username, domainID),
INDEX jiveUser_object_idx (objectType, objectID)
);
CREATE TABLE jiveGroup (
groupID BIGINT NOT NULL,
name VARCHAR(50) NOT NULL,
description VARCHAR(255),
creationDate CHAR(15) NOT NULL,
modificationDate CHAR(15) NOT NULL,
PRIMARY KEY (groupID),
INDEX jiveGroup_cDate_idx (creationDate),
INDEX jiveGroup_name_idx (name(10))
);
CREATE TABLE jiveGroupProp (
groupID BIGINT NOT NULL,
name VARCHAR(100) NOT NULL,
propValue TEXT NOT NULL,
PRIMARY KEY (groupID, name)
);
CREATE TABLE jiveGroupUser (
groupID BIGINT NOT NULL,
userID BIGINT NOT NULL,
administrator TINYINT NOT NULL,
PRIMARY KEY (groupID, userID, administrator)
);
CREATE TABLE jiveID (
idType INTEGER NOT NULL,
id BIGINT NOT NULL,
PRIMARY KEY (idType)
);
# MUC Tables
CREATE TABLE mucRoom (
roomID BIGINT NOT NULL,
name VARCHAR(50) NULL,
description VARCHAR(255),
canChangeSubject TINYINT NOT NULL,
maxUsers INTEGER NOT NULL,
publicRoom TINYINT NOT NULL,
moderated TINYINT NOT NULL,
invitationRequired TINYINT NOT NULL,
canInvite TINYINT NOT NULL,
passwordProtected TINYINT NOT NULL,
password VARCHAR(50) NULL,
canDiscoverJID TINYINT NOT NULL,
logEnabled TINYINT NOT NULL,
subject VARCHAR(100) NULL,
rolesToBroadcast TINYINT NOT NULL,
inMemory TINYINT NOT NULL,
PRIMARY KEY (name),
INDEX mucRoom_roomid_idx (roomID)
);
CREATE TABLE mucAffiliation (
roomID BIGINT NOT NULL,
jid TEXT NOT NULL,
affiliation TINYINT NOT NULL,
PRIMARY KEY (roomID,jid(70))
);
CREATE TABLE mucMember (
roomID BIGINT NOT NULL,
jid TEXT NOT NULL,
nickname VARCHAR(255) NULL,
PRIMARY KEY (roomID,jid(70))
);
CREATE TABLE mucConversationLog (
roomID BIGINT NOT NULL,
sender TEXT NOT NULL,
nickname VARCHAR(255) NULL,
time CHAR(15) NOT NULL,
subject VARCHAR(255) NULL,
body TEXT NULL
);
# Finally, insert default table values.
# Unique ID entry for user, group
# The User ID entry starts at 2 (after admin user entry).
INSERT INTO jiveID (idType, id) VALUES (0, 1);
INSERT INTO jiveID (idType, id) VALUES (1, 1);
INSERT INTO jiveID (idType, id) VALUES (2, 1);
INSERT INTO jiveID (idType, id) VALUES (3, 2);
INSERT INTO jiveID (idType, id) VALUES (4, 2);
INSERT INTO jiveID (idType, id) VALUES (13, 1);
INSERT INTO jiveID (idType, id) VALUES (14, 2);
INSERT INTO jiveID (idType, id) VALUES (18, 1);
INSERT INTO jiveID (idType, id) VALUES (19, 1);
INSERT INTO jiveID (idType, id) VALUES (23, 1);
# Create User Permissions Table
CREATE TABLE jiveUserPerm (
objectType INTEGER NOT NULL,
objectID BIGINT NOT NULL,
userID BIGINT NOT NULL,
permission INTEGER NOT NULL,
INDEX jiveUserPerm_object_idx (objectType, objectID),
INDEX jiveUserPerm_userID_idx (userID)
);
# Entry for admin user -- password is "admin"
INSERT INTO jiveUserID (username, domainID, objectType, objectID) VALUES ('admin', 1, 0, 1);
INSERT INTO jiveUser (userID, name, password, email, emailVisible, nameVisible, creationDate, modificationDate)
VALUES (1, 'Administrator', 'admin', 'admin@example.com', 1, 1, '0', '0');
# Make the administrator an admin member of the Administrators group
INSERT INTO jiveGroup (groupID, name, description, creationDate, modificationDate)
VALUES (1, 'Administrators', 'Messenger Server administrators', '0', '0');
INSERT INTO jiveGroupUser (groupID, userID, administrator) VALUES (1, 1, 1);
REM // $RCSfile$
REM // $Revision$
REM // $Date$
CREATE TABLE jiveUser (
userID INTEGER NOT NULL,
password VARCHAR2(32) NOT NULL,
name VARCHAR2(100),
nameVisible INTEGER NOT NULL,
email VARCHAR2(100),
emailVisible INTEGER NOT NULL,
creationDate CHAR(15) NOT NULL,
modificationDate CHAR(15) NOT NULL,
CONSTRAINT jiveUser_pk PRIMARY KEY (userID)
);
CREATE INDEX jiveUser_cDate_idx ON jiveUser (creationDate ASC);
CREATE TABLE jiveUserProp (
userID INTEGER NOT NULL,
name VARCHAR2(100) NOT NULL,
propValue VARCHAR2(4000) NOT NULL,
CONSTRAINT jiveUserProp_pk PRIMARY KEY (userID, name)
);
REM Commented out since this will cause a third party user system to break
REM If you do not use a third part user system, uncomment these constraints
REM ALTER TABLE jiveUserProp ADD CONSTRAINT jiveUserProp_userID_fk FOREIGN KEY (userID) REFERENCES jiveUser INITIALLY DEFERRED DEFERRABLE;
CREATE TABLE jivePrivate (
userID INTEGER NOT NULL,
name VARCHAR2(100) NOT NULL,
namespace VARCHAR2(200) NOT NULL,
value LONG NOT NULL,
CONSTRAINT jivePrivate_pk PRIMARY KEY (userID, name, namespace)
);
REM Commented out since this will cause a third party user system to break
REM If you do not use a third part user system, uncomment these constraints
REM ALTER TABLE jivePrivate ADD CONSTRAINT jivePrivate_userID_fk FOREIGN KEY (userID) REFERENCES jiveUser INITIALLY DEFERRED DEFERRABLE;
CREATE TABLE jiveOffline (
userID INTEGER NOT NULL,
messageID INTEGER NOT NULL,
creationDate CHAR(15) NOT NULL,
messageSize INTEGER NOT NULL,
message LONG NOT NULL,
CONSTRAINT jiveOffline_pk PRIMARY KEY (userID, messageID)
);
REM Commented out since this will cause a third party user system to break
REM If you do not use a third part user system, uncomment these constraints
REM ALTER TABLE jiveRoster ADD CONSTRAINT jiveRoster_userID_fk FOREIGN KEY (userID) REFERENCES jiveUser INITIALLY DEFERRED DEFERRABLE;
CREATE TABLE jiveRoster (
rosterID INTEGER NOT NULL,
userID INTEGER NOT NULL,
jid VARCHAR2(4000) NOT NULL,
sub INTEGER NOT NULL,
ask INTEGER NOT NULL,
recv INTEGER NOT NULL,
nick VARCHAR2(255),
CONSTRAINT jiveRoster_pk PRIMARY KEY (rosterID)
);
CREATE INDEX jiveRoster_userid_idx ON jiveRoster (userID ASC);
REM Commented out since this will cause a third party user system to break
REM If you do not use a third part user system, uncomment these constraints
REM ALTER TABLE jiveRoster ADD CONSTRAINT jiveRoster_userID_fk FOREIGN KEY (userID) REFERENCES jiveUser INITIALLY DEFERRED DEFERRABLE;
CREATE TABLE jiveRosterGroups (
rosterID INTEGER NOT NULL,
rank INTEGER NOT NULL,
groupName VARCHAR2(255) NOT NULL,
CONSTRAINT jiveRosterGroups_pk PRIMARY KEY (rosterID, rank)
);
CREATE INDEX jiveRosterGroup_rosterid_idx ON jiveRosterGroups (rosterID ASC);
ALTER TABLE jiveRosterGroups ADD CONSTRAINT jiveRosterGroups_rosterID_fk FOREIGN KEY (rosterID) REFERENCES jiveRoster INITIALLY DEFERRED DEFERRABLE;
CREATE TABLE jiveVCard (
userID INTEGER NOT NULL,
name VARCHAR2(100) NOT NULL,
propValue VARCHAR2(4000) NOT NULL,
CONSTRAINT JiveVCard_pk PRIMARY KEY (userID, name)
);
REM Commented out since this will cause a third party user system to break
REM If you do not use a third part user system, uncomment these constraints
REM ALTER TABLE jiveVCard ADD CONSTRAINT jiveVCard_userID_fk FOREIGN KEY (userID) REFERENCES jiveUser INITIALLY DEFERRED DEFERRABLE;
CREATE TABLE jiveDomain (
domainID INTEGER NOT NULL,
name VARCHAR2(100) UNIQUE NOT NULL,
description VARCHAR2(255),
creationDate CHAR(15) NOT NULL,
modificationDate CHAR(15) NOT NULL,
CONSTRAINT jiveDomain_pk PRIMARY KEY (domainID)
);
CREATE TABLE jiveChatbot (
chatbotID INTEGER NOT NULL,
description VARCHAR2(255),
creationDate CHAR(15) NOT NULL,
modificationDate CHAR(15) NOT NULL,
CONSTRAINT jiveChatbot_pk PRIMARY KEY (chatbotID)
);
CREATE TABLE jiveUserID (
username VARCHAR2(30) UNIQUE NOT NULL,
domainID INTEGER NOT NULL,
objectType INTEGER NOT NULL,
objectID INTEGER NOT NULL,
CONSTRAINT jiveUserID_pk PRIMARY KEY (username, domainID)
);
CREATE INDEX jiveUserID_object_idx ON jiveUserID (objectType, objectID);
CREATE TABLE jiveGroup (
groupID INTEGER NOT NULL,
name VARCHAR2(50) NOT NULL,
description VARCHAR2(255),
creationDate CHAR(15) NOT NULL,
modificationDate CHAR(15) NOT NULL,
CONSTRAINT jiveGroup_pk PRIMARY KEY (groupID)
);
CREATE INDEX jiveGroup_cDate_idx ON jiveGroup (creationDate ASC);
CREATE INDEX jiveGroup_name_idx ON jiveGroup (name);
CREATE TABLE jiveGroupProp (
groupID INTEGER NOT NULL,
name VARCHAR2(100) NOT NULL,
propValue VARCHAR2(4000) NOT NULL,
CONSTRAINT jiveGroupProp_pk PRIMARY KEY (groupID, name)
);
REM Commented out since this will cause a third party user system to break
REM If you do not use a third part user system, uncomment these constraints
REM ALTER TABLE jiveGroupProp ADD CONSTRAINT jiveGroupProp_groupID_fk FOREIGN KEY (groupID) REFERENCES jiveGroup INITIALLY DEFERRED DEFERRABLE;
CREATE TABLE jiveGroupUser (
groupID INTEGER NOT NULL,
userID INTEGER NOT NULL,
administrator INTEGER NOT NULL,
CONSTRAINT jiveGroupUser PRIMARY KEY (groupID, userID, administrator)
);
REM Commented out since this will cause a third party user system to break
REM If you do not use a third part user system, uncomment these constraints
REM ALTER TABLE jiveGroupUser ADD CONSTRAINT jiveGroupUser_groupID_fk FOREIGN KEY (groupID) REFERENCES jiveGroup INITIALLY DEFERRED DEFERRABLE;
REM ALTER TABLE jiveGroupUser ADD CONSTRAINT jiveGroupUser_userID_fk FOREIGN KEY (userID) REFERENCES jiveUser INITIALLY DEFERRED DEFERRABLE;
CREATE TABLE jiveID (
idType INTEGER NOT NULL,
id INTEGER NOT NULL,
CONSTRAINT jiveID_pk PRIMARY KEY (idType)
);
REM // MUC Tables
CREATE TABLE mucRoom(
roomID INT NOT NULL,
name VARCHAR2(50) NULL,
description VARCHAR2(255),
canChangeSubject INTEGER NOT NULL,
maxUsers INTEGER NOT NULL,
publicRoom INTEGER NOT NULL,
moderated INTEGER NOT NULL,
invitationRequired INTEGER NOT NULL,
canInvite INTEGER NOT NULL,
passwordProtected INTEGER NOT NULL,
password VARCHAR2(50) NULL,
canDiscoverJID INTEGER NOT NULL,
logEnabled INTEGER NOT NULL,
subject VARCHAR2(100) NULL,
rolesToBroadcast INTEGER NOT NULL,
inMemory INTEGER NOT NULL,
CONSTRAINT mucRoom_pk PRIMARY KEY (name)
);
CREATE INDEX mucRoom_roomid_idx ON mucRoom (roomID);
CREATE TABLE mucAffiliation (
roomID INT NOT NULL,
jid VARCHAR2(4000) NOT NULL,
affiliation INTEGER NOT NULL,
CONSTRAINT mucAffiliation_pk PRIMARY KEY (roomID, jid)
);
CREATE TABLE mucMember (
roomID INT NOT NULL,
jid VARCHAR2(4000) NOT NULL,
nickname VARCHAR2(255) NULL,
CONSTRAINT mucMember_pk PRIMARY KEY (roomID, jid)
);
CREATE TABLE mucConversationLog (
roomID INT NOT NULL,
sender VARCHAR2(4000) NOT NULL,
nickname VARCHAR2(255) NULL,
time CHAR(15) NOT NULL,
subject VARCHAR2(255) NULL,
body VARCHAR2(4000) NULL
);
REM // Finally, insert default table values.
REM // Unique ID entry for user, group
REM // The User ID entry starts at 2 (after admin user entry).
INSERT INTO jiveID (idType, id) VALUES (0, 1);
INSERT INTO jiveID (idType, id) VALUES (1, 1);
INSERT INTO jiveID (idType, id) VALUES (2, 1);
INSERT INTO jiveID (idType, id) VALUES (3, 2);
INSERT INTO jiveID (idType, id) VALUES (4, 2);
INSERT INTO jiveID (idType, id) VALUES (13, 1);
INSERT INTO jiveID (idType, id) VALUES (14, 2);
INSERT INTO jiveID (idType, id) VALUES (18, 1);
INSERT INTO jiveID (idType, id) VALUES (19, 1);
INSERT INTO jiveID (idType, id) VALUES (23, 1);
REM // Entry for admin user -- password is "admin"
INSERT INTO jiveUserID (username, domainID, objectType, objectID) VALUES ('admin', 1, 0, 1);
INSERT INTO jiveUser (userID, name, password, email, emailVisible, nameVisible, creationDate, modificationDate)
VALUES (1, 'Administrator', 'admin', 'admin@example.com', 1, 1, '0', '0');
REM // Make the administrator an admin member of the Administrators group
INSERT INTO jiveGroup (groupID, name, description, creationDate, modificationDate)
VALUES (1, 'Administrators', 'Messenger Server administrators', '0', '0');
INSERT INTO jiveGroupUser (groupID, userID, administrator) VALUES (1, 1, 1);
-- $RCSfile$
-- $Revision$
-- $Date$
-- Note: This schema has only been tested on PostgreSQL 7.3.2.
CREATE TABLE jiveUser (
userID INTEGER NOT NULL,
password VARCHAR(32) NOT NULL,
name VARCHAR(100),
nameVisible INTEGER NOT NULL,
email VARCHAR(100),
emailVisible INTEGER NOT NULL,
creationDate CHAR(15) NOT NULL,
modificationDate CHAR(15) NOT NULL,
CONSTRAINT jiveUser_pk PRIMARY KEY (userID)
);
CREATE INDEX jiveUser_cDate_idx ON jiveUser (creationDate);
CREATE TABLE jiveUserProp (
userID INTEGER NOT NULL,
name VARCHAR(100) NOT NULL,
propValue TEXT NOT NULL,
CONSTRAINT jiveUserProp_pk PRIMARY KEY (userID, name)
);
-- Commented out since this will cause a third party user system to break
-- If you do not use a third part user system, uncomment these constraints
-- ALTER TABLE jiveUserProp ADD CONSTRAINT jiveUserProp_userID_fk FOREIGN KEY (userID) REFERENCES jiveUser INITIALLY DEFERRED DEFERRABLE;
CREATE TABLE jivePrivate (
userID INTEGER NOT NULL,
name VARCHAR(100) NOT NULL,
namespace VARCHAR(200) NOT NULL,
value TEXT NOT NULL,
CONSTRAINT jivePrivate_pk PRIMARY KEY (userID, name, namespace)
);
-- Commented out since this will cause a third party user system to break
-- If you do not use a third part user system, uncomment these constraints
-- ALTER TABLE jivePrivate ADD CONSTRAINT jivePrivate_userID_fk FOREIGN KEY (userID) REFERENCES jiveUser INITIALLY DEFERRED DEFERRABLE;
CREATE TABLE jiveOffline (
userID INTEGER NOT NULL,
messageID INTEGER NOT NULL,
creationDate CHAR(15) NOT NULL,
messageSize INTEGER NOT NULL,
message LONG NOT NULL,
CONSTRAINT jiveOffline_pk PRIMARY KEY (userID, messageID)
);
-- Commented out since this will cause a third party user system to break
-- If you do not use a third part user system, uncomment these constraints
-- ALTER TABLE jiveRoster ADD CONSTRAINT jiveRoster_userID_fk FOREIGN KEY (userID) REFERENCES jiveUser INITIALLY DEFERRED DEFERRABLE;
CREATE TABLE jiveRoster (
rosterID INTEGER NOT NULL,
userID INTEGER NOT NULL,
jid TEXT NOT NULL,
sub INTEGER NOT NULL,
ask INTEGER NOT NULL,
recv INTEGER NOT NULL,
nick VARCHAR(255),
CONSTRAINT jiveRoster_pk PRIMARY KEY (rosterID)
);
CREATE INDEX jiveRoster_userID_idx ON jiveRoster (userID);
-- Commented out since this will cause a third party user system to break
-- If you do not use a third part user system, uncomment these constraints
-- ALTER TABLE jiveRoster ADD CONSTRAINT jiveRoster_userID_fk FOREIGN KEY (userID) REFERENCES jiveUser INITIALLY DEFERRED DEFERRABLE;
CREATE TABLE jiveRosterGroups (
rosterID INTEGER NOT NULL,
rank INTEGER NOT NULL,
groupName VARCHAR(255) NOT NULL,
CONSTRAINT jiveRosterGroups_pk PRIMARY KEY (rosterID, rank)
);
CREATE INDEX jiveRosterGroups_rosterID_idx ON jiveRosterGroups (rosterID);
ALTER TABLE jiveRosterGroups ADD CONSTRAINT jiveRosterGroups_rosterID_fk FOREIGN KEY (rosterID) REFERENCES jiveRoster INITIALLY DEFERRED DEFERRABLE;
CREATE TABLE jiveVCard (
userID INTEGER NOT NULL,
name VARCHAR(100) NOT NULL,
propValue TEXT NOT NULL,
CONSTRAINT jiveVCard_pk PRIMARY KEY (userID, name)
);
-- Commented out since this will cause a third party user system to break
-- If you do not use a third part user system, uncomment these constraints
-- ALTER TABLE jiveVCard ADD CONSTRAINT jiveVCard_userID_fk FOREIGN KEY (userID) REFERENCES jiveUser INITIALLY DEFERRED DEFERRABLE;
CREATE TABLE jiveDomain (
domainID INTEGER NOT NULL,
name VARCHAR(100) UNIQUE NOT NULL,
description VARCHAR(255),
creationDate CHAR(15) NOT NULL,
modificationDate CHAR(15) NOT NULL,
CONSTRAINT jiveDomain_pk PRIMARY KEY (domainID)
);
CREATE TABLE jiveChatbot (
chatbotID INTEGER NOT NULL,
description VARCHAR(255),
creationDate CHAR(15) NOT NULL,
modificationDate CHAR(15) NOT NULL,
CONSTRAINT jiveChatbot_pk PRIMARY KEY (chatbotID)
);
CREATE TABLE jiveUserID (
username VARCHAR(30) UNIQUE NOT NULL,
domainID INTEGER NOT NULL,
objectType INTEGER NOT NULL,
objectID INTEGER NOT NULL,
CONSTRAINT jiveUserID_pk PRIMARY KEY (username, domainID)
);
CREATE INDEX jiveUser_object_idx ON jiveUserID (objectType, objectID);
CREATE TABLE jiveGroup (
groupID INTEGER NOT NULL,
name VARCHAR(50) NOT NULL,
description VARCHAR(255),
creationDate CHAR(15) NOT NULL,
modificationDate CHAR(15) NOT NULL,
CONSTRAINT jiveGroup_pk PRIMARY KEY (groupID)
);
CREATE INDEX jiveGroup_cDate_idx ON jiveGroup (creationDate);
CREATE INDEX jiveGroup_name_idx ON jiveGroup (name);
CREATE TABLE jiveGroupProp (
groupID INTEGER NOT NULL,
name VARCHAR(100) NOT NULL,
propValue TEXT NOT NULL,
CONSTRAINT jiveGroupProp_pk PRIMARY KEY (groupID, name)
);
-- Commented out since this will cause a third party user system to break
-- If you do not use a third part user system, uncomment these constraints
-- ALTER TABLE jiveGroupProp ADD CONSTRAINT jiveGroupProp_groupID_fk FOREIGN KEY (groupID) REFERENCES jiveGroup INITIALLY DEFERRED DEFERRABLE;
CREATE TABLE jiveGroupUser (
groupID INTEGER NOT NULL,
userID INTEGER NOT NULL,
administrator INTEGER NOT NULL,
CONSTRAINT jiveGroupUser_pk PRIMARY KEY (groupID, userID, administrator)
);
-- Commented out since this will cause a third party user system to break
-- If you do not use a third part user system, uncomment these constraints
-- ALTER TABLE jiveGroupUser ADD CONSTRAINT jiveGroupUser_groupID_fk FOREIGN KEY (groupID) REFERENCES jiveGroup INITIALLY DEFERRED DEFERRABLE;
-- ALTER TABLE jiveGroupUser ADD CONSTRAINT jiveGroupUser_userID_fk FOREIGN KEY (userID) REFERENCES jiveUser INITIALLY DEFERRED DEFERRABLE;
CREATE TABLE jiveID (
idType INTEGER NOT NULL,
id INTEGER NOT NULL,
CONSTRAINT jiveID_pk PRIMARY KEY (idType)
);
-- Finally, insert default table values.
-- Unique ID entry for user, group
-- The User ID entry starts at 2 (after admin user entry).
INSERT INTO jiveID (idType, id) VALUES (0, 1);
INSERT INTO jiveID (idType, id) VALUES (1, 1);
INSERT INTO jiveID (idType, id) VALUES (2, 1);
INSERT INTO jiveID (idType, id) VALUES (3, 2);
INSERT INTO jiveID (idType, id) VALUES (4, 2);
INSERT INTO jiveID (idType, id) VALUES (13, 1);
INSERT INTO jiveID (idType, id) VALUES (14, 2);
INSERT INTO jiveID (idType, id) VALUES (18, 1);
INSERT INTO jiveID (idType, id) VALUES (19, 1);
INSERT INTO jiveID (idType, id) VALUES (23, 1);
-- Entry for admin user -- password is "admin"
INSERT INTO jiveUserID (username, domainID, objectType, objectID) VALUES ('admin', 1, 0, 1);
INSERT INTO jiveUser (userID, name, password, email, emailVisible, nameVisible, creationDate, modificationDate)
VALUES (1, 'Administrator', 'admin', 'admin@example.com', 1, 1, '0', '0');
-- Make the administrator an admin member of the Administrators group
INSERT INTO jiveGroup (groupID, name, description, creationDate, modificationDate)
VALUES (1, 'Administrators', 'Messenger Server administrators', '0', '0');
INSERT INTO jiveGroupUser (groupID, userID, administrator) VALUES (1, 1, 1);
/*
* $RCSfile$
* $Revision$
* $Date$
*/
CREATE TABLE jiveUser (
userID INTEGER NOT NULL,
password NVARCHAR(32) NOT NULL,
name NVARCHAR(100),
nameVisible INTEGER NOT NULL,
email VARCHAR(100),
emailVisible INTEGER NOT NULL,
creationDate CHAR(15) NOT NULL,
modificationDate CHAR(15) NOT NULL,
CONSTRAINT jiveUser_pk PRIMARY KEY (userID)
);
CREATE INDEX jiveUser_cDate_idx ON jiveUser (creationDate ASC);
CREATE TABLE jiveUserProp (
userID INTEGER NOT NULL,
name NVARCHAR(100) NOT NULL,
propValue NVARCHAR(3900) NOT NULL,
CONSTRAINT jiveUserProp_pk PRIMARY KEY (userID, name)
);
/* Commented out since this will cause a third party user system to break */
/* If you do not use a third part user system, uncomment these constraints */
/* ALTER TABLE jiveUserProp ADD CONSTRAINT jiveUserProp_userID_fk FOREIGN KEY (userID) REFERENCES jiveUser; */
CREATE TABLE jivePrivate (
userID INTEGER NOT NULL,
name NVARCHAR(100) NOT NULL,
namespace NVARCHAR(200) NOT NULL,
value NTEXT NOT NULL,
CONSTRAINT JivePrivate_pk PRIMARY KEY (userID, name, namespace)
);
/* Commented out since this will cause a third party user system to break */
/* If you do not use a third part user system, uncomment these constraints */
/* ALTER TABLE jivePrivate ADD CONSTRAINT jivePrivate_userID_fk FOREIGN KEY (userID) REFERENCES jiveUser; */
CREATE TABLE jiveOffline (
userID INTEGER NOT NULL,
messageID INTEGER NOT NULL,
creationDate CHAR(15) NOT NULL,
messageSize INTEGER NOT NULL,
message NVARCHAR(3700) NOT NULL,
CONSTRAINT jiveOffline_pk PRIMARY KEY (userID, messageID)
);
/* Commented out since this will cause a third party user system to break */
/* If you do not use a third part user system, uncomment these constraints */
/* ALTER TABLE jiveOffline ADD CONSTRAINT jiveOffline_userID_fk FOREIGN KEY (userID) REFERENCES jiveUser; */
CREATE TABLE jiveRoster (
rosterID INTEGER NOT NULL,
userID INTEGER NOT NULL,
jid NVARCHAR(3000) NOT NULL,
sub INTEGER NOT NULL,
ask INTEGER NOT NULL,
recv INTEGER NOT NULL,
nick NVARCHAR(255),
CONSTRAINT jiveRoster_pk PRIMARY KEY (rosterID)
);
CREATE INDEX jiveRoster_userID_idx ON jiveRoster (userID ASC);
/* Commented out since this will cause a third party user system to break */
/* If you do not use a third part user system, uncomment these constraints */
/* ALTER TABLE jiveRoster ADD CONSTRAINT jiveRoster_userID_fk FOREIGN KEY (userID) REFERENCES jiveUser; */
CREATE TABLE jiveRosterGroups (
rosterID INTEGER NOT NULL,
rank INTEGER NOT NULL,
groupName NVARCHAR(255) NOT NULL,
CONSTRAINT jiveRosterGroups_pk PRIMARY KEY (rosterID, rank)
);
CREATE INDEX jiveRosterGroups_rosterid_idx ON jiveRosterGroups (rosterID ASC);
ALTER TABLE jiveRosterGroups ADD CONSTRAINT jiveRosterGroups_rosterID_fk FOREIGN KEY (rosterID) REFERENCES jiveRoster;
CREATE TABLE jiveVCard (
userID INTEGER NOT NULL,
name NVARCHAR(100) NOT NULL,
propValue NVARCHAR(3900) NOT NULL,
CONSTRAINT JiveVCard_pk PRIMARY KEY (userID, name)
);
/* Commented out since this will cause a third party user system to break */
/* If you do not use a third part user system, uncomment these constraints */
/* ALTER TABLE jiveVCard ADD CONSTRAINT jiveVCard_userID_fk FOREIGN KEY (userID) REFERENCES jiveUser; */
CREATE TABLE jiveDomain (
domainID INTEGER NOT NULL,
name NVARCHAR(100) UNIQUE NOT NULL,
description NVARCHAR(255),
creationDate CHAR(15) NOT NULL,
modificationDate CHAR(15) NOT NULL,
CONSTRAINT jiveDomain_pk PRIMARY KEY (domainID)
);
CREATE TABLE jiveChatbot (
chatbotID INTEGER NOT NULL,
description NVARCHAR(255),
creationDate CHAR(15) NOT NULL,
modificationDate CHAR(15) NOT NULL,
CONSTRAINT jiveChatbot_pk PRIMARY KEY (chatbotID)
);
CREATE TABLE jiveUserID (
username NVARCHAR(30) UNIQUE NOT NULL,
domainID INTEGER NOT NULL,
objectType INTEGER NOT NULL,
objectID INTEGER NOT NULL,
CONSTRAINT jiveUserID_pk PRIMARY KEY (username, domainID)
);
CREATE INDEX jiveUserID_object_idx on jiveUserID (objectType, objectID);
CREATE TABLE jiveGroup (
groupID INTEGER NOT NULL,
name NVARCHAR(100) NOT NULL,
description NVARCHAR(255),
creationDate CHAR(15) NOT NULL,
modificationDate CHAR(15) NOT NULL,
CONSTRAINT group_pk PRIMARY KEY (groupID)
);
CREATE INDEX jiveGroup_cDate_idx ON jiveGroup (creationDate);
CREATE INDEX jiveGroup_name_idx ON jiveGroup (name);
CREATE TABLE jiveGroupProp (
groupID INTEGER NOT NULL,
name NVARCHAR(100) NOT NULL,
propValue NVARCHAR(3900) NOT NULL,
CONSTRAINT jiveGroupProp_pk PRIMARY KEY (groupID, name)
);
/* Commented out since this will cause a third party user system to break */
/* If you do not use a third part user system, uncomment these constraints */
/* ALTER TABLE jiveGroupProp ADD CONSTRAINT jiveGroupProp_groupID_fk FOREIGN KEY (groupID) REFERENCES jiveGroup; */
CREATE TABLE jiveGroupUser (
groupID INTEGER NOT NULL,
userID INTEGER NOT NULL,
administrator INTEGER NOT NULL,
CONSTRAINT jiveGroupUser_pk PRIMARY KEY (groupID, userID, administrator)
);
/* Commented out since this will cause a third party user system to break */
/* If you do not use a third part user system, uncomment these constraints */
/* ALTER TABLE jiveGroupUser ADD CONSTRAINT jiveGroupUser_groupID_fk FOREIGN KEY (groupID) REFERENCES jiveGroup; */
/* ALTER TABLE jiveGroupUser ADD CONSTRAINT jiveGroupUser_userID_fk FOREIGN KEY (userID) REFERENCES jiveUser; */
CREATE TABLE jiveID (
idType INTEGER NOT NULL,
id INTEGER NOT NULL,
CONSTRAINT jiveID_pk PRIMARY KEY (idType)
);
/* MUC Tables */
CREATE TABLE mucRoom (
roomID INT NOT NULL,
name NVARCHAR(50) NULL,
description NVARCHAR(255),
canChangeSubject INT NOT NULL,
maxUsers INT NOT NULL,
publicRoom INT NOT NULL,
moderated INT NOT NULL,
invitationRequired INT NOT NULL,
canInvite INT NOT NULL,
passwordProtected INT NOT NULL,
password NVARCHAR(50) NULL,
canDiscoverJID INT NOT NULL,
logEnabled INT NOT NULL,
subject NVARCHAR(100) NULL,
rolesToBroadcast INT NOT NULL,
inMemory INT NOT NULL,
CONSTRAINT mucRoom__pk PRIMARY KEY (name)
);
CREATE INDEX mucRoom_roomID_idx on mucRoom(roomID);
CREATE TABLE mucAffiliation (
roomID INT NOT NULL,
jid NVARCHAR(3000) NOT NULL,
affiliation INT NOT NULL,
CONSTRAINT mucAffiliation__pk PRIMARY KEY (roomID,jid)
);
CREATE TABLE mucMember (
roomID INT NOT NULL,
jid NVARCHAR(3000) NOT NULL,
nickname NVARCHAR(255) NULL,
CONSTRAINT mucMember__pk PRIMARY KEY (roomID,jid)
);
CREATE TABLE mucConversationLog (
roomID INT NOT NULL,
sender NVARCHAR(3000) NOT NULL,
nickname NVARCHAR(255) NULL,
time CHAR(15) NOT NULL,
subject NVARCHAR(255) NULL,
body NVARCHAR(3700) NULL
);
/* Finally, insert default table values. */
/* Unique ID entry for user, group */
/* The User ID entry starts at 2 (after admin user entry). */
INSERT INTO jiveID (idType, id) VALUES (0, 1);
INSERT INTO jiveID (idType, id) VALUES (1, 1);
INSERT INTO jiveID (idType, id) VALUES (2, 1);
INSERT INTO jiveID (idType, id) VALUES (3, 2);
INSERT INTO jiveID (idType, id) VALUES (4, 2);
INSERT INTO jiveID (idType, id) VALUES (13, 1);
INSERT INTO jiveID (idType, id) VALUES (14, 2);
INSERT INTO jiveID (idType, id) VALUES (18, 1);
INSERT INTO jiveID (idType, id) VALUES (19, 1);
INSERT INTO jiveID (idType, id) VALUES (23, 1);
/* Entry for admin user -- password is "admin" */
INSERT INTO jiveUserID (username, domainID, objectType, objectID) VALUES ('admin', 1, 0, 1);
INSERT INTO jiveUser (userID, name, password, email, emailVisible, nameVisible, creationDate, modificationDate)
VALUES (1, 'Administrator', 'admin', 'admin@example.com', 1, 1, '0', '0');
/* Make the administrator an admin member of the Administrators group */
INSERT INTO jiveGroup (groupID, name, description, creationDate, modificationDate)
VALUES (1, 'Administrators', 'Messenger Server administrators', '0', '0');
INSERT INTO jiveGroupUser (groupID, userID, administrator) VALUES (1, 1, 1);
\ No newline at end of file
# $RCSfile$
# $Revision$
# $Date$
# This resource bundle file is the default resource bundle that will be
# used by Jive if a resource bundle for a specific Locale cannot be found.
#
# Additional locales can be specified by creating a new resource file in this
# directory using the following conventions:
#
# jive_i18n "_" language "_" country ".properties"
# jive_i18n "_" language ".properties"
#
# e.g.
# jive_i18n_en.propertis <- English resources
# jive_i18n_en_US.properties <- American US resources
# jive_i18n_de.properties <- German resources
# jive_i18n_ja.properties <- Japanese resources
#
# Please note that the two digit language code should be lower case, and the
# two digit country code should be in uppercase. Often, it is not necessary to
# specify the country code.
#
# A full list of language codes can be found at
# http://www-old.ics.uci.edu/pub/ietf/http/related/iso639.txt
# and a full list of country codes can be found at
# http://www.chemie.fu-berlin.de/diverse/doc/ISO_3166.html
#
# In property strings that are parameterized, single quotes can be used to
# quote the "{" (curly brace) if necessary. A real single quote is represented by ''.
#
# Server startup messages
startup.name=Jive Messenger {0} {1} Started [{2}]
startup.license=Licensed: {0} users
startup.license.unlimited=Licensed: unlimited users
startup.starting=Messenger domain: {0}
startup.starting.chat=Chat domain: {0}
startup.starting.muc=Multi User Chat domain: {0}
startup.caches=Initializing caches
startup.channels=Initializing channels
startup.plain=Started plain (unencrypted) socket on port: {0}
startup.ssl=Started SSL (encrypted) socket on port: {0}
startup.error=Error starting the server. Please check the log files for more information.
startup.error.jivehome=Could not locate jiveHome. Set the jiveHome property or edit your jive_init.xml file for app server deployments.
startup.missing-plugins=Could not locate the plug-ins directory. Possibly corrupt installation. No plug ins will be loaded.
# Standard server error messages (for server admin)
admin.error=Internal server error
admin.error.accept=Trouble accepting connection
admin.error.bad-stream=Bad opening tag (not stream)
admin.error.bad-namespace=Stream not in correct namespace
admin.error.channel-notfound=Channel {0} could not be found
admin.error.close=Could not close socket
admin.error.connection=Connection closed before session established
admin.error.deliver=Could not deliver packet
admin.error.min-thread=Cannot set min thread count with invalid value.
admin.error.max-thread=Cannot set max thread count with invalid value.
admin.error.packet=Malformed packet received
admin.error.packet.text=Unexpected raw text in the stream
admin.error.packet.tag=Unexpected packet tag (not message,iq,presence)
admin.error.routing=Could not route packet
admin.error.socket-setup=Could not setup a server socket
admin.error.ssl=Could not setup SSL socket
admin.error.stream=Stream error detected
admin.drop-packet=Dropping unrecognized packet
admin.disconnect=Stream cut short (could be normal disconnect)
# Server messages (for server admin)
admin.password.update={0} updated password from session {1}
admin.authenticated={0} authenticated on connection {1}
admin.warn.license=License limit exceeded, refusing user connection
admin.error.license=Could not license plugin {0}
# Server messages (too users)
user.license=Try logging in later or contact your system administrator
user.license.title=Too many users logged in
admin.shutdown.now=The server is shutting down immediately
# XMPP error codes
xmpp.error.302=Redirect
xmpp.error.400=Bad Request
xmpp.error.401=Unauthorized
xmpp.error.402=Payment Required
xmpp.error.403=Forbidden
xmpp.error.404=Not Found
xmpp.error.405=Not Allowed
xmpp.error.406=Not Acceptable
xmpp.error.407=Registration Required
xmpp.error.408=Request Timeout
xmpp.error.409=Conflict
xmpp.error.500=Internal Server Error
xmpp.error.501=Not Implemented
xmpp.error.502=Remote Server Error
xmpp.error.503=Service Unavailable
xmpp.error.504=Remote Server Timeout
xmpp.error.unknown=Unknown error code
# Chat server messages
chat.join={0} has joined the room
chat.leave={0} has left the room
chat.error.not-supported=Chat client attempted to access unimplemented feature
# Multi User Chat server messages
muc.join={0} has joined the room
muc.leave={0} has left the room
muc.error.not-supported=Chat client attempted to access unimplemented feature
muc.locked=This room is locked from entry until configuration is confirmed.
muc.unlocked=Configuration confirmed: This room is now unlocked.
muc.warnnonanonymous=This room is not anonymous.
# Labels for extended info (dataform) returned for disco#info requests
muc.extended.info.desc=Description
muc.extended.info.subject=Subject
muc.extended.info.occupants=Number of occupants
# Labels for room registration data form
muc.form.reg.title=Registration with the room
muc.form.reg.instruction=Please provide the following information to register with this room.
muc.form.reg.first-name=First Name
muc.form.reg.last-name=Last Name
muc.form.reg.nickname=Desired Nickname
muc.form.reg.url=Your URL
muc.form.reg.email=Email Address
muc.form.reg.faqentry=FAQ Entry
# Labels for room configuration data form
muc.form.conf.title=Room configuration
muc.form.conf.instruction=Your room "{0}" has been created! The default configuration is as \
follows: \n- No logging\n- No moderation\n- Up to 30 participants\n- No password required\n\
- No invitation required\n- Room is not persistent\n- Only admins may change the subject\n\
To accept the default configuration, click OK. To select a different configuration, please \
complete this form
muc.form.conf.owner_roomname=Natural-Language Room Name
muc.form.conf.owner_roomdesc=Short Description of Room
muc.form.conf.owner_changesubject=Allow Occupants to Change Subject
muc.form.conf.owner_maxusers=Maximum Number of Room Occupants
muc.form.conf.none=None
muc.form.conf.owner_presencebroadcast=Roles for which Presence is Broadcast
muc.form.conf.moderator=Moderator
muc.form.conf.participant=Participant
muc.form.conf.visitor=Visitor
muc.form.conf.owner_publicroom=Allow Public Searching for Room
muc.form.conf.owner_persistentroom=Make Room Persistent
muc.form.conf.owner_moderatedroom=Make Room Moderated
muc.form.conf.owner_inviteonly=An Invitation is Required to Enter
muc.form.conf.allowinvitesfixed=By default, only admins can send invites in an invite-only room
muc.form.conf.owner_allowinvites=Allow Occupants to Invite Others
muc.form.conf.owner_passwordprotectedroom=A Password is required to enter?
muc.form.conf.roomsecretfixed=If a password is required to enter this room, you must specify the \
password below.
muc.form.conf.owner_roomsecret=The Room Password
muc.form.conf.owner_whois=Affiliations that May Discover Real JIDs of Occupants
muc.form.conf.anyone=Anyone
muc.form.conf.owner_enablelogging=Enable Logging of Room Conversations
muc.form.conf.roomadminsfixed=You may specify additional people who have administrative \
privileges in the room. Please provide one JID per line.
muc.form.conf.owner_roomadmins=Room Admins
muc.form.conf.roomownersfixed=You may specify additional owners for this room. Please provide \
one JID per line.
muc.form.conf.owner_roomowners=Room Owners
# Live Assistant specific messages
live.chatbot.info.description=Live Assistant workgroup. Edit using Live Assistant admin tools only.
\ No newline at end of file
#
# $RCSfile#
# $Revision$
# $Date$
#
# Copyright 2002-2003, Jive Software. Subject to license terms.
#
# Strings for the setup tool
setup.error.jive_home_not_set=The 'jiveHome' directory has not been set.
setup.error.jive_home_not_readable=The 'jiveHome' directory is not readable by your appserver. Please change its permissions settings.
setup.error.jive_home_not_writeable=The 'jiveHome' directory is not writable by your appserver. Please change its permissions settings.
setup.error.jive_license_does_not_exist=A valid Jive Messenger license does not exist.
setup.error.jive_license_not_readable=Your Jive Messenger license is not readable. Please change its permissions settings and load this page again.
setup.error.jive_license_expired=Your Jive Messenger license has expired.
setup.error.jive_license_does_not_validate=Your license file does not validate which means it might be corrupt. Please verify you have the correct license in place and load this page again.
setup.error.jive_config_file_not_exist=The jive_config.xml file does not exist in your jiveHome directory. Make sure the file is there an that the appserver has read access to the jiveHome directory.
setup.error.jive_config_file_no_perms=Your appserver does not have permission to read or write to the jive_config.xml file. Please change the file permissions then reload this page.
setup.error.license_text_invalid=License text invalid - please enter valid text.
setup.error.license_file_not_writeable=Error saving the jive.license text - make sure your appserver has write permimssions to the jive.license file and jiveHome directory.
setup.error.main.general=Before setup can continue you need to fix the errors listed below.
setup.error.usersystem.invalid_mode=Invalid mode - please choose a valid user/group/authentication mode below.
setup.error.usersystem.not_enterprise=You need to install Jive Messenger Enterprise before using this feature.
setup.error.datasource.invalid_mode=Invalid mode - please choose a valid datasource mode below.
/**
* $RCSfile$
* $Revision$
* $Date$
*
* Copyright (C) 2004 Jive Software. All rights reserved.
*
* This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution.
*/
package org.jivesoftware.database;
import java.sql.*;
import java.util.Map;
/**
* An implementation of the Connection interface that wraps an underlying
* Connection object.
*
* @author Gaston Dombiak
*/
public class AbstractConnection implements Connection {
protected Connection connection;
public AbstractConnection(Connection connection) {
this.connection = connection;
}
public Statement createStatement() throws SQLException {
return connection.createStatement();
}
public PreparedStatement prepareStatement(String sql) throws SQLException {
return connection.prepareStatement(sql);
}
public CallableStatement prepareCall(String sql) throws SQLException {
return connection.prepareCall(sql);
}
public String nativeSQL(String sql) throws SQLException {
return connection.nativeSQL(sql);
}
public void setAutoCommit(boolean autoCommit) throws SQLException {
connection.setAutoCommit(autoCommit);
}
public boolean getAutoCommit() throws SQLException {
return connection.getAutoCommit();
}
public void close() throws SQLException {
connection.close();
}
public void commit() throws SQLException {
connection.commit();
}
public void rollback() throws SQLException {
connection.rollback();
}
public boolean isClosed() throws SQLException {
return connection.isClosed();
}
public DatabaseMetaData getMetaData() throws SQLException {
return connection.getMetaData();
}
public void setReadOnly(boolean readOnly) throws SQLException {
connection.setReadOnly(readOnly);
}
public boolean isReadOnly() throws SQLException {
return connection.isReadOnly();
}
public void setCatalog(String catalog) throws SQLException {
connection.setCatalog(catalog);
}
public String getCatalog() throws SQLException {
return connection.getCatalog();
}
public void setTransactionIsolation(int level) throws SQLException {
connection.setTransactionIsolation(level);
}
public int getTransactionIsolation() throws SQLException {
return connection.getTransactionIsolation();
}
public SQLWarning getWarnings() throws SQLException {
return connection.getWarnings();
}
public void clearWarnings() throws SQLException {
connection.clearWarnings();
}
public Statement createStatement(int resultSetType, int resultSetConcurrency)
throws SQLException {
return connection.createStatement(resultSetType, resultSetConcurrency);
}
public PreparedStatement prepareStatement(String sql, int resultSetType,
int resultSetConcurrency) throws SQLException {
return connection.prepareStatement(sql, resultSetType, resultSetConcurrency);
}
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency)
throws SQLException {
return connection.prepareCall(sql, resultSetType, resultSetConcurrency);
}
public Map<String, Class<?>> getTypeMap() throws SQLException {
return connection.getTypeMap();
}
public void setTypeMap(Map<String, Class<?>> map) throws SQLException {
connection.setTypeMap(map);
}
public void setHoldability(int holdability) throws SQLException {
connection.setHoldability(holdability);
}
public int getHoldability() throws SQLException {
return connection.getHoldability();
}
public Savepoint setSavepoint() throws SQLException {
return connection.setSavepoint();
}
public Savepoint setSavepoint(String name) throws SQLException {
return connection.setSavepoint(name);
}
public void rollback(Savepoint savepoint) throws SQLException {
connection.rollback(savepoint);
}
public void releaseSavepoint(Savepoint savepoint) throws SQLException {
connection.releaseSavepoint(savepoint);
}
public Statement createStatement(int resultSetType, int resultSetConcurrency,
int resultSetHoldability) throws SQLException {
return connection.createStatement(resultSetType, resultSetConcurrency,
resultSetHoldability);
}
public PreparedStatement prepareStatement(String sql, int resultSetType,
int resultSetConcurrency, int resultSetHoldability)
throws SQLException {
return connection.prepareStatement(sql, resultSetType, resultSetConcurrency,
resultSetHoldability);
}
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency,
int resultSetHoldability) throws SQLException {
return connection.prepareCall(sql, resultSetType, resultSetConcurrency,
resultSetHoldability);
}
public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys)
throws SQLException {
return connection.prepareStatement(sql, autoGeneratedKeys);
}
public PreparedStatement prepareStatement(String sql, int columnIndexes[]) throws SQLException {
return connection.prepareStatement(sql, columnIndexes);
}
public PreparedStatement prepareStatement(String sql, String columnNames[])
throws SQLException {
return connection.prepareStatement(sql, columnNames);
}
}
This diff is collapsed.
/**
* $RCSfile$
* $Revision$
* $Date$
*
* Copyright (C) 2004 Jive Software. All rights reserved.
*
* This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution.
*/
package org.jivesoftware.database;
import java.sql.Connection;
import java.sql.SQLException;
/**
* Abstract class that defines the connection provider framework. Other classes
* extend this abstract class to make connection to actual data sources.<p>
* <p/>
* It is expected that each subclass be a JavaBean, so that properties of
* the connection provider are exposed through bean introspection.
*
* @author Jive Software
*/
public interface ConnectionProvider {
/**
* Returns true if this connection provider provides connections out
* of a connection pool. Implementing and using connection providers that
* are pooled is strongly recommended, as they greatly increase the speed
* of Jive.
*
* @return true if the Connection objects returned by this provider are
* pooled.
*/
public boolean isPooled();
/**
* Returns a database connection. When a Jive component is done with a
* connection, it will call the close method of that connection. Therefore,
* connection pools with special release methods are not directly
* supported by the connection provider infrastructure. Instead, connections
* from those pools should be wrapped such that calling the close method
* on the wrapper class will release the connection from the pool.
*
* @return a Connection object.
*/
public Connection getConnection() throws SQLException;
/**
* Starts the connection provider. For some connection providers, this
* will be a no-op. However, connection provider users should always call
* this method to make sure the connection provider is started.
*/
public void start();
/**
* This method should be called whenever properties have been changed so
* that the changes will take effect.
*/
public void restart();
/**
* Tells the connection provider to destroy itself. For many connection
* providers, this will essentially result in a no-op. However,
* connection provider users should always call this method when changing
* from one connection provider to another to ensure that there are no
* dangling database connections.
*/
public void destroy();
}
\ No newline at end of file
/**
* $RCSfile$
* $Revision$
* $Date$
*
* Copyright (C) 2004 Jive Software. All rights reserved.
*
* This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution.
*/
package org.jivesoftware.database;
import org.jivesoftware.database.AbstractConnection;
import org.jivesoftware.database.ConnectionPool;
import java.sql.Connection;
import java.sql.SQLException;
/**
* An implementation of the Connection interface that wraps an underlying
* Connection object. It releases the connection back to a connection pool
* when Connection.close() is called.
*
* @author Jive Software
*/
public class ConnectionWrapper extends AbstractConnection {
public ConnectionPool pool;
public boolean checkedout = false;
public long createTime;
public long lockTime;
public long checkinTime;
public Exception exception;
public boolean hasLoggedException = false;
public ConnectionWrapper(Connection connection, ConnectionPool pool) {
super(connection);
this.pool = pool;
createTime = System.currentTimeMillis();
lockTime = createTime;
checkinTime = lockTime;
}
public void setConnection(Connection connection) {
super.connection = connection;
}
/**
* Instead of closing the underlying connection, we simply release
* it back into the pool.
*/
public void close() throws SQLException {
synchronized (this) {
checkedout = false;
checkinTime = System.currentTimeMillis();
}
pool.freeConnection();
// Release object references. Any further method calls on the connection will fail.
// super.connection = null;
}
public String toString() {
if (connection != null) {
return connection.toString();
}
else {
return "Jive Software Connection Wrapper";
}
}
public synchronized boolean isCheckedOut() {
return checkedout;
}
}
/**
* $RCSfile$
* $Revision$
* $Date$
*
* Copyright (C) 2004 Jive Software. All rights reserved.
*
* This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution.
*/
package org.jivesoftware.database;
/**
* An interface for loading Jive database objects.
*
* @author Jive Software
*/
public interface DatabaseObjectFactory {
/**
* Returns the object associated with <code>id</code> or null if the object could not be loaded.
*
* @param id the id of the object to load.
* @return the object specified by <code>id</code> or null if it could not be loaded.
*/
public Object loadObject(long id);
}
This diff is collapsed.
/**
* $RCSfile$
* $Revision$
* $Date$
*
* Copyright (C) 2004 Jive Software. All rights reserved.
*
* This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution.
*/
package org.jivesoftware.database;
import org.jivesoftware.util.JiveBeanInfo;
/**
* BeanInfo class for the DefaultConnectionProvider class.
*
* @author Jive Software
*/
public class DefaultConnectionProviderBeanInfo extends JiveBeanInfo {
public static final String[] PROPERTY_NAMES = {
"driver",
"serverURL",
"username",
"password",
"minConnections",
"maxConnections",
"connectionTimeout"
};
public DefaultConnectionProviderBeanInfo() {
super();
}
public Class getBeanClass() {
return org.jivesoftware.database.DefaultConnectionProvider.class;
}
public String[] getPropertyNames() {
return PROPERTY_NAMES;
}
public String getName() {
return "DefaultConnectionProvider";
}
}
\ No newline at end of file
/**
* $RCSfile$
* $Revision$
* $Date$
*
* Copyright (C) 2004 Jive Software. All rights reserved.
*
* This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution.
*/
package org.jivesoftware.database;
import org.jivesoftware.util.Log;
import org.jivesoftware.messenger.JiveGlobals;
import org.jivesoftware.database.ConnectionPool;
import org.jivesoftware.database.ConnectionProvider;
import java.io.File;
import java.io.IOException;
import java.sql.Connection;
import java.sql.SQLException;
/**
* A connection provider for the embedded hsqlDB database. The database file is stored at
* <tt>jiveHome/database</tt>. The log file for this connection provider is stored at
* <tt>[jiveHome]/logs/EmbeddedConnectionProvider.log</tt>, so you should ensure
* that the <tt>[jiveHome]/logs</tt> directory exists.
*
* @author Matt Tucker
*/
public class EmbeddedConnectionProvider implements ConnectionProvider {
private ConnectionPool connectionPool = null;
private Object initLock = new Object();
public boolean isPooled() {
return true;
}
public Connection getConnection() throws SQLException {
if (connectionPool == null) {
// Block until the init has been done
synchronized (initLock) {
// If still null, something has gone wrong
if (connectionPool == null) {
Log.error("Error: EmbeddedConnectionProvider.getConnection() was" +
"called before the internal pool has been initialized.");
return null;
}
}
}
return connectionPool.getConnection();
}
public void start() {
// Acquire lock so that no connections can be returned while creating the pool.
synchronized (initLock) {
try {
String driver = "org.hsqldb.jdbcDriver";
File jiveHome = new File(JiveGlobals.getJiveHome(), File.separator + "database" + File.separator + "messenger");
String path = jiveHome.getCanonicalPath();
String serverURL = "jdbc:hsqldb:" + path;
String username = "sa";
String password = "jiverocks";
int minConnections = 3;
int maxConnections = 10;
double connectionTimeout = 0.5;
connectionPool = new ConnectionPool(driver, serverURL, username, password,
minConnections, maxConnections, connectionTimeout, false);
}
catch (IOException ioe) {
Log.error("Error starting connection pool.", ioe);
}
}
}
public void restart() {
// Kill off pool.
destroy();
// Start a new pool.
start();
}
public void destroy() {
if (connectionPool != null) {
try {
connectionPool.destroy();
}
catch (Exception e) {
Log.error(e);
}
}
// Release reference to connectionPool
connectionPool = null;
}
public void finalize() {
destroy();
}
}
/**
* $RCSfile$
* $Revision$
* $Date$
*
* Copyright (C) 2004 Jive Software. All rights reserved.
*
* This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution.
*/
package org.jivesoftware.database;
import org.jivesoftware.util.Log;
import org.jivesoftware.messenger.JiveGlobals;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.*;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.sql.DataSource;
/**
* An implementation of ConnectionProvider that utilizes a JDBC 2.0 DataSource
* made available via JNDI. This is useful for application servers where a pooled
* data connection is already provided so Jive can share the pool with the
* other applications.<p>
* <p/>
* The JNDI location of the DataSource stored as the Jive property
* <code>database.JNDIProvider.name</code>. This can be overridden by setting
* the provider's <code>name</code> property if required.
*
* @author <a href="mailto:joe@truemesh.com">Joe Walnes</a>
* @see ConnectionProvider
*/
public class JNDIDataSourceProvider implements ConnectionProvider {
private String dataSourceName;
private DataSource dataSource;
/**
* Keys of JNDI properties to query PropertyManager for.
*/
private static final String[] jndiPropertyKeys = {
Context.APPLET,
Context.AUTHORITATIVE,
Context.BATCHSIZE,
Context.DNS_URL,
Context.INITIAL_CONTEXT_FACTORY,
Context.LANGUAGE,
Context.OBJECT_FACTORIES,
Context.PROVIDER_URL,
Context.REFERRAL,
Context.SECURITY_AUTHENTICATION,
Context.SECURITY_CREDENTIALS,
Context.SECURITY_PRINCIPAL,
Context.SECURITY_PROTOCOL,
Context.STATE_FACTORIES,
Context.URL_PKG_PREFIXES
};
/**
* Initialize.
*/
public JNDIDataSourceProvider() {
dataSourceName = JiveGlobals.getJiveProperty("database.JNDIProvider.name");
}
public String getName() {
return "JNDI DataSource Connection Provider";
}
public String getDescription() {
return "Connection Provider for Jive to lookup pooled "
+ "DataSource from JNDI location. Requires 'name' "
+ "property with JNDI location. This can be set in "
+ "the properties file as 'JNDIDataSource.name'";
}
public String getAuthor() {
return "Joe Walnes - joe@truemesh.com";
}
public int getMajorVersion() {
return 2;
}
public int getMinorVersion() {
return 1;
}
public boolean isPooled() {
return true;
}
public void start() {
if (dataSourceName == null || dataSourceName.equals("")) {
error("No name specified for DataSource. JNDI lookup will fail", null);
return;
}
try {
Properties contextProperties = new Properties();
for (int i = 0; i < jndiPropertyKeys.length; i++) {
String k = jndiPropertyKeys[i];
String v = JiveGlobals.getJiveProperty(k);
if (v != null) {
contextProperties.setProperty(k, v);
}
}
Context context = null;
if (contextProperties.size() > 0) {
context = new InitialContext(contextProperties);
}
else {
context = new InitialContext();
}
dataSource = (DataSource)context.lookup(dataSourceName);
}
catch (Exception e) {
error("Could not lookup DataSource at '" + dataSourceName + "'", e);
}
}
public void restart() {
destroy();
start();
}
public void destroy() {
}
public Connection getConnection() {
if (dataSource == null) {
error("DataSource has not been initialized.", null);
return null;
}
try {
return dataSource.getConnection();
}
catch (SQLException e) {
error("Could not retrieve Connection from DataSource", e);
return null;
}
}
public String getProperty(String name) {
if ("name".equals(name)) {
return dataSourceName;
}
else {
return null;
}
}
public void setProperty(String name, String value) {
if ("name".equals(name)) {
this.dataSourceName = value;
JiveGlobals.setJiveProperty("database.JNDIProvider.name", value);
}
}
public Iterator propertyNames() {
List list = new ArrayList();
list.add("name");
return Collections.unmodifiableList(list).iterator();
}
public String getPropertyDescription(String name) {
if ("name".equals(name)) {
return "JNDI name to lookup. eg: java:comp/env/jdbc/MyDataSource";
}
else {
return null;
}
}
/**
* Log an error.
*
* @param msg Description of error
* @param e Exception to printStackTrace (may be null)
*/
private final void error(String msg, Exception e) {
Log.error(msg, e);
}
}
/**
* $RCSfile$
* $Revision$
* $Date$
*
* Copyright (C) 2004 Jive Software. All rights reserved.
*
* This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution.
*/
package org.jivesoftware.database;
import java.sql.*;
import java.math.BigDecimal;
import java.io.InputStream;
import java.io.Reader;
import java.util.Calendar;
import java.net.URL;
/**
* An implementation of the PreparedStatement interface that wraps an underlying
* PreparedStatement object.
*
* @author Gaston Dombiak
*/
public abstract class PreparedStatementWrapper extends StatementWrapper
implements PreparedStatement {
protected PreparedStatement pstmt;
public PreparedStatementWrapper(PreparedStatement pstmt) {
super(pstmt);
this.pstmt = pstmt;
}
public ResultSet executeQuery() throws SQLException {
return pstmt.executeQuery();
}
public int executeUpdate() throws SQLException {
return pstmt.executeUpdate();
}
public void setNull(int parameterIndex, int sqlType) throws SQLException {
pstmt.setNull(parameterIndex, sqlType);
}
public void setBoolean(int parameterIndex, boolean x) throws SQLException {
pstmt.setBoolean(parameterIndex, x);
}
public void setByte(int parameterIndex, byte x) throws SQLException {
pstmt.setByte(parameterIndex, x);
}
public void setShort(int parameterIndex, short x) throws SQLException {
pstmt.setShort(parameterIndex, x);
}
public void setInt(int parameterIndex, int x) throws SQLException {
pstmt.setInt(parameterIndex, x);
}
public void setLong(int parameterIndex, long x) throws SQLException {
pstmt.setLong(parameterIndex, x);
}
public void setFloat(int parameterIndex, float x) throws SQLException {
pstmt.setFloat(parameterIndex, x);
}
public void setDouble(int parameterIndex, double x) throws SQLException {
pstmt.setDouble(parameterIndex, x);
}
public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException {
pstmt.setBigDecimal(parameterIndex, x);
}
public void setString(int parameterIndex, String x) throws SQLException {
pstmt.setString(parameterIndex, x);
}
public void setBytes(int parameterIndex, byte x[]) throws SQLException {
pstmt.setBytes(parameterIndex, x);
}
public void setDate(int parameterIndex, Date x) throws SQLException {
pstmt.setDate(parameterIndex, x);
}
public void setTime(int parameterIndex, Time x) throws SQLException {
pstmt.setTime(parameterIndex, x);
}
public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException {
pstmt.setTimestamp(parameterIndex, x);
}
public void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException {
pstmt.setAsciiStream(parameterIndex, x, length);
}
@Deprecated public void setUnicodeStream(int parameterIndex, InputStream x, int length)
throws SQLException {
pstmt.setUnicodeStream(parameterIndex, x, length);
}
public void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException {
pstmt.setBinaryStream(parameterIndex, x, length);
}
public void clearParameters() throws SQLException {
pstmt.clearParameters();
}
public void setObject(int parameterIndex, Object x, int targetSqlType, int scale)
throws SQLException {
pstmt.setObject(parameterIndex, x, targetSqlType, scale);
}
public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException {
pstmt.setObject(parameterIndex, x, targetSqlType);
}
public void setObject(int parameterIndex, Object x) throws SQLException {
pstmt.setObject(parameterIndex, x);
}
public boolean execute() throws SQLException {
return pstmt.execute();
}
public void addBatch() throws SQLException {
pstmt.addBatch();
}
public void setCharacterStream(int parameterIndex, Reader reader, int length)
throws SQLException {
pstmt.setCharacterStream(parameterIndex, reader, length);
}
public void setRef(int i, Ref x) throws SQLException {
pstmt.setRef(i, x);
}
public void setBlob(int i, Blob x) throws SQLException {
pstmt.setBlob(i, x);
}
public void setClob(int i, Clob x) throws SQLException {
pstmt.setClob(i, x);
}
public void setArray(int i, Array x) throws SQLException {
pstmt.setArray(i, x);
}
public ResultSetMetaData getMetaData() throws SQLException {
return pstmt.getMetaData();
}
public void setDate(int parameterIndex, Date x, Calendar cal) throws SQLException {
pstmt.setDate(parameterIndex, x, cal);
}
public void setTime(int parameterIndex, Time x, Calendar cal) throws SQLException {
pstmt.setTime(parameterIndex, x, cal);
}
public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) throws SQLException {
pstmt.setTimestamp(parameterIndex, x, cal);
}
public void setNull(int paramIndex, int sqlType, String typeName) throws SQLException {
pstmt.setNull(paramIndex, sqlType, typeName);
}
public void setURL(int parameterIndex, URL x) throws SQLException {
pstmt.setURL(parameterIndex, x);
}
public ParameterMetaData getParameterMetaData() throws SQLException {
return pstmt.getParameterMetaData();
}
}
This diff is collapsed.
/**
* $RCSfile$
* $Revision$
* $Date$
*
* Copyright (C) 2004 Jive Software. All rights reserved.
*
* This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution.
*/
package org.jivesoftware.database;
/**
* Simple class for tracking profiling stats for individual SQL queries.
*
* @author Jive Software
*/
public class ProfiledConnectionEntry {
/**
* The SQL query.
*/
public String sql;
/**
* Number of times the query has been executed.
*/
public int count;
/**
* The total time spent executing the query (in milliseconds).
*/
public int totalTime;
public ProfiledConnectionEntry(String sql) {
this.sql = sql;
count = 0;
totalTime = 0;
}
}
/**
* $RCSfile$
* $Revision$
* $Date$
*
* Copyright (C) 2004 Jive Software. All rights reserved.
*
* This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution.
*/
package org.jivesoftware.database;
import org.jivesoftware.util.JiveConstants;
import org.jivesoftware.util.Log;
import org.jivesoftware.util.LongHashMap;
import org.jivesoftware.database.DbConnectionManager;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
/**
* Manages sequences of unique ID's that get stored in the database. Database support for sequences
* varies widely; some don't use them at all. Instead, we handle unique ID generation with a
* combination VM/database solution.<p>
* <p/>
* A special table in the database doles out blocks of unique ID's to each
* virtual machine that interacts with Jive. This has the following consequences:
* <ul>
* <li>There is no need to go to the database every time we want a new unique id.
* <li>Multiple app servers can interact with the same db without id collision.
* <li>The order of unique id's may not correspond to the creation date of objects.
* <li>There can be gaps in ID's after server restarts since blocks will get "lost" if the block
* size is greater than 1.
* </ul><p>
* <p/>
* Each sequence type that this class manages has a different block size value. Objects that aren't
* created often have a block size of 1, while frequently created objects such as entries and
* comments have larger block sizes.
*
* @author Matt Tucker
* @author Bruce Ritchie
*/
public class SequenceManager {
private static final String LOAD_ID =
"SELECT id FROM jiveID WHERE idType=?";
private static final String UPDATE_ID =
"UPDATE jiveID SET id=? WHERE idType=? AND id=?";
// Statically startup a sequence manager for each of the sequence counters.
private static LongHashMap managers;
static {
managers = new LongHashMap();
new SequenceManager(JiveConstants.USER, 1);
new SequenceManager(JiveConstants.GROUP, 1);
new SequenceManager(JiveConstants.ROSTER, 5);
new SequenceManager(JiveConstants.OFFLINE, 1);
new SequenceManager(JiveConstants.WORKGROUP_AGENT, 1);
new SequenceManager(JiveConstants.WORKGROUP_GROUP, 1);
new SequenceManager(JiveConstants.WORKGROUP_QUEUE, 1);
new SequenceManager(JiveConstants.MUC_ROOM, 1);
}
/**
* Returns the next ID of the specified type.
*
* @param type the type of unique ID.
* @return the next unique ID of the specified type.
*/
public static long nextID(int type) {
if (managers.containsKey(type)) {
return ((SequenceManager)managers.get(type)).nextUniqueID();
}
else {
throw new IllegalArgumentException("Invalid type");
}
}
private int type;
private long currentID;
private long maxID;
private int blockSize;
/**
* Creates a new DbSequenceManager.
*
* @param seqType the type of sequence.
* @param size the number of id's to "checkout" at a time.
*/
public SequenceManager(int seqType, int size) {
managers.put(seqType, this);
this.type = seqType;
this.blockSize = size;
currentID = 0l;
maxID = 0l;
}
/**
* Returns the next available unique ID. Essentially this provides for the functionality of an
* auto-increment database field.
*/
public synchronized long nextUniqueID() {
if (!(currentID < maxID)) {
// Get next block -- make 5 attempts at maximum.
getNextBlock(5);
}
long id = currentID;
currentID++;
return id;
}
/**
* Performs a lookup to get the next available ID block. The algorithm is as follows:
* <ol>
* <li> Select currentID from appropriate db row.
* <li> Increment id returned from db.
* <li> Update db row with new id where id=old_id.
* <li> If update fails another process checked out the block first; go back to step 1.
* Otherwise, done.
* </ol>
*/
private void getNextBlock(int count) {
if (count == 0) {
Log.error("Failed at last attempt to obtain an ID, aborting...");
return;
}
Connection con = null;
PreparedStatement pstmt = null;
boolean abortTransaction = false;
boolean success = false;
try {
con = DbConnectionManager.getTransactionConnection();
// Get the current ID from the database.
pstmt = con.prepareStatement(LOAD_ID);
pstmt.setInt(1, type);
ResultSet rs = pstmt.executeQuery();
if (!rs.next()) {
throw new SQLException("Loading the current ID failed. The " +
"jiveID table may not be correctly populated.");
}
long currentID = rs.getLong(1);
pstmt.close();
// Increment the id to define our block.
long newID = currentID + blockSize;
// The WHERE clause includes the last value of the id. This ensures
// that an update will occur only if nobody else has performed an
// update first.
pstmt = con.prepareStatement(UPDATE_ID);
pstmt.setLong(1, newID);
pstmt.setInt(2, type);
pstmt.setLong(3, currentID);
// Check to see if the row was affected. If not, some other process
// already changed the original id that we read. Therefore, this
// round failed and we'll have to try again.
success = pstmt.executeUpdate() == 1;
if (success) {
this.currentID = currentID;
this.maxID = newID;
}
}
catch (SQLException e) {
Log.error(e);
abortTransaction = true;
}
finally {
try {
if (pstmt != null) {
pstmt.close();
}
}
catch (Exception e) {
Log.error(e);
}
DbConnectionManager.closeTransactionConnection(con, abortTransaction);
}
if (!success) {
Log.error("WARNING: failed to obtain next ID block due to " +
"thread contention. Trying again...");
// Call this method again, but sleep briefly to try to avoid thread contention.
try {
Thread.sleep(75);
}
catch (InterruptedException ie) {
}
getNextBlock(count - 1);
}
}
}
/**
* $RCSfile$
* $Revision$
* $Date$
*
* Copyright (C) 2004 Jive Software. All rights reserved.
*
* This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution.
*/
package org.jivesoftware.database;
import java.sql.*;
/**
* An implementation of the Statement interface that wraps an underlying
* Statement object.
*
* @author Gaston Dombiak
*/
public abstract class StatementWrapper implements Statement {
protected Statement stmt;
/**
* Creates a new StatementWrapper that wraps <tt>stmt</tt>.
*
* @param stmt
*/
public StatementWrapper(Statement stmt) {
this.stmt = stmt;
}
public ResultSet executeQuery(String sql) throws SQLException {
return stmt.executeQuery(sql);
}
public int executeUpdate(String sql) throws SQLException {
return stmt.executeUpdate(sql);
}
public void close() throws SQLException {
stmt.close();
}
public int getMaxFieldSize() throws SQLException {
return stmt.getMaxFieldSize();
}
public void setMaxFieldSize(int max) throws SQLException {
stmt.setMaxFieldSize(max);
}
public int getMaxRows() throws SQLException {
return stmt.getMaxRows();
}
public void setMaxRows(int max) throws SQLException {
stmt.setMaxRows(max);
}
public void setEscapeProcessing(boolean enable) throws SQLException {
stmt.setEscapeProcessing(enable);
}
public int getQueryTimeout() throws SQLException {
return stmt.getQueryTimeout();
}
public void setQueryTimeout(int seconds) throws SQLException {
stmt.setQueryTimeout(seconds);
}
public void cancel() throws SQLException {
stmt.cancel();
}
public SQLWarning getWarnings() throws SQLException {
return stmt.getWarnings();
}
public void clearWarnings() throws SQLException {
stmt.clearWarnings();
}
public void setCursorName(String name) throws SQLException {
stmt.setCursorName(name);
}
public boolean execute(String sql) throws SQLException {
return stmt.execute(sql);
}
public ResultSet getResultSet() throws SQLException {
return stmt.getResultSet();
}
public int getUpdateCount() throws SQLException {
return stmt.getUpdateCount();
}
public boolean getMoreResults() throws SQLException {
return stmt.getMoreResults();
}
public void setFetchDirection(int direction) throws SQLException {
stmt.setFetchDirection(direction);
}
public int getFetchDirection() throws SQLException {
return stmt.getFetchDirection();
}
public void setFetchSize(int rows) throws SQLException {
stmt.setFetchSize(rows);
}
public int getFetchSize() throws SQLException {
return stmt.getFetchSize();
}
public int getResultSetConcurrency() throws SQLException {
return stmt.getResultSetConcurrency();
}
public int getResultSetType() throws SQLException {
return stmt.getResultSetType();
}
public void addBatch(String sql) throws SQLException {
stmt.addBatch(sql);
}
public void clearBatch() throws SQLException {
stmt.clearBatch();
}
public int[] executeBatch() throws SQLException {
return stmt.executeBatch();
}
public Connection getConnection() throws SQLException {
return stmt.getConnection();
}
public boolean getMoreResults(int current) throws SQLException {
return stmt.getMoreResults(current);
}
public ResultSet getGeneratedKeys() throws SQLException {
return stmt.getGeneratedKeys();
}
public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException {
return stmt.executeUpdate(sql, autoGeneratedKeys);
}
public int executeUpdate(String sql, int columnIndexes[]) throws SQLException {
return stmt.executeUpdate(sql, columnIndexes);
}
public int executeUpdate(String sql, String columnNames[]) throws SQLException {
return stmt.executeUpdate(sql, columnNames);
}
public boolean execute(String sql, int autoGeneratedKeys) throws SQLException {
return stmt.execute(sql, autoGeneratedKeys);
}
public boolean execute(String sql, int columnIndexes[]) throws SQLException {
return stmt.execute(sql, columnIndexes);
}
public boolean execute(String sql, String columnNames[]) throws SQLException {
return stmt.execute(sql, columnNames);
}
public int getResultSetHoldability() throws SQLException {
return stmt.getResultSetHoldability();
}
}
This diff is collapsed.
/**
* $RCSfile$
* $Revision$
* $Date$
*
* Copyright (C) 1999-2003 CoolServlets, Inc. All rights reserved.
*
* This software is the proprietary information of CoolServlets, Inc.
* Use is subject to license terms.
*/
package org.jivesoftware.messenger;
import org.jivesoftware.messenger.auth.UnauthorizedException;
/**
* Interface to handle packets delivered by Channels.
*
* @author Matt Tucker
*/
public interface ChannelHandler<T extends XMPPPacket> {
/**
* Process an XMPP packet.
*
* @param packet a packet to process.
* @throws UnauthorizedException thrown if the packet's sender lacks authorization
* to access resources (will result in uniform unauthorized access error reply).
* @throws PacketException thrown if the packet is malformed (results in the sender's
* session being shutdown).
*/
public abstract void process(T packet) throws UnauthorizedException, PacketException;
}
\ No newline at end of file
/**
* $RCSfile$
* $Revision$
* $Date$
*
* Copyright (C) 1999-2003 CoolServlets, Inc. All rights reserved.
*
* This software is the proprietary information of CoolServlets, Inc.
* Use is subject to license terms.
*/
package org.jivesoftware.messenger;
/**
* Thrown when a channel lookup fails to find the specified channel.
*
* @author Matt Tucker
*/
public class ChannelNotFoundException extends RuntimeException {
public ChannelNotFoundException() {
super();
}
public ChannelNotFoundException(String msg) {
super(msg);
}
}
This diff is collapsed.
/**
* $RCSfile$
* $Revision$
* $Date$
*
* Copyright (C) 1999-2003 CoolServlets, Inc. All rights reserved.
*
* This software is the proprietary information of CoolServlets, Inc.
* Use is subject to license terms.
*/
package org.jivesoftware.messenger;
/**
* Implement and register with a connection to receive notification
* of the connection closing.
*
* @author Iain Shigeoka
*/
public interface ConnectionCloseListener {
/**
* Called when a connection is closed.
*
* @param handback The handback object associated with the connection listener during Connection.registerCloseListener()
*/
public void onConnectionClose(Object handback);
}
/**
* $RCSfile$
* $Revision$
* $Date$
*
* Copyright (C) 1999-2003 CoolServlets, Inc. All rights reserved.
*
* This software is the proprietary information of CoolServlets, Inc.
* Use is subject to license terms.
*/
package org.jivesoftware.messenger;
import java.net.Socket;
import java.util.Iterator;
import javax.xml.stream.XMLStreamException;
/**
* <p>Coordinates connections (accept, read, termination) on the server.</p>
*
* @author Iain Shigeoka
*/
public interface ConnectionManager {
/**
* <p>Obtain an array of the ports managed by this connection manager.</p>
*
* @return Iterator of the ports managed by this connection manager (can be an empty but never null)
*/
public Iterator getPorts();
/**
* <p>Adds a socket to be managed by the connection manager.</p>
*
* @param sock The socket to add to this manager for management
* @param isSecure True if this is a secure connection
*/
public void addSocket(Socket sock, boolean isSecure) throws XMLStreamException;
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* RCSFile: $
* Revision: $
* Date: $
*
* Copyright (C) 1999-2003 CoolServlets, Inc. All rights reserved.
*
* This software is the proprietary information of CoolServlets, Inc.
* Use is subject to license terms.
*/
package org.jivesoftware.messenger;
/**
* <p>Route iq packets throughout the server.</p>
* <p>Routing is based on the recipient and sender addresses. The typical
* packet will often be routed twice, once from the sender to some internal
* server component for handling or processing, and then back to the router
* to be delivered to it's final destination.</p>
*
* @author Iain Shigeoka
*/
public interface IQRouter {
/**
* <p>Performs the actual packet routing.</p>
* <p>You routing is considered 'quick' and implementations may not take
* excessive amounts of time to complete the routing. If routing will take
* a long amount of time, the actual routing should be done in another thread
* so this method returns quickly.</p>
* <h2>Warning</h2>
* <p>Be careful to enforce concurrency DbC of concurrent by synchronizing
* any accesses to class resources.</p>
*
* @param packet The packet to route
* @throws NullPointerException If the packet is null
*/
public void route(IQ packet);
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment