Skip to main content
summaryrefslogtreecommitdiffstats
blob: dabaa0cd838ac2a1fb80dc013df0b0ea02b78cdc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*******************************************************************************
 * Copyright (c) 2013 Boeing.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Boeing - initial API and implementation
 *******************************************************************************/
package org.eclipse.osee.framework.core.server.internal;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import org.eclipse.osee.framework.core.data.OseeServerInfo;

/**
 * @author Roberto E. Escobar
 */
public class OseeServerInfoMutable extends OseeServerInfo {

   private static final long serialVersionUID = 4437012224149055646L;

   public OseeServerInfoMutable(String serverId, String serverAddress, int port, String[] version, Timestamp dateStarted, boolean isAcceptingRequests) {
      super(serverId, serverAddress, port, version, dateStarted, isAcceptingRequests);
   }

   public void setAcceptingRequests(boolean value) {
      backingData.put(IS_ACCEPTING_REQUESTS, value);
   }

   public void setVersions(Set<String> versions) {
      backingData.put(VERSION, versions.toArray(new String[versions.size()]));
   }

   public void addVersion(String version) {
      Set<String> versions = getVersionSet();
      versions.add(version);
      setVersions(versions);
   }

   public Set<String> getVersionSet() {
      Set<String> versions = new HashSet<String>();
      for (String current : getVersion()) {
         versions.add(current);
      }
      return versions;
   }

}

Back to the top