join-cvs Mailing List for Join Integration Management System (Page 62)
Brought to you by:
lbroudoux
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(68) |
Aug
(146) |
Sep
(35) |
Oct
(30) |
Nov
(56) |
Dec
(45) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
|
Feb
(48) |
Mar
(56) |
Apr
(13) |
May
(15) |
Jun
(37) |
Jul
(113) |
Aug
(41) |
Sep
(24) |
Oct
(44) |
Nov
(52) |
Dec
|
| 2005 |
Jan
(73) |
Feb
(14) |
Mar
(19) |
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
(90) |
Sep
(51) |
Oct
(5) |
Nov
(24) |
Dec
(1) |
| 2006 |
Jan
(26) |
Feb
(6) |
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
(165) |
Aug
(4) |
Sep
(5) |
Oct
(48) |
Nov
(3) |
Dec
(10) |
| 2007 |
Jan
(38) |
Feb
(48) |
Mar
(3) |
Apr
(31) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(10) |
Nov
(9) |
Dec
|
| 2008 |
Jan
(21) |
Feb
(41) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(12) |
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
| 2009 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <lbr...@us...> - 2003-07-30 14:21:17
|
Update of /cvsroot/join/join/src/main/org/figure8/join/service
In directory sc8-pr-cvs1:/tmp/cvs-serv19850
Added Files:
Notifier.java NotifierSupport.java MDBNotificationManager.java
Log Message:
Initial checkin
--- NEW FILE: Notifier.java ---
/*
* Notifier.java
*
* Created on 25 janvier 2003, 15:58
*/
package org.figure8.join.service;
import org.figure8.join.view.UpdateView;
import org.figure8.join.view.VersionView;
import org.figure8.join.businessobjects.environment.interfaces.LogicalEnvData;
/**
* Provides methods that the Join application Notification Service must implement.
* The Notification Service is used when Join is configured "full-featured" : as
* an Integration Network. Notification Service is used to keep current software
* project clients up-to-date with the project evolution. The notification of
* clients can occurs basically on 3 types of event : a logical environment creation
* event, a version creation event or an environment update event.
* @author <a href="mailto:lau...@fr...">Laurent Broudoux</a>
*/
public interface Notifier{
// Static -------------------------------------------------------------------
public static final int NOTIFICATION_KO = 0;
public static final int NOTIFICATION_OK = 1;
// Public -------------------------------------------------------------------
/**
* Notify current software project client of an environment update.
* @return NOTIFICATION_OK when nofication is successfull, NOTIFICATION_KO otherwise.
*/
public int notifyUpdate(UpdateView view);
/**
* Notify current software project client of a new sofware version creation.
* @return NOTIFICATION_OK when nofication is successfull, NOTIFICATION_KO otherwise.
*/
public int notifyVersion(VersionView view);
/**
* Notify current software project client of a new logical environment creation.
* @return NOTIFICATION_OK when notification is successfull, NOTIFICATION_KO otherwise.
*/
public int notifyEnvironment(LogicalEnvData data);
/**
* Set notifyer parameters before notifying clients of environment update.
* When defining a notification manager, this method must be called before
* notifyUpdate(). The parameters are typically implementation specific
* properties to set, such as :<br>
* <li>a connection url and a connection driver to use,
* <li>some security properties (user/password),
* <li>a Web Service endpoint address, ...
*/
public void setUpdateParameters(String parameters);
/**
* Set notifyer parameters before notifying clients of a new software version
* creation. When defining a notification manager, this method must be called
* before notifyVersion(). The parameters are typically implementation specific
* properties to set, such as :<br>
* <li>a connection url and a connection driver to use,
* <li>some security properties (user/password),
* <li>a Web Service endpoint address, ...
*/
public void setVersionParameters(String parameters);
/**
* Set notifyer parameters before notifying clients of a new logical environment
* creation. When defining a notification manager, this method must be called
* before notifyEnvironment(). The parameters are typically implementation
* specific properties to set, such as :<br>
* <li>a connection url and a connection driver to use,
* <li>some security properties (user/password),
* <li>a Web Service endpoint address, ...
*/
public void setEnvironmentParameters(String parameters);
}
--- NEW FILE: NotifierSupport.java ---
/*
* NotifierSupport.java
*
* Created on 25 janvier 2003, 16:06
*/
package org.figure8.join.service;
import org.figure8.join.util.LogUtil;
import org.figure8.join.view.UpdateView;
import org.figure8.join.view.VersionView;
import org.figure8.join.businessobjects.component.util.VersionUtil;
import org.figure8.join.businessobjects.environment.util.UpdateUtil;
import org.figure8.join.businessobjects.component.interfaces.VersionLocal;
import org.figure8.join.businessobjects.environment.interfaces.UpdateLocal;
import org.figure8.join.businessobjects.environment.interfaces.LogicalEnvData;
import org.apache.commons.logging.Log;
import java.lang.reflect.Method;
import java.util.StringTokenizer;
/**
* Abstract implementation of Notifier providing helper method for
* setting parameters of notification.
* @author <a href="mailto:lau...@fr...">Laurent Broudoux</a>
*/
public abstract class NotifierSupport implements Notifier{
// Attributes ---------------------------------------------------------------
/** Logger for diagnostic messages */
protected Log log;
// Constructors -------------------------------------------------------------
/** Creates a new instance of NotifierSupport */
public NotifierSupport(){
log = LogUtil.getLog(this.getClass());
}
// Public -------------------------------------------------------------------
/**
* Helper for setUpdateParameters() and setVersionParameters() of Notifyer.
* Take parameters as a dot-comma separated list of key/value pairs and set
* properties with name equals to <br>key</b>.<br>
* Example : parameters may be "driver=com.oracle.jdbc.Driver;user=tiger", this
* method will try to call setDriver("com.oracle.jdbc.Driver") and setUser("tiger")
* on current NotificationSupport extension class.
* @param dot-comma separated list of key/value
*/
public void setParameters(String parameters){
StringTokenizer tokenizer = new StringTokenizer(parameters, ";");
// Browse tokens to set properties using reflection.
while (tokenizer != null && tokenizer.hasMoreTokens()){
String token = tokenizer.nextToken();
// Get key/value pair.
String key = token.substring(0, token.indexOf("="));
String value = token.substring(token.indexOf("=") + 1, token.length());
// Get property name with 1st letter in upper case.
String property = key.substring(0, 1).toUpperCase() + key.substring(1, key.length());
if (log.isDebugEnabled()){
log.debug("Setting notification props... Property :" + property + " - Value: " + value);
}
try{
// Get setProperty(String) method and use it.
Class clazz = this.getClass();
Method setProperty = clazz.getDeclaredMethod("set" + property, new Class[]{String.class});
setProperty.invoke(this, new Object[]{value});
}
catch (Exception e){
log.error("Setting notification property failed for property: " + property);
log.error("Check that Notifier implementation as a setter for this property !");
}
}
}
// Implementation of Notifyer -----------------------------------------------
/**
* Notify current software project client of an environment update.
* @return NOTIFICATION_OK when nofication is successfull, NOTIFICATION_KO otherwise.
*/
public abstract int notifyUpdate(UpdateView view);
/**
* Notify current software project client of an environment update.
* @return NOTIFICATION_OK when nofication is successfull, NOTIFICATION_KO otherwise.
*/
public abstract int notifyVersion(VersionView view);
/**
* Notify current software project client of a new logical environment creation.
* @return NOTIFICATION_OK when notification is successfull, NOTIFICATION_KO otherwise.
*/
public abstract int notifyEnvironment(LogicalEnvData data);
/**
* Set notifier parameters before notifying clients of environment update.
* When defining a notification manager, this method must be called before
* notifyUpdate(). The parameters are typically implementation specific
* properties to set, such as :<br>
* <li>a connection url and a connection driver to use,
* <li>some security properties (user/password),
* <li>a Web Service endpoint address, ...
*/
public void setUpdateParameters(String parameters){
setParameters(parameters);
}
/**
* Set notifier parameters before notifying clients of a new software version
* creation. When defining a notification manager, this method must be called
* before notifyVersion(). The parameters are typically implementation spcecific
* properties to set, such as :<br>
* <li>a connection url and a connection driver to use,
* <li>some security properties (user/password),
* <li>a Web Service endpoint address, ...
*/
public void setVersionParameters(String parameters){
setParameters(parameters);
}
/**
* Set notifier parameters before notifying clients of a new logical environment
* creation. When defining a notification manager, this method must be called
* before notifyEnvironment(). The parameters are typically implementation
* specific properties to set, such as :<br>
* <li>a connection url and a connection driver to use,
* <li>some security properties (user/password),
* <li>a Web Service endpoint address, ...
*/
public void setEnvironmentParameters(String parameters){
setParameters(parameters);
}
}
--- NEW FILE: MDBNotificationManager.java ---
/*
* MDBNotificationManager.java
*
* Created on 25 janvier 2003, 18:10
*/
package org.figure8.join.service;
import org.figure8.join.service.Notifier;
import org.figure8.join.view.UpdateView;
import org.figure8.join.view.VersionView;
import org.figure8.join.view.ConfigurationView;
import org.figure8.join.businessfacades.interfaces.ConfigurationManager;
import org.figure8.join.businessfacades.interfaces.ConfigurationManagerHome;
import org.figure8.join.businessobjects.environment.interfaces.LogicalEnvData;
import org.figure8.join.businessobjects.configuration.interfaces.ClientData;
import org.figure8.join.businessobjects.configuration.interfaces.NotificationFailureData;
import org.figure8.join.util.LogUtil;
import org.apache.commons.logging.Log;
import javax.jms.Message;
import javax.jms.ObjectMessage;
import javax.jms.MessageListener;
import javax.ejb.MessageDrivenContext;
import javax.naming.InitialContext;
import java.util.Iterator;
/**
* Message Driven Bean for Join system's clients notification. This bean manages the
* notification of all the current configuration clients for a received event. This
* Message Driven Bean uses 1 parameter specified as an ejb reference :
* <li> <b>java:comp/env/ejb/ConfigurationManager</b> must be a reference to the remote
* home interface of the ConfigurationManager session bean handling the configuration
* operations of your Join system.
* @author <a href="mailto:lau...@fr...">Laurent Broudoux</a>
*
* @ejb.bean name="NotificationManager"
* destination-type="javax.jms.Topic"
* subscription-durability="NonDurable"
* transaction-type="Bean"
*
* @ejb.ejb-ref ejb-name="ConfigurationManager" ref-name="ejb/ConfigurationManager" view-type="remote"
*
* @jboss.ejb-ref-jndi ref-name="ConfigurationManager" jndi-name="${facades.configuration.remote.jndi-name}"
* @jboss.destination-jndi-name name="${resources.notificationtopic.jndi-name}"
*/
public class MDBNotificationManager implements javax.ejb.MessageDrivenBean, MessageListener{
// Attributes ---------------------------------------------------------------
private MessageDrivenContext mdctx = null;
private Log log;
private ConfigurationView config;
private ConfigurationManagerHome managerHome;
// Implementation of MessageListener ----------------------------------------
/**
* Notification Manager business method. This method takes place in steps
* <li> First, retrieve the object from JMS Message,
* <li> Then, depending on object class invoke a manageXXXNotification() method
* (this methods are responsible of clients notification, failures tracking and
* reporting).
* This methods are public so that you can extend them.
* @param message Message picked in topic.
*/
public void onMessage(Message message){
// Process only the ObjectMessages.
if (message instanceof ObjectMessage){
// Retrieve Object from JMS Message.
Object obj = null;
try {obj = ((ObjectMessage)message).getObject();}
catch (Exception e){
log.error("Exception when casting message in NotificationManager: " + e.getMessage());
return;
}
// Notify clients if there's at least one ...
if (config.getClients() != null && config.getClients().size() > 0){
// Depending on object class, manage notifications.
if (obj instanceof UpdateView)
manageUpdateNotification((UpdateView)obj);
else if (obj instanceof VersionView)
manageVersionNotification((VersionView)obj);
else if (obj instanceof LogicalEnvData)
manageEnvironmentNotification((LogicalEnvData)obj);
else
log.warn("Object class is not supported: " + obj.getClass());
}
}
return;
}
// Public -------------------------------------------------------------------
/**
* Get the ConfigurationManager remote home interface used.
* Useful when extending this bean and re-defining managerXXXNotification()
* methods.
*/
public ConfigurationManagerHome getConfigurationManagerHome(){
return managerHome;
}
/**
* Manage the notification of an "environment update" event for all
* the clients of the current configuration.
* @param update The view on Update conserned by this event.
*/
public void manageUpdateNotification(UpdateView update){
if (log.isInfoEnabled()){
log.info("Notifying clients of '" + config.getLabel() + "' configuration");
log.info("Event is environment Update with id: " + update.getId());
}
// Browse clients and notify each of them.
Iterator iterator = config.getClients().iterator();
while (iterator != null && iterator.hasNext()){
ClientData client = (ClientData)iterator.next();
try{
Notifier notifier = getNotifier(client);
log.debug("Notifying the client '" + client.getName() + "' of environment update");
if (client.getNotifierUpdateParams() != null && client.getNotifierUpdateParams().length() > 0){
// Launch client notification.
notifier.setUpdateParameters(client.getNotifierUpdateParams());
int result = notifier.notifyUpdate(update);
// Check result and and log a failure if KO.
if (result == Notifier.NOTIFICATION_KO)
throw new Exception("Failure in notifying client: " + client.getName());
}
}
catch (Exception e){
// Build a notification failure data object.
NotificationFailureData data = new NotificationFailureData();
data.setType("update");
data.setReference(update.getId());
try{
// Create the notification failure into system.
ConfigurationManager manager = managerHome.create();
manager.createNotificationFailure(data, client.getId());
manager.remove();
}
catch (Exception ee){
log.error("Error while reporting notification failure for update: " + data);
ee.printStackTrace();
}
}
}
}
/**
* Manage the notification of an "version creation" event for all
* the clients of the current configuration.
* @param version The view on Version concerned by this event.
*/
public void manageVersionNotification(VersionView version){
if (log.isInfoEnabled()){
log.info("Notifying clients of '" + config.getLabel() + "' configuration");
log.info("Event is a Version creation with id: " + version.getId());
}
// Browse clients and notify each of them.
Iterator iterator = config.getClients().iterator();
while (iterator != null && iterator.hasNext()){
ClientData client = (ClientData)iterator.next();
try{
Notifier notifier = getNotifier(client);
log.debug("Notifying the client '" + client.getName() +"' of version creation");
if (client.getNotifierVersionParams() != null && client.getNotifierVersionParams().length() > 0){
// Launch client notification.
notifier.setVersionParameters(client.getNotifierVersionParams());
int result = notifier.notifyVersion(version);
// Check result and log a failure if KO
if (result == Notifier.NOTIFICATION_KO)
throw new Exception("Failure in notifying client: " + client.getName());
}
}
catch (Exception e){
// Build a notification failure data object.
NotificationFailureData data = new NotificationFailureData();
data.setType("version");
data.setReference(version.getId());
try{
// Create the notification failure into system.
ConfigurationManager manager = managerHome.create();
manager.createNotificationFailure(data, client.getId());
manager.remove();
}
catch (Exception ee){
log.error("Error while reporting notification failure for version: " + data);
ee.printStackTrace();
}
}
}
}
/**
* Manage the notification of an "environment creation" event for all
* the clients of the current configuration.
* @param version The data of Environment concerned by this event.
*/
public void manageEnvironmentNotification(LogicalEnvData env){
if (log.isInfoEnabled()){
log.info("Notifying clients of '" + config.getLabel() + "' configuration");
log.info("Event is an Environment creation with label: " + env.getLabel());
}
// Browse clients and notify each of them.
Iterator iterator = config.getClients().iterator();
while (iterator != null && iterator.hasNext()){
ClientData client = (ClientData)iterator.next();
try{
Notifier notifier = getNotifier(client);
log.debug("Notifying the client '" + client.getName() +"' of environment creation");
if (client.getNotifierEnvironmentParams() != null && client.getNotifierEnvironmentParams().length() > 0){
// Launch client notification.
notifier.setEnvironmentParameters(client.getNotifierEnvironmentParams());
int result = notifier.notifyEnvironment(env);
// Check result and log a failure if KO.
if (result == Notifier.NOTIFICATION_KO)
throw new Exception("Failure in notifying client: " + client.getName());
}
}
catch (Exception e){
// Build a notification failure data object.
NotificationFailureData data = new NotificationFailureData();
data.setType("environment");
data.setReference(env.getId().toString());
try{
// Create the notification failure into system.
ConfigurationManager manager = managerHome.create();
manager.createNotificationFailure(data, client.getId());
manager.remove();
}
catch (Exception ee){
log.error("Error while reporting notification failure for update: " + data);
ee.printStackTrace();
}
}
}
}
// Implementation of MessageDrivenBean --------------------------------------
/** Create a new NotificationManager */
public void ejbCreate() {}
/** Retrieve message driven context and env-entries */
public void setMessageDrivenContext(MessageDrivenContext mdctx) throws javax.ejb.EJBException{
this.mdctx = mdctx;
// Get the logger for this MDB.
log = LogUtil.getLog(this.getClass());
try{
InitialContext ctx = new InitialContext();
// Get the configuration manager home JNDI and instance.
managerHome = (ConfigurationManagerHome)ctx.lookup("java:comp/env/ejb/ConfigurationManager");
// Retrieve and initialize the current config.
ConfigurationManager manager = managerHome.create();
config = manager.getActiveConfiguration();
manager.remove();
}
catch (Exception e) {e.printStackTrace(); throw new javax.ejb.EJBException("Unable to create a NotificationManager instance, checl environmenbt entries.");}
}
/** Remove this NotificationManager */
public void ejbRemove(){
this.mdctx = null;
}
// Protected ----------------------------------------------------------------
/**
* Build specifc notifier implementation.
* @param Client to retrieve a notifyer for.
*/
protected Notifier getNotifier(ClientData client) throws Exception{
if (log.isDebugEnabled())
log.debug("Building notifier of class: " + client.getNotifierImpl());
// Use current context class loader.
String notifierClass = client.getNotifierImpl();
Class notifierClazz = Thread.currentThread().getContextClassLoader().loadClass(notifierClass);
Notifier notifier = (Notifier)notifierClazz.newInstance();
// Return result.
return notifier;
}
}
|
|
From: <lbr...@us...> - 2003-07-30 09:35:38
|
Update of /cvsroot/join/join/src/resources/META-INF In directory sc8-pr-cvs1:/tmp/cvs-serv3677 Added Files: application.xml jboss-app.xml Manifest.mf Log Message: Initial checkin --- NEW FILE: application.xml --- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE application PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN' 'http://java.sun.com/dtd/application_1_3.dtd'> <application> <display-name>application.name</display-name> <module> <ejb>application.dep.ejb-jar.jar</ejb> </module> <module> <web> <web-uri>application.dep.war.war</web-uri> <context-root>/application.dep.context</context-root> </web> </module> </application> --- NEW FILE: jboss-app.xml --- <jboss-app> <loader-repository>application.name:loader=application.dep.ear.ear</loader-repository> </jboss-app> --- NEW FILE: Manifest.mf --- Manifest-Version: 1.0 Class-Path: ./ext/commons-logging.jar ./ext/ant.jar |
|
From: <lbr...@us...> - 2003-07-30 09:34:15
|
Update of /cvsroot/join/join/src/resources/META-INF In directory sc8-pr-cvs1:/tmp/cvs-serv3441/META-INF Log Message: Directory /cvsroot/join/join/src/resources/META-INF added to the repository |
|
From: <lbr...@us...> - 2003-07-30 09:27:58
|
Update of /cvsroot/join/join/src/web/WEB-INF In directory sc8-pr-cvs1:/tmp/cvs-serv2344/WEB-INF Log Message: Directory /cvsroot/join/join/src/web/WEB-INF added to the repository |
|
From: <lbr...@us...> - 2003-07-30 09:27:43
|
Update of /cvsroot/join/join/src/web/style In directory sc8-pr-cvs1:/tmp/cvs-serv2307/style Log Message: Directory /cvsroot/join/join/src/web/style added to the repository |
|
From: <lbr...@us...> - 2003-07-30 09:27:26
|
Update of /cvsroot/join/join/src/web/scripts In directory sc8-pr-cvs1:/tmp/cvs-serv2267/scripts Log Message: Directory /cvsroot/join/join/src/web/scripts added to the repository |
|
From: <lbr...@us...> - 2003-07-30 09:27:16
|
Update of /cvsroot/join/join/src/web/pages In directory sc8-pr-cvs1:/tmp/cvs-serv2229/pages Log Message: Directory /cvsroot/join/join/src/web/pages added to the repository |
|
From: <lbr...@us...> - 2003-07-30 09:27:04
|
Update of /cvsroot/join/join/src/web/layouts In directory sc8-pr-cvs1:/tmp/cvs-serv2157/layouts Log Message: Directory /cvsroot/join/join/src/web/layouts added to the repository |
|
From: <lbr...@us...> - 2003-07-30 09:26:53
|
Update of /cvsroot/join/join/src/web/jsp In directory sc8-pr-cvs1:/tmp/cvs-serv2098/jsp Log Message: Directory /cvsroot/join/join/src/web/jsp added to the repository |
|
From: <lbr...@us...> - 2003-07-30 09:26:40
|
Update of /cvsroot/join/join/src/web/includes In directory sc8-pr-cvs1:/tmp/cvs-serv2060/includes Log Message: Directory /cvsroot/join/join/src/web/includes added to the repository |
|
From: <lbr...@us...> - 2003-07-30 09:26:22
|
Update of /cvsroot/join/join/src/web/images In directory sc8-pr-cvs1:/tmp/cvs-serv1999/images Log Message: Directory /cvsroot/join/join/src/web/images added to the repository |
|
From: <lbr...@us...> - 2003-07-30 09:25:25
|
Update of /cvsroot/join/join/src/web In directory sc8-pr-cvs1:/tmp/cvs-serv1837/web Log Message: Directory /cvsroot/join/join/src/web added to the repository |
|
From: <lbr...@us...> - 2003-07-30 09:20:55
|
Update of /cvsroot/join/join/src/main/org/figure8/util In directory sc8-pr-cvs1:/tmp/cvs-serv1085/util Log Message: Directory /cvsroot/join/join/src/main/org/figure8/util added to the repository |
|
From: <lbr...@us...> - 2003-07-30 09:19:34
|
Update of /cvsroot/join/join/src/main/org/figure8/join/util
In directory sc8-pr-cvs1:/tmp/cvs-serv790
Added Files:
DeliverablePropertiesExtractor.java LogUtil.java
Log Message:
Initial checkin
--- NEW FILE: DeliverablePropertiesExtractor.java ---
/*
* DeliverablePropertiesExtractor.java
*
* Created on 9 january 2003, 19:20
*/
package org.figure8.join.util;
import org.figure8.join.view.DeliverableView;
import org.figure8.join.service.PropertiesExtractor;
import java.util.Properties;
/**
* Implementation of PropertiesExtractor that flatten <code>org.figure8.join.
* view.DeliverableView</code> objects into String properties. The result properties
* are prefixed by "version.". This properties are "id", "release.name",
* "supplier.id", "type.id" and "type.label" where type is the deliverable type.
* @author <a href="mailto:lau...@fr...">Laurent Broudoux</a>
*/
public class DeliverablePropertiesExtractor implements PropertiesExtractor{
// Constructors -------------------------------------------------------------
/** Creates a new instance of DeliverablePropertiesExtractor */
public DeliverablePropertiesExtractor() {}
// Implementation of PropertiesExtractor ------------------------------------
/**
* Extract a set of properties from the given object.
* @param obj The object to flatten into properties
* @throws IllegalArgumentException if the object class is not supported
* by extractor implementation
*/
public Properties extract(Object obj) throws IllegalArgumentException{
// Chekc that object is DeliverableView.
if (obj instanceof DeliverableView){
DeliverableView view = (DeliverableView)obj;
Properties props = new Properties();
// Get general info properties.
props.setProperty("deliverable.id", view.getId());
props.setProperty("deliverable.supplier.id", view.getSupplierId());
props.setProperty("deliverable.release.name", view.getReleaseName());
// Get deliverable type related infos.
props.setProperty("deliverable.type.id", view.getTypeId());
props.setProperty("deliverable.type.label", view.getTypeLabel());
return props;
}
else throw new IllegalArgumentException("DeliverablePropertiesExtractor can only process DeliverableView, not " + obj.getClass());
}
}
--- NEW FILE: LogUtil.java ---
/*
* LogUtil.java
*
* Created on 6 september 2002, 14:31
*/
package org.figure8.join.util;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* Logger factory.
* @author <a href="mailto:lau...@fr...">Laurent Broudoux</a>
*/
public final class LogUtil{
// Static -------------------------------------------------------------------
/**
* Returns an instance of Jakarta Commons Log object.
* For now simply return the classname as a log.
* @param clazz Class (will use clazz.getName() to obtain the class name)
* @return A logger for the specified class
*/
public static Log getLog(Class clazz){
return LogFactory.getLog(clazz.getName());
}
/**
* Returns an instance of Jakarta Commons Log object.
* For now simply return the classname + '.' + name as a log.
* @param clazz Class (will use clazz.getName() to obtain the class name)
* @param name Method name
* @return A logger for the specified class and method
*/
public static Log getLog(Class clazz, String name){
return LogFactory.getLog(new StringBuffer(clazz.getName()).append('.').append(name).toString());
}
}
|
|
From: <lbr...@us...> - 2003-07-30 09:16:58
|
Update of /cvsroot/join/join/src/main/org/figure8/join/businessfacades In directory sc8-pr-cvs1:/tmp/cvs-serv32767/businessfacades Log Message: Directory /cvsroot/join/join/src/main/org/figure8/join/businessfacades added to the repository |
|
From: <lbr...@us...> - 2003-07-30 09:16:53
|
Update of /cvsroot/join/join/src/main/org/figure8/join/ant In directory sc8-pr-cvs1:/tmp/cvs-serv32719/ant Log Message: Directory /cvsroot/join/join/src/main/org/figure8/join/ant added to the repository |
|
From: <lbr...@us...> - 2003-07-30 09:16:00
|
Update of /cvsroot/join/join/src/main/org/figure8/join/util In directory sc8-pr-cvs1:/tmp/cvs-serv32580/util Log Message: Directory /cvsroot/join/join/src/main/org/figure8/join/util added to the repository |
|
From: <lbr...@us...> - 2003-07-30 09:14:55
|
Update of /cvsroot/join/join/src/main/org/figure8/join/control/form In directory sc8-pr-cvs1:/tmp/cvs-serv32393/form Log Message: Directory /cvsroot/join/join/src/main/org/figure8/join/control/form added to the repository |
|
From: <lbr...@us...> - 2003-07-30 09:14:46
|
Update of /cvsroot/join/join/src/main/org/figure8/join/control/action In directory sc8-pr-cvs1:/tmp/cvs-serv32359/action Log Message: Directory /cvsroot/join/join/src/main/org/figure8/join/control/action added to the repository |
|
From: <lbr...@us...> - 2003-07-30 09:13:23
|
Update of /cvsroot/join/join/src/main/org/figure8/join/control
In directory sc8-pr-cvs1:/tmp/cvs-serv32197
Added Files:
JoinAction.java JoinServlet.java UserContainer.java
Log Message:
Initial checkin
--- NEW FILE: JoinAction.java ---
/*
* JoinAction.java
*
* Created on 10 september 2002, 17:08
*/
package org.figure8.join.control;
import org.apache.struts.action.Action;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpServletRequest;
/**
* An abstract Action class that all Join action classes must extend.
* @author <a href="mailto:lau...@fr...">Laurent Broudoux</a>
*/
public abstract class JoinAction extends Action{
// Static -------------------------------------------------------------------
public static final String GUI_KEY = "gui";
// Public -------------------------------------------------------------------
/**
* Check if user tied to the HttpServletRequest is logged
* in Join application (ie : has a non empty UserContainer).
*/
public static boolean isLoggedIn(HttpServletRequest request){
UserContainer container = getUserContainer(request);
return (container != null && container.getView() != null);
}
/**
* Retrieve the user container for the user tied to the HttpServletRequest.
* Creates an empty container if one doesn't exist already.
*/
public static UserContainer getUserContainer(HttpServletRequest request){
HttpSession session = request.getSession();
UserContainer container = (UserContainer)session.getAttribute("user.container");
// Create a UserContainer if one doesn't exist already.
if (container == null){
container = new UserContainer();
session.setAttribute("user.container", container);
}
return container;
}
}
--- NEW FILE: JoinServlet.java ---
/*
* JoinServlet.java
*
* Created on 11 september 2002, 15:09
*/
package org.figure8.join.control;
import org.figure8.join.view.ConfigurationView;
import org.figure8.join.service.UserCache;
import org.figure8.join.service.UserManagerHome;
import org.figure8.join.service.UserManagerFactory;
import org.figure8.join.businessfacades.interfaces.*;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.UnavailableException;
import javax.naming.InitialContext;
/**
* Controller servlet of Join application. This servlet is an extension
* of the Struts ActionServlet.
* @author <a href="mailto:lau...@fr...">Laurent Broudoux</a>
*/
public class JoinServlet extends org.apache.struts.action.ActionServlet{
// Override of ActionServlet ------------------------------------------------
/**
* Override of Struts ActionServlet init() method. Call super.init()
* and then retrieve and store into servlet context objects sharedd by
* the whole application.
*/
public void init() throws ServletException{
// Make sure to always call the super's init() first.
super.init();
// Retrieve objects that are shared across application.
try{
// Get context parameters.
String cacheFqn = (String)getServletContext().getInitParameter("user.cache.fqn");
String builPatt = (String)getServletContext().getInitParameter("build.name.pattern");
String versPatt = (String)getServletContext().getInitParameter("version.name.pattern");
String reposPath = (String)getServletContext().getInitParameter("deliverable.repository.path");
String docReposUrl = (String)getServletContext().getInitParameter("deliverable.docrepository.url");
String docReposPath = (String)getServletContext().getInitParameter("deliverable.docrepository.path");
String authorizationFailureUrl = (String)getServletContext().getInitParameter("authorization.failure.url");
getServletContext().setAttribute("build.pattern", builPatt);
getServletContext().setAttribute("version.pattern", versPatt);
getServletContext().setAttribute("deliverable.repos.path", reposPath);
getServletContext().setAttribute("deliverable.docrepos.url", docReposUrl);
getServletContext().setAttribute("deliverable.docrepos.path", docReposPath);
getServletContext().setAttribute("authorization.fails.url", authorizationFailureUrl);
// Get EJB references.
InitialContext ctx = new InitialContext();
UserManagerHome userHome = UserManagerFactory.createUserManagerHome("java:comp/env/ejb/UserManagerLocal");
ISystemManagerLocalHome isHome = (ISystemManagerLocalHome)ctx.lookup("java:comp/env/ejb/ISystemManagerLocal");
JoinCycleManagerLocalHome cycleHome = (JoinCycleManagerLocalHome)ctx.lookup("java:comp/env/ejb/JoinCycleManagerLocal");
ResourceManagerLocalHome resourceHome = (ResourceManagerLocalHome)ctx.lookup("java:comp/env/ejb/ResourceManagerLocal");
ComponentManagerLocalHome componentHome = (ComponentManagerLocalHome)ctx.lookup("java:comp/env/ejb/ComponentManagerLocal");
ReportingManagerLocalHome reportingHome = (ReportingManagerLocalHome)ctx.lookup("java:comp/env/ejb/ReportingManagerLocal");
EnvironmentManagerLocalHome environmentHome = (EnvironmentManagerLocalHome)ctx.lookup("java:comp/env/ejb/EnvironmentManagerLocal");
ConfigurationManagerLocalHome configurationHome = (ConfigurationManagerLocalHome)ctx.lookup("java:comp/env/ejb/ConfigurationManagerLocal");
getServletContext().setAttribute("user.manager.home", userHome);
getServletContext().setAttribute("is.manager.home", isHome);
getServletContext().setAttribute("cycle.manager.home", cycleHome);
getServletContext().setAttribute("resource.manager.home", resourceHome);
getServletContext().setAttribute("component.manager.home", componentHome);
getServletContext().setAttribute("reporting.manager.home", reportingHome);
getServletContext().setAttribute("environment.manager.home", environmentHome);
getServletContext().setAttribute("configuration.manager.home", configurationHome);
// Build the users cache.
Class cacheClazz = Thread.currentThread().getContextClassLoader().loadClass(cacheFqn);
UserCache cache = (UserCache)cacheClazz.newInstance();
cache.initialize(userHome);
getServletContext().setAttribute("user.cache", cache);
// Get Active Configuration.
ConfigurationManagerLocal manager = configurationHome.create();
ConfigurationView config = manager.getActiveConfiguration();
getServletContext().setAttribute("config", config);
manager.remove();
// Build Mapping Handler.
MappingHandler handler = new MappingHandler();
getServletContext().setAttribute("mapping.handler", handler);
}
catch (Exception e){
e.printStackTrace();
throw new UnavailableException("One or more services are unavailable");
}
}
}
--- NEW FILE: UserContainer.java ---
/*
* UserContainer.java
*
* Created on 10 september 2002, 17:08
*/
package org.figure8.join.control;
import org.figure8.join.view.UserView;
import javax.servlet.http.HttpSessionBindingEvent;
import javax.servlet.http.HttpSessionBindingListener;
import java.util.Iterator;
import java.util.Collection;
/**
* Used to store information about a specific user. This class is used so that
* the information is not scattered throughout the HttpSession. Only this object
* is stored in the session for the user. This class implements the HttpSession
* BindingListener so that it can be notified of session timeoutand perform cleanup.
* @author <a href="mailto:lau...@fr...">Laurent Broudoux</a>
*/
public class UserContainer implements java.io.Serializable, HttpSessionBindingListener{
// Attributes ---------------------------------------------------------------
private UserView view = null;
// Constructors -------------------------------------------------------------
/** Creates a new instance of UserContainer */
public UserContainer(){
super();
}
// Public -------------------------------------------------------------------
/** Get the user view */
public UserView getView() {return view;}
/** Set the user view */
public void setView(UserView view) {this.view = view;}
/**
* Check if user has the required role.
* @param role String representation of Role
*/
public boolean isUserInRole(String role){
if (view != null && view.getHabilitations().get(role) != null)
return true;
else
return false;
}
/**
* Check if user has the required role for given resource.
* @param role String representation of Role
* @param resource String representation of resource
*/
public boolean isUserInRoleForResource(String role, String resource){
if (isUserInRole(role)){
Iterator it = ((Collection)view.getHabilitations().get(role)).iterator();
while (it != null && it.hasNext()){
String res = (String)it.next();
if (res.equals(resource))
return true;
}
}
return false;
}
/**
* Get the resources for this role if user has the given role.
* Resources can represents deliverables, environments on which user
* has rights, depending on the role.
* @param role String representation of Role
*/
public Collection getResources(String role){
if (isUserInRole(role))
return (Collection)view.getHabilitations().get(role);
else
return null;
}
// Protected ----------------------------------------------------------------
/** Cleanup any opened resources */
protected void cleanup(){
this.view = null;
}
// Implementation of HttpSessionBindingListener -----------------------------
/**
* The container calls this method when this object is
* being bound to the user's session.
*/
public void valueBound(HttpSessionBindingEvent httpSessionBindingEvent){
}
/**
* The container calls this method when this object is
* being unbound from the user's session.
*/
public void valueUnbound(HttpSessionBindingEvent httpSessionBindingEvent){
cleanup();
}
}
|
|
From: <lbr...@us...> - 2003-07-30 09:11:19
|
Update of /cvsroot/join/join/src/main/org/figure8/join/control In directory sc8-pr-cvs1:/tmp/cvs-serv31953/control Log Message: Directory /cvsroot/join/join/src/main/org/figure8/join/control added to the repository |
|
From: <lbr...@us...> - 2003-07-30 09:09:57
|
Update of /cvsroot/join/join/src/main/org/figure8/join/businessobjects/configuration/ejb
In directory sc8-pr-cvs1:/tmp/cvs-serv31520
Modified Files:
Tag: 1.12
ClientBean.java
Log Message:
Misspelled "notifier" (not notifyer ... oops!)
--- NEW FILE: ClientBean.java ---
/*
* ClientBean.java
*
* Created on 20 october 2002, 18:12
*/
package org.figure8.join.businessobjects.configuration.ejb;
import org.figure8.join.businessobjects.configuration.util.ClientUtil;
import org.figure8.join.businessobjects.configuration.interfaces.ClientData;
import org.figure8.join.businessobjects.configuration.interfaces.ConfigurationLocal;
import java.util.Set;
/**
* This object is the representation of a client project for the software project
* to join. It means that current project can be seen as an "Information System Type"
* and current environments as "Information System" of the client. <br>
* In order to have the most efficiency, integration systems of this two projects
* must be connected together. A Client handles information on the client project
* itself (name, home page, ...) and how to notify it of new version creation
* and environment updates.
* @author <a href="mailto:lau...@fr...">Laurent Broudoux</a>
*
* @ejb.bean name="Client"
type="CMP" cmp-version="2.x" view-type="local"
jndi-name="${objects.conf.client.jndi-name}"
local-jndi-name="${objects.conf.client.jndi-name}Local"
primkey-field="id"
* @ejb.home local-class="org.figure8.join.businessobjects.configuration.interfaces.ClientLocalHome"
* @ejb.interface local-class="org.figure8.join.businessobjects.configuration.interfaces.ClientLocal"
* @ejb.data-object package="org.figure8.join.businessobjects.configuration.interfaces"
*
* @ejb.pk class="java.lang.String" generate="false" unchecked="true"
* @ejb.persistence table-name="${objects.conf.client.table-name}"
*
* @jboss.tuned-updates "true"
* @jboss.read-ahead strategy="on-load"
* page-size="2"
*/
public abstract class ClientBean implements javax.ejb.EntityBean{
// Public -------------------------------------------------------------------
/**
* Client id
* @ejb.pk-field
* @ejb.persistence column-name="s_id"
*/
public abstract String getId();
/** Client id */
public abstract void setId(String id);
/**
* Client name
* @ejb.interface-method
* @ejb.persistence column-name="s_name"
*/
public abstract String getName();
/**
* Client name
* @ejb.interface-method
*/
public abstract void setName(String name);
/**
* Client home page
* @ejb.interface-method
* @ejb.persistence column-name="s_homepage"
*/
public abstract String getHomePage();
/**
* Client home page
* @ejb.interface-method
*/
public abstract void setHomePage(String homePage);
/**
* Client notifier implementation
* @ejb.interface-method
* @ejb.persistence column-name="s_notifyerimpl"
*/
public abstract String getNotifierImpl();
/**
* Client notifier implementation
* @ejb.interface-method
*/
public abstract void setNotifierImpl(String implementation);
/**
* Client notifier implementation params for
* notification of version creation
* @ejb.interface-method
* @ejb.persistence column-name="s_notifyerversionparams"
*/
public abstract String getNotifierVersionParams();
/**
* Client notifier implementation params for
* notification of version creation
* @ejb.interface-method
*/
public abstract void setNotifierVersionParams(String params);
/**
* Client notifier implementation params for
* notification of environment update
* @ejb.interface-method
* @ejb.persistence column-name="s_notifyerupdateparams"
*/
public abstract String getNotifierUpdateParams();
/**
* Client notifier implementation params for
* notification of environment update
* @ejb.interface-method
*/
public abstract void setNotifierUpdateParams(String param);
/**
* Client notifier implementation params for notification
* of logical environment creation
* @ejb.interface-method
* @ejb.persistence column-name="s_notifyerenvironmentparams"
*/
public abstract String getNotifierEnvironmentParams();
/**
* Client notifier implementation params for notification
* of logical environment creation
* @ejb.interface-method
*/
public abstract void setNotifierEnvironmentParams(String param);
/**
* Configuration to which the client is tied
* @ejb.interface-method view-type="local"
* @ejb.relation name="Configuration-OneToMany-Clients-Bi"
* role-name="Client-has-Configuration"
* cascade-delete="yes"
* @jboss.relation fk-constraint="true"
* related-pk-field="id"
* fk-column="s_configuration_fk"
*/
public abstract ConfigurationLocal getConfiguration();
/**
* Configuration to which the client is tied
* @ejb.interface-method view-type="local"
*/
public abstract void setConfiguration(ConfigurationLocal configuration);
/**
* Failures happened when notifying this client
* @ejb.interface-method view-type="local"
* @ejb.relation name="Client-OneToMany-Failures-Bi"
* role-name="Client-has-Failures"
*/
public abstract Set getNotificationFailures();
/**
* Failures happened when notifying this client
* @ejb.interface-method view-type="local"
*/
public abstract void setNotificationFailures(Set failures);
/**
* Generated bulk accessor
* @ejb.interface-method
*/
public abstract ClientData getData();
/** Generated bulk accessor */
public abstract void setData(ClientData data);
// Implementation of EntityBean ---------------------------------------------
/**
* Create a new Client
* @ejb.create-method
*/
public String ejbCreate(ClientData data, ConfigurationLocal configuration) throws javax.ejb.CreateException{
if (data != null){
setId(ClientUtil.generateGUID(this));
setData(data);
}
else throw new javax.ejb.CreateException("Data object for Client must be non null.");
return null;
}
/** Create a new Client */
public void ejbPostCreate(ClientData data, ConfigurationLocal configuration) throws javax.ejb.CreateException{
setConfiguration(configuration);
}
/**
* Remove this Client
* @ejb.transaction type="Mandatory"
*/
public void ejbRemove() throws javax.ejb.RemoveException, javax.ejb.EJBException {}
}
|
Update of /cvsroot/join/join/src/main/org/figure8/join/businessobjects/resource/ejb
In directory sc8-pr-cvs1:/tmp/cvs-serv3839
Added Files:
BoundGatewayBean.java BoundISBean.java BoundResourceBean.java
BoundServiceBean.java
Log Message:
Initial checkin
--- NEW FILE: BoundGatewayBean.java ---
/*
* BoundGatewayBean.java
*
* Created on 3 september 2002, 18:52
*/
package org.figure8.join.businessobjects.resource.ejb;
import org.figure8.join.businessobjects.resource.util.BoundGatewayUtil;
import org.figure8.join.businessobjects.resource.interfaces.GatewayLocal;
import org.figure8.join.businessobjects.resource.interfaces.BoundGatewayData;
import org.figure8.join.businessobjects.environment.interfaces.PhysicalEnvLocal;
import java.sql.Date;
/**
* This object is a representation of a gateway bound to an environment.
* It is indeed the link between a physical environment and a specific gateway.
* This link can be active (<b>enddate</b> == null) or broken (<b>enddate</b> != null)
* in order to keep history.
* @author <a href="mailto:lau...@fr...">Laurent Broudoux</a>
*
* @ejb.bean name="BoundGateway"
type="CMP" cmp-version="2.x" view-type="local"
jndi-name="${objects.res.boundGateway.jndi-name}"
local-jndi-name="${objects.res.boundGateway.jndi-name}Local"
primkey-field="id"
* @ejb.home local-class="org.figure8.join.businessobjects.resource.interfaces.BoundGatewayLocalHome"
* @ejb.interface local-class="org.figure8.join.businessobjects.resource.interfaces.BoundGatewayLocal"
* @ejb.data-object package="org.figure8.join.businessobjects.resource.interfaces"
*
* @ejb.finder signature="Collection findActivesForPhysical(org.figure8.join.businessobjects.environment.interfaces.PhysicalEnvLocal env)"
unchecked="true" transaction-type="Supports"
query="SELECT DISTINCT OBJECT(bg) FROM BoundGateway AS bg WHERE bg.physicalEnv=?1 AND bg.endDate IS NULL"
*
* @ejb.pk class="java.lang.String" generate="false" unchecked="true"
* @ejb.persistence table-name="${objects.res.boundGateway.table-name}"
*
* @jboss.tuned-updates "true"
* @jboss.read-ahead strategy="on-find"
*/
public abstract class BoundGatewayBean implements javax.ejb.EntityBean{
// Public -------------------------------------------------------------------
/**
* Bound Gateway id
* @ejb.pk-field
* @ejb.persistence column-name="s_id"
*/
public abstract String getId();
/** Bound Gateway id */
public abstract void setId(String id);
/**
* Bound Gateway creation date
* @ejb.interface-method
* @ejb.persistence column-name="d_creation"
* sql-type="TIMESTAMP"
*/
public abstract java.sql.Date getCreationDate();
/**
* Bound Gateway creation date
* @ejb.interface-method
*/
public abstract void setCreationDate(java.sql.Date creationDate);
/**
* Bound Gateway end date
* @ejb.interface-method
* @ejb.persistence column-name="d_end"
* sql-type="TIMESTAMP"
*/
public abstract java.sql.Date getEndDate();
/**
* Bound Gateway end date
* @ejb.interface-method
*/
public abstract void setEndDate(java.sql.Date endDate);
/**
* Gateway to which this object links
* @ejb.interface-method view-type="local"
* @ejb.relation name="Gateway-OneToMany-BoundGateways-Uni"
* role-name="BoundGateway-belongsto-Gateway"
* target-role-name="Gateway-has-BoundGateways"
* target-ejb="Gateway"
* target-multiple="yes"
* @jboss.relation fk-constraint="true"
* related-pk-field="id"
* fk-column="n_gateway_fk"
*/
public abstract GatewayLocal getGateway();
/**
* Gateway to which this object links
* @ejb.interface-method view-type="local"
*/
public abstract void setGateway(GatewayLocal gateway);
/**
* Physical environment to which the gateway is bound
* @ejb.interface-method view-type="local"
* @ejb.relation name="PhysicalEnv-OneToMany-BoundGateways-Bi"
* role-name="BoundGateway-has-PhysicalEnv"
* cascade-delete="yes"
* @jboss.relation fk-constraint="true"
* related-pk-field="id"
* fk-column="n_physicalenv_fk"
*/
public abstract PhysicalEnvLocal getPhysicalEnv();
/**
* Physical environment to which the gateway is bound
* @ejb.interface-method view-type="local"
*/
public abstract void setPhysicalEnv(PhysicalEnvLocal environment);
/**
* Generated bulk accessor
* @ejb.interface-method
*/
public abstract BoundGatewayData getData();
/** Generated bulk accessor */
public abstract void setData(BoundGatewayData data);
/**
* Make this binding between physical environment and gateway end.
* @ejb.interface-method
*/
public void close(){
setEndDate(new java.sql.Date(System.currentTimeMillis()));
}
// Implementation of EntityBean ---------------------------------------------
/**
* Create a new Bound Gateway
* @ejb.create-method
*/
public String ejbCreate(BoundGatewayData data, GatewayLocal gateway, PhysicalEnvLocal env) throws javax.ejb.CreateException{
if (data != null){
setId(BoundGatewayUtil.generateGUID(this));
setData(data);
}
else throw new javax.ejb.CreateException("Data object for BoundGateway must be non null.");
return null;
}
/** Create a new Bound Gateway */
public void ejbPostCreate(BoundGatewayData data, GatewayLocal gateway, PhysicalEnvLocal env) throws javax.ejb.CreateException{
setGateway(gateway);
setPhysicalEnv(env);
}
/**
* Remove this Bound Resource
* @ejb.transaction type="Mandatory"
*/
public void ejbRemove() throws javax.ejb.RemoveException, javax.ejb.EJBException {}
}
--- NEW FILE: BoundISBean.java ---
/*
* BoundISBean.java
*
* Created on 9 october 2003, 18:55
*/
package org.figure8.join.businessobjects.resource.ejb;
import org.figure8.join.businessobjects.resource.util.BoundISUtil;
import org.figure8.join.businessobjects.resource.interfaces.ISTypeLocal;
import org.figure8.join.businessobjects.resource.interfaces.ISystemLocal;
import org.figure8.join.businessobjects.resource.interfaces.GatewayLocal;
import org.figure8.join.businessobjects.resource.interfaces.BoundISData;
import java.sql.Date;
/**
* This object is a representation of an Information SYstem bound to a gateway.
* It is indeed the link between a gateway and a specific Information System. This
* link can be active (<b>enddate</b> == null) or broken (<b>enddate</b> != null)
* in order to keep history.
* @author <a href="mailto:lau...@fr...">Laurent Broudoux</a>
*
* @ejb.bean name="BoundIS"
type="CMP" cmp-version="2.x" view-type="local"
jndi-name="${objects.res.boundIS.jndi-name}"
local-jndi-name="${objects.res.boundIS.jndi-name}Local"
primkey-field="id"
* @ejb.home local-class="org.figure8.join.businessobjects.resource.interfaces.BoundISLocalHome"
* @ejb.interface local-class="org.figure8.join.businessobjects.resource.interfaces.BoundISLocal"
* @ejb.data-object package="org.figure8.join.businessobjects.resource.interfaces"
*
* @ejb.finder signature="Collection findActivesForGateway(org.figure8.join.businessobjects.resource.interfaces.GatewayLocal gat)"
unchecked="true" transaction-type="Supports"
query="SELECT DISTINCT OBJECT(bi) FROM BoundIS AS bi WHERE bi.gateway=?1 AND bi.endDate IS NULL"
* @ejb.finder signature="Collection findActivesForGatewayAndDate(org.figure8.join.businessobjects.resource.interfaces.GatewayLocal gat,
java.util.Date date)"
unchecked="true" transaction-type="Supports"
query="SELECT DISTINCT OBJECT(bi) FROM BoundIS AS bi WHERE bi.gateway=?1 AND (bi.creationDate<?2 OR bi.creationDate=?2) AND (bi.endDate>?2 OR bi.endDate=?2)"
* @ejb.finder signature="Collection findActivesForGatewayAndType(org.figure8.join.businessobjects.resource.interfaces.GatewayLocal gat,
org.figure8.join.businessobjects.resource.interfaces.ISTypeLocal type)"
unchecked="true" transaction-type="Supports"
query="SELECT DISTINCT OBJECT(bi) FROM BoundIS AS bi WHERE bi.gateway=?1 AND bi.iSType=?2 AND bi.endDate IS NULL"
*
* @ejb.pk class="java.lang.String" generate="false" unchecked="true"
* @ejb.persistence table-name="${objects.res.boundIS.table-name}"
*
* @jboss.tuned-updates "true"
* @jboss.read-ahead strategy="on-find"
*/
public abstract class BoundISBean implements javax.ejb.EntityBean{
// Public -------------------------------------------------------------------
/**
* Bound Information System id
* @ejb.pk-field
* @ejb.persistence column-name="s_id"
*/
public abstract String getId();
/** Bound Information System id */
public abstract void setId(String id);
/**
* Bound Information System creation date
* @ejb.interface-method
* @ejb.persistence column-name="d_creation"
* sql-type="TIMESTAMP"
*/
public abstract java.sql.Date getCreationDate();
/**
* Bound Information System creation date
* @ejb.interface-method
*/
public abstract void setCreationDate(java.sql.Date creationDate);
/**
* Bound Information System end date
* @ejb.interface-method
* @ejb.persistence column-name="d_end"
* sql-type="TIMESTAMP"
*/
public abstract java.sql.Date getEndDate();
/**
* Bound Information System end date
* @ejb.interface-method
*/
public abstract void setEndDate(java.sql.Date endDate);
/**
* Information System bound
* @ejb.interface-method view-type="local"
* @ejb.relation name="IS-OneToMany-BoundISs-Uni"
* role-name="BoundIS-belongsto-IS"
* target-role-name="IS-has-BoundISs"
* target-ejb="ISystem"
* target-multiple="yes"
* @jboss.relation fk-constraint="true"
* related-pk-field="id"
* fk-column="s_is_fk"
*/
public abstract ISystemLocal getIS();
/**
* Information System bound
* @ejb.interface-method view-type="local"
*/
public abstract void setIS(ISystemLocal is);
/**
* Type of this Bound Information System
* @ejb.interface-method view-type="local"
* @ejb.relation name="ISType-OneToMany-BoundISs-Uni"
* role-name="BoundIS-belongsto-ISType"
* target-role-name="ISType-has-BoundISs"
* target-ejb="ISType"
* target-multiple="yes"
* @jboss.relation fk-constraint="true"
* related-pk-field="id"
* fk-column="s_istype_fk"
*/
public abstract ISTypeLocal getISType();
/**
* Type of this Bound Information System
* @ejb.interface-method view-type="local"
*/
public abstract void setISType(ISTypeLocal type);
/**
* Gateway to which the Information System is bound
* @ejb.interface-method view-type="local"
* @ejb.relation name="Gateway-OneToMany-BoundISs-Bi"
* role-name="BoundIS-belongsto-Gateway"
* target-multiple="yes"
* cascade-delete="yes"
* @jboss.relation fk-constraint="true"
* related-pk-field="id"
* fk-column="n_gateway_fk"
*/
public abstract GatewayLocal getGateway();
/**
* Gateway to which the Information System is bound
* @ejb.interface-method view-type="local"
*/
public abstract void setGateway(GatewayLocal gateway);
/**
* Generated bulk accessor
* @ejb.interface-method
*/
public abstract BoundISData getData();
/** Generated bulk accessor */
public abstract void setData(BoundISData data);
/**
* Make this binding between gateway and IS end.
* @ejb.interface-method
*/
public void close(){
setEndDate(new java.sql.Date(System.currentTimeMillis()));
}
// Implementation of EntityBean ---------------------------------------------
/**
* Create a new Bound Information System
* @ejb.create-method
*/
public String ejbCreate(BoundISData data, ISystemLocal is, ISTypeLocal type, GatewayLocal gateway) throws javax.ejb.CreateException{
if (data != null){
setId(BoundISUtil.generateGUID(this));
setData(data);
}
else throw new javax.ejb.CreateException("Data object for BoundIS must be non null.");
return null;
}
/** Create a new Bound Information System */
public void ejbPostCreate(BoundISData data, ISystemLocal is, ISTypeLocal type, GatewayLocal gateway) throws javax.ejb.CreateException{
setIS(is);
setISType(type);
setGateway(gateway);
}
/**
* Remove this Bound Information System
* @ejb.transaction type="Mandatory"
*/
public void ejbRemove() throws javax.ejb.RemoveException, javax.ejb.EJBException {}
}
--- NEW FILE: BoundResourceBean.java ---
/*
* BoundResourceBean.java
*
* Created on 28 august 2002, 14:14
*/
package org.figure8.join.businessobjects.resource.ejb;
import org.figure8.join.businessobjects.resource.util.BoundResourceUtil;
import org.figure8.join.businessobjects.resource.interfaces.ResourceLocal;
import org.figure8.join.businessobjects.resource.interfaces.ResourceTypeLocal;
import org.figure8.join.businessobjects.resource.interfaces.BoundResourceData;
import org.figure8.join.businessobjects.environment.interfaces.PhysicalEnvLocal;
import java.sql.Date;
/**
* This object is a representation of a resource bound to an environment.
* It is indeed the link between a physical environment and a specific resource.
* This link can be active (<b>enddate</b> == null) or broken
* (<b>enddate</b> != null) in order to keep history.
* @author <a href="mailto:lau...@fr...">Laurent Broudoux</a>
*
* @ejb.bean name="BoundResource"
type="CMP" cmp-version="2.x" view-type="local"
jndi-name="${objects.res.boundResource.jndi-name}"
local-jndi-name="${objects.res.boundResource.jndi-name}Local"
primkey-field="id"
* @ejb.home local-class="org.figure8.join.businessobjects.resource.interfaces.BoundResourceLocalHome"
* @ejb.interface local-class="org.figure8.join.businessobjects.resource.interfaces.BoundResourceLocal"
* @ejb.data-object package="org.figure8.join.businessobjects.resource.interfaces"
*
* @ejb.finder signature="Collection findActivesForPhysical(org.figure8.join.businessobjects.environment.interfaces.PhysicalEnvLocal env)"
unchecked="true" transaction-type="Supports"
query="SELECT DISTINCT OBJECT(br) FROM BoundResource AS br WHERE br.physicalEnv=?1 AND br.endDate IS NULL"
* @ejb.finder signature="Collection findActivesForPhysicalAndDate(org.figure8.join.businessobjects.environment.interfaces.PhysicalEnvLocal env,
java.util.Date date)"
unchecked="true" transaction-type="Supports"
query="SELECT DISTINCT OBJECT(br) FROM BoundResource AS br WHERE br.physicalEnv=?1 AND (br.creationDate<?2 OR br.creationDate=?2) AND (br.endDate>?2 OR br.endDate=?2)"
* @ejb.finder signature="Collection findActivesForPhysicalAndType(org.figure8.join.businessobjects.environment.interfaces.PhysicalEnvLocal env,
org.figure8.join.businessobjects.resource.interfaces.ResourceTypeLocal type)"
unchecked="true" transaction-type="Supports"
query="SELECT DISTINCT OBJECT(br) FROM BoundResource AS br WHERE br.physicalEnv=?1 AND br.resourceType=?2 AND br.endDate IS NULL"
*
* @ejb.pk class="java.lang.String" generate="false" unchecked="true"
* @ejb.persistence table-name="${objects.res.boundResource.table-name}"
*
* @jboss.tuned-updates "true"
* @jboss.read-ahead strategy="on-find"
*/
public abstract class BoundResourceBean implements javax.ejb.EntityBean{
// Public -------------------------------------------------------------------
/**
* Bound Resource id
* @ejb.pk-field
* @ejb.persistence column-name="s_id"
*/
public abstract String getId();
/** Bound Resource id */
public abstract void setId(String id);
/**
* Bound Resource creation date
* @ejb.interface-method
* @ejb.persistence column-name="d_creation"
* sql-type="TIMESTAMP"
*/
public abstract java.sql.Date getCreationDate();
/**
* Bound Resource date
* @ejb.interface-method
*/
public abstract void setCreationDate(java.sql.Date creationDate);
/**
* Bound Resource end date
* @ejb.interface-method
* @ejb.persistence column-name="d_end"
* sql-type="TIMESTAMP"
*/
public abstract java.sql.Date getEndDate();
/**
* Bound Resource end date
* @ejb.interface-method
*/
public abstract void setEndDate(java.sql.Date endDate);
/**
* Resource bound
* @ejb.interface-method view-type="local"
* @ejb.relation name="Resource-OneToMany-BoundResources-Uni"
* role-name="BoundResource-belongsto-Resource"
* target-role-name="Resource-has-BoundResources"
* target-ejb="Resource"
* target-multiple="yes"
* @jboss.relation fk-constraint="true"
* related-pk-field="id"
* fk-column="s_resource_fk"
*/
public abstract ResourceLocal getResource();
/**
* Resource bound
* @ejb.interface-method view-type="local"
*/
public abstract void setResource(ResourceLocal resource);
/**
* Type of this Bound Resource
* @ejb.interface-method view-type="local"
* @ejb.relation name="ResourceType-OneToMany-BoundResources-Uni"
* role-name="BoundResource-belongsto-ResourceType"
* target-role-name="ResourceType-has-BoundResources"
* target-ejb="ResourceType"
* target-multiple="yes"
* @jboss.relation fk-constraint="true"
* related-pk-field="id"
* fk-column="s_resourcetype_fk"
* @jboss.relation-read-ahead strategy="on-find"
* page-size="4
*/
public abstract ResourceTypeLocal getResourceType();
/**
* Type of this Bound Resource
* @ejb.interface-method view-type="local"
*/
public abstract void setResourceType(ResourceTypeLocal type);
/**
* Physical environment to which the resource is bound
* @ejb.interface-method view-type="local"
* @ejb.relation name="PhysicalEnv-OneToMany-BoundResources-Bi"
* role-name="BoundResource-belongsto-PhysicalEnv"
* target-multiple="yes"
* cascade-delete="yes"
* @jboss.relation fk-constraint="true"
* related-pk-field="id"
* fk-column="n_physicalenv_fk"
*/
public abstract PhysicalEnvLocal getPhysicalEnv();
/**
* Physical environment to which the resource is bound
* @ejb.interface-method view-type="local"
*/
public abstract void setPhysicalEnv(PhysicalEnvLocal environment);
/**
* Generated bulk accessor
* @ejb.interface-method
*/
public abstract BoundResourceData getData();
/** Generated bulk accessor */
public abstract void setData(BoundResourceData data);
/**
* Make this binding between physical environment and resource end.
* @ejb.interface-method
*/
public void close(){
setEndDate(new java.sql.Date(System.currentTimeMillis()));
}
// Implementation of EntityBean ---------------------------------------------
/**
* Create a new Bound Resource
* @ejb.create-method
*/
public String ejbCreate(BoundResourceData data, ResourceLocal resource, ResourceTypeLocal type, PhysicalEnvLocal env) throws javax.ejb.CreateException{
if (data != null){
setId(BoundResourceUtil.generateGUID(this));
setData(data);
}
else throw new javax.ejb.CreateException("Data object for BoundResource must be non null.");
return null;
}
/** Create a new Bound Resource */
public void ejbPostCreate(BoundResourceData data, ResourceLocal resource, ResourceTypeLocal type, PhysicalEnvLocal env) throws javax.ejb.CreateException{
setPhysicalEnv(env);
setResource(resource);
setResourceType(type);
}
/**
* Remove this Bound Resource
* @ejb.transaction type="Mandatory"
*/
public void ejbRemove() throws javax.ejb.RemoveException, javax.ejb.EJBException {}
}
--- NEW FILE: BoundServiceBean.java ---
/*
* BoundServiceBean.java
*
* Created on 21 december 2002, 09:44
*/
package org.figure8.join.businessobjects.resource.ejb;
import org.figure8.join.businessobjects.resource.util.BoundServiceUtil;
import org.figure8.join.businessobjects.resource.interfaces.ServiceLocal;
import org.figure8.join.businessobjects.resource.interfaces.ServiceTypeLocal;
import org.figure8.join.businessobjects.resource.interfaces.BoundServiceData;
import org.figure8.join.businessobjects.environment.interfaces.PhysicalEnvLocal;
import java.sql.Date;
/**
* This object is a representation of a service bound to an environment.
* It is indeed the link between a physical environment and a specific service.
* This link can be active (<b>enddate</b> == null) or broken
* (<b>enddate</b> != null) in order to keep history.
* @author <a href="mailto:lau...@fr...">Laurent Broudoux</a>
*
* @ejb.bean name="BoundService"
type="CMP" cmp-version="2.x" view-type="local"
jndi-name="${objects.res.boundService.jndi-name}"
local-jndi-name="${objects.res.boundService.jndi-name}Local"
primkey-field="id"
* @ejb.home local-class="org.figure8.join.businessobjects.resource.interfaces.BoundServiceLocalHome"
* @ejb.interface local-class="org.figure8.join.businessobjects.resource.interfaces.BoundServiceLocal"
* @ejb.data-object package="org.figure8.join.businessobjects.resource.interfaces"
*
* @ejb.finder signature="Collection findActivesForPhysical(org.figure8.join.businessobjects.environment.interfaces.PhysicalEnvLocal env)"
unchecked="true" transaction-type="Supports"
query="SELECT DISTINCT OBJECT(bs) FROM BoundService AS bs WHERE bs.physicalEnv=?1 AND bs.endDate IS NULL"
* @ejb.finder signature="Collection findActivesForPhysicalAndDate(org.figure8.join.businessobjects.environment.interfaces.PhysicalEnvLocal env,
java.util.Date date)"
unchecked="true" transaction-type="Supports"
query="SELECT DISTINCT OBJECT(bs) FROM BoundService AS bs WHERE bs.physicalEnv=?1 AND (bs.creationDate<?2 OR bs.creationDate=?2) AND (bs.endDate>?2 OR bs.endDate=?2)"
* @ejb.finder signature="Collection findActivesForPhysicalAndType(org.figure8.join.businessobjects.environment.interfaces.PhysicalEnvLocal env,
org.figure8.join.businessobjects.resource.interfaces.ServiceTypeLocal type)"
unchecked="true" transaction-type="Supports"
query="SELECT DISTINCT OBJECT(bs) FROM BoundService AS bs WHERE bs.physicalEnv=?1 AND bs.serviceType=?2 AND bs.endDate IS NULL"
*
* @ejb.pk class="java.lang.String" generate="false" unchecked="true"
* @ejb.persistence table-name="${objects.res.boundService.table-name}"
*
* @jboss.tuned-updates "true"
* @jboss.read-ahead strategy="on-find"
*/
public abstract class BoundServiceBean implements javax.ejb.EntityBean{
// Public -------------------------------------------------------------------
/**
* Bound Resource id
* @ejb.pk-field
* @ejb.persistence column-name="s_id"
*/
public abstract String getId();
/** Bound Resource id */
public abstract void setId(String id);
/**
* Bound Resource creation date
* @ejb.interface-method
* @ejb.persistence column-name="d_creation"
* sql-type="TIMESTAMP"
*/
public abstract java.sql.Date getCreationDate();
/**
* Bound Resource date
* @ejb.interface-method
*/
public abstract void setCreationDate(java.sql.Date creationDate);
/**
* Bound Resource end date
* @ejb.interface-method
* @ejb.persistence column-name="d_end"
* sql-type="TIMESTAMP"
*/
public abstract java.sql.Date getEndDate();
/**
* Bound Resource end date
* @ejb.interface-method
*/
public abstract void setEndDate(java.sql.Date endDate);
/**
* Service bound
* @ejb.interface-method view-type="local"
* @ejb.relation name="Service-OneToMany-BoundServices-Uni"
* role-name="BoundService-belongsto-Service"
* target-role-name="Service-has-BoundServices"
* target-ejb="Service"
* target-multiple="yes"
* @jboss.relation fk-constraint="true"
* related-pk-field="id"
* fk-column="s_service_fk"
*/
public abstract ServiceLocal getService();
/**
* Service bound
* @ejb.interface-method view-type="local"
*/
public abstract void setService(ServiceLocal service);
/**
* Type of this Bound Service
* @ejb.interface-method view-type="local"
* @ejb.relation name="ServiceType-OneToMany-BoundServices-Uni"
* role-name="BoundService-belongsto-ServiceType"
* target-role-name="ServiceType-has-BoundServices"
* target-ejb="ServiceType"
* target-multiple="yes"
* @jboss.relation fk-constraint="true"
* related-pk-field="id"
* fk-column="s_servicetype_fk"
* @jboss.relation-read-ahead strategy="on-find"
* page-size="4"
*/
public abstract ServiceTypeLocal getServiceType();
/**
* Type of this Bound Service
* @ejb.interface-method view-type="local"
*/
public abstract void setServiceType(ServiceTypeLocal type);
/**
* Physical environment to which the service is bound
* @ejb.interface-method view-type="local"
* @ejb.relation name="PhysicalEnv-OneToMany-BoundServices-Bi"
* role-name="BoundService-belongsto-PhysicalEnv"
* target-multiple="yes"
* cascade-delete="yes"
* @jboss.relation fk-constraint="true"
* related-pk-field="id"
* fk-column="n_physicalenv_fk"
*/
public abstract PhysicalEnvLocal getPhysicalEnv();
/**
* Physical environment to which the service is bound
* @ejb.interface-method view-type="local"
*/
public abstract void setPhysicalEnv(PhysicalEnvLocal environment);
/**
* Generated bulk accessor
* @ejb.interface-method
*/
public abstract BoundServiceData getData();
/** Generated bulk accessor */
public abstract void setData(BoundServiceData data);
/**
* Make this binding between physical environment and service end.
* @ejb.interface-method
*/
public void close(){
setEndDate(new java.sql.Date(System.currentTimeMillis()));
}
// Implementation of EntityBean ---------------------------------------------
/**
* Create a new Bound Service
* @ejb.create-method
*/
public String ejbCreate(BoundServiceData data, ServiceLocal service, ServiceTypeLocal type, PhysicalEnvLocal env) throws javax.ejb.CreateException{
if (data != null){
setId(BoundServiceUtil.generateGUID(this));
setData(data);
}
else throw new javax.ejb.CreateException("Data object for BoundService must be non null.");
return null;
}
/** Create a new Bound Service */
public void ejbPostCreate(BoundServiceData data, ServiceLocal service, ServiceTypeLocal type, PhysicalEnvLocal env) throws javax.ejb.CreateException{
setPhysicalEnv(env);
setService(service);
setServiceType(type);
}
/**
* Remove this Bound Service
* @ejb.transaction type="Mandatory"
*/
public void ejbRemove() throws javax.ejb.RemoveException, javax.ejb.EJBException {}
}
|
|
From: <lbr...@us...> - 2003-07-28 09:36:41
|
Update of /cvsroot/join/join/src/main/org/figure8/join/businessobjects/resource/ejb
In directory sc8-pr-cvs1:/tmp/cvs-serv3801
Added Files:
GatewayBean.java
Log Message:
Initial checkin
--- NEW FILE: GatewayBean.java ---
/*
* GatewayBean.java
*
* Created on 26 august 2002, 16:22
*/
package org.figure8.join.businessobjects.resource.ejb;
import org.figure8.join.businessobjects.resource.interfaces.GatewayData;
import org.figure8.join.businessobjects.resource.interfaces.MachineLocal;
import java.util.Set;
/**
* This object is a representation of a logical Gateway (or portal).
* A gateway represents a unique access points to Information Systems available
* from software project to join. A gateway will be typically used for a portal
* type project. A gateway is hosted on a machine.
* @author <a href="mailto:lau...@fr...">Laurent Broudoux</a>
*
* @ejb.bean name="Gateway"
type="CMP" cmp-version="2.x" view-type="local"
jndi-name="${objects.res.gateway.jndi-name}"
local-jndi-name="${objects.res.gateway.jndi-name}Local"
primkey-field="id"
* @ejb.home local-class="org.figure8.join.businessobjects.resource.interfaces.GatewayLocalHome"
* @ejb.interface local-class="org.figure8.join.businessobjects.resource.interfaces.GatewayLocal"
* @ejb.data-object package="org.figure8.join.businessobjects.resource.interfaces"
*
* @ejb.finder signature="Collection findAll()"
unchecked="true" transaction-type="NotSupported"
query="SELECT DISTINCT OBJECT(g) FROM Gateway AS g"
*
* @ejb.pk class="java.lang.Integer" generate="false" unchecked="true"
* @ejb.persistence table-name="${objects.res.gateway.table-name}"
*
* @jboss.tuned-updates "true"
* @jboss.read-ahead strategy="on-find"
*
* @jboss.query signature="Collection findAll()"
query="SELECT DISTINCT OBJECT(g) FROM Gateway AS g ORDER BY g.label ASC"
*/
public abstract class GatewayBean implements javax.ejb.EntityBean{
// Public -------------------------------------------------------------------
/**
* Gateway id
* @ejb.pk-field
* @ejb.persistence column-name="n_id"
*/
public abstract Integer getId();
/** Gateway id */
public abstract void setId(Integer id);
/**
* Gateway label
* @ejb.interface-method
* @ejb.persistence column-name="s_label"
*/
public abstract String getLabel();
/**
* Gateway label
* @ejb.interface-method
*/
public abstract void setLabel(String label);
/**
* Gateway logs directory path
* @ejb.interface-method
* @ejb.persistence column-name="s_logdirpath"
*/
public abstract String getLogDirPath();
/**
* Gateway logs directory path
* @ejb.interface-method
*/
public abstract void setLogDirPath(String logPath);
/**
* Gateway current log file path
* @ejb.interface-method
* @ejb.persistence column-name="s_logfilepath"
*/
public abstract String getLogFilePath();
/**
* Gateway current log file path
* @ejb.interface-method
*/
public abstract void setLogFilePath(String logPath);
/**
* Machine of this Gateway
* @ejb.interface-method view-type="local"
* @ejb.relation name="Machine-OneToMany-Gateways-Bi"
* role-name="Gateway-belongsto-Machine"
* cascade-delete="yes"
* @jboss.relation fk-constraint="true"
* related-pk-field="id"
* fk-column="s_machine_fk"
*/
public abstract MachineLocal getMachine();
/**
* Machine of this Gateway
* @ejb.interface-method view-type="local"
*/
public abstract void setMachine(MachineLocal machine);
/**
* Gateway bound Information Systems
* @ejb.interface-method view-type="local"
* @ejb.relation name="Gateway-OneToMany-BoundISs-Bi"
* role-name="Gateway-has-BoundResources"
* @return Set of <code>org.figure8.join.businessobjects.resource.interfaces.BoundISLocal</code>
*/
public abstract Set getBoundISs();
/**
* Gateway bound Information Systems
* @ejb.interface-method view-type="local"
*/
public abstract void setBoundISs(Set boundISs);
/**
* Generated bulk accessor
* @ejb.interface-method
*/
public abstract GatewayData getData();
/** Generated bulk accessor */
public abstract void setData(GatewayData data);
// Implementation of EntityBean ---------------------------------------------
/**
* Create a new Gateway
* @ejb.create-method
*/
public Integer ejbCreate(GatewayData data, MachineLocal machine) throws javax.ejb.CreateException{
if (data.getId() != null){
setId(data.getId());
setData(data);
}
else throw new javax.ejb.CreateException("Identifier (id) for Gateway must be non null.");
return null;
}
/** Create a new Gateway */
public void ejbPostCreate(GatewayData data, MachineLocal machine) throws javax.ejb.CreateException{
setMachine(machine);
}
/**
* Remove this Gateway
* @ejb.transaction type="Mandatory"
*/
public void ejbRemove() throws javax.ejb.RemoveException, javax.ejb.EJBException {}
}
|
Update of /cvsroot/join/join/src/main/org/figure8/join/businessobjects/resource/ejb
In directory sc8-pr-cvs1:/tmp/cvs-serv3765
Added Files:
ISTypeBean.java ISUpdateBean.java ISVersionBean.java
ISystemBean.java
Log Message:
Initial checkin
--- NEW FILE: ISTypeBean.java ---
/*
* ISTypeBean.java
*
* Created on 8 october 2002, 18:08
*/
package org.figure8.join.businessobjects.resource.ejb;
import org.figure8.join.businessobjects.resource.interfaces.ISTypeData;
import java.util.Set;
/**
* This is the representation of an Information System type.
* @author <a href="mailto:lau...@fr...">Laurent Broudoux</a>
*
* @ejb.bean name="ISType"
type="CMP" cmp-version="2.x" view-type="local"
jndi-name="${objects.res.isType.jndi-name}"
local-jndi-name="${objects.res.isType.jndi-name}Local"
primkey-field="id"
* @ejb.home local-class="org.figure8.join.businessobjects.resource.interfaces.ISTypeLocalHome"
* @ejb.interface local-class="org.figure8.join.businessobjects.resource.interfaces.ISTypeLocal"
* @ejb.data-object package="org.figure8.join.businessobjects.resource.interfaces"
*
* @ejb.finder signature="Collection findAll()" unchecked="true" transaction-type="NotSupported"
*
* @ejb.pk class="java.lang.String" generate="false" unchecked="true"
* @ejb.persistence table-name="${objects.res.isType.table-name}"
*
* @jboss.tuned-updates "true"
* @jboss.read-ahead strategy="on-find"
*/
public abstract class ISTypeBean implements javax.ejb.EntityBean{
// Public -------------------------------------------------------------------
/**
* Information System Type id
* @ejb.pk-field
* @ejb.persistence column-name="s_id"
*/
public abstract String getId();
/** Information System Type id */
public abstract void setId(String id);
/**
* Information System Type label
* @ejb.interface-method
* @ejb.persistence column-name="s_label"
*/
public abstract String getLabel();
/**
* Information System Type label
* @ejb.interface-method
*/
public abstract void setLabel(String label);
/**
* Information Systems of this type
* @ejb.interface-method view-type="local"
* @ejb.relation name="ISType-OneToMany-ISs-Bi"
* role-name="ISType-has-ISs"
*/
public abstract Set getISystems();
/**
* Information Systems of this type
* @ejb.interface-method view-type="local"
*/
public abstract void setISystems(Set iSystems);
/**
* Generated bulk accessor
* @ejb.interface-method
*/
public abstract ISTypeData getData();
/** Generated bulk accessor */
public abstract void setData(ISTypeData data);
// Implementation of EntityBean ---------------------------------------------
/**
* Create a new Information System Type
* @ejb.create-method
*/
public String ejbCreate(ISTypeData data) throws javax.ejb.CreateException{
if (data.getId() != null){
setId(data.getId());
setData(data);
}
else throw new javax.ejb.CreateException("Identifier (id) for ISType must be non null.");
return null;
}
/** Create a new Information System Type */
public void ejbPostCreate(ISTypeData data) throws javax.ejb.CreateException {}
/**
* Remove this Information System Type
* @ejb.transaction type="Mandatory"
*/
public void ejbRemove() throws javax.ejb.RemoveException, javax.ejb.EJBException {}
}
--- NEW FILE: ISUpdateBean.java ---
/*
* ISUpdateBean.java
*
* Created on 24 january 2003, 18:58
*/
package org.figure8.join.businessobjects.resource.ejb;
import org.figure8.join.businessobjects.resource.util.ISUpdateUtil;
import org.figure8.join.businessobjects.resource.interfaces.ISystemLocal;
import org.figure8.join.businessobjects.resource.interfaces.ISVersionLocal;
import org.figure8.join.businessobjects.resource.interfaces.ISUpdateData;
import java.sql.Date;
/**
* This is a representation of an ISystem Update. A ISystem can have many updates
* during time so keep history information for updates. This means that last update,
* with current version on ISystem is the one with <b>enddate == NULL</b>.
* @author <a href="mailto:lau...@fr...">Laurent Broudoux</a>
*
* @ejb.bean name="ISUpdate"
type="CMP" cmp-version="2.x" view-type="local"
jndi-name="${objects.res.isUpdate.jndi-name}"
local-jndi-name="${objects.res.isUpdate.jndi-name}Local"
primkey-field="id"
* @ejb.home local-class="org.figure8.join.businessobjects.resource.interfaces.ISUpdateLocalHome"
* @ejb.interface local-class="org.figure8.join.businessobjects.resource.interfaces.ISUpdateLocal"
* @ejb.data-object package="org.figure8.join.businessobjects.resource.interfaces"
*
* @ejb.finder signature="Collection findActivesForISystem(org.figure8.join.businessobjects.resource.interfaces.ISystemLocal sys)"
unchecked="true" transaction-type="Supports"
query="SELECT DISTINCT OBJECT(iu) FROM ISUpdate AS iu WHERE iu.iSystem=?1 AND iu.endDate IS NULL"
* @ejb.finder signature="Collection findActivesForISystemAndDate(org.figure8.join.businessobjects.resource.interfaces.ISystemLocal sys,
java.util.Date date)"
unchecked="true" transaction-type="Supports"
query="SELECT DISTINCT OBJECT(iu) FROM ISUpdate AS iu WHERE iu.iSystem=?1 AND (iu.startDate<?2 OR iu.startDate=?2) AND (iu.endDate>?2 OR iu.endDate=?2)"
*
* @ejb.pk class="java.lang.String" generate="false" unchecked="true"
* @ejb.persistence table-name="${objects.res.isUpdate.table-name}"
*
* @jboss.tuned-updates "true"
* @jboss.read-ahead strategy="on-find"
*/
public abstract class ISUpdateBean implements javax.ejb.EntityBean{
// Public -------------------------------------------------------------------
/**
* Resource Update id
* @ejb.pk-field
* @ejb.persistence column-name="s_id"
*/
public abstract String getId();
/** Resource Update id */
public abstract void setId(String id);
/**
* Resource Update end date
* @ejb.interface-method
* @ejb.persistence column-name="d_end"
* sql-type="TIMESTAMP"
*/
public abstract java.sql.Date getEndDate();
/**
* Resource Update end date
* @ejb.interface-method
*/
public abstract void setEndDate(java.sql.Date endDate);
/**
* Resource Update start date
* @ejb.interface-method
* @ejb.persistence column-name="d_start"
* sql-type="TIMESTAMP"
*/
public abstract java.sql.Date getStartDate();
/**
* Resource Update start date
* @ejb.interface-method
*/
public abstract void setStartDate(java.sql.Date startDate);
/**
* ISystem concerned by this update
* @ejb.interface-method view-type="local"
* @ejb.relation name="IS-OneToMany-ISUpdates-Uni"
* role-name="ISUpdate-belongsto-IS"
* target-role-name="IS-has-ISUpdates"
* target-ejb="ISystem"
* target-multiple="yes"
* @jboss.relation fk-constraint="true"
* related-pk-field="id"
* fk-column="s_is_fk"
*/
public abstract ISystemLocal getISystem();
/**
* ISystem concerned by this update
* @ejb.interface-method view-type="local"
*/
public abstract void setISystem(ISystemLocal isystem);
/**
* Version used for this update
* @ejb.interface-method view-type="local"
* @ejb.relation name="ISVersion-OneToMany-ISUpdates-Bi"
* role-name="ISUpdate-belongsto-ISVersioin"
* cascade-delete="yes"
* @jboss.relation fk-constraint="true"
* related-pk-field="id"
* fk-column="s_version_fk"
*/
public abstract ISVersionLocal getISVersion();
/**
* Version used for this update
* @ejb.interface-method view-type="local"
*/
public abstract void setISVersion(ISVersionLocal version);
/**
* Generated bulk accessor
* @ejb.interface-method
*/
public abstract ISUpdateData getData();
/** Generated bulk accessor */
public abstract void setData(ISUpdateData data);
/**
* Make this update of IS with version end (because of a new update).
* @ejb.interface-method
*/
public void close(){
setEndDate(new java.sql.Date(System.currentTimeMillis()));
}
// Implementation of EntityBean ---------------------------------------------
/**
* Create a new ISystem Update
* @ejb.create-method
*/
public String ejbCreate(ISUpdateData data, ISystemLocal isystem, ISVersionLocal version) throws javax.ejb.CreateException{
if (data != null){
setId(ISUpdateUtil.generateGUID(this));
setData(data);
}
else throw new javax.ejb.CreateException("Data object for ISpdate must be non null.");
return null;
}
/** Create a new ISystem Update */
public void ejbPostCreate(ISUpdateData data, ISystemLocal isystem, ISVersionLocal version) throws javax.ejb.CreateException{
setISystem(isystem);
setISVersion(version);
}
/**
* Remove this ISystem Update
* @ejb.transaction type="Mandatory"
*/
public void ejbRemove() throws javax.ejb.RemoveException, javax.ejb.EJBException {}
}
--- NEW FILE: ISVersionBean.java ---
/*
* ISVersionBean.java
*
* Created on 9 january 2003, 18:51
*/
package org.figure8.join.businessobjects.resource.ejb;
import org.figure8.join.businessobjects.resource.util.ISVersionUtil;
import org.figure8.join.businessobjects.resource.interfaces.ISTypeLocal;
import org.figure8.join.businessobjects.resource.interfaces.ISVersionData;
import java.sql.Date;
import java.util.Set;
/**
* This is the representation of an Information System Version.
* @author <a href="mailto:lau...@fr...">Laurent Broudoux</a>
*
* @ejb.bean name="ISVersion"
type="CMP" cmp-version="2.x" view-type="local"
jndi-name="${objects.res.isVersion.jndi-name}"
local-jndi-name="${objects.res.isVersion.jndi-name}Local"
primkey-field="id"
* @ejb.home local-class="org.figure8.join.businessobjects.resource.interfaces.ISVersionLocalHome"
* @ejb.interface local-class="org.figure8.join.businessobjects.resource.interfaces.ISVersionLocal"
* @ejb.data-object package="org.figure8.join.businessobjects.resource.interfaces"
*
* @ejb.finder signature="Collection findAll()" unchecked="true" transaction-type="NotSupported"
* @ejb.finder signature="Collection findByType(org.figure8.join.businessobjects.resource.interfaces.ISTypeLocal type)"
unchecked="true" transaction-type="Supports"
query="SELECT DISTINCT OBJECT(iv) FROM ISVersion AS iv WHERE iv.iSType=?1"
*
* @ejb.pk class="java.lang.String" generate="false" unchecked="true"
* @ejb.persistence table-name="${objects.res.isVersion.table-name}"
*
* @jboss.tuned-updates "true"
* @jboss.read-ahead strategy="on-load"
page-size="10"
*
* @jboss.query signature="Collection findByType(org.figure8.join.businessobjects.resource.interfaces.ISTypeLocal type)"
query="SELECT DISTINCT OBJECT(iv) FROM ISVersion AS iv WHERE iv.iSType=?1 ORDER BY iv.creationDate DESC"
strategy="on-find"
*/
public abstract class ISVersionBean implements javax.ejb.EntityBean{
// Public -------------------------------------------------------------------
/**
* Information System Version id
* @ejb.pk-field
* @ejb.persistence column-name="s_id"
*/
public abstract String getId();
/** Information System Version id */
public abstract void setId(String id);
/**
* Information System Version label
* @ejb.interface-method
* @ejb.persistence column-name="s_label"
*/
public abstract String getLabel();
/**
* Information System Version label
* @ejb.interface-method
*/
public abstract void setLabel(String label);
/**
* Information System Version creation date
* @ejb.interface-method
* @ejb.persistence column-name="d_creation"
*/
public abstract java.sql.Date getCreationDate();
/**
* Information System Version creation date
* @ejb.interface-method
*/
public abstract void setCreationDate(java.sql.Date creationDate);
/**
* Information System Version comments
* @ejb.interface-method
* @ejb.persistence column-name="s_comments"
*/
public abstract String getComments();
/**
* Information System Version comments
* @ejb.interface-method
*/
public abstract void setComments(String comments);
/**
* Type of this Information System Version
* @ejb.interface-method view-type="local"
* @ejb.relation name="ISType-OneToMany-ISVersions-Uni"
* role-name="ISVersion-belongsto-ISType"
* target-role-name="ISType-has-ISVersions"
* target-ejb="ISType"
* target-multiple="yes"
* cascade-delete="yes"
* @jboss.relation fk-constraint="true"
* related-pk-field="id"
* fk-column="s_istype_fk"
*/
public abstract ISTypeLocal getISType();
/**
* Type of this Information System Version
* @ejb.interface-method view-type="local"
*/
public abstract void setISType(ISTypeLocal type);
/**
* Updates made with this IS Version
* @ejb.interface-method view-type="local"
* @ejb.relation name="ISVersion-OneToMany-ISUpdates-Bi"
* role-name="ISVersion-has-ISUpdates"
*/
public abstract Set getISUpdates();
/**
* Updates made with this IS Version
* @ejb.interface-method view-type="local"
*/
public abstract void setISUpdates(Set updates);
/**
* Generated bulk accessor
* @ejb.interface-method
*/
public abstract ISVersionData getData();
/** Generated bulk accessor */
public abstract void setData(ISVersionData data);
// Implementation of EntityBean ---------------------------------------------
/**
* Create a new Information System Version
* @ejb.create-method
*/
public String ejbCreate(ISVersionData data, ISTypeLocal type) throws javax.ejb.CreateException{
if (data.getId() != null){
setId(data.getId());
setData(data);
}
else throw new javax.ejb.CreateException("Identifier for ISVersion must be non null.");
return null;
}
/** Create a new Information System Version */
public void ejbPostCreate(ISVersionData data, ISTypeLocal type) throws javax.ejb.CreateException{
setISType(type);
}
/**
* Remove this Information System Version
* @ejb.transaction type="Mandatory"
*/
public void ejbRemove() throws javax.ejb.RemoveException, javax.ejb.EJBException {}
}
--- NEW FILE: ISystemBean.java ---
/*
* ISystemBean.java
*
* Created on 8 october 2002, 18:59
*/
package org.figure8.join.businessobjects.resource.ejb;
import org.figure8.join.businessobjects.resource.util.ISystemUtil;
import org.figure8.join.businessobjects.resource.interfaces.ISystemData;
import org.figure8.join.businessobjects.resource.interfaces.ISTypeLocal;
/**
* This is the representation of an Information System available from
* the portal part of the software project to Join. Information System has
* a specific type (Many IS could be reached from the current project to join).<br>
* This bean is deployed with name "ISystem" cause we can't use "IS" that is
* a reserved EJB-QL identifier.
* @author <a href="mailto:lau...@fr...">Laurent Broudoux</a>
*
* @ejb.bean name="ISystem"
type="CMP" cmp-version="2.x" view-type="local"
jndi-name="${objects.res.is.jndi-name}"
local-jndi-name="${objects.res.is.jndi-name}Local"
primkey-field="id"
* @ejb.home local-class="org.figure8.join.businessobjects.resource.interfaces.ISystemLocalHome"
* @ejb.interface local-class="org.figure8.join.businessobjects.resource.interfaces.ISystemLocal"
* @ejb.data-object package="org.figure8.join.businessobjects.resource.interfaces"
*
* @ejb.finder signature="Collection findAll()" unchecked="true" transaction-type="NotSupported"
* @ejb.finder signature="Collection findByTypeAndName(org.figure8.join.businessobjects.resource.interfaces.ISTypeLocal type, java.lang.String name)"
unchecked="true" transaction-type="Supports"
query="SELECT DISTINCT OBJECT(sys) FROM ISystem AS sys WHERE sys.iSType=?1 AND sys.name=?2"
*
* @ejb.pk class="java.lang.String" generate="false" unchecked="true"
* @ejb.persistence table-name="${objects.res.is.table-name}"
*
* @jboss.tuned-updates "true"
* @jboss.read-ahead strategy="on-find"
*/
public abstract class ISystemBean implements javax.ejb.EntityBean{
// Public -------------------------------------------------------------------
/**
* Information System id
* @ejb.pk-field
* @ejb.persistence column-name="s_id"
*/
public abstract String getId();
/** Information System id */
public abstract void setId(String id);
/**
* Information System name
* @ejb.interface-method
* @ejb.persistence column-name="s_name"
*/
public abstract String getName();
/**
* Information System name
* @ejb.interface-method
*/
public abstract void setName(String name);
/**
* Type of this Information System
* @ejb.interface-method view-type="local"
* @ejb.relation name="ISType-OneToMany-ISs-Bi"
* role-name="IS-belongsto-ISType"
* cascade-delete="yes"
* @jboss.relation fk-constraint="true"
* related-pk-field="id"
* fk-column="s_istype_fk"
*/
public abstract ISTypeLocal getISType();
/**
* Type of this Information System
* @ejb.interface-method view-type="local"
*/
public abstract void setISType(ISTypeLocal type);
/**
* Generated bulk accessor
* @ejb.interface-method
*/
public abstract ISystemData getData();
/** Generated bulk accessor */
public abstract void setData(ISystemData data);
// Implementation of EntityBean ---------------------------------------------
/**
* Create a new Information System
* @ejb.create-method
*/
public String ejbCreate(ISystemData data, ISTypeLocal type) throws javax.ejb.CreateException{
if (data != null){
setId(ISystemUtil.generateGUID(this));
setData(data);
}
else throw new javax.ejb.CreateException("Data object for IS must be non null.");
return null;
}
/** Create a new Information System */
public void ejbPostCreate(ISystemData data, ISTypeLocal type) throws javax.ejb.CreateException{
setISType(type);
}
/**
* Remove this Resource
* @ejb.transaction type="Mandatory"
*/
public void ejbRemove() throws javax.ejb.RemoveException, javax.ejb.EJBException {}
}
|