Пример #1
0
 public int deleteAddresssByUser(UserType user) throws FactoryException {
   long[] ids =
       getIdByField(
           new QueryField[] {QueryFields.getFieldOwner(user.getId())},
           user.getOrganization().getId());
   return deleteAddresssByIds(ids, user.getOrganization());
 }
Пример #2
0
 public AddressType newAddress(UserType user, DirectoryGroupType group) throws ArgumentException {
   if (user == null || user.getDatabaseRecord() == false)
     throw new ArgumentException("Invalid owner");
   AddressType obj = new AddressType();
   obj.setLocationType(LocationEnumType.UNKNOWN);
   obj.setOrganization(group.getOrganization());
   obj.setOwnerId(user.getId());
   obj.setGroup(group);
   obj.setNameType(NameEnumType.ADDRESS);
   return obj;
 }
Пример #3
0
  public AddressType newAddress(UserType user, AddressType parentAddress) throws ArgumentException {
    if (user == null || user.getDatabaseRecord() == false)
      throw new ArgumentException("Invalid owner");

    AddressType obj = newAddress(user, parentAddress.getGroup());

    return obj;
  }
 public OperationResponseEnumType operate(
     final PatternType pattern, FactType sourceFact, final FactType referenceFact) {
   if (sourceFact.getSourceUrn() == null) {
     logger.error("Invalid argument");
     return OperationResponseEnumType.ERROR;
   }
   UserType u = read(sourceFact, referenceFact);
   if (u == null) {
     logger.error(
         "Failed to find user "
             + sourceFact.getSourceUrn()
             + " in organization "
             + referenceFact.getOrganization().getName());
     return OperationResponseEnumType.FAILED;
   }
   logger.info(
       "Found user "
           + sourceFact.getSourceUrn()
           + " in organization "
           + referenceFact.getOrganization().getName()
           + " having user id "
           + u.getId());
   return OperationResponseEnumType.SUCCEEDED;
 }