protected synchronized void addSession(Session session) { sessionsByID.put(session.getID(), session); }
protected synchronized void addSession(Session session) { sessionsByID.put(session.getID(), session); }
protected synchronized void removeSession(Session session) { String id = session.getID(); Session s2 = sessionsByID.get(id); if (session == s2) sessionsByID.remove(id); }
protected synchronized void removeSession(Session session) { String id = session.getID(); Session s2 = sessionsByID.get(id); if (session == s2) sessionsByID.remove(id); }
private IRI getIRIforSession(Session session) { // Use the Stanbol-internal namespace, so that the whole configuration can be ported. return new IRI(_NS_STANBOL_INTERNAL + Session.shortName + "/" + session.getID()); }
private IRI getIRIforSession(Session session) { // Use the Stanbol-internal namespace, so that the whole configuration can be ported. return new IRI(_NS_STANBOL_INTERNAL + Session.shortName + "/" + session.getID()); }
@POST public Response createSessionWithAutomaticId(@Context UriInfo uriInfo, @Context HttpHeaders headers) { Session s; try { s = sessionManager.createSession(); } catch (SessionLimitException e) { throw new WebApplicationException(e, FORBIDDEN); } String uri = uriInfo.getRequestUri().toString(); while (uri.endsWith("/")) uri = uri.substring(0, uri.length() - 1); uri += "/" + s.getID(); ResponseBuilder rb = Response.created(URI.create(uri)); // addCORSOrigin(servletContext, rb, headers); return rb.build(); }
log.error("-- has incompatible types in the meta-graph."); } else { log.debug("Removing all triples for session \"{}\".", session.getID()); Iterator<Triple> it; for (it = meta.filter(null, null, sessionur); it.hasNext();)
log.error("-- has incompatible types in the meta-graph."); } else { log.debug("Removing all triples for session \"{}\".", session.getID()); Iterator<Triple> it; for (it = meta.filter(null, null, sessionur); it.hasNext();)
log.debug("SUCCESS add ontology to session {}.", session.getID()); log.debug("Storage key : {}", key);
+ session.getID() + "/" + uri)); else rb = Response.seeOther(URI.create("/ontonet/session/" + session.getID())); } else if (rb == null) rb = Response.status(INTERNAL_SERVER_ERROR); for (String key : keys) session.addOntology(new StoredOntologySource(OntologyUtils.decode(key))); rb = Response.seeOther(URI.create("/ontonet/session/" + session.getID())); log.info("Appending scope \"{}\" to session \"{}\".", scid, session.getID()); session.attachScope(scid); log.info("Appended scope \"{}\".", scid); rb = Response.seeOther(URI.create("/ontonet/session/" + session.getID()));