View Javadoc
1   /*
2    * Copyright 2010 FatWire Corporation. All Rights Reserved.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *    http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package com.fatwire.gst.foundation.vwebroot;
17  
18  import COM.FutureTense.Interfaces.Utilities;
19  
20  import com.fatwire.assetapi.data.AssetId;
21  import com.openmarket.xcelerate.asset.AssetIdImpl;
22  
23  /**
24   * Simple Virtual Webroot Bean
25   * 
26   * @author Tony Field
27   * @since Jul 22, 2010
28   */
29  final class VWebrootBeanImpl implements VirtualWebroot {
30  
31      public static final String GST_VIRTUAL_WEBROOT = "GSTVirtualWebroot";
32      private AssetId id;
33      private String masterVWebroot;
34      private String envVWebroot;
35      private String envName;
36  
37      VWebrootBeanImpl(long id, String masterVWebroot, String envVWebroot, String envName) {
38          this.id = new AssetIdImpl(GST_VIRTUAL_WEBROOT, id);
39          if (!Utilities.goodString(masterVWebroot))
40              throw new IllegalArgumentException("Invalid Master VWebroot:" + masterVWebroot);
41          this.masterVWebroot = masterVWebroot;
42          if (!Utilities.goodString(envVWebroot))
43              throw new IllegalArgumentException("Invalid Env VWebroot:" + envVWebroot);
44          this.envVWebroot = envVWebroot;
45          if (!Utilities.goodString(envName))
46              throw new IllegalArgumentException("Invalid Env Name:" + envName);
47          this.envName = envName;
48      }
49  
50      public AssetId getId() {
51          return id;
52      }
53  
54      public String getMasterVirtualWebroot() {
55          return masterVWebroot;
56      }
57  
58      public String getEnvironmentVirtualWebroot() {
59          return envVWebroot;
60      }
61  
62      public String getEnvironmentName() {
63          return envName;
64      }
65  }