@@ -544,7 +544,7 @@ |
private Throwable process0() throws Exception { |
Resource[] resources = Binaries.getResourcesByType(getClass(), ResourceType.OMS_COMP); |
if (resources.length > 0) { |
- Class cl = getClass(); |
+ Class<?> cl = getClass(); |
if (!resources[0].file().isEmpty()) { |
String classname = resources[0].file(); |
cl = Thread.currentThread().getContextClassLoader().loadClass(classname); |
@@ -744,6 +744,7 @@ |
* @param mi |
* @deprecated |
*/ |
+ @Deprecated |
public final void setMetainfo(JSONObject mi) { |
metainfo = mi; |
} |
@@ -754,6 +755,7 @@ |
* @param parameter |
* @deprecated |
*/ |
+ @Deprecated |
public void setParam(JSONArray parameter) { |
param = parameter; |
} |
@@ -764,6 +766,7 @@ |
* @param req |
* @deprecated |
*/ |
+ @Deprecated |
public final void setRequest(JSONObject req) { |
request = req; |
} |
@@ -773,6 +776,7 @@ |
* Set the Parameter map |
* @deprecated |
*/ |
+ @Deprecated |
public final void setParamMap(Map<String, JSONObject> pm) { |
paramMap = pm; |
} |
@@ -873,7 +877,7 @@ |
*/ |
protected Set<String> getMetainfoNames() { |
Set<String> s = new TreeSet<>(); |
- Iterator i = getMetainfo().keys(); |
+ Iterator<?> i = getMetainfo().keys(); |
while (i.hasNext()) { |
s.add(i.next().toString()); |
} |
@@ -1569,6 +1573,7 @@ |
* @param val the value to store |
* @deprecated |
*/ |
+ @Deprecated |
protected void putResult(Object val) { |
results().put(val); |
} |
@@ -2200,7 +2205,7 @@ |
Resource[] resource = Binaries.getResourcesByType(getClass(), ResourceType.OMS_COMP); |
if (resource.length > 0) { |
try { |
- Class cl = getClass(); |
+ Class<?> cl = getClass(); |
if (!resource[0].file().isEmpty()) { |
String classname = resource[0].file(); |
cl = Thread.currentThread().getContextClassLoader().loadClass(classname); |
@@ -30,15 +30,19 @@ |
import java.io.InputStream; |
import java.util.LinkedHashSet; |
import java.util.Set; |
+import java.util.logging.Logger; |
|
/** |
* |
*/ |
+@Deprecated |
class MongoArchiveStore implements ArchiveStore { |
|
MongoClient mongo; |
String dbname; |
static final String fsColl = "fs"; |
+ |
+ static final Logger LOG = Logger.getLogger(MongoArchiveStore.class.getName()); |
|
|
MongoArchiveStore(String uri) { |
@@ -53,19 +57,20 @@ |
} // "mongodb://user:pass@host:port/db" |
|
|
- public synchronized void removeAll() { |
- DB db = mongo.getDB(dbname); |
- //Let's store the standard data in regular collection |
- DBCollection collection = db.getCollection(fsColl); |
- collection.remove(new BasicDBObject()); |
- // remove all file in the bucket |
- GridFS fileStore = new GridFS(db, fsColl); |
- fileStore.remove((DBObject) null); |
- } |
+// public synchronized void removeAll() { |
+// DB db = mongo.getDB(dbname); |
+// //Let's store the standard data in regular collection |
+// DBCollection collection = db.getCollection(fsColl); |
+// collection.remove(new BasicDBObject()); |
+// // remove all file in the bucket |
+// GridFS fileStore = new GridFS(db, fsColl); |
+// fileStore.remove((DBObject) null); |
+// } |
|
|
@Override |
public synchronized void archiveSession(String sid, ModelArchive ma, File f) throws Exception { |
+ LOG.info("ARCHIVE archiveSession : " + sid + " " + f); |
DB db = mongo.getDB(dbname); |
//Let's store the standard data in regular collection |
DBCollection collection = db.getCollection(fsColl); |
@@ -114,6 +119,8 @@ |
|
@Override |
public synchronized ModelArchive getArchive(String suid) throws Exception { |
+ LOG.info("ARCHIVE getArchive : " + suid ); |
+ |
DB db = mongo.getDB(dbname); |
DBCollection collection = db.getCollection(fsColl); |
BasicDBObject findQuery = new BasicDBObject("_id", suid); |
@@ -133,6 +140,8 @@ |
|
@Override |
public synchronized void removeArchive(String suid) { |
+ LOG.info("ARCHIVE removeArchive : " + suid); |
+ |
DB db = mongo.getDB(dbname); |
DBCollection collection = db.getCollection(fsColl); |
BasicDBObject q = new BasicDBObject("_id", suid); |
@@ -144,6 +153,8 @@ |
|
@Override |
public synchronized byte[] getFile(String suid, String filename) throws Exception { |
+ LOG.info("ARCHIVE getFile : " + suid + " " + filename); |
+ |
DB db = mongo.getDB(dbname); |
GridFS fileStore = new GridFS(db, fsColl); |
BasicDBObject query = new BasicDBObject("_id", suid); |
@@ -71,19 +71,19 @@ |
|
|
String getServicePath(Class<?> c) { |
- Path p = (Path) c.getAnnotation(Path.class); |
+ Path p = c.getAnnotation(Path.class); |
return (p == null) ? "" : p.value(); |
} |
|
|
String getServiceName(Class<?> c) { |
- Name p = (Name) c.getAnnotation(Name.class); |
+ Name p = c.getAnnotation(Name.class); |
return (p == null) ? "" : p.value(); |
} |
|
|
String getServiceDescription(Class<?> c) { |
- Description p = (Description) c.getAnnotation(Description.class); |
+ Description p = c.getAnnotation(Description.class); |
return (p == null) ? "" : p.value(); |
} |
|
@@ -188,8 +188,8 @@ |
private static final long DATE_AT_STARTUP = new Date().getTime(); |
private static final long DATE_AT_STARTUP_SEC = DATE_AT_STARTUP / 1000l; |
|
- private static SimpleCache<Class, Resource[]> rc = new SimpleCache<>(); |
- private static SimpleCache<Class, Boolean> extractCache = new SimpleCache<>(); |
+ private static SimpleCache<Class<?>, Resource[]> rc = new SimpleCache<>(); |
+ private static SimpleCache<Class<?>, Boolean> extractCache = new SimpleCache<>(); |
|
|
/** |
@@ -703,7 +703,7 @@ |
|
public static void extractAllResources(Class<?> c, SessionLogger LOG) throws ServiceException { |
// do this only once per class, hence the SimpleCache |
- extractCache.get(c, (Class k) -> { |
+ extractCache.get(c, (Class<?> k) -> { |
File csip_home = new File(Config.getString(CSIP_DIR)); |
csip_home.mkdirs(); |
for (Resource resource : getMergedResources(c)) { |
@@ -955,6 +955,7 @@ |
* @param in |
* @return the size in bytes. |
*/ |
+ @SuppressWarnings("fallthrough") |
public static long parseByteSize(String in) { |
in = in.trim().replaceAll(",", "."); |
try { |