コード例 #1
0
 private static void initPropertyCollector() {
   if (PROP_COLLECTOR == null) {
     try {
       PROP_COLLECTOR = SERVICE_CONTENT.getPropertyCollector();
     } catch (Exception e) {
       e.printStackTrace();
     }
   }
 }
コード例 #2
0
 private static void initRootFolder() {
   if (ROOT_FOLDER == null) {
     try {
       ROOT_FOLDER = SERVICE_CONTENT.getRootFolder();
     } catch (Exception e) {
       e.printStackTrace();
     }
   }
 }
コード例 #3
0
 /**
  * Disconnects the user session
  *
  * @throws Exception
  */
 private static void disconnect() throws Exception {
   VIM_PORT.logout(SERVICE_CONTENT.getSessionManager());
 }
コード例 #4
0
 /**
  * @param url The URL of the server
  * @param uname The user name for the session
  * @param pword The password for the user
  *     <p>Establishes session with the virtual center / ESX server
  * @throws Exception
  */
 private static void connect(String url, String uname, String pword) throws Exception {
   VIM_PORT.login(SERVICE_CONTENT.getSessionManager(), uname, pword, null);
 }