Ejemplo n.º 1
0
 /**
  * Update status of feature.
  *
  * @param uid feature id
  * @param enable enabler
  */
 private void updateStatus(String uid, boolean enable) {
   if (uid == null || uid.isEmpty()) {
     throw new IllegalArgumentException("Feature identifier cannot be null nor empty");
   }
   if (!exist(uid)) {
     throw new FeatureNotFoundException(uid);
   }
   DBObject target = BUILDER.getFeatUid(uid);
   Object enabledd = BUILDER.getEnable(enable);
   collection.update(target, BasicDBObjectBuilder.start(MONGO_SET, enabledd).get());
 }
Ejemplo n.º 2
0
 /** {@inheritDoc} */
 @Override
 public void disableGroup(String groupName) {
   if (groupName == null || groupName.isEmpty()) {
     throw new IllegalArgumentException("Groupname cannot be null nor empty");
   }
   if (!existGroup(groupName)) {
     throw new GroupNotFoundException(groupName);
   }
   for (DBObject dbObject : collection.find(BUILDER.getGroupName(groupName))) {
     Object enabledd = BUILDER.getEnable(false);
     collection.update(dbObject, BasicDBObjectBuilder.start(MONGO_SET, enabledd).get());
   }
 }