Java tutorial
/* Copyright (C) 2006 NTT DATA Corporation This program is free software; you can redistribute it and/or Modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ package com.clustercontrol.repository.action; import java.util.List; import org.eclipse.jface.dialogs.MessageDialog; import com.clustercontrol.accesscontrol.util.ClientSession; import com.clustercontrol.repository.util.RepositoryEndpointWrapper; import com.clustercontrol.util.HinemosMessage; import com.clustercontrol.util.Messages; import com.clustercontrol.ws.repository.InvalidRole_Exception; import com.clustercontrol.ws.repository.UsedFacility_Exception; /** * ??<BR> * * @version 1.0.0 * @since 1.0.0 */ public class DeleteNodeProperty { /** * ????? * * @param managerName ??? * @param facilityIdList */ public void delete(String managerName, List<String> facilityIdList) { try { RepositoryEndpointWrapper wrapper = RepositoryEndpointWrapper.getWrapper(managerName); wrapper.deleteNode(facilityIdList); // ?? ClientSession.doCheck(); // ?? String[] arg = { managerName }; MessageDialog.openInformation(null, Messages.getString("successful"), Messages.getString("message.repository.8", arg)); } catch (Exception e) { String errMessage = ""; if (e instanceof InvalidRole_Exception) { // ?????? MessageDialog.openInformation(null, Messages.getString("message"), Messages.getString("message.accesscontrol.16")); } else if (e instanceof UsedFacility_Exception) { // ??????? Object[] args = { facilityIdList, HinemosMessage.replace(((UsedFacility_Exception) e).getMessage()) }; MessageDialog.openInformation(null, Messages.getString("message"), Messages.getString("message.repository.28", args)); } else { errMessage = ", " + HinemosMessage.replace(e.getMessage()); } // ? MessageDialog.openError(null, Messages.getString("failed"), Messages.getString("message.repository.9") + errMessage); } return; } }