當前位置: 首頁>>代碼示例>>Java>>正文


Java Vertex.getEdges方法代碼示例

本文整理匯總了Java中com.tinkerpop.blueprints.Vertex.getEdges方法的典型用法代碼示例。如果您正苦於以下問題:Java Vertex.getEdges方法的具體用法?Java Vertex.getEdges怎麽用?Java Vertex.getEdges使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.tinkerpop.blueprints.Vertex的用法示例。


在下文中一共展示了Vertex.getEdges方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: migrateContainer

import com.tinkerpop.blueprints.Vertex; //導入方法依賴的package包/類
private void migrateContainer(Vertex container) {

		boolean isPublished = false;
		Iterable<Edge> edges = container.getEdges(Direction.IN, "HAS_FIELD_CONTAINER");

		// Check whether the container is published
		for (Edge edge : edges) {
			String type = edge.getProperty("edgeType");
			if ("P".equals(type)) {
				isPublished = true;
			}
		}

		// The container is not published anywhere. Remove the bogus publish webroot info which otherwise causes publish webroot conflicts with new versions.
		if (!isPublished) {
			if (container.getProperty(WEBROOT_PUB) != null) {
				log.info("Found inconsistency on container {" + container.getProperty("uuid") + "}");
				container.removeProperty(WEBROOT_PUB);
				log.info("Inconsistency fixed");
			}
		}
	}
 
開發者ID:gentics,項目名稱:mesh,代碼行數:23,代碼來源:RemoveBogusWebrootProperty.java

示例2: migrateSchemaContainerRootEdges

import com.tinkerpop.blueprints.Vertex; //導入方法依賴的package包/類
/**
 * The edge label has change. Migrate existing edges.
 */
private void migrateSchemaContainerRootEdges(Vertex schemaRoot) {
	for (Edge edge : schemaRoot.getEdges(Direction.OUT, "HAS_SCHEMA_CONTAINER")) {
		Vertex container = edge.getVertex(Direction.IN);
		schemaRoot.addEdge("HAS_SCHEMA_CONTAINER_ITEM", container);
		edge.remove();
	}
}
 
開發者ID:gentics,項目名稱:mesh,代碼行數:11,代碼來源:ChangeTVCMigration.java

示例3: migrateTagFamilies

import com.tinkerpop.blueprints.Vertex; //導入方法依賴的package包/類
private void migrateTagFamilies(Vertex project) {
	Vertex tagFamilyRoot = project.getVertices(Direction.OUT, "HAS_TAGFAMILY_ROOT").iterator().next();
	for (Vertex tagFamily : tagFamilyRoot.getVertices(Direction.OUT, "HAS_TAG_FAMILY")) {

		// Check dates
		Object tagFamilyCreationTimeStamp = tagFamily.getProperty("creation_timestamp");
		if (tagFamilyCreationTimeStamp == null) {
			tagFamily.setProperty("creation_timestamp", System.currentTimeMillis());
		}
		Object tagFamilyEditTimeStamp = tagFamily.getProperty("last_edited_timestamp");
		if (tagFamilyEditTimeStamp == null) {
			tagFamily.setProperty("last_edited_timestamp", System.currentTimeMillis());
		}

		// Create a new tag root vertex for the tagfamily and link the tags to this vertex instead to the tag family itself.
		Vertex tagRoot = getGraph().addVertex("class:TagRootImpl");
		tagRoot.setProperty("ferma_type", "com.gentics.mesh.core.data.root.impl.TagRootImpl");
		tagRoot.setProperty("uuid", randomUUID());
		for (Edge tagEdge : tagFamily.getEdges(Direction.OUT, "HAS_TAG")) {
			Vertex tag = tagEdge.getVertex(Direction.IN);
			tagEdge.remove();
			tagRoot.addEdge("HAS_TAG", tag);
			tag.getEdges(Direction.OUT, "HAS_TAGFAMILY_ROOT").forEach(edge -> edge.remove());
			tag.addEdge("HAS_TAGFAMILY_ROOT", tagFamily);
			if (!tag.getEdges(Direction.OUT, "ASSIGNED_TO_PROJECT").iterator().hasNext()) {
				log.error("Tag {" + tag.getProperty("uuid") + " has no project assigned to it. Fixing it...");
				tag.addEdge("ASSIGNED_TO_PROJECT", project);
			}
			Object creationTimeStamp = tag.getProperty("creation_timestamp");
			if (creationTimeStamp == null) {
				tag.setProperty("creation_timestamp", System.currentTimeMillis());
			}
			Object editTimeStamp = tag.getProperty("last_edited_timestamp");
			if (editTimeStamp == null) {
				tag.setProperty("last_edited_timestamp", System.currentTimeMillis());
			}
		}
		tagFamily.addEdge("HAS_TAG_ROOT", tagRoot);
		if (!tagFamily.getEdges(Direction.OUT, "ASSIGNED_TO_PROJECT").iterator().hasNext()) {
			log.error("TagFamily {" + tagFamily.getProperty("uuid") + " has no project assigned to it. Fixing it...");
			tagFamily.addEdge("ASSIGNED_TO_PROJECT", project);
		}

		getOrFixUserReference(tagFamily, "HAS_EDITOR");
		getOrFixUserReference(tagFamily, "HAS_CREATOR");
	}

}
 
開發者ID:gentics,項目名稱:mesh,代碼行數:49,代碼來源:ChangeTVCMigration.java


注:本文中的com.tinkerpop.blueprints.Vertex.getEdges方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。