Changeset 2193
- Timestamp:
- 05/28/08 11:27:18
(6 months ago)
- Author:
- npatrick
- Message:
Added code to remove network resources from all systems when it is removed from the fnet file.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r2188 |
r2193 |
|
| 9 | 9 | |
|---|
| 10 | 10 | package com.tresys.framework.compiler.linkage.net; |
|---|
| | 11 | |
|---|
| | 12 | import java.util.ArrayList; |
|---|
| | 13 | import java.util.Collection; |
|---|
| | 14 | import java.util.Iterator; |
|---|
| 11 | 15 | |
|---|
| 12 | 16 | import com.tresys.framework.compiler.ErrorHandler; |
|---|
| … | … | |
| 81 | 85 | public void Visit (NetworkConfig i_net_config) |
|---|
| 82 | 86 | { |
|---|
| 83 | | |
|---|
| | 87 | // Remove any NetworkResources that do not exist in the fnet file. |
|---|
| | 88 | Collection col = i_net_config.getNetworkItems (); |
|---|
| | 89 | Iterator itr = m_sysPolicy.GetResources ().values ().iterator (); |
|---|
| | 90 | ArrayList list = new ArrayList(); |
|---|
| | 91 | |
|---|
| | 92 | while (itr.hasNext ()) |
|---|
| | 93 | { |
|---|
| | 94 | Object res = itr.next (); |
|---|
| | 95 | if (res instanceof NetworkResource) |
|---|
| | 96 | { |
|---|
| | 97 | NetworkResource nRes = (NetworkResource)res; |
|---|
| | 98 | NetResource netRes = i_net_config.getResource (nRes.getName ()); |
|---|
| | 99 | |
|---|
| | 100 | if (netRes == null) |
|---|
| | 101 | { |
|---|
| | 102 | list.add (nRes); |
|---|
| | 103 | } |
|---|
| | 104 | } |
|---|
| | 105 | } |
|---|
| | 106 | |
|---|
| | 107 | itr = list.iterator (); |
|---|
| | 108 | |
|---|
| | 109 | while (itr.hasNext ()) |
|---|
| | 110 | { |
|---|
| | 111 | NetworkResource nRes = (NetworkResource)itr.next (); |
|---|
| | 112 | m_sysPolicy.Remove (nRes); |
|---|
| | 113 | } |
|---|
| 84 | 114 | } |
|---|
| 85 | 115 | |
|---|
Download in other formats:
* Generating other formats may take time.