public boolean profileExist(ProfileID profileID) throws SystemException { Object profileFound = findProfileMBean(profileID.getProfileTableName(), profileID.getProfileName()); if (profileFound == null) return false; else return true; }
public Collection<ProfileID> getProfilesByAttribute( String attributeName, Object attributeValue, boolean isSlee11) throws UnrecognizedAttributeException, AttributeNotIndexedException, AttributeTypeMismatchException, SLEEException { if (logger.isDebugEnabled()) { logger.debug("getProfilesByAttribute( attributeName = "+attributeName+" , attributeValue = "+attributeValue+" , isSlee11 = "+isSlee11+" )"); } // We get profile entities Collection<ProfileEntity> profileEntities = getProfileEntitiesByAttribute(attributeName, attributeValue, isSlee11); // We need ProfileIDs Collection<ProfileID> profileIDs = new ArrayList<ProfileID>(); for(ProfileEntity profileEntity : profileEntities) { profileIDs.add( new ProfileID(profileEntity.getTableName(), profileEntity.getProfileName()) ); } return Collections.unmodifiableCollection( profileIDs ); }
/** * Retrieves a profile given the cmp method name and profile id */ public static Object getProfileCMPMethod(SbbEntity sbbEntity, String getProfileCMPMethodName, ProfileID profileID) throws UnrecognizedProfileTableNameException, UnrecognizedProfileNameException { GetProfileCMPMethodDescriptor mGetProfileCMPMethod = sbbEntity.getSbbComponent() .getDescriptor().getGetProfileCMPMethods().get( getProfileCMPMethodName); if (mGetProfileCMPMethod == null) throw new AbstractMethodError("Profile CMP Method not found"); if (sbbEntity.getSbbObject().getState() != SbbObjectState.READY) { throw new IllegalStateException( "Could not invoke getProfileCMP Method, Sbb Object is not in the READY state!"); } ProfileManagement sleeProfileManager = sleeContainer .getSleeProfileTableManager(); ProfileTable profileTable = sleeProfileManager.getProfileTable(profileID.getProfileTableName()); if (!profileTable.profileExists(profileID.getProfileName())) { throw new UnrecognizedProfileNameException(profileID.toString()); } return profileTable.getProfile(profileID.getProfileName()).getProfileCmpSlee10Wrapper(); }
public Object getProfileAttributeValue(ProfileID profileID, String attributeName) throws SystemException { return getTransactionManager().getObject( tcache, this.generateProfileKey(profileID.getProfileName(), profileID .getProfileName()), attributeName); }
profiles.add(((ProfileID) obj).getProfileName());
/** * This method renames Profile Table in backend storage. NOTE: It should not be called directly, use SleeProfileTableManager instead! * @param newProfileTableName */ public void rename(String newProfileTableName) { //we have to do this like that cause once JPA is done, those profiles wont exist, since we do UPDATE of a table name, not a copy //thus no profiles will be returned on this call later on. ouch :) Collection<ProfileID> profileIDs = this.getProfiles(); component.getProfileEntityFramework().renameProfileTable(this.profileTableName, newProfileTableName); //here we remove beans. for(ProfileID pid: profileIDs) { try{ AbstractProfileMBeanImpl.close(pid.getProfileTableName(), pid.getProfileName()); }catch(Exception e) { if(logger.isEnabledFor(Level.WARN)) { logger.warn("Unexpected behaviour on MBean deregistration.", e); } } } }
/** * * @return */ public Collection<ProfileID> getProfiles() { List<ProfileID> result = new ArrayList<ProfileID>(); for (ProfileEntity profileEntity : component.getProfileEntityFramework().findAll(this.getProfileTableName())) { result.add(new ProfileID(profileTableName,profileEntity.getProfileName())); } return Collections.unmodifiableCollection(result); }
this.removeProfile(profileID.getProfileName(), false, isUninstall);
String key = this.generateProfileKey(profileID.getProfileTableName(), profileID.getProfileName()); String profileTableKey = this.generateProfileTableKey(profileID .getProfileTableName()); String cmpInterfaceName = (String) transactionManager.getObject(tcache, profileTableKey, "cmpInterfaceName");
/** * * @param profileEntityAfterAction */ AbstractProfileEvent(ProfileEntity profileEntityAfterAction, ProfileManagementImpl profileManagement) { this.profileManagement = profileManagement; this.profileAfterAction = profileEntityAfterAction; this.profileAddress = new Address(AddressPlan.SLEE_PROFILE, profileEntityAfterAction.getTableName() + "/" + profileEntityAfterAction.getProfileName()); this.profileID = new ProfileID(this.profileAddress); }
/** * Get an instance of a profile specified by the profileID given in parameter * @param method * @param profileID * @return * @throws SystemException */ private Object callGetProfileMethod(ProfileCMPMethod method, ProfileID profileID) throws UnrecognizedProfileTableNameException, UnrecognizedProfileNameException, SystemException{ SleeProfileManager sleeProfileManager=SleeProfileManager.getInstance(); try { if(sleeProfileManager.findProfileSpecId(profileID.getProfileTableName())==null) throw new UnrecognizedProfileTableNameException(); } catch (SystemException e) { throw new SLEEException("low-level failure"); } if(sleeProfileManager.findProfileMBean(profileID.getProfileTableName(),profileID.getProfileName())==null) throw new UnrecognizedProfileNameException(); //TODO call this method under a valid transaction context as defined in the spec return sleeProfileManager.getSbbCMPProfile(profileID); }
Iterator it = profiles.iterator(); while (it.hasNext()) { profileIDs.add(new ProfileID(profileTableName, (String) it.next()));
ProfileTableImpl profileTable = ((ProfileManagementImpl)sleeContainer.getSleeProfileTableManager()).getProfileTable(profileId.getProfileTableName()); return profileTable.profileExists(profileId.getProfileName());
Iterator it = profiles.iterator(); while (it.hasNext()) { profileIDs.add(new ProfileID(profileTableName, (String) it.next()));
profileIDs.add(new ProfileID(profileEntity.getTableName(),profileEntity.getProfileName()));
profileIDs.add(new ProfileID(profileEntity.getTableName(),profileEntity.getProfileName()));
return new ProfileID(profileTableName, (String) profiles.iterator() .next());
profileAddress, new ProfileID(profileAddress), profileManagement, activityContextInterface, profileTableActivityContextInterfaceFactory);
ProfileID profileID = new ProfileID(profileTableName, profileName); try { profileAddress, new ProfileID(profileAddress), profile, activityContextInterface, profileTableActivityContextInterfaceFactory); profileAddress, new ProfileID(profileAddress), profileBeforeUpdate, profile, activityContextInterface, profileTableActivityContextInterfaceFactory);