All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class icc.db.Partner

java.lang.Object
   |
   +----icc.db.Entity
           |
           +----icc.db.Partner

public class Partner
extends Entity
The Partner class represents a person or project partner.

A partner is minimally defined by a unique identifier and a unique username. Other attributes may be specified as well, preferably a first and last name.

All changes to a Partner object must be submitted to the project database before these will take effect. Note that only the partner self, or the administrator of a project this person is a partner of, can submit such changes successfully.


Variable Index

 o ENTRY
The name of a service that updates partner information in the database on request.
 o FIRSTNAME
A useful constant for specifying or retrieving the partner's first name.
 o LASTNAME
A useful constant for specifying or retrieving the partner's last name.
 o QUERY
The name of a service that retrieves partner information from the database on request.
 o reset
A request to reset all partner information stored at the webtop level.

Constructor Index

 o Partner(Integer, String)
 o Partner(String)
Allocates a Partner object with the specified username.

Method Index

 o addProject(Integer)
Creates a data request to add this partner to the specified project.
 o addProject(Integer, String)
Creates a data request to add this partner to the specified project.
 o alter()
Creates a data request to modify this partner information.
 o attribute(String)
Returns the partner's attribute value with respect to the specified key.
 o attributes()
Returns an enumeration of the attributes.
 o clean()
Clears all information in this partner.
 o clear()
Removes all Partner objects previously put.
 o clearAttributes()
Removes all attributes.
 o contains(Integer)
Tests if a partner with the specified identifier has previously been put.
 o copy(Partner)
Copies the specified partner information into this partner.
 o create(Integer, String, String, Integer)
Creates a data request to create a new partner with the specified password and add this partner to the specified project (with function), as a member of the specified team.
 o description()
Returns the partner's full name (first and last).
 o find(String)
Creates a data request to find the partner identifier corresponding the specified username in the project database.
 o get(Integer)
Retrieves the Partner object for the specified identifier, if previously put.
 o get(String)
Retrieves a partner by username, if previously put.
 o hasAttributes()
Returns the number of attributes defined for this partner.
 o id(String)
Retrieves the partner identifier corresponding the specified username, if previously put.
 o put()
Stores this object for later retrieval by username or identifier.
 o remove()
Removes this object from local storage, if previously put.
 o remove(Integer)
Removes the Partner object with the specified identifier previously put, if any.
 o removeAttribute(String)
Removes an attribute.
 o removeProject(Integer)
Creates a data request to remove this partner from the specified project.
 o retrieve(Integer)
Creates a data request to retrieve the partner information for the specified identifier.
 o retrieve(Integer[])
Creates a data request to retrieve an array of partner informations for the specified identifiers.
 o retrieve(String)
Creates a data request to retrieve the partner information for the specified username.
 o retrieve(String, String)
Creates a data request to retrieve an array of partner informations corresponding the specified attribute information.
 o setAttribute(String, String)
Sets an attribute.
 o setUsername(String)
Sets this partner's username.
 o username()
Returns the partner's username.

Variables

 o FIRSTNAME
 public static final String FIRSTNAME
A useful constant for specifying or retrieving the partner's first name.

 o LASTNAME
 public static final String LASTNAME
A useful constant for specifying or retrieving the partner's last name.

 o QUERY
 public static final String QUERY
The name of a service that retrieves partner information from the database on request.

 o ENTRY
 public static final String ENTRY
The name of a service that updates partner information in the database on request. This service only accepts requests submitted by the partner self, or the administrator of a project this person is a partner of.

 o reset
 public static final Request reset
A request to reset all partner information stored at the webtop level. Though this information should always be identical to the information in the project database, upon certain administrative actions this may no longer be the case. A request to reset this information should only be submitted by the project administrator.

Constructors

 o Partner
 Partner(Integer id,
         String username)
 o Partner
 public Partner(String username)
Allocates a Partner object with the specified username. The partner identifier is set to NEW.

Parameters:
username - the partner's unique username
See Also:
NEW

Methods

 o username
 public final String username()
Returns the partner's username.

Returns:
the username
 o description
 public String description()
Returns the partner's full name (first and last).

Returns:
the full name
Overrides:
description in class Entity
 o attribute
 public final String attribute(String key)
Returns the partner's attribute value with respect to the specified key.

Parameters:
key - the attribute key
Returns:
the attribute value
 o hasAttributes
 public final int hasAttributes()
Returns the number of attributes defined for this partner.

Returns:
the number of attributes
 o attributes
 public final Enumeration attributes()
Returns an enumeration of the attributes. Use the Enumeration methods on the returned object to fetch the elements sequentially.

Returns:
an enumeration of the attributes
 o setUsername
 public final void setUsername(String name)
Sets this partner's username. This can only be done as long as the partner information has not been stored in the project database, i.e., if the partner's identifier is equal to NEW.

Parameters:
name - the new partner's username
See Also:
NEW, create
 o setAttribute
 public final void setAttribute(String key,
                                String value)
Sets an attribute. Any previous setting is lost. Altering the partner's attributes has no actual effect until these attributes are also updated in the database.

Parameters:
key - the attribute key
value - the attribute value
See Also:
alter
 o removeAttribute
 public final void removeAttribute(String key)
Removes an attribute. Altering the partner's attributes has no actual effect until these attributes are also updated in the database.

Parameters:
key - the attribute key
See Also:
alter
 o clearAttributes
 public final void clearAttributes()
Removes all attributes. Altering the partner's attributes has no actual effect until these attributes are also updated in the database.

See Also:
alter
 o copy
 public void copy(Partner from)
Copies the specified partner information into this partner. This partner cannot be trusted.

Parameters:
from - the partner information to be copied
 o clean
 public void clean()
Clears all information in this partner. This partner cannot be trusted.

 o contains
 public static final boolean contains(Integer id)
Tests if a partner with the specified identifier has previously been put.

Parameters:
id - a partner identifier
Returns:
true if this partner has previously been put; false otherwise
 o get
 public static final Partner get(Integer id)
Retrieves the Partner object for the specified identifier, if previously put.

Parameters:
id - a partner identifier
Returns:
the partner corresponding this identifier, if known; otherwise null
 o get
 public static final Partner get(String name)
Retrieves a partner by username, if previously put.

Parameters:
name - a partner's username
Returns:
the partner corresponding this username, if known; otherwise null
 o id
 public static final Integer id(String name)
Retrieves the partner identifier corresponding the specified username, if previously put.

Parameters:
name - a partner's username
Returns:
the partner identifier, if known; otherwise null
 o put
 public final void put()
Stores this object for later retrieval by username or identifier. Only trusted objects can be stored.

 o remove
 public final void remove()
Removes this object from local storage, if previously put.

 o remove
 public static final Partner remove(Integer id)
Removes the Partner object with the specified identifier previously put, if any.

Parameters:
id - a partner identifier
Returns:
the object in question, if any; otherwise null
 o clear
 public static final void clear()
Removes all Partner objects previously put.

 o find
 public static DataRequest find(String name)
Creates a data request to find the partner identifier corresponding the specified username in the project database.

Parameters:
name - a username
Returns:
a data request to find a partner identifier
See Also:
SERVICE
 o retrieve
 public static DataRequest retrieve(String name)
Creates a data request to retrieve the partner information for the specified username.

Parameters:
name - a username
Returns:
a data request to retrieve partner information
See Also:
SERVICE
 o retrieve
 public static DataRequest retrieve(Integer id)
Creates a data request to retrieve the partner information for the specified identifier.

Parameters:
id - a partner identifier
Returns:
a data request to retrieve partner information
See Also:
SERVICE
 o retrieve
 public static DataRequest retrieve(Integer ids[])
Creates a data request to retrieve an array of partner informations for the specified identifiers.

Parameters:
ids - an array of partner identifiers
Returns:
a data request to retrieve an array of partner informations
See Also:
SERVICE
 o retrieve
 public static DataRequest retrieve(String type,
                                    String value)
Creates a data request to retrieve an array of partner informations corresponding the specified attribute information.

Parameters:
type - the attribute type
value - the attribute value
Returns:
a data request to retrieve an array of partner informations
See Also:
SERVICE
 o create
 public DataRequest create(Integer project,
                           String password,
                           String function,
                           Integer team)
Creates a data request to create a new partner with the specified password and add this partner to the specified project (with function), as a member of the specified team. Only the project administrator can submit this request. If successful, appropriate events are posted.

Parameters:
project - a project identifier
password - an initial password
function - a project function
team - a team identifier
Returns:
a data request to create a new project partner
See Also:
SERVICE, PartnerEvents, ProjectEvents
 o alter
 public DataRequest alter()
Creates a data request to modify this partner information. Only the partner self, or the administrator of a project the person is a partner of, can submit this request. If successful, an appropriate event is posted.

Returns:
a data request to modify partner information
See Also:
SERVICE, PartnerEvents
 o addProject
 public DataRequest addProject(Integer project)
Creates a data request to add this partner to the specified project. Only the project administrator can submit this request. If successful, an appropriate event is posted.

Parameters:
project - a project identifier
Returns:
a data request to add a partner to a project
See Also:
SERVICE, ProjectEvents
 o addProject
 public DataRequest addProject(Integer project,
                               String function)
Creates a data request to add this partner to the specified project. Only the project administrator can submit this request. If successful, an appropriate event is posted.

Parameters:
project - a project identifier
function - the partner's function
Returns:
a data request to add a partner to a project
See Also:
SERVICE, ProjectEvents
 o removeProject
 public DataRequest removeProject(Integer project)
Creates a data request to remove this partner from the specified project. Only the project administrator can submit this request. If successful, an appropriate event is posted.

Parameters:
project - a project identifier
Returns:
a data request to remove a partner from a project
See Also:
removePartner, SERVICE, ProjectEvents

All Packages  Class Hierarchy  This Package  Previous  Next  Index

This website has been archived and is no longer maintained.