01: /*
02: * All content copyright (c) 2003-2007 Terracotta, Inc., except as may otherwise be noted in a separate copyright
03: * notice. All rights reserved.
04: */
05: package com.tc.test.activepassive;
06:
07: public class ActivePassiveSharedDataMode {
08: public static final String DISK = "disk";
09: public static final String NETWORK = "network";
10:
11: private final String mode;
12:
13: public ActivePassiveSharedDataMode(String mode) {
14: if (!mode.equals(DISK) && !mode.equals(NETWORK)) {
15: throw new AssertionError("Unrecognized share data mode ["
16: + mode + "]");
17: }
18: this .mode = mode;
19: }
20:
21: public String getMode() {
22: if (mode == null) {
23: throw new AssertionError("Mode was not set");
24: }
25: return mode;
26: }
27:
28: public boolean isNetworkShare() {
29: return getMode().equals(NETWORK);
30: }
31: }
|