import org.splat.service.technical.IndexServiceImpl;
/**
- * Stand proxy for entities such as Study and Knowledge Element returned by Lucene-based searches.
- * This interface provides access to properties of searched entities which can be presented in a result search list
- * before loading the corresponding persistent objects from the database (reason for most properties to be returned as
- * strings).
- * One of these properties is the internal persistent identifier of the object represented by a proxy allowing the
- * user of this interface to load the object from the database.
+ * Stand proxy for entities such as Study and Knowledge Element returned by Lucene-based searches. This interface provides access to
+ * properties of searched entities which can be presented in a result search list before loading the corresponding persistent objects from
+ * the database (reason for most properties to be returned as strings). One of these properties is the internal persistent identifier of the
+ * object represented by a proxy allowing the user of this interface to load the object from the database.
*
* @see IndexServiceImpl
* @see IndexServiceImpl.ObjectProxy
- * @author Daniel Brunier-Coulin
+ * @author Daniel Brunier-Coulin
* @copyright OPEN CASCADE 2012
*/
public interface Proxy {
- String getAuthorName ();
+ /**
+ * Get the name of the object author.
+ *
+ * @return the author name
+ */
+ String getAuthorName();
-/**
- * Returns the internal persistent identifier of the object represented by this proxy. The returned identifier can be used
- * for selecting the corresponding persistent object from the database.
- * @return the internal persistent identifier of the object represented by this proxy.
- */
- Long getIndex ();
+ /**
+ * Returns the internal persistent identifier of the object represented by this proxy. The returned identifier can be used for selecting
+ * the corresponding persistent object from the database.
+ *
+ * @return the internal persistent identifier of the object represented by this proxy.
+ */
+ Long getIndex();
- ProgressState getProgressState ();
+ /**
+ * Get the progress state of the object.
+ *
+ * @return the progress state
+ */
+ ProgressState getProgressState();
-/**
- * Returns the external reference number of the object represented by this proxy. The returned reference is formated
- * according to the format defined in the configuration file of the application.
- * @return the external reference number of the object represented by this proxy.
- */
- String getReference ();
+ /**
+ * Returns the external reference number of the object represented by this proxy. The returned reference is formated according to the
+ * format defined in the configuration file of the application.
+ *
+ * @return the external reference number of the object represented by this proxy.
+ */
+ String getReference();
- String getTitle ();
+ /**
+ * Get a title of the object.
+ *
+ * @return the object title
+ */
+ String getTitle();
-/**
- * Returns the type of the object represented by this proxy. Depending on the implementation, the returned type may or
- * may not be localized in the current locale of final user.
- * @return the type of the object represented by this proxy.
- */
- String getType ();
+ /**
+ * Returns the type of the object represented by this proxy. Depending on the implementation, the returned type may or may not be
+ * localized in the current locale of final user.
+ *
+ * @return the type of the object represented by this proxy.
+ */
+ String getType();
}
\ No newline at end of file
/**
* Initialization constructor.
- * @param username user name
- * @param role role name
+ *
+ * @param username
+ * user name
+ * @param role
+ * role name
*/
protected RoleDTO(final String username, final String role) {
this._username = username;
/**
* Add a role.
- * @param role the role to add
+ *
+ * @param role
+ * the role to add
*/
protected void addRole(final String role) {
this._name = this._name + "," + role;
/**
* Get roles as an array of separate DTOs.
+ *
* @return array of roles
*/
protected RoleDTO[] toArray() {
// ==============================================================================================================================
// In functions below, the role is supposed having previously been extracted as an array.
+ /**
+ * Get role name.
+ *
+ * @return the role name
+ */
public String getName() {
return _name;
}
+ /**
+ * Set role name.
+ *
+ * @param name
+ * the role name to set
+ */
public void setName(final String name) {
_name = name;
}
-
- public boolean is(final String name) {
- return this._name.equals(name);
- }
-
- public boolean isSame(final RoleDTO other) {
- return this._name.equals(other._name);
- }
}
\ No newline at end of file
/**
* User DTO.
- *
+ *
* @author <a href="mailto:roman.kozlov@opencascade.com">Roman Kozlov (RKV)</a>
*/
public class UserDTO implements Principal, Name {
- private String _password; // Property without getter function
- private String _username; // Unique in the user directory
+ /**
+ * User password.
+ */
+ private String _password;
+ /**
+ * User login name. Unique in the user directory.
+ */
+ private String _username;
+ /**
+ * User first name.
+ */
private String _firstName;
+ /**
+ * User family.
+ */
private String _name;
- private String _displayName; // Optional
- private RoleDTO _role = new RoleDTO(); // Roles as list (as stored into the database)
+ /**
+ * User name to be displayed. Optional.
+ */
+ private String _displayName;
+ /**
+ * Roles as list (as stored in the database).
+ */
+ private RoleDTO _role = new RoleDTO();
+ /**
+ * Email address.
+ */
private String _mailAddress;
+ /**
+ * Organization name.
+ */
private String _organizationName;
/**
// Public member functions
// ==============================================================================================================================
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
@Override
public boolean equals(final Object item) {
boolean res = (item != null);
return res;
}
+ /**
+ * Get user display name.
+ *
+ * @return the user display name
+ */
public String getDisplayName() {
String res = _displayName;
if (res == null) {
return res;
}
+ /**
+ * Get user first name.
+ *
+ * @return the user first name
+ */
public String getFirstName() {
return _firstName;
}
+ /**
+ * Set user first name.
+ *
+ * @param name
+ * the first name to set
+ */
public void setFirstName(final String name) {
_firstName = name;
}
+ /**
+ * Get user email address.
+ *
+ * @return the email address
+ */
public String getMailAddress() {
return _mailAddress;
}
+ /**
+ * Set user email address.
+ *
+ * @param addr
+ * the email address to set
+ */
public void setMailAddress(final String addr) {
_mailAddress = addr;
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.security.Principal#getName()
+ */
public String getName() {
return _name;
}
-
+
+ /**
+ * Set user family.
+ *
+ * @param name
+ * the user family to set
+ */
public void setName(final String name) {
_name = name;
}
+ /**
+ * Get user's organization name.
+ *
+ * @return the user's organization name
+ */
public String getOrganizationName() {
return _organizationName;
}
+ /**
+ * Set user's organization name.
+ *
+ * @param name
+ * the user's organization name
+ */
public void setOrganizationName(final String name) {
_organizationName = name;
}
+ /**
+ * Get user roles names separated by commas.
+ *
+ * @return the string containing roles names
+ */
public String getRoleNames() {
return _role.getName();
}
+ /**
+ * Get users roles as an array of DTO.
+ *
+ * @return the array of roles DTO
+ */
public RoleDTO[] getRoles() {
return _role.toArray();
}
+ /**
+ * Get user login name.
+ * @return the user login name
+ */
public String getUsername() {
return _username;
}
+ /**
+ * {@inheritDoc}
+ * @see java.lang.Object#toString()
+ */
@Override
public String toString() {
return _name + " " + _firstName;
/**
* Get the password.
+ *
* @return the password
*/
public String getPassword() {
/**
* Set the password.
- * @param password the password to set
+ *
+ * @param password
+ * the password to set
*/
public void setPassword(final String password) {
this._password = password;
/**
* Set the username.
- * @param username the username to set
+ *
+ * @param username
+ * the username to set
*/
public void setUsername(final String username) {
this._username = username;
/**
* Get the role.
+ *
* @return the role
*/
public RoleDTO getRole() {
/**
* Set the role.
- * @param role the role to set
+ *
+ * @param role
+ * the role to set
*/
public void setRole(final RoleDTO role) {
this._role = role;
/**
* Set the displayName.
- * @param displayName the displayName to set
+ *
+ * @param displayName
+ * the displayName to set
*/
public void setDisplayName(final String displayName) {
_displayName = displayName;