⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 createentry.java

📁 以remedy平台上构建的cmdb为基础
💻 JAVA
字号:
package com.remedy;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import com.andy.conn.*;
import com.andy.conn.ConnAR;
import com.remedy.arsys.api.ARException;
import com.remedy.arsys.api.ARServerUser;
import com.remedy.arsys.api.Entry;
import com.remedy.arsys.api.EntryFactory;
import com.remedy.arsys.api.EntryItem;
import com.remedy.arsys.api.NameID;

public class CreateEntry {

	 public int createEntry(String schema,ArrayList arraylist) throws ARException, IOException
	  {
		 int tag=0;
	     Entry entry=null;
	      EntryFactory entryMan=EntryFactory.getFactory();
	      entry= (Entry)entryMan.newInstance();
	      ARServerUser context = new ConnAR().GetARServerUser();
	      entry.setContext(context);
	      NameID name = new NameID(schema);
	      entry.setSchemaID(name);
	      // create entryItems
	      EntryItem[] entryItems =GeneralMethod.getEntryItemList(arraylist);
	      // set the entry items...
	      entry.setEntryItems(entryItems);
	      entry.create();
	      tag=1;
	      System.out.println(" created in: " + schema);
	      System.out.println("create success");
	      entryMan.releaseInstance(entry);
	      return tag;
	  }
	 public int createEntry(String schema,HashMap map) throws ARException, IOException
	 {
		 ArrayList fieldList=new ArrayList();
		 fieldList=GetFieldNameIDMap.getIDValueMap(schema,map);
		 return createEntry(schema,fieldList);
	 }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -