Perforce

com.perforce.api
Class Group

java.lang.Object
  extended by com.perforce.api.SourceControlObject
      extended by com.perforce.api.Group
All Implemented Interfaces:
Cacheable

public final class Group
extends SourceControlObject

Representation of a source control group. Each instance can store one p4 group's information. This is custom defined class at Quinstreet

Version:
$Date: 2007/02/12 $ $Revision: #1 $
Author:
Sivananda Poreddy

Constructor Summary
Group()
          Default no-argument constructor.
Group(String id)
          Constructor that accepts the id of the group.
 
Method Summary
 void commit()
          TBD: The commit method is not working yet.
 HashDecay getCache()
          Returns the HashDecay instance for this class
static Group getGroup(Env env, String gid)
          Gets the group information for the specified group.
static Enumeration getGroups()
          Returns an Enumeration of all Group objects.
static Enumeration getGroups(Env env)
          Returns an Enumeration of all Group objects.
 String getId()
          Returns the id for this Group.
 Vector getUsers()
          Returns the list of users for a given group
 void setId(String id)
          Sets the id for this Group.
 void sync()
          Synchronizes the Group information with P4.
 void sync(String id)
          Synchronizes the Group information with P4.
 String toString()
           
 String toXML()
          Returns a string containing the object in XML form.
 
Methods inherited from class com.perforce.api.SourceControlObject
clearCache, getEnv, getSyncTime, getUpdateTime, inSync, invalidate, outOfSync, refreshUpdateTime, setEnv
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Group

public Group()
Default no-argument constructor.


Group

public Group(String id)
Constructor that accepts the id of the group. This simply creates an instance that has the id set. No other information in the class will be present until the sync() method is called.

Parameters:
id - Id for the Group.
Method Detail

commit

public void commit()
TBD: The commit method is not working yet.

Specified by:
commit in interface Cacheable
Specified by:
commit in class SourceControlObject

getCache

public HashDecay getCache()
Description copied from class: SourceControlObject
Returns the HashDecay instance for this class

Specified by:
getCache in interface Cacheable
Specified by:
getCache in class SourceControlObject

getGroup

public static Group getGroup(Env env,
                             String gid)
Gets the group information for the specified group. If that group has been gotten before, that group information will not be reloaded from P4. It is instead loaded from an internal HashDecay.

If the group information must be up to date, then the sync() method must be called.

Parameters:
env - Source control environment to use.
gid - The group id of the group information to get from p4.

getGroups

public static Enumeration getGroups()
Returns an Enumeration of all Group objects.


getGroups

public static Enumeration getGroups(Env env)
Returns an Enumeration of all Group objects.


getId

public String getId()
Returns the id for this Group.

Returns:
Id for the Group.

getUsers

public Vector getUsers()
                throws PerforceException
Returns the list of users for a given group

Throws:
PerforceException

setId

public void setId(String id)
Sets the id for this Group.

Parameters:
id - Id for the Group.

sync

public void sync()
Synchronizes the Group information with P4. This method must be called to ensure that this contains the latest information from p4.

Specified by:
sync in interface Cacheable
Specified by:
sync in class SourceControlObject

sync

public void sync(String id)
Synchronizes the Group information with P4. This method must be called to ensure that this contains the latest information from p4. This form of the method can be used to change the Group Id in at the same time.

Parameters:
id - The Group id for this to synchronize from p4.

toString

public String toString()
Overrides:
toString in class Object

toXML

public String toXML()
Description copied from class: SourceControlObject
Returns a string containing the object in XML form.

Specified by:
toXML in class SourceControlObject

Perforce

Copyright © 2008, Perforce Software, All rights reserved.