KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > filesys > smb > dcerpc > info > ShareInfoList


1 /*
2  * Copyright (C) 2005 Alfresco, Inc.
3  *
4  * Licensed under the Mozilla Public License version 1.1
5  * with a permitted attribution clause. You may obtain a
6  * copy of the License at
7  *
8  * http://www.alfresco.org/legal/license.txt
9  *
10  * Unless required by applicable law or agreed to in writing,
11  * software distributed under the License is distributed on an
12  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13  * either express or implied. See the License for the specific
14  * language governing permissions and limitations under the
15  * License.
16  */

17 package org.alfresco.filesys.smb.dcerpc.info;
18
19 import java.util.Vector JavaDoc;
20
21 import org.alfresco.filesys.smb.dcerpc.DCEBuffer;
22 import org.alfresco.filesys.smb.dcerpc.DCEBufferException;
23 import org.alfresco.filesys.smb.dcerpc.DCEList;
24 import org.alfresco.filesys.smb.dcerpc.DCEReadable;
25
26 /**
27  * Server Share Information List Class
28  * <p>
29  * Holds the details for a DCE/RPC share enumeration request or response.
30  */

31 public class ShareInfoList extends DCEList
32 {
33
34     /**
35      * Default constructor
36      */

37     public ShareInfoList()
38     {
39         super();
40     }
41
42     /**
43      * Class constructor
44      *
45      * @param buf DCEBuffer
46      * @exception DCEBufferException
47      */

48     public ShareInfoList(DCEBuffer buf) throws DCEBufferException
49     {
50         super(buf);
51     }
52
53     /**
54      * Class constructor
55      *
56      * @param infoLevel int
57      */

58     public ShareInfoList(int infoLevel)
59     {
60         super(infoLevel);
61     }
62
63     /**
64      * Return share information object from the list
65      *
66      * @param idx int
67      * @return ShareInfo
68      */

69     public final ShareInfo getShare(int idx)
70     {
71         return (ShareInfo) getElement(idx);
72     }
73
74     /**
75      * Create a new share information object
76      *
77      * @return DCEReadable
78      */

79     protected DCEReadable getNewObject()
80     {
81         return new ShareInfo(getInformationLevel());
82     }
83
84     /**
85      * Add a share to the list
86      *
87      * @param share ShareInfo
88      */

89     public final void addShare(ShareInfo share)
90     {
91
92         // Check if the share list is valid
93

94         if (getList() == null)
95             setList(new Vector JavaDoc());
96
97         // Add the share
98

99         getList().add(share);
100     }
101
102     /**
103      * Set the share information list
104      *
105      * @param list Vector
106      */

107     public final void setShareList(Vector JavaDoc list)
108     {
109         setList(list);
110     }
111 }
112
Popular Tags