code: private synchronized void updateDeploymentMap(DigitalObject obj,
              Connection c, boolean isPurge) throws SQLException {
  
          String sDep = obj.getPid();
          Set<RelationshipTuple> sDefs =
                  obj.getRelationships(Constants.MODEL.IS_DEPLOYMENT_OF, null);
          Set<RelationshipTuple> models =
                  obj.getRelationships(Constants.MODEL.IS_CONTRACTOR_OF, null);
  
          /* Read in the new deployment map from the object */
          Set<ServiceContext> newContext = new HashSet<ServiceContext>();
  
          if (!isPurge) {
              for (RelationshipTuple sDefTuple : sDefs) {
                  String sDef = sDefTuple.getObjectPID();
                  for (RelationshipTuple cModelTuple : models) {
                      String cModel = cModelTuple.getObjectPID();
                      newContext.add(ServiceContext.getInstance(cModel, sDef));
                  }
              }
          }
  
          /* Read in the old deployment map from the cache */
          Set<ServiceContext> oldContext =
                  m_cModelDeploymentMap.getContextFor(sDep);
  
          /* Remove any obsolete deployments from the registry/cache */
          for (ServiceContext o : oldContext) {
              if (!newContext.contains(o)) {
                  removeDeployment(o, obj, c);
              }
          }
  
          /* Add any new deployments from the registry/cache */
          for (ServiceContext n : newContext) {
              if (!oldContext.contains(n)) {
                  addDeployment(n, obj, c);
              } else {
                  updateDeployment(n, obj, c);
              }
          }
      }
docs: Update the registry and deployment cache to reflect the latest state of
  reality.
  
  @param obj
  DOReader of a service deployment object