org.kohsuke.jnt
Class JNProject

java.lang.Object
  extended by org.kohsuke.jnt.JNProject
All Implemented Interfaces:
Comparable

public final class JNProject
extends Object
implements Comparable

Java.net project.

Comparisons are based on their project names, so one can compare two JNProjects from different JavaNets.

Author:
Kohsuke Kawaguchi (kk@kohsuke.org), Bruno Souza

Method Summary
 void approve()
          Approves the project.
 int compareTo(Object o)
           
 void disapprove(String reason)
          Disapproves the project.
 boolean equals(Object o)
           
 boolean exists()
           
 JavaNet getConnection()
          Returns the JavaNet object that this project belongs to.
 JNFileFolder getFolder(String folderPathName)
          Obtains the top folder in the file sharing section.
 JNForums getForums()
          Obtains the object that represents the discussion forums section.
 JNIssueTracker getIssueTracker()
          Obtains the object that represents the issue tracker section.
 JNMailingLists getMailingLists()
          Accesses the membership section of the project.
 JNMembership getMembership()
          Accesses the membership section of the project.
 String getName()
          Gets the name of this project.
 JNNewsItems getNewsItems()
          Obtains the object that represents the news item section.
 String getOwnerAlias()
          Returns the e-mail alias connected to all the current owners of this project.
 JNProject getOwnerCommunity()
          Gets the community project to which this project directly/indirectly belongs.
 String getOwnerMessage()
          Gets the owner's message.
 String getOwnerMessage2()
          Gets the owner's message.
 Set<JNUser> getOwners()
          Returns a set of JNUsers that represent project owners.
 JNProject getParent()
          Gets the parent project.
 JNFileFolder getRootFolder()
          Returns the top folder in the document & files section.
 Set<JNProject> getSubProjects()
          Returns a set of JNProject objects that represent the sub-projects of this project.
 String getSummary()
          Gets the one-line summary of this project.
 URL getURL()
          Returns the URL of the project top page.
 JNVCS getVersionControl()
          Gets the version control system this project uses.
 int hashCode()
           
 boolean isCommunity()
          Returns true if this project is a community project.
 String setOwnerMessage(String msg)
          Sets the owner's message.
 void setParent(JNProject newParent)
          Moves this project under the specified project.
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getConnection

public JavaNet getConnection()
Returns the JavaNet object that this project belongs to.

Returns:
never null.

getName

public String getName()
Gets the name of this project.

Returns:
always non-null.

getVersionControl

public JNVCS getVersionControl()
                        throws ProcessingException
Gets the version control system this project uses.

Returns:
always non-null.
Throws:
ProcessingException

getSummary

public String getSummary()
                  throws ProcessingException
Gets the one-line summary of this project. such as "This is the java.net community project. All are welcome."

Returns:
always non-null.
Throws:
ProcessingException

getOwnerMessage

public String getOwnerMessage()
                       throws ProcessingException
Gets the owner's message. This could contain HTML.

Generally speaking, this library cannot obtain the exact char-by-char representation of such HTML (for example, whitespace between attributes are lost.)

Returns:
null if the owner message is not set. Otherwise non-null string.
Throws:
ProcessingException
See Also:
getOwnerMessage2()

getOwnerMessage2

public String getOwnerMessage2()
                        throws ProcessingException
Gets the owner's message.

This is an admin-only operation, but unlike getOwnerMessage(), this method returns the exact char-by-char owner's message as currently set.

Returns:
null if the owner message is not set. Otherwise non-null string.
Throws:
ProcessingException
See Also:
getOwnerMessage()

setOwnerMessage

public String setOwnerMessage(String msg)
                       throws ProcessingException
Sets the owner's message.

This is an admin-only operation. When set, the owner's message is displayed in the project top page.

Parameters:
msg - null to reset the owner message. Otherwise the string will be set as the owner's message. Can contain HTML.
Returns:
the old owner's message, or null if none was set.
Throws:
ProcessingException

getParent

public JNProject getParent()
                    throws ProcessingException
Gets the parent project.

Returns:
null if this is a top-level project. For example, all communities are top-level projects.
Throws:
ProcessingException

setParent

public void setParent(JNProject newParent)
               throws ProcessingException
Moves this project under the specified project.

This is a priviledged operation.

Throws:
ProcessingException

getOwnerCommunity

public JNProject getOwnerCommunity()
                            throws ProcessingException
Gets the community project to which this project directly/indirectly belongs.

Returns:
If this project is a community, this method returns this. If this project doesn't belong to any community (which means it's a free standing project), this method returns null.
Throws:
ProcessingException

isCommunity

public boolean isCommunity()
                    throws ProcessingException
Returns true if this project is a community project.

Certain java.net projects are designated as "community" projects (e.g., games.dev.java.net, java-ws-xml.dev.java.net)

Throws:
ProcessingException

getOwners

public Set<JNUser> getOwners()
                      throws ProcessingException
Returns a set of JNUsers that represent project owners.

Returns:
always return non-null set. If the project doesn't have any owner, it returns an empty set. The set is read-only.
Throws:
ProcessingException
See Also:
getOwners()

getOwnerAlias

public String getOwnerAlias()
Returns the e-mail alias connected to all the current owners of this project.

This alias is maintained by java.net. It is always "owner@PROJECT.dev.java.net"

See Also:
getOwners()

getSubProjects

public Set<JNProject> getSubProjects()
                              throws ProcessingException
Returns a set of JNProject objects that represent the sub-projects of this project.

Note that depending on the permission of the current account used to log in to the system, you might not be able to see all the sub-projects

Returns:
always return non-null set. If the project doesn't have any sub-project, it returns an empty set. The set is read-only.
Throws:
ProcessingException

exists

public boolean exists()
               throws ProcessingException
Throws:
ProcessingException

getMembership

public JNMembership getMembership()
Accesses the membership section of the project.

Returns:
always non-null.

getMailingLists

public JNMailingLists getMailingLists()
Accesses the membership section of the project.

Returns:
always non-null.

getURL

public URL getURL()
Returns the URL of the project top page.

Returns:
URL that looks like "https://PROJECTNAME.dev.java.net/". Never be null.

getFolder

public JNFileFolder getFolder(String folderPathName)
                       throws ProcessingException
Obtains the top folder in the file sharing section.

Parameters:
folderPathName - String like "/folder1/subfolder"
Returns:
if the folder is not found, return null.
Throws:
ProcessingException

getRootFolder

public JNFileFolder getRootFolder()
Returns the top folder in the document & files section.


getNewsItems

public JNNewsItems getNewsItems()
Obtains the object that represents the news item section.


getForums

public JNForums getForums()
Obtains the object that represents the discussion forums section.


getIssueTracker

public JNIssueTracker getIssueTracker()
Obtains the object that represents the issue tracker section.


approve

public void approve()
             throws ProcessingException
Approves the project.

This is an admin-only operation.

Throws:
ProcessingException

disapprove

public void disapprove(String reason)
                throws ProcessingException
Disapproves the project.

This is an admin-only operation.

Throws:
ProcessingException

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2003-2009 Kohsuke Kawaguchi. All Rights Reserved.