de.deepamehta.core.util
Class DeepaMehtaUtils

Show UML class diagram
java.lang.Object
  extended by de.deepamehta.core.util.DeepaMehtaUtils

public class DeepaMehtaUtils
extends Object


Field Summary
private static String DM4_HOST_URL
           
private static Logger logger
           
 
Constructor Summary
DeepaMehtaUtils()
           
 
Method Summary
static void createAssociations(JSONArray assocs, DeepaMehtaService dms)
           
static void createAssociationTypes(JSONArray assocTypes, DeepaMehtaService dms)
           
static void createTopics(JSONArray topics, DeepaMehtaService dms)
           
static void createTopicTypes(JSONArray topicTypes, DeepaMehtaService dms)
           
static List<Long> idList(Collection objects)
           
static boolean isDeepaMehtaURL(URL url)
          Checks if an URL refers to this DeepaMehta installation.
static JSONArray objectsToJSON(Collection<? extends JSONEnabled> objects)
           
static void readMigrationFile(InputStream is, String migrationFileName, DeepaMehtaService dms)
          Creates types and topics from a JSON formatted input stream.
static JSONArray stringsToJson(Collection<String> strings)
           
static List toList(JSONArray o)
           
static Map toMap(JSONObject o)
           
static Map toMap(JSONObject o, Map map)
           
static String topicNames(Collection<? extends Topic> topics)
           
static List<TopicModel> toTopicModels(List<RelatedTopic> relTopics)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static Logger logger

DM4_HOST_URL

private static final String DM4_HOST_URL
Constructor Detail

DeepaMehtaUtils

public DeepaMehtaUtils()
Method Detail

isDeepaMehtaURL

public static boolean isDeepaMehtaURL(URL url)
Checks if an URL refers to this DeepaMehta installation. The check relies on the "dm4.host.url" system property.


idList

public static List<Long> idList(Collection objects)

toTopicModels

public static List<TopicModel> toTopicModels(List<RelatedTopic> relTopics)

topicNames

public static String topicNames(Collection<? extends Topic> topics)

toMap

public static Map toMap(JSONObject o)

toMap

public static Map toMap(JSONObject o,
                        Map map)

toList

public static List toList(JSONArray o)

stringsToJson

public static JSONArray stringsToJson(Collection<String> strings)

objectsToJSON

public static JSONArray objectsToJSON(Collection<? extends JSONEnabled> objects)

readMigrationFile

public static void readMigrationFile(InputStream is,
                                     String migrationFileName,
                                     DeepaMehtaService dms)
Creates types and topics from a JSON formatted input stream.

Parameters:
migrationFileName - The origin migration file. Used for logging only.

createTopicTypes

public static void createTopicTypes(JSONArray topicTypes,
                                    DeepaMehtaService dms)
                             throws Exception
Throws:
Exception

createAssociationTypes

public static void createAssociationTypes(JSONArray assocTypes,
                                          DeepaMehtaService dms)
                                   throws Exception
Throws:
Exception

createTopics

public static void createTopics(JSONArray topics,
                                DeepaMehtaService dms)
                         throws Exception
Throws:
Exception

createAssociations

public static void createAssociations(JSONArray assocs,
                                      DeepaMehtaService dms)
                               throws Exception
Throws:
Exception


Copyright © 2014. All Rights Reserved.