PageRenderTime 56ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/servers/jain-slee/core/components/components/src/main/java/org/mobicents/slee/container/component/deployment/jaxb/descriptors/ProfileSpecificationDescriptorImpl.java

http://mobicents.googlecode.com/
Java | 307 lines | 118 code | 42 blank | 147 comment | 5 complexity | 234b3c3536c06067b3447f40df1c3fe9 MD5 | raw file
Possible License(s): LGPL-3.0, GPL-3.0, LGPL-2.1, GPL-2.0, CC-BY-SA-3.0, CC0-1.0, Apache-2.0, BSD-3-Clause
  1. /*
  2. * JBoss, Home of Professional Open Source
  3. * Copyright 2011, Red Hat, Inc. and individual contributors
  4. * by the @authors tag. See the copyright.txt in the distribution for a
  5. * full listing of individual contributors.
  6. *
  7. * This is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU Lesser General Public License as
  9. * published by the Free Software Foundation; either version 2.1 of
  10. * the License, or (at your option) any later version.
  11. *
  12. * This software is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with this software; if not, write to the Free
  19. * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  20. * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  21. */
  22. package org.mobicents.slee.container.component.deployment.jaxb.descriptors;
  23. import java.util.List;
  24. import javax.slee.profile.ProfileSpecificationID;
  25. import org.mobicents.slee.container.component.UsageParametersInterfaceDescriptor;
  26. import org.mobicents.slee.container.component.common.ProfileSpecRefDescriptor;
  27. import org.mobicents.slee.container.component.deployment.jaxb.descriptors.common.MEnvEntry;
  28. import org.mobicents.slee.container.component.deployment.jaxb.descriptors.common.MSecurityPermissions;
  29. import org.mobicents.slee.container.component.deployment.jaxb.descriptors.common.references.MProfileSpecRef;
  30. import org.mobicents.slee.container.component.deployment.jaxb.descriptors.profile.MCollator;
  31. import org.mobicents.slee.container.component.deployment.jaxb.descriptors.profile.MProfileClasses;
  32. import org.mobicents.slee.container.component.deployment.jaxb.descriptors.profile.MProfileIndex;
  33. import org.mobicents.slee.container.component.deployment.jaxb.descriptors.profile.MProfileSpec;
  34. import org.mobicents.slee.container.component.deployment.jaxb.descriptors.profile.query.MQuery;
  35. import org.mobicents.slee.container.component.profile.ProfileAbstractClassDescriptor;
  36. import org.mobicents.slee.container.component.profile.ProfileLocalInterfaceDescriptor;
  37. import org.mobicents.slee.container.component.profile.ProfileSpecificationDescriptor;
  38. import org.mobicents.slee.container.component.profile.cmp.ProfileCMPInterfaceDescriptor;
  39. /**
  40. * Start time:13:41:11 2009-01-18<br>
  41. * Project: mobicents-jainslee-server-core<br>
  42. *
  43. * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a>
  44. * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a>
  45. */
  46. public class ProfileSpecificationDescriptorImpl extends
  47. AbstractComponentWithLibraryRefsDescriptor implements
  48. ProfileSpecificationDescriptor {
  49. private final ProfileSpecificationID profileSpecificationID;
  50. private List<MProfileIndex> indexedAttributes;
  51. // FIXME: add hints here?
  52. private List<MProfileSpecRef> profileSpecRefs;
  53. private List<MCollator> collators;
  54. private List<MEnvEntry> envEntries;
  55. private List<MQuery> queryElements;
  56. private boolean singleProfile = false;
  57. private boolean readOnly = true;
  58. private boolean eventsEnabled = true;
  59. private String securityPremissions;
  60. private final UsageParametersInterfaceDescriptor usageParametersInterface;
  61. private final ProfileCMPInterfaceDescriptor profileCMPInterface;
  62. private final String profileManagementInterface;
  63. private final String profileTableInterface;
  64. private final ProfileAbstractClassDescriptor profileAbstractClassDescriptor;
  65. private final ProfileLocalInterfaceDescriptor profileLocalInterfaceDescriptor;
  66. private final boolean isolateSecurityPermissions;
  67. public ProfileSpecificationDescriptorImpl(MProfileSpec profileSpec,
  68. MSecurityPermissions mSecurityPermissions, boolean isSlee11) {
  69. super(isSlee11);
  70. this.profileSpecificationID = new ProfileSpecificationID(profileSpec
  71. .getProfileSpecName(), profileSpec.getProfileSpecVendor(),
  72. profileSpec.getProfileSpecVersion());
  73. this.securityPremissions = mSecurityPermissions == null ? null
  74. : mSecurityPermissions.getSecurityPermissionSpec();
  75. final MProfileClasses profileClasses = profileSpec.getProfileClasses();
  76. // Just for 1.0
  77. indexedAttributes = profileSpec.getProfileIndex();
  78. // Now it's only 1.1
  79. super.setLibraryRefs(profileSpec.getLibraryRefs());
  80. this.profileSpecRefs = profileSpec.getProfileSpecRef();
  81. for (ProfileSpecRefDescriptor profileSpecRefDescriptor : profileSpec.getProfileSpecRef()) {
  82. super.dependenciesSet.add(profileSpecRefDescriptor.getComponentID());
  83. }
  84. this.collators = profileSpec.getCollator();
  85. this.envEntries = profileSpec.getEnvEntry();
  86. this.queryElements = profileSpec.getQuery();
  87. this.readOnly = profileSpec.getProfileReadOnly().booleanValue();
  88. this.eventsEnabled = profileSpec.getProfileEventsEnabled()
  89. .booleanValue();
  90. this.profileCMPInterface = profileClasses.getProfileCMPInterface();
  91. this.usageParametersInterface = profileClasses.getProfileUsageParameterInterface();
  92. this.profileManagementInterface = profileClasses.getProfileManagementInterface() == null ? null : profileClasses.getProfileManagementInterface().getProfileManagementInterfaceName();
  93. this.profileTableInterface = profileClasses.getProfileTableInterface() == null ? null : profileClasses.getProfileTableInterface().getProfileTableInterfaceName();
  94. this.profileAbstractClassDescriptor = profileClasses.getProfileAbstractClass();
  95. this.profileLocalInterfaceDescriptor = profileClasses.getProfileLocalInterface();
  96. this.isolateSecurityPermissions = this.getProfileLocalInterface() == null?false:(this.getProfileLocalInterface().isIsolateSecurityPermissions());
  97. }
  98. /*
  99. * (non-Javadoc)
  100. * @see org.mobicents.slee.core.component.profile.ProfileSpecificationDescriptor#isIsolateSecurityPermissions()
  101. */
  102. public boolean isIsolateSecurityPermissions() {
  103. return isolateSecurityPermissions;
  104. }
  105. /*
  106. * (non-Javadoc)
  107. *
  108. * @see
  109. * org.mobicents.slee.core.component.profile.ProfileSpecificationDescriptor
  110. * #getCollators()
  111. */
  112. public List<MCollator> getCollators() {
  113. return collators;
  114. }
  115. /*
  116. * (non-Javadoc)
  117. *
  118. * @see
  119. * org.mobicents.slee.core.component.profile.ProfileSpecificationDescriptor
  120. * #getEnvEntries()
  121. */
  122. public List<MEnvEntry> getEnvEntries() {
  123. return envEntries;
  124. }
  125. /*
  126. * (non-Javadoc)
  127. *
  128. * @see
  129. * org.mobicents.slee.core.component.profile.ProfileSpecificationDescriptor
  130. * #getEventsEnabled()
  131. */
  132. public boolean getEventsEnabled() {
  133. return eventsEnabled;
  134. }
  135. /*
  136. * (non-Javadoc)
  137. *
  138. * @see
  139. * org.mobicents.slee.core.component.profile.ProfileSpecificationDescriptor
  140. * #getIndexedAttributes()
  141. */
  142. public List<MProfileIndex> getIndexedAttributes() {
  143. return indexedAttributes;
  144. }
  145. /*
  146. * (non-Javadoc)
  147. *
  148. * @see
  149. * org.mobicents.slee.core.component.profile.ProfileSpecificationDescriptor
  150. * #getProfileAbstractClass()
  151. */
  152. public ProfileAbstractClassDescriptor getProfileAbstractClass() {
  153. return profileAbstractClassDescriptor;
  154. }
  155. /*
  156. * (non-Javadoc)
  157. *
  158. * @see
  159. * org.mobicents.slee.core.component.profile.ProfileSpecificationDescriptor
  160. * #getProfileCMPInterface()
  161. */
  162. public ProfileCMPInterfaceDescriptor getProfileCMPInterface() {
  163. return profileCMPInterface;
  164. }
  165. /*
  166. * (non-Javadoc)
  167. *
  168. * @see
  169. * org.mobicents.slee.core.component.profile.ProfileSpecificationDescriptor
  170. * #getProfileLocalInterface()
  171. */
  172. public ProfileLocalInterfaceDescriptor getProfileLocalInterface() {
  173. return profileLocalInterfaceDescriptor;
  174. }
  175. /*
  176. * (non-Javadoc)
  177. *
  178. * @see
  179. * org.mobicents.slee.core.component.profile.ProfileSpecificationDescriptor
  180. * #getProfileManagementInterface()
  181. */
  182. public String getProfileManagementInterface() {
  183. return profileManagementInterface;
  184. }
  185. /*
  186. * (non-Javadoc)
  187. *
  188. * @see
  189. * org.mobicents.slee.core.component.profile.ProfileSpecificationDescriptor
  190. * #getProfileSpecificationID()
  191. */
  192. public ProfileSpecificationID getProfileSpecificationID() {
  193. return profileSpecificationID;
  194. }
  195. /*
  196. * (non-Javadoc)
  197. *
  198. * @see
  199. * org.mobicents.slee.core.component.profile.ProfileSpecificationDescriptor
  200. * #getProfileSpecRefs()
  201. */
  202. public List<MProfileSpecRef> getProfileSpecRefs() {
  203. return profileSpecRefs;
  204. }
  205. /*
  206. * (non-Javadoc)
  207. *
  208. * @see
  209. * org.mobicents.slee.core.component.profile.ProfileSpecificationDescriptor
  210. * #getProfileTableInterface()
  211. */
  212. public String getProfileTableInterface() {
  213. return profileTableInterface;
  214. }
  215. /*
  216. * (non-Javadoc)
  217. *
  218. * @see
  219. * org.mobicents.slee.core.component.profile.ProfileSpecificationDescriptor
  220. * #getProfileUsageParameterInterface()
  221. */
  222. public UsageParametersInterfaceDescriptor getProfileUsageParameterInterface() {
  223. return usageParametersInterface;
  224. }
  225. /*
  226. * (non-Javadoc)
  227. *
  228. * @see
  229. * org.mobicents.slee.core.component.profile.ProfileSpecificationDescriptor
  230. * #getQueryElements()
  231. */
  232. public List<MQuery> getQueryElements() {
  233. return queryElements;
  234. }
  235. /*
  236. * (non-Javadoc)
  237. *
  238. * @see
  239. * org.mobicents.slee.core.component.profile.ProfileSpecificationDescriptor
  240. * #getReadOnly()
  241. */
  242. public boolean getReadOnly() {
  243. return readOnly;
  244. }
  245. /*
  246. * (non-Javadoc)
  247. *
  248. * @see
  249. * org.mobicents.slee.core.component.profile.ProfileSpecificationDescriptor
  250. * #getSecurityPermissions()
  251. */
  252. public String getSecurityPermissions() {
  253. return securityPremissions;
  254. }
  255. /*
  256. * (non-Javadoc)
  257. *
  258. * @see
  259. * org.mobicents.slee.core.component.profile.ProfileSpecificationDescriptor
  260. * #isSingleProfile()
  261. */
  262. public boolean isSingleProfile() {
  263. return this.singleProfile;
  264. }
  265. }