예제 #1
0
 public OnmsGroup map(Group inputGroup) {
   if (inputGroup == null) return null;
   final OnmsGroup xmlGroup = new OnmsGroup(inputGroup.getName());
   xmlGroup.setComments(inputGroup.getComments());
   xmlGroup.setUsers(inputGroup.getUserCollection());
   return xmlGroup;
 }
예제 #2
0
 public Group map(OnmsGroup inputGroup) {
   if (inputGroup == null) return null;
   Group castorGroup = new Group();
   castorGroup.setName(inputGroup.getName());
   castorGroup.setComments(inputGroup.getComments());
   castorGroup.setUser(inputGroup.getUsers().toArray(EMPTY_STRING_ARRAY));
   return castorGroup;
 }
예제 #3
0
  public synchronized void save(final OnmsGroup group) throws Exception {
    Group castorGroup = getGroup(group.getName());
    if (castorGroup == null) {
      castorGroup = new Group();
      castorGroup.setName(group.getName());
    }
    castorGroup.setComments(group.getComments());
    castorGroup.setUser(group.getUsers().toArray(EMPTY_STRING_ARRAY));

    saveGroup(group.getName(), castorGroup);
  }
  public OnmsGroup getOnmsGroup(final String groupName)
      throws MarshalException, ValidationException, IOException {
    final Group castorGroup = getGroup(groupName);
    if (castorGroup == null) return null;

    final OnmsGroup group = new OnmsGroup(groupName);
    group.setComments(castorGroup.getComments());
    group.setUsers(castorGroup.getUserCollection());

    return group;
  }