Exemplo n.º 1
0
        public void sendContent(Object target, Filter filter) throws IllegalArgumentException {

          MeemContentClient meemContentClient = (MeemContentClient) target;
          Collection<MeemPath> valueSet;
          synchronized (meemPaths) {
            valueSet = meemPaths.values();

            if (filter == null) {
              logger.info("!!!! No filter for meem content client");

              for (MeemPath meemPath : valueSet) {
                meemContentClient.meemContentChanged(meemPath, contentStore.load(meemPath));
              }
            } else if (filter instanceof ExactMatchFilter) {
              /*
               * If it is an exact match filter, grab the MeemPath out of it.
               * If that MeemPath isn't in the list, send back an empty MeemContent
               */
              Object filterObject = ((ExactMatchFilter) filter).getTemplate();
              if (filterObject instanceof MeemPath) {
                MeemPath filterPath = (MeemPath) filterObject;
                if (valueSet.contains(filterPath)) {
                  meemContentClient.meemContentChanged(filterPath, contentStore.load(filterPath));
                } else {
                  meemContentClient.meemContentChanged(filterPath, new MeemContent());
                }
              }
            }
          }
        }
Exemplo n.º 2
0
        public void sendContent(Object target, Filter filter) throws IllegalArgumentException {

          MeemDefinitionClient meemDefinitionClient = (MeemDefinitionClient) target;
          Collection<MeemPath> valueSet;
          synchronized (meemPaths) {
            valueSet = meemPaths.values();

            if (filter == null) {
              logger.info("!!!! No filter for meem definition client");
              for (MeemPath meemPath : valueSet) {
                meemDefinitionClient.meemDefinitionChanged(
                    meemPath, definitionStore.load(meemPath));
              }
            } else if (filter instanceof ExactMatchFilter) {
              Object filterObject = ((ExactMatchFilter) filter).getTemplate();
              if (filterObject instanceof MeemPath) {
                MeemPath filterPath = (MeemPath) filterObject;
                if (valueSet.contains(filterPath)) {
                  meemDefinitionClient.meemDefinitionChanged(
                      filterPath, definitionStore.load(filterPath));
                } else {
                  meemDefinitionClient.meemDefinitionChanged(filterPath, null);
                }
              }
            }
          }
        }
Exemplo n.º 3
0
        public void sendContent(Object target, Filter filter) throws IllegalArgumentException {

          MeemStoreClient meemStoreClient = (MeemStoreClient) target;
          Collection<MeemPath> valueSet;

          synchronized (meemPaths) {
            valueSet = meemPaths.values();

            if (filter == null) {
              // send paths of all stored meems
              for (MeemPath meemPath : valueSet) {
                meemStoreClient.meemStored(meemPath);
              }
            } else if (filter instanceof ExactMatchFilter) {
              // determine whether the meem is stored in this MeemStore
              MeemPath meemPath = (MeemPath) ((ExactMatchFilter) filter).getTemplate();
              if (valueSet.contains(meemPath)) {
                meemStoreClient.meemStored(meemPath);
              }
            }
          }
        }