tim-connector: comments improved and NotNull annotations added

This commit is contained in:
miciele Ghiorghis 2013-02-13 17:11:56 +01:00 committed by Manuel Rego Casasnovas
parent 3b34928a23
commit 81479a1850
4 changed files with 55 additions and 3 deletions

View file

@ -19,10 +19,22 @@
package org.libreplan.business.common.entities;
import org.hibernate.validator.NotNull;
import org.libreplan.business.common.BaseEntity;
/**
* AppProperties Entity
* AppProperties Entity, represents application configuration parameters.
*
* This property can be used by all applications who needs simple name-value
* pair configurations. It consists the following properties:
* <ul>
* <li>majorId: an indication for some large piece of functionality like "jira"
* for "jira-connector"</li>
* <li>minorId: used for sub module within this majorId. It can be null if not
* used</li>
* <li>propertyName: holder for the name of a property</li>
* <li>propertyValue: holder for the value of a property</li>
* </ul>
*
* @author Miciele Ghiorghis <m.ghiorghis@antoniusziekenhuis.nl>
*/
@ -33,8 +45,11 @@ public class AppProperties extends BaseEntity {
}
private String majorId;
private String minorId;
private String propertyName;
private String propertyValue;
/**
@ -43,6 +58,7 @@ public class AppProperties extends BaseEntity {
protected AppProperties() {
}
@NotNull(message = "majorId not specified")
public String getMajorId() {
return majorId;
}
@ -59,6 +75,7 @@ public class AppProperties extends BaseEntity {
this.minorId = minorId;
}
@NotNull(message = "property name not specified")
public String getPropertyName() {
return propertyName;
}
@ -67,6 +84,7 @@ public class AppProperties extends BaseEntity {
this.propertyName = propertyName;
}
@NotNull(message = "property value not specified")
public String getPropertyValue() {
return propertyValue;
}

View file

@ -19,10 +19,17 @@
package org.libreplan.business.common.entities;
import org.hibernate.validator.NotNull;
import org.libreplan.business.common.BaseEntity;
/**
* JobSchedulerConfiguration entity
* JobSchedulerConfiguration entity, represents parameters for the jobs to be
* scheduled. This entity is used by the <code>SchedulerManager</code> to
* schedule jobs and in UI to show the scheduler status.
*
* The <code>jobGroup</code> and <code>jobName</code> together forms a job key
* and non of the fields must be null. Moreover it should contain a valid
* <code>cronExpression</code>
*
* @author Miciele Ghiorghis <m.ghiorghis@antoniusziekenhuis.nl>
*/
@ -39,12 +46,18 @@ public class JobSchedulerConfiguration extends BaseEntity {
}
private String jobGroup;
private String jobName;
private String triggerGroup;
private String triggerName;
private String cronExpression;
private String jobClassName;
@NotNull(message = "job group not specified")
public String getJobGroup() {
return jobGroup;
}
@ -53,6 +66,7 @@ public class JobSchedulerConfiguration extends BaseEntity {
this.jobGroup = jobGroup;
}
@NotNull(message = "job name not specified")
public String getJobName() {
return jobName;
}
@ -61,6 +75,7 @@ public class JobSchedulerConfiguration extends BaseEntity {
this.jobName = jobName;
}
@NotNull(message = "trigger group not specified")
public String getTriggerGroup() {
return triggerGroup;
}
@ -69,6 +84,7 @@ public class JobSchedulerConfiguration extends BaseEntity {
this.triggerGroup = triggerGroup;
}
@NotNull(message = "trigger name not specified")
public String getTriggerName() {
return triggerName;
}
@ -77,6 +93,7 @@ public class JobSchedulerConfiguration extends BaseEntity {
this.triggerName = triggerName;
}
@NotNull(message = "cron expression not specified")
public String getCronExpression() {
return cronExpression;
}
@ -85,6 +102,7 @@ public class JobSchedulerConfiguration extends BaseEntity {
this.cronExpression = cronExpression;
}
@NotNull(message = "job class name not specified")
public String getJobClassName() {
return jobClassName;
}

View file

@ -15,7 +15,7 @@
<property name="majorId" column="major_id" not-null="true" />
<property name="minorId" column="minor_id" />
<property name="propertyName" column="property_name" not-null="true"/>
<property name="propertyValue" column="property_value" />
<property name="propertyValue" column="property_value" not-null="true"/>
</class>
</hibernate-mapping>

View file

@ -71,6 +71,22 @@ public class RosterException {
/**
* updates the <code>exceptionType</code> and <code>effortDuration</code>
*
* In Tim you can divide your exception day in different
* <code>exceptionType</code>, for example on Monday:
* <ul>
* <li>4 hours RESOURCE_HOLIDAY</li>
* <li>2 hours STRIKE</li>
* <li>2 hours BANK_HOLIDAY</li>
* </ul>
*
* But Libreplan allows only one <code>exceptionType</code> per day.
*
* In order to store different <code>exceptionTypes</code> per day as one
* <code>exceptionType</code>, this method gets the
* <code>exceptionType</code> from the <code>rosterDTO</code> with the
* highest duration, in this example RESOURCE_HOLIDAY as a valid exception
* type, but the total duration is the sum of all these exception types
*
* @param rosterExceptionItem
* the rosterException item
* @param rosterDTOs