Skip to main content
summaryrefslogtreecommitdiffstats
blob: 1dbad1864ce6423f549ef52f25cfa7ab947293fa (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*******************************************************************************
 * Copyright (c) 2009 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.orcs.db.internal.exchange.handler;


/**
 * @author Ryan D. Brooks
 */
public enum ExportItem implements IExportItem {
   EXPORT_MANIFEST(""),
   EXPORT_TYPE_MODEL("osee_type_model"),
   EXPORT_DB_SCHEMA("db.metadata"),
   OSEE_BRANCH_DATA("osee_branch"),
   OSEE_TX_DETAILS_DATA("osee_tx_details"),
   OSEE_TXS_DATA("osee_txs"),
   OSEE_TXS_ARCHIVED_DATA("osee_txs_archived"),
   OSEE_ARTIFACT_DATA("osee_artifact"),
   OSEE_ATTRIBUTE_DATA("osee_attribute"),
   OSEE_RELATION_LINK_DATA("osee_relation_link"),
   OSEE_MERGE_DATA("osee_merge"),
   OSEE_CONFLICT_DATA("osee_conflict"),
   OSEE_BRANCH_ACL_DATA("osee_branch_acl"),
   OSEE_ARTIFACT_ACL_DATA("osee_artifact_acl");

   private final String source;

   private ExportItem(String source) {
      this.source = source;
   }

   @Override
   public String toString() {
      return this.name().toLowerCase().replace('_', '.');
   }

   @Override
   public String getFileName() {
      String extension = this != EXPORT_TYPE_MODEL ? ".xml" : ".osee";
      return this + extension;
   }

   @Override
   public String getSource() {
      return source;
   }

   @Override
   public int getPriority() {
      return ordinal();
   }

   public boolean matches(ExportItem... exportItems) {
      for (ExportItem exportItem : exportItems) {
         if (this == exportItem) {
            return true;
         }
      }
      return false;
   }
}

Back to the top