new service databases
This commit is contained in:
parent
bf0f8816ff
commit
38942756ec
@ -48,7 +48,6 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<build>
|
<build>
|
||||||
<finalName>cust-webapp</finalName>
|
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-war-plugin</artifactId>
|
<artifactId>maven-war-plugin</artifactId>
|
||||||
@ -56,6 +55,46 @@
|
|||||||
<archiveClasses>true</archiveClasses>
|
<archiveClasses>true</archiveClasses>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<excludes>
|
||||||
|
<exclude>**/XmlRpcServlet.properties</exclude>
|
||||||
|
</excludes>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>make-a-jar</id>
|
||||||
|
<phase>compile</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>jar</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
|
<artifactId>build-helper-maven-plugin</artifactId>
|
||||||
|
<version>1.7</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>attach-artifacts</id>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>attach-artifact</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<artifacts>
|
||||||
|
<artifact>
|
||||||
|
<file>${project.basedir}/target/cust-webapp-1.0-SNAPSHOT.jar</file>
|
||||||
|
<type>jar</type>
|
||||||
|
</artifact>
|
||||||
|
</artifacts>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.openejb.maven</groupId>
|
<groupId>org.apache.openejb.maven</groupId>
|
||||||
<artifactId>tomee-maven-plugin</artifactId>
|
<artifactId>tomee-maven-plugin</artifactId>
|
||||||
|
13
database-services/.gitignore
vendored
Normal file
13
database-services/.gitignore
vendored
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
*.class
|
||||||
|
|
||||||
|
# Package Files #
|
||||||
|
*.jar
|
||||||
|
*.war
|
||||||
|
*.ear
|
||||||
|
|
||||||
|
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||||
|
hs_err_pid*
|
||||||
|
/target
|
||||||
|
/.settings
|
||||||
|
/.classpath
|
||||||
|
/.project
|
81
database-services/pom.xml
Normal file
81
database-services/pom.xml
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
|
||||||
|
http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>de.hsadmin</groupId>
|
||||||
|
<artifactId>hsadmin-parent</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>database-webapp</artifactId>
|
||||||
|
<packaging>war</packaging>
|
||||||
|
<name>HSAdmin XML-RPC Database Webapp</name>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>de.hsadmin</groupId>
|
||||||
|
<artifactId>framework</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>de.hsadmin</groupId>
|
||||||
|
<artifactId>cust-webapp</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.geronimo.specs</groupId>
|
||||||
|
<artifactId>geronimo-jpa_2.0_spec</artifactId>
|
||||||
|
<version>1.1</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.geronimo.specs</groupId>
|
||||||
|
<artifactId>geronimo-ejb_3.0_spec</artifactId>
|
||||||
|
<version>1.0.1</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.geronimo.specs</groupId>
|
||||||
|
<artifactId>geronimo-validation_1.0_spec</artifactId>
|
||||||
|
<version>1.1</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.xmlrpc</groupId>
|
||||||
|
<artifactId>xmlrpc-server</artifactId>
|
||||||
|
<version>3.1.3</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>javax.servlet</groupId>
|
||||||
|
<artifactId>servlet-api</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<build>
|
||||||
|
<finalName>database-webapp</finalName>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-war-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<archiveClasses>true</archiveClasses>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.openejb.maven</groupId>
|
||||||
|
<artifactId>tomee-maven-plugin</artifactId>
|
||||||
|
<version>1.7.4</version>
|
||||||
|
<configuration>
|
||||||
|
<tomeeVersion>1.7.4</tomeeVersion>
|
||||||
|
<tomeeClassifier>webprofile</tomeeClassifier>
|
||||||
|
<debug>false</debug>
|
||||||
|
<debugPort>8000</debugPort>
|
||||||
|
<config>${project.basedir}/src/test/tomee/conf</config>
|
||||||
|
<libs>
|
||||||
|
<lib>org.postgresql:postgresql:9.4.1212.jre7</lib>
|
||||||
|
</libs>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
@ -0,0 +1,14 @@
|
|||||||
|
package de.hsadmin.service.database;
|
||||||
|
|
||||||
|
import de.hsadmin.xmlrpc.AbstractRemote;
|
||||||
|
import de.hsadmin.xmlrpc.Remote;
|
||||||
|
|
||||||
|
|
||||||
|
public class MySqlDatabaseRemote extends AbstractRemote<MySqlDatabaseVO> implements Remote {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getModuleLookup() {
|
||||||
|
return "MySqlDatabaseServiceLocal";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,10 @@
|
|||||||
|
package de.hsadmin.service.database;
|
||||||
|
|
||||||
|
import javax.ejb.Local;
|
||||||
|
|
||||||
|
import de.hsadmin.module.Module;
|
||||||
|
|
||||||
|
@Local
|
||||||
|
public interface MySqlDatabaseServiceLocal extends Module<MySqlDatabaseVO>{
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
package de.hsadmin.service.database;
|
||||||
|
|
||||||
|
import de.hsadmin.common.error.TechnicalException;
|
||||||
|
import de.hsadmin.module.ValueObject;
|
||||||
|
import de.hsadmin.module.impl.AbstractVO;
|
||||||
|
|
||||||
|
public class MySqlDatabaseVO extends AbstractVO implements ValueObject {
|
||||||
|
|
||||||
|
public MySqlDatabaseVO() throws TechnicalException {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package de.hsadmin.service.database;
|
||||||
|
|
||||||
|
import de.hsadmin.xmlrpc.AbstractRemote;
|
||||||
|
import de.hsadmin.xmlrpc.Remote;
|
||||||
|
|
||||||
|
|
||||||
|
public class MySqlUserRemote extends AbstractRemote<MySqlUserVO> implements Remote {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getModuleLookup() {
|
||||||
|
return "MySqlUserServiceLocal";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package de.hsadmin.service.database;
|
||||||
|
|
||||||
|
import javax.ejb.Stateless;
|
||||||
|
import javax.persistence.EntityManager;
|
||||||
|
import javax.persistence.PersistenceContext;
|
||||||
|
|
||||||
|
import de.hsadmin.common.error.TechnicalException;
|
||||||
|
import de.hsadmin.module.impl.AbstractModule;
|
||||||
|
|
||||||
|
@Stateless
|
||||||
|
public class MySqlUserService extends AbstractModule<MySqlUserVO> implements MySqlUserServiceLocal {
|
||||||
|
|
||||||
|
@PersistenceContext(name="hsar")
|
||||||
|
private EntityManager entityManager;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MySqlUserVO buildVO() throws TechnicalException {
|
||||||
|
return new MySqlUserVO();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,10 @@
|
|||||||
|
package de.hsadmin.service.database;
|
||||||
|
|
||||||
|
import javax.ejb.Local;
|
||||||
|
|
||||||
|
import de.hsadmin.module.Module;
|
||||||
|
|
||||||
|
@Local
|
||||||
|
public interface MySqlUserServiceLocal extends Module<MySqlUserVO>{
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
package de.hsadmin.service.database;
|
||||||
|
|
||||||
|
import de.hsadmin.common.error.TechnicalException;
|
||||||
|
import de.hsadmin.module.ValueObject;
|
||||||
|
import de.hsadmin.module.impl.AbstractVO;
|
||||||
|
|
||||||
|
public class MySqlUserVO extends AbstractVO implements ValueObject {
|
||||||
|
|
||||||
|
public MySqlUserVO() throws TechnicalException {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package de.hsadmin.service.database;
|
||||||
|
|
||||||
|
import de.hsadmin.xmlrpc.AbstractRemote;
|
||||||
|
import de.hsadmin.xmlrpc.Remote;
|
||||||
|
|
||||||
|
|
||||||
|
public class PgSqlDatabaseRemote extends AbstractRemote<PgSqlDatabaseVO> implements Remote {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getModuleLookup() {
|
||||||
|
return "PgSqlDatabaseServiceLocal";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,10 @@
|
|||||||
|
package de.hsadmin.service.database;
|
||||||
|
|
||||||
|
import javax.ejb.Local;
|
||||||
|
|
||||||
|
import de.hsadmin.module.Module;
|
||||||
|
|
||||||
|
@Local
|
||||||
|
public interface PgSqlDatabaseServiceLocal extends Module<PgSqlDatabaseVO>{
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
package de.hsadmin.service.database;
|
||||||
|
|
||||||
|
import de.hsadmin.common.error.TechnicalException;
|
||||||
|
import de.hsadmin.module.ValueObject;
|
||||||
|
import de.hsadmin.module.impl.AbstractVO;
|
||||||
|
|
||||||
|
public class PgSqlDatabaseVO extends AbstractVO implements ValueObject {
|
||||||
|
|
||||||
|
public PgSqlDatabaseVO() throws TechnicalException {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package de.hsadmin.service.database;
|
||||||
|
|
||||||
|
import de.hsadmin.xmlrpc.AbstractRemote;
|
||||||
|
import de.hsadmin.xmlrpc.Remote;
|
||||||
|
|
||||||
|
|
||||||
|
public class PgSqlUserRemote extends AbstractRemote<PgSqlUserVO> implements Remote {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getModuleLookup() {
|
||||||
|
return "PgSqlUserServiceLocal";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,10 @@
|
|||||||
|
package de.hsadmin.service.database;
|
||||||
|
|
||||||
|
import javax.ejb.Local;
|
||||||
|
|
||||||
|
import de.hsadmin.module.Module;
|
||||||
|
|
||||||
|
@Local
|
||||||
|
public interface PgSqlUserServiceLocal extends Module<PgSqlUserVO>{
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
package de.hsadmin.service.database;
|
||||||
|
|
||||||
|
import de.hsadmin.common.error.TechnicalException;
|
||||||
|
import de.hsadmin.module.ValueObject;
|
||||||
|
import de.hsadmin.module.impl.AbstractVO;
|
||||||
|
|
||||||
|
public class PgSqlUserVO extends AbstractVO implements ValueObject {
|
||||||
|
|
||||||
|
public PgSqlUserVO() throws TechnicalException {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
mysqluser=de.hsadmin.service.database.MySqlUserRemote
|
||||||
|
mysqldb=de.hsadmin.service.database.MySqlDatabaseRemote
|
||||||
|
pgsqluser=de.hsadmin.service.database.PgSqlUserRemote
|
||||||
|
pgsqldb=de.hsadmin.service.database.PgSqlDatabaseRemote
|
22
database-services/src/main/webapp/WEB-INF/web.xml
Normal file
22
database-services/src/main/webapp/WEB-INF/web.xml
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
|
||||||
|
version="2.5">
|
||||||
|
|
||||||
|
<servlet>
|
||||||
|
<servlet-name>XmlRpcServlet</servlet-name>
|
||||||
|
<servlet-class>de.hsadmin.xmlrpc.HSXmlRpcServlet</servlet-class>
|
||||||
|
<init-param>
|
||||||
|
<param-name>enabledForExtensions</param-name>
|
||||||
|
<param-value>true</param-value>
|
||||||
|
</init-param>
|
||||||
|
</servlet>
|
||||||
|
|
||||||
|
<servlet-mapping>
|
||||||
|
<servlet-name>XmlRpcServlet</servlet-name>
|
||||||
|
<url-pattern>/xmlrpc/*</url-pattern>
|
||||||
|
</servlet-mapping>
|
||||||
|
|
||||||
|
|
||||||
|
</web-app>
|
6
database-services/src/test/tomee/conf/hsadmin.properties
Normal file
6
database-services/src/test/tomee/conf/hsadmin.properties
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
ticketvalidator.class=de.hsadmin.login.TestTicketValidator
|
||||||
|
cas.validate.url=https://login.hostsharing.net:443/cas/proxyValidate
|
||||||
|
cas.service.url=https://config.hostsharing.net:443/hsar/backend
|
||||||
|
accountprefix.hostmaster=hsh01
|
||||||
|
accountprefix.customer=hsh00
|
||||||
|
domainpostfix.pacdomain=hostsharing.net
|
40
framework/README.md
Normal file
40
framework/README.md
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
Entwicklung eines HSAdmin Modul
|
||||||
|
===============================
|
||||||
|
|
||||||
|
Für die Klasse <Entity> werden folgende Klassen/Interfaces angelegt:
|
||||||
|
|
||||||
|
Das Namens-Präfix "Entity" wird durch den spezifischen Modulnamen ersetzt.
|
||||||
|
|
||||||
|
Value-Objekt *EntityVO*
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
class **EntityVO** extends _AbstractVO_ implements _ValueObject_
|
||||||
|
|
||||||
|
Beschreibt das Mapping der Attribute zum persistenten Objekt und
|
||||||
|
Eigenschaften des Feldes in der GUI bzw. im Skript-Client.
|
||||||
|
|
||||||
|
XML-RPC Schnittstelle *EntityRemote*
|
||||||
|
------------------------------------
|
||||||
|
|
||||||
|
class **EntityRemote** extends _AbstractRemote<MySqlUserVO>_ implements _Remote_
|
||||||
|
|
||||||
|
Das Interface _Remote_ gibt die Methoden search, add, update und delete
|
||||||
|
der HSAdmin-API vor.
|
||||||
|
|
||||||
|
Die abstrakte Implementierung aus _AbstractRemote_ muss in der Regel nur um eine
|
||||||
|
Implementierung der Methode _getModuleLookup()_ erweitert werden. _getModuleLookup()_
|
||||||
|
liefert den Namen des EJB-Local-Interface der Session-Bean (s.u.).
|
||||||
|
|
||||||
|
EJB Schnittstelle *EntityServiceLocal*
|
||||||
|
--------------------------------------
|
||||||
|
|
||||||
|
interface **EntityServiceLocal** extends _Module<EntityVO>_
|
||||||
|
|
||||||
|
Entity-spezifische Erweiterung des Interface _Module_.
|
||||||
|
|
||||||
|
EJB Implementierung *EntityService*
|
||||||
|
-----------------------------------
|
||||||
|
|
||||||
|
class **EntityService** extends _AbstractModule<EntityVO>_ implements _EntityServiceLocal_
|
||||||
|
|
||||||
|
Modul-spezifische Implementierung unter Nutzung der generischen Implementierung aus _AbstactModule_.
|
1
pom.xml
1
pom.xml
@ -14,6 +14,7 @@
|
|||||||
<module>db-migration</module>
|
<module>db-migration</module>
|
||||||
<module>framework</module>
|
<module>framework</module>
|
||||||
<module>cust-services</module>
|
<module>cust-services</module>
|
||||||
|
<module>database-services</module>
|
||||||
<module>web</module>
|
<module>web</module>
|
||||||
<module>cli</module>
|
<module>cli</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
Loading…
Reference in New Issue
Block a user