net.codescore.managers
Class ProblemManager

java.lang.Object
  extended by net.codescore.managers.ProblemManager

public class ProblemManager
extends Object


Field Summary
private static NamedQuery all_problems
           
private static NamedQuery all_tags
           
private static org.apache.commons.logging.Log log
           
private static ObjectContext oc
           
 
Constructor Summary
ProblemManager()
           
 
Method Summary
static boolean checkPNameUnique(String name, Problem p)
           
static boolean checkPUnixNameUnique(String unixname, Problem p)
           
static Problem createNewProblem()
           
static List<Problem> getAllProblems()
           
static List<Tag> getAllTags()
           
static List<TestCase> getCases(Problem prob)
           
static Problem getProblemByID(int probid)
           
static Problem getProblemByID(ObjectContext oc, int probid)
           
static Problem getProblemByName(ObjectContext c, String name)
           
static Problem getProblemByUnixName(ObjectContext c, String unixname)
           
static ProblemStatus getStatusByID(ObjectContext c, int ID)
           
static Tag getTag(String tagName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

all_tags

private static NamedQuery all_tags

all_problems

private static NamedQuery all_problems

log

private static org.apache.commons.logging.Log log

oc

private static ObjectContext oc
Constructor Detail

ProblemManager

public ProblemManager()
Method Detail

checkPNameUnique

public static boolean checkPNameUnique(String name,
                                       Problem p)
Parameters:
name - The new problem name
p - The target problem for the new name. NOTE: this method will not set the name.
Returns:
true if the name is unique, false if it already exists in the database.

checkPUnixNameUnique

public static boolean checkPUnixNameUnique(String unixname,
                                           Problem p)
Parameters:
unixname - The new problem unixname
p - The target problem for the new unix name. NOTE: this method will not set the unix name.
Returns:
true if the unixname is unique, false

createNewProblem

public static Problem createNewProblem()

getAllProblems

public static List<Problem> getAllProblems()

getAllTags

public static List<Tag> getAllTags()

getCases

public static List<TestCase> getCases(Problem prob)

getProblemByID

public static Problem getProblemByID(int probid)

getProblemByID

public static Problem getProblemByID(ObjectContext oc,
                                     int probid)

getProblemByName

public static Problem getProblemByName(ObjectContext c,
                                       String name)

getProblemByUnixName

public static Problem getProblemByUnixName(ObjectContext c,
                                           String unixname)

getStatusByID

public static ProblemStatus getStatusByID(ObjectContext c,
                                          int ID)

getTag

public static Tag getTag(String tagName)


Copyright 2008 © Adam Cornett, Andrew Conner All Rights Reserved.