From: <jen...@us...> - 2007-08-20 15:23:29
|
Revision: 9 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=9&view=rev Author: jenslehmann Date: 2007-08-20 08:23:17 -0700 (Mon, 20 Aug 2007) Log Message: ----------- web service implementation added Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/server/DLLearnerWS.java trunk/src/dl-learner/org/dllearner/server/DLLearnerWSStart.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/server/ClientState.java trunk/src/dl-learner/org/dllearner/server/DLLearnerWS2.java trunk/src/dl-learner/org/dllearner/server/DLLearnerWSoriginal.java trunk/src/dl-learner/org/dllearner/server/LearnMonitor.java trunk/src/dl-learner/org/dllearner/server/exceptions/ trunk/src/dl-learner/org/dllearner/server/exceptions/ClientNotKnownException.java trunk/src/dl-learner/org/dllearner/server/exceptions/NoOntologySelectedException.java trunk/src/dl-learner/org/dllearner/server/exceptions/OntologyURLNotValid.java trunk/src/dl-learner/org/dllearner/server/jaxws/ trunk/src/dl-learner/org/dllearner/server/jaxws/ClientNotKnownExceptionBean.java trunk/src/dl-learner/org/dllearner/server/jaxws/NoOntologySelectedExceptionBean.java trunk/src/dl-learner/org/dllearner/server/jaxws/OntologyURLNotValidBean.java Added: trunk/src/dl-learner/org/dllearner/server/ClientState.java =================================================================== --- trunk/src/dl-learner/org/dllearner/server/ClientState.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/server/ClientState.java 2007-08-20 15:23:17 UTC (rev 9) @@ -0,0 +1,532 @@ +package org.dllearner.server; + +import java.net.MalformedURLException; +import java.net.URL; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; +import java.util.SortedSet; +import java.util.TreeSet; + +import org.dllearner.Config; +import org.dllearner.ConfigurationManager; +import org.dllearner.ConfigurationOption; +import org.dllearner.Main; +import org.dllearner.OntologyFileFormat; +import org.dllearner.algorithms.refinement.ROLearner; +import org.dllearner.dl.AtomicConcept; +import org.dllearner.dl.AtomicRole; +import org.dllearner.dl.Concept; +import org.dllearner.dl.Individual; +import org.dllearner.dl.KB; +import org.dllearner.reasoning.Reasoner; +import org.dllearner.reasoning.ReasoningMethodUnsupportedException; +import org.dllearner.reasoning.ReasoningService; + +import org.dllearner.server.exceptions.NoOntologySelectedException; +import org.dllearner.server.exceptions.OntologyURLNotValid; + +import com.hp.hpl.jena.shared.DoesNotExistException; +import com.hp.hpl.jena.shared.JenaException; + +public class ClientState { + + private String reasonerURL="http://localhost:8081"; + //private String reasonerURL="http://localhost:3490"; + + private SortedSet<Individual> positiveExamples = new TreeSet<Individual>(); + public SortedSet<Individual> getPosExamples() { return this.positiveExamples;} + + private SortedSet<Individual> negativeExamples = new TreeSet<Individual>(); + public SortedSet<Individual> getNegExamples() { return this.negativeExamples;} + + private SortedSet<String> ignoredConcept = new TreeSet<String>(); + + + private Reasoner reasoner; + public Reasoner getReasoner() { return reasoner;} + + private ReasoningService rs; + public ReasoningService getRs() { return rs; } + + private String currentOntologyURL=null; + private boolean debug_flag=true; + private LearnMonitor lm=null; + + private String lastResult=""; + public String getLastResult(){ + try{ + return ROL.getBestSolution().toString(); + }catch (Exception e) {} + return this.lastResult; } + public void setLastResult(String lastResult) {this.lastResult = lastResult;} + + private String status="maiden-like"; + public void setStatus(String status) {this.status = status;} + + ConfigurationManager confMgr; + public void addOption(ConfigurationOption c){confMgr.applyConfigurationOption(c);} + ROLearner ROL; + + public ClientState() { + + + TreeSet<ConfigurationOption> s=new TreeSet<ConfigurationOption>(); + //s.add(new ConfigurationOption("refinement","quiet","true")); + /*s.add(new ConfigurationOption()); + s.add(new ConfigurationOption()); + s.add(new ConfigurationOption()); + s.add(new ConfigurationOption()); + s.add(new ConfigurationOption()); + s.add(new ConfigurationOption());*/ + + confMgr = new ConfigurationManager(s); + addOption(new ConfigurationOption("refinement","quiet","true")); + //confMgr.applyOptions(); + + } + + + + + public void addPositiveExample(String posExample) { + positiveExamples.add(new Individual(posExample)); + p("added pos: "+posExample); + } + + + public void addNegativeExample(String negExample) { + negativeExamples.add(new Individual(negExample)); + p("added neg: "+negExample); + } + + public void addIgnoredConcept(String concept) { + ignoredConcept.add(concept); + p("added ignoredConcepts: "+concept); + } + + public String[] selectInstancesForAConcept(String Concept)throws NoOntologySelectedException{ + if(Concept.endsWith("#Thing"))return new String[]{}; + AtomicConcept SelectedConcept=new AtomicConcept(Concept); + ArrayList<String> al=new ArrayList<String>(); + Individual indtmp=null; + Set ConceptSet=null; + AtomicConcept ac=null; + + + System.out.println("selectInstancesForAConcept: "+Concept); + // add all positives + Set positives=rs.retrieval(SelectedConcept); + Iterator i = positives.iterator(); + while(i.hasNext()){ + indtmp=(Individual)i.next(); + p("added "+indtmp.getName()+" to positives"); + al.add("added "+indtmp.getName()+" to positives"); + positiveExamples.add(indtmp); + } + + //find more general concepts + ArrayList<AtomicConcept> superConcepts=new ArrayList<AtomicConcept>(); + try{ + //ConceptSet = rs.getSubsumptionHierarchy().getMoreGeneralConcepts(new AtomicConcept(Concept)); + //System.out.println(ConceptSet); + //Concept c=new AtomicConcept(Concept); + /*Set<AtomicConcept> s=rs.getAtomicConcepts(); + Set<Concept> sc=new TreeSet<Concept>(); + Iterator a=s.iterator(); + while (a.hasNext()) { + sc.add((Concept) a.next()); + } + sc=rs.subsumes(sc,new AtomicConcept(Concept));*/ + superConcepts=subsumesAll(SelectedConcept); + + //System.out.println("sizebefore: "+"size after:"+sc); + }catch (Exception e) {e.printStackTrace();} + + +// remove top + for (int j = 0; j < superConcepts.size(); ) { + //TODO no unique name assumption? + if(superConcepts.get(j).getName().equals(SelectedConcept.getName())){ + superConcepts.remove(j); + j=0; + continue; + } + if(superConcepts.get(j).getName().equals("TOP")){ + superConcepts.remove(j); + j=0; + continue; + } + j++; + } + + System.out.println("Found all those:"+ superConcepts); + + ac=null; + + if(superConcepts.size()==0){return al2s(al); }//TODO + else + { // add all negatives of all superclasses; + + //Iterator it=ConceptSet.iterator(); + for (int jj = 0; jj < superConcepts.size(); jj++) + { + ac=superConcepts.get(jj); + p("next this: "+ac.getName()); + Set negatives=rs.retrieval(ac); + Iterator i2 = negatives.iterator(); + indtmp=null; + while(i2.hasNext()){ + + indtmp=(Individual)i2.next(); + + if(!positives.contains(indtmp)){ + + p("added "+indtmp.getName()+" to NEGATIVES"); + al.add("added "+indtmp.getName()+" to NEGATIVES"); + negativeExamples.add(indtmp); + } + else{ + p("skipped "+indtmp.getName()); + al.add("skipped "+indtmp.getName()); + } + + } + }//endfor + return al2s(al); + } + + + } + + public ArrayList<AtomicConcept> subsumesAll(AtomicConcept c){ + Set s=rs.getAtomicConcepts(); + ArrayList<AtomicConcept> ret=new ArrayList<AtomicConcept>(); + Iterator i=s.iterator(); + while (i.hasNext()) { + AtomicConcept element = (AtomicConcept) i.next(); + if(rs.subsumes(element, c)) + { + ret.add(element); + } + + } + return ret; + } + public String[] getPositiveExamples(){ + String[] ret=new String[positiveExamples.size()]; + Iterator i=positiveExamples.iterator(); + int a=0; + while (i.hasNext()){ + ret[a++]=((Individual)i.next()).getName(); + } + //p("getPositiveEx"); + return ret; + } + public String[] getNegativeExamples(){ + String[] ret=new String[negativeExamples.size()]; + Iterator i=negativeExamples.iterator(); + int a=0; + while (i.hasNext()){ + ret[a++]=((Individual)i.next()).getName(); + } + //p("getNegativeEx"); + return ret; + } + + public String[] getIgnoredConcepts() { + String[] ret=new String[ignoredConcept.size()]; + Iterator i=ignoredConcept.iterator(); + int a=0; + while (i.hasNext()){ + ret[a++]=((String)i.next()); + } + //p("getNegativeEx"); + return ret; + } + + public String getSubsumptionHierarchy() throws NoOntologySelectedException { + try{ + return this.rs.getSubsumptionHierarchy().toString(); + }catch (Exception e) {throw new NoOntologySelectedException("Subsumptionhierarchy",e.getMessage());} + + } + + + + public boolean removeNegativeExample(String NegExample){ + p("removed from neg: "+NegExample); + return negativeExamples.remove(new Individual(NegExample)); + } + public boolean removePositiveExample(String PosExample){ + p("removed from pos: "+PosExample); + return positiveExamples.remove(new Individual(PosExample)); + } + + public boolean removeAllPositiveExamples(){ + positiveExamples = new TreeSet<Individual>(); + p("removing all positive examples"); + return true; + } + public boolean removeAllNegativeExamples(){ + negativeExamples = new TreeSet<Individual>(); + p("removing all negative examples"); + return true; + } + + public boolean removeAllExamples(){ + positiveExamples = new TreeSet<Individual>(); + negativeExamples = new TreeSet<Individual>(); + p("removing all examples"); + return true; + } + + public void removeIgnoredConcept(String concept) { + //ignoredConcept.add(concept); + this.ignoredConcept.remove(concept); + p("removed ignoredConcepts: "+concept); + } + + public String[] getInstances()throws NoOntologySelectedException{ + try{ + SortedSet<Individual> s=rs.getIndividuals(); + //System.out.println(s); + String[] ret=new String[s.size()]; + Iterator i=s.iterator(); + int a=0; + while (i.hasNext()){ + ret[a++]=((Individual)i.next()).getName(); + } + Arrays.sort(ret); + //p("getInstances"); + return ret; + }catch (Exception e) {throw new NoOntologySelectedException("Failed to get instances, no ontology selected","");} + } + + public String getCurrentOntologyURL()throws NoOntologySelectedException{ + p("getCurrentOntology: "+currentOntologyURL); + if(currentOntologyURL==null)throw new NoOntologySelectedException("Select Ontology First","quatsch"); + else return currentOntologyURL; + } + + public String getAlgorithmStatus(){ + return this.status; + } + + /** + * Specifies the URI of the ontology containing the background + * knowledge. Reads the ontology and sends it to the reasoner. + * + * @param ontologyURI The URI of the ontology to use. + */ + // gleiche Methoden mit verschiedenen Parametern sind offenbar problematisch + /* + @WebMethod + public void readOntology(String ontologyURI) { + readOntology(ontologyURI, "RDF/XML"); + } + */ + + + public void removeOntology() { + this.currentOntologyURL=null; + this.reasoner=null; + this.rs=null; + this.positiveExamples = new TreeSet<Individual>(); + this.negativeExamples = new TreeSet<Individual>(); + this.ignoredConcept=new TreeSet<String>(); + p("removing Ontology"); + + } + + /** + * Specifies the URI of the ontology containing the background + * knowledge and its format. Reads the ontology and sends it to + * the reasoner. + * + * @param ontologyURI The URI of the ontology to use. + * @param format "RDF/XML" or "N-TRIPLES". + */ + + + public void readOntology(String ontologyURL, String format) throws OntologyURLNotValid{ + this.currentOntologyURL=ontologyURL; + p("trying to read: "+ontologyURL+" ::"+format); + try{ + // this.ontologyURL = ontologyURL; + // this.ontologyFormat = format; + + // TODO: potentielles Sicherheitsrisiko, da man damit derzeit auch lokale Dateien + // laden könnte (Fix: nur http:// zulassen, kein file://) + URL ontology = null; + try { + ontology = new URL(ontologyURL); + } catch (MalformedURLException e1) { + this.removeOntology(); + throw new OntologyURLNotValid("The URL of the Ontology is not correct<br>\nCheck settings and URL","OntologyURLNotValid"); + + } + + OntologyFileFormat ofFormat; + if (format.equals("RDF/XML")) + ofFormat = OntologyFileFormat.RDF_XML; + else + ofFormat = OntologyFileFormat.N_TRIPLES; + + Map<URL, OntologyFileFormat> m = new HashMap<URL, OntologyFileFormat>(); + m.put(ontology, ofFormat); + + // Default-URI für DIG-Reasoner setzen + + try { + Config.digReasonerURL = new URL(reasonerURL); + } catch (MalformedURLException e) { + // Exception tritt nie auf, da URL korrekt + e.printStackTrace(); + } + + reasoner = Main.createReasoner(new KB(), m); + rs = new ReasoningService(reasoner); + + Main.autoDetectConceptsAndRoles(rs); + reasoner.prepareSubsumptionHierarchy(); + if (Config.Refinement.improveSubsumptionHierarchy) { + try { + reasoner.getSubsumptionHierarchy().improveSubsumptionHierarchy(); + } catch (ReasoningMethodUnsupportedException e) { + // solange DIG-Reasoner eingestellt ist, schlägt diese Operation nie fehl + e.printStackTrace(); + } + } + p(rs.getSubsumptionHierarchy().toString()); + //rs.getRoleMembers(arg0) + } + catch (DoesNotExistException e) { + this.removeOntology(); + throw new OntologyURLNotValid("The URL of the Ontology is not correct<br>\nCheck settings and URL","OntologyURLNotValid"); + } + catch (JenaException e) { + e.printStackTrace();} + + + /*catch(Exception e2) { + + //p("exception:"+e.getMessage()); + e2.printStackTrace(); + }*/ + p("Ontology read: "+currentOntologyURL); + } + + + public void learnMonitored(){ + addOption(new ConfigurationOption("refinement","ignoredConcepts",ignoredConcept)); + this.lm=new LearnMonitor(this); + this.lm.start(); + //this.lm.learn(this); + } + + /*public void relearn(){ + //TreeSet<String> s=new TreeSet<String>(); + //new ConfigurationOption(); + this.lm=new LearnMonitor(this); + this.lm.start(); + //this.lm.learn(this); + }*/ + + + public String[] getAtomicConcepts()throws NoOntologySelectedException{ + try{ + return SortedSet2StringListConcepts( rs.getAtomicConcepts()); + }catch (Exception e) {throw new NoOntologySelectedException("Select Ontology First","ddddd");} + } + + public String[] retrieval(String Concept)throws NoOntologySelectedException{ + return SortedSet2StringListIndividuals(rs.retrieval(new AtomicConcept(Concept))); + } + + public String[] getAtomicRoles()throws NoOntologySelectedException{ + return SortedSet2StringListRoles( rs.getAtomicRoles()); + } + + public String[] getIndividualsForARole(String Role)throws NoOntologySelectedException{ + Map m=rs.getRoleMembers(new AtomicRole(Role)); + Set s=m.keySet(); + return SortedSet2StringListIndividuals(s); + } + + public synchronized void stop(){ + System.out.println("ROL"+this.ROL); + + System.out.println("lm"+lm); + System.out.println("lmstate"+lm.getState()); + System.out.println("lmalive"+lm.isAlive()); + System.out.println("lminterrupt"+lm.isInterrupted()); + this.ROL.stop(); + /*try{ + synchronized (this.lm) { + //this.lm.yield(); + } + }catch (Exception e) {e.printStackTrace();}*/ + System.out.println("lmstate"+lm.getState()); + System.out.println("lmalive"+lm.isAlive()); + System.out.println("lminterrupt"+lm.isInterrupted()); + + //this.ROL.stop(); + //this.lm.interrupt(); + + //this.lm.end(); + //this.lm.notify(); + } + + public String[] SortedSet2StringListIndividuals(Set s){ + + String[] ret=new String[s.size()]; + Iterator i=s.iterator(); + int a=0; + while (i.hasNext()){ + ret[a++]=((Individual)i.next()).getName(); + } + Arrays.sort(ret); + return ret; + } + + public String[] SortedSet2StringListConcepts(Set s){ + + String[] ret=new String[s.size()]; + Iterator i=s.iterator(); + int a=0; + while (i.hasNext()){ + ret[a++]=((AtomicConcept)i.next()).getName(); + } + Arrays.sort(ret); + return ret; + } + public String[] SortedSet2StringListRoles(Set s){ + + String[] ret=new String[s.size()]; + Iterator i=s.iterator(); + int a=0; + while (i.hasNext()){ + ret[a++]=((AtomicRole)i.next()).getName(); + } + Arrays.sort(ret); + return ret; + } + + public String[] al2s(ArrayList<String> al){ + String[] ret=new String[al.size()]; + for (int i = 0; i < al.size(); i++) { + ret[i]=al.get(i); + } + return ret; + } + public void p(String s){ + if(debug_flag){ + System.out.println("\t"+s); + } + + } +} Modified: trunk/src/dl-learner/org/dllearner/server/DLLearnerWS.java =================================================================== --- trunk/src/dl-learner/org/dllearner/server/DLLearnerWS.java 2007-08-20 15:00:11 UTC (rev 8) +++ trunk/src/dl-learner/org/dllearner/server/DLLearnerWS.java 2007-08-20 15:23:17 UTC (rev 9) @@ -1,190 +1,223 @@ -package org.dllearner.server; - -import java.net.MalformedURLException; -import java.net.URL; -import java.util.HashMap; -import java.util.Map; -import java.util.SortedSet; -import java.util.TreeSet; - -import javax.annotation.PostConstruct; -import javax.annotation.PreDestroy; -import javax.jws.WebMethod; -import javax.jws.WebService; -import javax.jws.soap.SOAPBinding; - -import org.dllearner.Config; -import org.dllearner.LearningProblem; -import org.dllearner.Main; -import org.dllearner.OntologyFileFormat; -import org.dllearner.algorithms.refinement.ROLearner; -import org.dllearner.dl.Individual; -import org.dllearner.dl.KB; -import org.dllearner.reasoning.Reasoner; -import org.dllearner.reasoning.ReasoningMethodUnsupportedException; -import org.dllearner.reasoning.ReasoningService; - -/** - * Offene Fragen: - * - * Welche Rückgabetypen sind erlaubt? - * Wie behandelt man Exceptions (z.B. aus angegebener URI kann keine Ontologie - * gelesen werden)? - * - * @author Jens Lehmann - * - */ -@WebService(name = "DLLearnerWebService") -@SOAPBinding(style = SOAPBinding.Style.RPC) -public class DLLearnerWS { - - // private String ontologyURL; - // private String ontologyFormat; - private Reasoner reasoner; - private ReasoningService rs; - private SortedSet<Individual> positiveExamples; - private SortedSet<Individual> negativeExamples; - - /* - public DLLearnerWS() { - System.out.println("call"); - }*/ - - @PostConstruct - public void postConstruct() { - System.out.println("post construct"); - positiveExamples = new TreeSet<Individual>(); - negativeExamples = new TreeSet<Individual>(); - } - - @PreDestroy - public void preConstruct() { - System.out.println("pre destroy"); - } - - /** - * Specifies the URI of the ontology containing the background - * knowledge. Reads the ontology and sends it to the reasoner. - * - * @param ontologyURI The URI of the ontology to use. - */ - // gleiche Methoden mit verschiedenen Parametern sind offenbar problematisch - /* - @WebMethod - public void readOntology(String ontologyURI) { - readOntology(ontologyURI, "RDF/XML"); - } - */ - - /** - * Specifies the URI of the ontology containing the background - * knowledge and its format. Reads the ontology and sends it to - * the reasoner. - * - * @param ontologyURI The URI of the ontology to use. - * @param format "RDF/XML" or "N-TRIPLES". - */ - @WebMethod - public void readOntology(String ontologyURL, String format) { - // this.ontologyURL = ontologyURL; - // this.ontologyFormat = format; - - // TODO: potentielles Sicherheitsrisiko, da man damit derzeit auch lokale Dateien - // laden könnte (Fix: nur http:// zulassen, kein file://) - URL ontology = null; - try { - ontology = new URL(ontologyURL); - } catch (MalformedURLException e1) { - e1.printStackTrace(); - } - - OntologyFileFormat ofFormat; - if (format.equals("RDF/XML")) - ofFormat = OntologyFileFormat.RDF_XML; - else - ofFormat = OntologyFileFormat.N_TRIPLES; - - Map<URL, OntologyFileFormat> m = new HashMap<URL, OntologyFileFormat>(); - m.put(ontology, ofFormat); - - // Default-URI für DIG-Reasoner setzen - try { - Config.digReasonerURL = new URL("http://localhost:8081"); - } catch (MalformedURLException e) { - // Exception tritt nie auf, da URL korrekt - e.printStackTrace(); - } - - reasoner = Main.createReasoner(new KB(), m); - rs = new ReasoningService(reasoner); - } - - /* - // String[] funktioniert leider noch nicht - @WebMethod - public void addPositiveExamples(String[] posExamples) { - for(String example : posExamples) - positiveExamples.add(new Individual(example)); - } - - @WebMethod - public void addNegativeExamples(String[] negExamples) { - for(String example : negExamples) - negativeExamples.add(new Individual(example)); - } - */ - - @WebMethod - public void addPositiveExample(String posExample) { - positiveExamples.add(new Individual(posExample)); - } - - @WebMethod - public void addNegativeExample(String negExample) { - negativeExamples.add(new Individual(negExample)); - } - - @WebMethod - public void removePositiveExample(String posExample) { - positiveExamples.remove(new Individual(posExample)); - } - - @WebMethod - public void removeNegativeExample(String negExample) { - negativeExamples.remove(new Individual(negExample)); - } - - @WebMethod - public String learnConcept() { - // notwendige Vorverarbeitungsschritte für den Lernalgorithmus - // - es müssen ein paar Konzepte, die ev. von Jena generiert wurden ignoriert - // werden - // - die Subsumptionhierarchie muss erstellt werden - // - die Subsumptionhierarchie wird verbessert um das Lernen effizienter zu machen - Main.autoDetectConceptsAndRoles(rs); - reasoner.prepareSubsumptionHierarchy(); - if (Config.Refinement.improveSubsumptionHierarchy) { - try { - reasoner.getSubsumptionHierarchy().improveSubsumptionHierarchy(); - } catch (ReasoningMethodUnsupportedException e) { - // solange DIG-Reasoner eingestellt ist, schlägt diese Operation nie fehl - e.printStackTrace(); - } - } - - System.out.println(positiveExamples); - System.out.println(negativeExamples); - - LearningProblem learningProblem = new LearningProblem(rs, positiveExamples, negativeExamples); - // erstmal wird nur der Refinement-Learner als Web-Service angeboten - ROLearner learner = new ROLearner(learningProblem); - return learner.getBestSolution().toString(); - } - - // Testmethode - @WebMethod - public String hello(String name) { - return "Hello " + name + "!"; - } - +package org.dllearner.server; + +import java.util.HashMap; +import java.util.Random; + +import javax.jws.WebMethod; +import javax.jws.WebService; +import javax.jws.soap.SOAPBinding; + +import org.dllearner.server.exceptions.ClientNotKnownException; +import org.dllearner.server.exceptions.NoOntologySelectedException; +import org.dllearner.server.exceptions.OntologyURLNotValid; + +/** + * Offene Fragen: + * + * Welche Rückgabetypen sind erlaubt? + * Wie behandelt man Exceptions (z.B. aus angegebener URI kann keine Ontologie + * gelesen werden)? + * + * @author Jens Lehmann + * + */ +@WebService(name = "DLLearnerWebService") +@SOAPBinding(style = SOAPBinding.Style.RPC) +public class DLLearnerWS { + Random rand=new Random(); + private HashMap<Integer, ClientState> clients; + + // private String ontologyURL; + // private String ontologyFormat; + + + + public DLLearnerWS(){ + this.clients=new HashMap<Integer, ClientState>(); + + } + + /** + * + * + * + */ + @WebMethod + public int getID(){ + int id=rand.nextInt(); + while (id<=0){ + id=rand.nextInt(); + } + + // dont change to local function get, cause of exception + ClientState c=this.clients.get(new Long(id)); + if(c!=null){ + return getID(); + } + else { + this.clients.put(new Integer(id), new ClientState()); + System.out.println("new Client with id: "+id); + return id; + } + + } + + @WebMethod + public void addPositiveExample(int id,String posExample) throws ClientNotKnownException{ + ClientState c=getClientState(id); + c.addPositiveExample(posExample); + //positiveExamples.add(new Individual(posExample)); + } + @WebMethod + public void addNegativeExample(int id,String negExample) throws ClientNotKnownException { + ClientState c=getClientState(id); + c.addNegativeExample(negExample); + } + @WebMethod + public void addIgnoredConcept(int id,String concept)throws ClientNotKnownException { + getClientState(id).addIgnoredConcept(concept); + } + + @WebMethod + public String[] selectInstancesForAConcept(int id,String Concept)throws ClientNotKnownException,NoOntologySelectedException{ + return getClientState(id).selectInstancesForAConcept(Concept); + } + + + @WebMethod + public String[] getPositiveExamples(int id)throws ClientNotKnownException{ + ClientState c=getClientState(id); + return c.getPositiveExamples(); + } + @WebMethod + public String[] getNegativeExamples(int id)throws ClientNotKnownException{ + ClientState c=getClientState(id); + return c.getNegativeExamples(); + } + @WebMethod + public String[] getIgnoredConcepts(int id)throws ClientNotKnownException{ + return getClientState(id).getIgnoredConcepts(); + } + + @WebMethod + public boolean removePositiveExample(int id, String pos)throws ClientNotKnownException{ + return getClientState(id).removePositiveExample(pos); + } + + @WebMethod + public boolean removeNegativeExample(int id, String neg)throws ClientNotKnownException{ + return getClientState(id).removeNegativeExample(neg); + } + @WebMethod + public boolean removeAllExamples(int id)throws ClientNotKnownException{ + return getClientState(id).removeAllExamples(); + } + @WebMethod + public boolean removeAllPositiveExamples(int id)throws ClientNotKnownException{ + return getClientState(id).removeAllPositiveExamples(); + } + @WebMethod + public boolean removeAllNegativeExamples(int id)throws ClientNotKnownException{ + return getClientState(id).removeAllNegativeExamples(); + } + @WebMethod + public void removeIgnoredConcept(int id,String concept)throws ClientNotKnownException{ + getClientState(id).removeIgnoredConcept(concept); + } + + @WebMethod + public String getCurrentOntologyURL(int id)throws ClientNotKnownException,NoOntologySelectedException{ + return getClientState(id).getCurrentOntologyURL(); + + } + + @WebMethod + public String[] getInstances(int id)throws ClientNotKnownException,NoOntologySelectedException{ + return getClientState(id).getInstances(); + } + + @WebMethod + public String[] getAtomicConcepts(int id)throws ClientNotKnownException,NoOntologySelectedException{ + return getClientState(id).getAtomicConcepts(); + } + + @WebMethod + public String[] getAtomicRoles(int id)throws ClientNotKnownException,NoOntologySelectedException{ + return getClientState(id).getAtomicRoles(); + } + @WebMethod + public String[] getIndividualsForARole(int id,String Role)throws ClientNotKnownException, NoOntologySelectedException{ + return getClientState(id).getIndividualsForARole(Role); + } + @WebMethod + public String getSubsumptionHierarchy(int id)throws ClientNotKnownException, NoOntologySelectedException{ + return getClientState(id).getSubsumptionHierarchy(); + } + + @WebMethod + public String[] retrieval(int id,String Concept)throws ClientNotKnownException,NoOntologySelectedException{ + return getClientState(id).retrieval(Concept); + } + + @WebMethod + public void readOntology(int id,String ontologyURL, String format)throws ClientNotKnownException,OntologyURLNotValid{ + getClientState(id).readOntology(ontologyURL, format); + + } + + @WebMethod + public void removeOntology(int id)throws ClientNotKnownException{ + getClientState(id).removeOntology(); + } + + @WebMethod + public String learnConcept(int id)throws ClientNotKnownException{ + return "Deprecated method"; + + } + + + @WebMethod + public String getAlgorithmStatus(int id ) throws ClientNotKnownException{ + + return getClientState(id).getAlgorithmStatus(); + } + + + @WebMethod + public void learnMonitored(int id )throws ClientNotKnownException{ + getClientState(id).learnMonitored(); + } + /*@WebMethod + public void relearn(int id,String Concept )throws ClientNotKnownException{ + getClientState(id).relearn(Concept); + }*/ + + @WebMethod + public String getLastResult(int id)throws ClientNotKnownException{ + return getClientState(id).getLastResult(); + } + + @WebMethod + public void stop(int id)throws ClientNotKnownException{ + getClientState(id).stop(); + } + + + //*************************USER MANAGEMENT + + public ClientState getClientState(int id)throws ClientNotKnownException{ + System.out.println("Request from "+id); + ClientState c=this.clients.get(new Integer(id)); + if(c==null){ + //System.out.println(clients.keySet().toString()); + throw new ClientNotKnownException("Client with id: "+id+" is not known","ClientNotKnownException");}; + return c; + + } + + + + + } \ No newline at end of file Added: trunk/src/dl-learner/org/dllearner/server/DLLearnerWS2.java =================================================================== --- trunk/src/dl-learner/org/dllearner/server/DLLearnerWS2.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/server/DLLearnerWS2.java 2007-08-20 15:23:17 UTC (rev 9) @@ -0,0 +1,68 @@ +package org.dllearner.server; + +import javax.jws.WebMethod; +import javax.jws.WebService; +import javax.jws.soap.SOAPBinding; + +import org.dllearner.server.exceptions.ClientNotKnownException; + + +/** + * Offene Fragen: + * + * Welche Rückgabetypen sind erlaubt? + * Wie behandelt man Exceptions (z.B. aus angegebener URI kann keine Ontologie + * gelesen werden)? + * + * @author Jens Lehmann + * + */ +@WebService(name = "DLLearnerWebService") + +@SOAPBinding(style = SOAPBinding.Style.RPC) +public class DLLearnerWS2 { + + /* + // String[] funktioniert leider noch nicht + @WebMethod + public void addPositiveExamples(String[] posExamples) { + for(String example : posExamples) + positiveExamples.add(new Individual(example)); + } + + @WebMethod + public void addNegativeExamples(String[] negExamples) { + for(String example : negExamples) + negativeExamples.add(new Individual(example)); + } + */ + + @WebMethod + /** + * @param name + * + * @return The sum + * @throws AddNumbersException + * if any of the numbers to be added is negative. + * + **/ + public String hellosimple(String name) throws ClientNotKnownException{ + /*for (int i = 0; i < name.length; i++) { + name[i]=i+"nnnn<br>"; + }*/ + if(name.equals("aa"))throw new ClientNotKnownException("a","b"); + + return "bbb"; + } + + + // Testmethode + @WebMethod + public String hello(String name){ + name=null; + //name.substring(5); + //throw new NullPointerException(); + return "Hello " + name + "!"; + } + +} \ No newline at end of file Modified: trunk/src/dl-learner/org/dllearner/server/DLLearnerWSStart.java =================================================================== --- trunk/src/dl-learner/org/dllearner/server/DLLearnerWSStart.java 2007-08-20 15:00:11 UTC (rev 8) +++ trunk/src/dl-learner/org/dllearner/server/DLLearnerWSStart.java 2007-08-20 15:23:17 UTC (rev 9) @@ -1,42 +1,71 @@ -package org.dllearner.server; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; - -import javax.xml.ws.Endpoint; - -public class DLLearnerWSStart { - - public static void main(String[] args) { - String url = "http://localhost:8181/services"; - if (args.length > 0) - url = args[0]; - - System.out.print("Starting DL-Learner web service at " + url + " ... "); - Endpoint endpoint = Endpoint.publish(url, new DLLearnerWS()); - System.out.println("OK."); - - System.out.println("Type \"exit\" to terminate web service."); - boolean terminate = false; - String inputString = ""; - do { - BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); - - try { - inputString = input.readLine(); - } catch (IOException e) { - e.printStackTrace(); - } - - if (inputString.equals("exit")) - terminate = true; - - } while (!terminate); - - System.out.print("Stopping web service ... "); - endpoint.stop(); - System.out.println("OK."); - } - -} +package org.dllearner.server; + + + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; + +import javax.xml.ws.Endpoint; + +import com.sun.net.httpserver.HttpContext; +import com.sun.net.httpserver.HttpServer; + + +public class DLLearnerWSStart { + + public static void main(String[] args) { + String url = "http://139.18.114.78:8181/services"; + if (args.length > 0) + url = args[0]; + try{ + + InetSocketAddress isa=new InetSocketAddress("localhost",8181); + HttpServer server = HttpServer.create(isa, 5); + ExecutorService threads = Executors.newFixedThreadPool(5); + server.setExecutor(threads); + server.start(); + + System.out.print("Starting DL-Learner web service at http://" + + isa.getHostName()+":"+isa.getPort()+ "/services ... "); + Endpoint endpoint = Endpoint.create(new DLLearnerWS()); + //Endpoint endpoint = Endpoint.create(new CustomDataClass()); + HttpContext context = server.createContext("/services"); + endpoint.publish(context); + //Endpoint endpoint = Endpoint.publish(url, new DLLearnerWS()); + + System.out.println("OK."); + + + + System.out.println("Type \"exit\" to terminate web service."); + boolean terminate = false; + String inputString = ""; + do { + BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); + + try { + inputString = input.readLine(); + } catch (IOException e) { + e.printStackTrace(); + } + + if (inputString.equals("exit")) + terminate = true; + + } while (!terminate); + + System.out.print("Stopping web service ... "); + endpoint.stop(); + + server.stop(1); + threads.shutdown(); + System.out.println("OK."); + }catch (Exception e) {e.printStackTrace();} + } + +} Added: trunk/src/dl-learner/org/dllearner/server/DLLearnerWSoriginal.java =================================================================== --- trunk/src/dl-learner/org/dllearner/server/DLLearnerWSoriginal.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/server/DLLearnerWSoriginal.java 2007-08-20 15:23:17 UTC (rev 9) @@ -0,0 +1,166 @@ +package org.dllearner.server; + +import java.net.MalformedURLException; +import java.net.URL; +import java.util.HashMap; +import java.util.Map; +import java.util.SortedSet; +import java.util.TreeSet; + +import javax.jws.WebMethod; +import javax.jws.WebService; +import javax.jws.soap.SOAPBinding; + +import org.dllearner.Config; +import org.dllearner.LearningProblem; +import org.dllearner.Main; +import org.dllearner.OntologyFileFormat; +import org.dllearner.algorithms.refinement.ROLearner; +import org.dllearner.dl.Individual; +import org.dllearner.dl.KB; +import org.dllearner.reasoning.Reasoner; +import org.dllearner.reasoning.ReasoningMethodUnsupportedException; +import org.dllearner.reasoning.ReasoningService; + +/** + * Offene Fragen: + * + * Welche Rückgabetypen sind erlaubt? + * Wie behandelt man Exceptions (z.B. aus angegebener URI kann keine Ontologie + * gelesen werden)? + * + * @author Jens Lehmann + * + */ +@WebService(name = "DLLearnerWebService") +@SOAPBinding(style = SOAPBinding.Style.RPC) +public class DLLearnerWSoriginal { + + // private String ontologyURL; + // private String ontologyFormat; + private Reasoner reasoner; + private ReasoningService rs; + private SortedSet<Individual> positiveExamples = new TreeSet<Individual>(); + private SortedSet<Individual> negativeExamples = new TreeSet<Individual>(); + + /** + * Specifies the URI of the ontology containing the background + * knowledge. Reads the ontology and sends it to the reasoner. + * + * @param ontologyURI The URI of the ontology to use. + */ + // gleiche Methoden mit verschiedenen Parametern sind offenbar problematisch + /* + @WebMethod + public void readOntology(String ontologyURI) { + readOntology(ontologyURI, "RDF/XML"); + } + */ + + /** + * Specifies the URI of the ontology containing the background + * knowledge and its format. Reads the ontology and sends it to + * the reasoner. + * + * @param ontologyURI The URI of the ontology to use. + * @param format "RDF/XML" or "N-TRIPLES". + */ + @WebMethod + public void readOntology(String ontologyURL, String format) { + // this.ontologyURL = ontologyURL; + // this.ontologyFormat = format; + + // TODO: potentielles Sicherheitsrisiko, da man damit derzeit auch lokale Dateien + // laden könnte (Fix: nur http:// zulassen, kein file://) + URL ontology = null; + try { + ontology = new URL(ontologyURL); + } catch (MalformedURLException e1) { + e1.printStackTrace(); + } + + OntologyFileFormat ofFormat; + if (format.equals("RDF/XML")) + ofFormat = OntologyFileFormat.RDF_XML; + else + ofFormat = OntologyFileFormat.N_TRIPLES; + + Map<URL, OntologyFileFormat> m = new HashMap<URL, OntologyFileFormat>(); + m.put(ontology, ofFormat); + + // Default-URI für DIG-Reasoner setzen + try { + Config.digReasonerURL = new URL("http://localhost:8081"); + } catch (MalformedURLException e) { + // Exception tritt nie auf, da URL korrekt + e.printStackTrace(); + } + + reasoner = Main.createReasoner(new KB(), m); + + rs = new ReasoningService(reasoner); + + } + + + @WebMethod + public String[] testString(String c) { + + return new String[]{"a","b"}; + } + + // String[] funktioniert leider noch nicht + @WebMethod + public void addPositiveExamples(String[] posExamples) { + for(String example : posExamples) + positiveExamples.add(new Individual(example)); + } + + @WebMethod + public void addNegativeExamples(String[] negExamples) { + for(String example : negExamples) + negativeExamples.add(new Individual(example)); + } + + + @WebMethod + public void addPositiveExample(String posExample) { + positiveExamples.add(new Individual(posExample)); + } + + @WebMethod + public void addNegativeExample(String negExample) { + negativeExamples.add(new Individual(negExample)); + } + + @WebMethod + public String learnConcept() { + // notwendige Vorverarbeitungsschritte für den Lernalgorithmus + // - es müssen ein paar Konzepte, die ev. von Jena generiert wurden ignoriert + // werden + // - die Subsumptionhierarchie muss erstellt werden + // - die Subsumptionhierarchie wird verbessert um das Lernen effizienter zu machen + Main.autoDetectConceptsAndRoles(rs); + reasoner.prepareSubsumptionHierarchy(); + if (Config.Refinement.improveSubsumptionHierarchy) { + try { + reasoner.getSubsumptionHierarchy().improveSubsumptionHierarchy(); + } catch (ReasoningMethodUnsupportedException e) { + // solange DIG-Reasoner eingestellt ist, schlägt diese Operation nie fehl + e.printStackTrace(); + } + } + + LearningProblem learningProblem = new LearningProblem(rs, positiveExamples, negativeExamples); + // erstmal wird nur der Refinement-Learner als Web-Service angeboten + ROLearner learner = new ROLearner(learningProblem); + return learner.getBestSolution().toString(); + } + + // Testmethode + @WebMethod + public String hello(String name) { + return "Hello " + name + "!"; + } + +} \ No newline at end of file Added: trunk/src/dl-learner/org/dllearner/server/LearnMonitor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/server/LearnMonitor.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/server/LearnMonitor.java 2007-08-20 15:23:17 UTC (rev 9) @@ -0,0 +1,81 @@ +package org.dllearner.server; + +import org.dllearner.Config; +import org.dllearner.LearningProblem; +import org.dllearner.Main; +import org.dllearner.algorithms.refinement.ROLearner; +import org.dllearner.reasoning.ReasoningMethodUnsupportedException; + +public class LearnMonitor extends Thread { + + + private ClientState c; + private boolean active = false; + + //private ROLearner ROL; + + public LearnMonitor(ClientState c){ + this.c=c; + } + + + public void end(){ + + System.out.println("trying to end"); + System.out.println("ROL2"+c.ROL); + this.c.ROL.stop(); + c.setLastResult(c.ROL.getBestSolution().toString()); + c.setStatus("stopped"); + } + + public void learn(){ + + this.start(); + + } + + public void run(){ + try{ + c.setStatus("still running"); + active=true; + c.setStatus("running"); + + // notwendige Vorverarbeitungsschritte für den Lernalgorithmus + // - es müssen ein paar Konzepte, die ev. von Jena generiert wurden ignoriert + // werden + // - die Subsumptionhierarchie muss erstellt werden + // - die Subsumptionhierarchie wird verbessert um das Lernen effizienter zu machen + Main.autoDetectConceptsAndRoles(c.getRs()); + c.getReasoner().prepareSubsumptionHierarchy(); + if (Config.Refinement.improveSubsumptionHierarchy) { + try { + c.getReasoner().getSubsumptionHierarchy().improveSubsumptionHierarchy(); + } catch (ReasoningMethodUnsupportedException e) { + // solange DIG-Reasoner eingestellt ist, schlägt diese Operation nie fehl + e.printStackTrace(); + } + } + c.p("learning started"); + LearningProblem learningProblem = new LearningProblem(c.getRs(), c.getPosExamples(), c.getNegExamples()); + // erstmal wird nur der Refinement-Learner als Web-Service angeboten + //System.out.println("aaaa"); + c.ROL = new ROLearner(learningProblem); + + c.ROL.start(); + //new ROLearner(); + //c.p(("ROL1"+ROL)); + + + + + + + //c.setLastResult(c.ROL.getBestSolution().toString()); + c.setLastResult(c.ROL.getBestSolution().toString()); + c.setStatus("finished"); + + }catch (Exception e) {e.printStackTrace();} + finally{active=false;}; + } + +} Added: trunk/src/dl-learner/org/dllearner/server/exceptions/ClientNotKnownException.java =================================================================== --- trunk/src/dl-learner/org/dllearner/server/exceptions/ClientNotKnownException.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/server/exceptions/ClientNotKnownException.java 2007-08-20 15:23:17 UTC (rev 9) @@ -0,0 +1,14 @@ +package org.dllearner.server.exceptions; + +public class ClientNotKnownException extends Exception { + String detail; + + public ClientNotKnownException (String message, String detail) { + super (message); + this.detail = detail; + } + + public String getDetail () { + return detail; + } +} Added: trunk/src/dl-learner/org/dllearner/server/exceptions/NoOntologySelectedException.java =================================================================== --- trunk/src/dl-learner/org/dllearner/server/exceptions/NoOntologySelectedException.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/server/exceptions/NoOntologySelectedException.java 2007-08-20 15:23:17 UTC (rev 9) @@ -0,0 +1,14 @@ +package org.dllearner.server.exceptions; + +public class NoOntologySelectedException extends Exception { + String detail; + + public NoOntologySelectedException (String message, String detail) { + super (message); + this.detail = detail; + } + + public String getDetail () { + return detail; + } +} Added: trunk/src/dl-learner/org/dllearner/server/exceptions/OntologyURLNotValid.java =================================================================== --- trunk/src/dl-learner/org/dllearner/server/exceptions/OntologyURLNotValid.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/server/exceptions/OntologyURLNotValid.java 2007-08-20 15:23:17 UTC (rev 9) @@ -0,0 +1,14 @@ +package org.dllearner.server.exceptions; + +public class OntologyURLNotValid extends Exception { + String detail; + + public OntologyURLNotValid (String message, String detail) { + super (message); + this.detail = detail; + } + + public String getDetail () { + return detail; + } +} Added: trunk/src/dl-learner/org/dllearner/server/jaxws/ClientNotKnownExceptionBean.java =================================================================== --- trunk/src/dl-learner/org/dllearner/server/jaxws/ClientNotKnownExceptionBean.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/server/jaxws/ClientNotKnownExceptionBean.java 2007-08-20 15:23:17 UTC (rev 9) @@ -0,0 +1,63 @@ + +package org.dllearner.server.jaxws; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + * This class was generated by the JAXWS SI. + * JAX-WS RI 2.0_02-b08-fcs + * Generated source version: 2.0_02 + * + */ +@XmlRootElement(name = "ClientNotKnownException", namespace = "http://ws/") +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "ClientNotKnownException", namespace = "http://ws/", propOrder = { + "detail", + "message" +}) +public class ClientNotKnownExceptionBean { + + private String detail; + private String message; + + /** + * + * @return + * returns String + */ + public String getDetail() { + return this.detail; + } + + /** + * + * @param detail + * the value for the detail property + */ + public void setDetail(String detail) { + this.detail = detail; + } + + /** + * + * @return + * returns String + */ + public String getMessage() { + return this.message; + } + + /** + * + * @param message + * the value for the message property + */ + public void setMessage(String message) { + this.message = message; + } + +} Added: trunk/src/dl-learner/org/dllearner/server/jaxws/NoOntologySelectedExceptionBean.java =================================================================== --- trunk/src/dl-learner/org/dllearner/server/jaxws/NoOntologySelectedExceptionBean.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/server/jaxws/NoOntologySelectedExceptionBean.java 2007-08-20 15:23:17 UTC (rev 9) @@ -0,0 +1,63 @@ + +package org.dllearner.server.jaxws; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + * This class was generated by the JAXWS SI. + * JAX-WS RI 2.0_02-b08-fcs + * Generated source version: 2.0_02 + * + */ +@XmlRootElement(name = "NoOntologySelectedException", namespace = "http://ws/") +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "NoOntologySelectedException", namespace = "http://ws/", propOrder = { + "detail", + "message" +}) +public class NoOntologySelectedExceptionBean { + + private String detail; + private String message; + + /** + * + * @return + * returns String + */ + public String getDetail() { + return this.detail; + } + + /** + * + * @param detail + * the value for the detail property + */ + public void setDetail(String detail) { + this.detail = detail; + } + + /** + * + * @return + * returns String + */ + public String getMessage() { + return this.message; + } + + /** + * + * @param message + * the value for the message property + */ + public void setMessage(String message) { + this.message = message; + } + +} Added: trunk/src/dl-learner/org/dllearner/server/jaxws/OntologyURLNotValidBean.java =================================================================== --- trunk/src/dl-learner/org/dllearner/server/jaxws/OntologyURLNotValidBean.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/server/jaxws/OntologyURLNotValidBean.java 2007-08-20 15:23:17 UTC (rev 9) @@ -0,0 +1,63 @@ + +package org.dllearner.server.jaxws; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + * This class was generated by the JAXWS SI. + * JAX-WS RI 2.0_02-b08-fcs + * Generated source version: 2.0_02 + * + */ +@XmlRootElement(name = "OntologyURLNotValid", namespace = "http://ws/") +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "OntologyURLNotValid", namespace = "http://ws/", propOrder = { + "detail", + "message" +}) +public class OntologyURLNotValidBean { + + private String detail; + private String message; + + /** + * + * @return + * returns String + */ + public String getDetail() { + return this.detail; + } + + /** + * + * @param detail + * the value for the detail property + */ + public void setDetail(String detail) { + this.detail = detail; + } + + /** + * + * @return + * returns String + */ + public String getMessage() { + return this.message; + } + + /** + * + * @param message + * the value for the message property + */ + public void setMessage(String message) { + this.message = message; + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |