Changeset 2217
- Timestamp:
- 06/10/08 10:20:29 (3 months ago)
- Files:
-
- trunk/framework-plugin/src/com/tresys/framework/compiler/linkage/net/FNETParser.jj (modified) (3 diffs)
- trunk/framework-plugin/src/com/tresys/framework/compiler/linkage/net/NetworkConfig.java (modified) (1 diff)
- trunk/framework-plugin/src/com/tresys/framework/plugin/builder/ENetworkConfig.java (modified) (1 diff)
- trunk/framework-plugin/src/com/tresys/framework/plugin/builder/FrameworkBuilder.java (modified) (2 diffs)
- trunk/framework-plugin/src/com/tresys/framework/plugin/builder/SELinuxSystem.java (modified) (3 diffs)
- trunk/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/GraphicPolicyRefresh.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/framework-plugin/src/com/tresys/framework/compiler/linkage/net/FNETParser.jj
r2216 r2217 308 308 Endpoint source; 309 309 { 310 addHandlerToToken (system); 310 311 NetSystem netSys = m_configuration.getSystem (system.image); 311 312 if (netSys == null) … … 338 339 Endpoint target; 339 340 { 341 addHandlerToToken (system); 340 342 NetSystem netSys = m_configuration.getSystem (system.image); 341 343 if (netSys == null) … … 359 361 connection = <ID> 360 362 { 363 addHandlerToToken (connection); 361 364 NetResource netRes = m_configuration.getResource (connection.image); 362 365 if (netRes == null) trunk/framework-plugin/src/com/tresys/framework/compiler/linkage/net/NetworkConfig.java
r2216 r2217 143 143 throw new IllegalArgumentException (); 144 144 145 145 146 NetResource res = i_connection.getResource (); 146 Collection cons = (Collection) m_connections.get (res.getName ()); 147 cons.add (i_connection); 148 149 Collection entrypoints = (Collection) m_endpoints.get (res.getName ()); 150 entrypoints.add (i_connection.getSource ()); 151 entrypoints.add (i_connection.getTarget ()); 147 148 if (res != null) 149 { 150 String sName = res.getName (); 151 Collection cons = (Collection) m_connections.get (sName); 152 cons.add (i_connection); 153 154 Collection entrypoints = (Collection) m_endpoints.get (sName); 155 entrypoints.add (i_connection.getSource ()); 156 entrypoints.add (i_connection.getTarget ()); 157 } 152 158 } 153 159 trunk/framework-plugin/src/com/tresys/framework/plugin/builder/ENetworkConfig.java
r2215 r2217 130 130 m_netresources.put (e.getNewValue ().toString (), m_netresources.remove (e.getOldValue ().toString ())); 131 131 m_endpoints.put (e.getNewValue ().toString (), m_endpoints.remove (e.getOldValue ().toString ())); 132 m_connections.put (e.getNewValue ().toString (), m_connections.remove (e.getOldValue ().toString ())); 132 133 Collection connections = (Collection) m_connections.remove (e.getOldValue ().toString ()); 134 for (Iterator itr = connections.iterator (); itr.hasNext (); ) 135 { 136 NetConnection connection = (NetConnection) itr.next (); 137 connection.getResource ().setName (e.getNewValue ().toString ()); 138 } 139 140 m_connections.put (e.getNewValue ().toString (), connections); 133 141 } 134 142 } trunk/framework-plugin/src/com/tresys/framework/plugin/builder/FrameworkBuilder.java
r2172 r2217 26 26 import org.eclipse.core.runtime.CoreException; 27 27 import org.eclipse.core.runtime.IProgressMonitor; 28 import org.eclipse.swt.widgets.Display; 29 28 30 import com.tresys.framework.compiler.linkage.net.NetworkConfig; 29 31 import com.tresys.framework.compiler.linkage.net.NetworkAdder; … … 101 103 for (Iterator itr = nat.getSystems ().iterator (); itr.hasNext (); ) 102 104 { 103 SELinuxSystem sys = (SELinuxSystem) itr.next (); 104 Policy sysPolicy = sys.getPolicy (); 105 final SELinuxSystem sys = (SELinuxSystem) itr.next (); 106 final Policy sysPolicy = sys.getPolicy (); 107 105 108 NetworkAdder adder = new NetworkAdder (sysPolicy, sys.getFPOLErrorHandler ()); 106 107 109 config.Accept (adder); 108 110 109 GraphicPolicyRefresh graphic_refresh = new GraphicPolicyRefresh (sys); 110 sysPolicy.Accept (graphic_refresh); 111 Display.getDefault ().syncExec (new Runnable () 112 { 113 /* (non-Javadoc) 114 * @see java.lang.Runnable#run() 115 */ 116 public void run () 117 { 118 GraphicPolicyRefresh graphic_refresh = new GraphicPolicyRefresh (sys); 119 sysPolicy.Accept (graphic_refresh); 120 } 121 }); 111 122 } 112 123 trunk/framework-plugin/src/com/tresys/framework/plugin/builder/SELinuxSystem.java
r2215 r2217 224 224 if (m_policy != null) 225 225 return m_policy; 226 227 228 229 if (DEBUG)230 System.out.println("SELinuxSystem.java.getPolicy returns null /builder/..");231 232 226 233 227 // if (m_policy == null) 234 m_policy = new Policy (getName (), dictionary, linkage);228 m_policy = new Policy (getName (), dictionary, linkage); 235 229 236 230 … … 238 232 m_policy.setBasePolicyBooleans (getAllBooleans ()); 239 233 FrameworkNature.deleteMarkers (fpol); 234 m_policyModStamp = modStamp; 240 235 241 236 ErrorHandler policyHandler = getFPOLErrorHandler(); 242 237 m_policy.AddPolicyReader (new InputStreamReader (fpol.getContents (true)), getNetworkConfig (), policyHandler); 243 m_policyModStamp = modStamp;244 238 245 239 rebuildSystemResources (); … … 273 267 ce.printStackTrace (); 274 268 } 269 270 if (m_policy == null && DEBUG) 271 System.out.println("SELinuxSystem.java.getPolicy returns null /builder/.."); 275 272 276 273 return m_policy; trunk/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/GraphicPolicyRefresh.java
r2213 r2217 1 1 /*\ 2 |*| Copyright (C) 2006 Tresys Technology, LLC2 |*| Copyright (C) 2006-2008 Tresys Technology, LLC 3 3 |*| License: refer to COPYING file for license information. 4 4 |*| Author: David Sugar <dsugar@tresys.com> 5 5 |*| 6 |*| Version: @version@ 6 |*| $Date$ 7 |*| $Rev$ 7 8 |*| 8 9 |*| Refresh the graphic representation based on the policy model
