public void activate(ServiceID[] serviceIDs) throws NullPointerException, InvalidArgumentException, UnrecognizedServiceException, InvalidStateException, ManagementException { if (serviceIDs.length == 0) { throw new InvalidArgumentException("InvalidArgumentException"); } for (int i = 0; i < serviceIDs.length; i++) { if (serviceIDs[i] == null) { throw new InvalidArgumentException("InvalidArgumentException"); } } for (int i = 0; i < serviceIDs.length - 1; i++) for (int j = i + 1; j < serviceIDs.length; j++) if (serviceIDs[i] == (serviceIDs[j])) { throw new InvalidArgumentException( "InvalidArgumentException"); } for (int i = 0; i < serviceIDs.length; i++) { activate(serviceIDs[i]); } }
private void validateNewEntityOrLinkName(String name) throws InvalidArgumentException { for (int i = 0; i < name.length(); i++) { char c = name.charAt(i); if (!Character.isLetterOrDigit(c)) { if (c < '\u0020' || c > '\u007e') { throw new InvalidArgumentException( name + " includes char " + c + " ,which is not a letter or digit or in unicode range 0x0020-0x007e"); } } } }
public ObjectName getUsageNotificationManagerMBean(String arg0) throws NullPointerException, UnrecognizedSubsystemException, InvalidArgumentException, ManagementException { if (arg0 == null) { throw new NullPointerException(); } if (arg0.equals(DUMMY_SUBSYSTEM)) { throw new InvalidArgumentException(); } else { throw new UnrecognizedSubsystemException(); } }
public String[] getUsageParameterSets(String arg0) throws NullPointerException, UnrecognizedSubsystemException, InvalidArgumentException, ManagementException { if (arg0 == null) { throw new NullPointerException(); } if (arg0.equals(DUMMY_SUBSYSTEM)) { throw new InvalidArgumentException(); } else { throw new UnrecognizedSubsystemException(); } }
throw new InvalidArgumentException("The parameter array(s) must not be empty."); throw new InvalidArgumentException("The parameter arrays must have same lenght."); throw new InvalidArgumentException("Null entry found in parameter array(s)."); throw new InvalidArgumentException("Repeated entry found in parameter array(s).");
public ObjectName getUsageMBean(String arg0) throws NullPointerException, UnrecognizedSubsystemException, InvalidArgumentException, ManagementException { if (arg0 == null) { throw new NullPointerException(); } if (arg0.equals(DUMMY_SUBSYSTEM)) { throw new InvalidArgumentException(); } else { throw new UnrecognizedSubsystemException(); } }
/** * Return the set of named usage parameter names as an array. * * @param sbbId -- * sbb id for which to get the usage parameter set. * @return */ public String[] getNamedUsageParameterSets(SbbID sbbId) throws InvalidArgumentException { HashSet paramSet = (HashSet) this.usageParameterNames.get(sbbId.toString()); String[] retval = null; if (paramSet != null) { retval = new String[paramSet.size()]; paramSet.toArray(retval); return retval; } else throw new InvalidArgumentException ( "No named usage parameters for this sbb " + sbbId); } /**
public ObjectName getUsageMBean(String arg0, String arg1) throws NullPointerException, UnrecognizedSubsystemException, InvalidArgumentException, UnrecognizedUsageParameterSetNameException, ManagementException { if (arg0 == null) { throw new NullPointerException(); } if (arg0.equals(DUMMY_SUBSYSTEM)) { throw new InvalidArgumentException(); } else { throw new UnrecognizedSubsystemException(); } }
public ObjectName getSbbUsageMBean(SbbID sbbId, String name) throws NullPointerException, UnrecognizedSbbException, InvalidArgumentException, UnrecognizedUsageParameterSetNameException, ManagementException { if (name == null) throw new NullPointerException("Sbb usage param set is null"); if (name.length() == 0) throw new InvalidArgumentException( "The lenght of the Usage Parameter Set Name is zero!"); if (!isValidUsageParameterName(name)) throw new InvalidArgumentException( "The lenght of the Usage Parameter Set Name is zero!"); return _getSbbUsageMBean(sbbId, name); }
public void createUsageParameterSet(SbbID sbbId, String name) throws NullPointerException, UnrecognizedSbbException, InvalidArgumentException, UsageParameterSetNameAlreadyExistsException, ManagementException { if (name == null) throw new NullPointerException("Sbb usage param set is null"); if (name.length() == 0) throw new InvalidArgumentException( "The lenght of the Usage Parameter Set Name is zero!"); if (!isValidUsageParameterName(name)) throw new InvalidArgumentException( "The lenght of the Usage Parameter Set Name is zero!"); _createUsageParameterSet(sbbId, name, true); }
public void removeUsageParameterSet(SbbID sbbId, String name) throws NullPointerException, UnrecognizedSbbException, InvalidArgumentException, UnrecognizedUsageParameterSetNameException, ManagementException { if (name == null) throw new NullPointerException("Sbb usage param set is null"); if (name.length() == 0) throw new InvalidArgumentException( "The lenght of the Usage Parameter Set Name is zero!"); if (!isValidUsageParameterName(name)) throw new InvalidArgumentException( "The lenght of the Usage Parameter Set Name is zero!"); _removeUsageParameterSet(sbbId, name); }
public void unsetTracerLevel(String tracerName) throws InvalidArgumentException { if (!isTracerDefined(tracerName)) { throw new InvalidArgumentException("No tracer definition with name: " + tracerName + ", for notification source: " + this.notificationSource + ". See section 13.3 of JSLEE 1.1 specs"); } TracerImpl tracer = this.tracers.get(tracerName); if (tracer.getParentTracerName() == null) { throw new InvalidArgumentException("Can not unset root tracer level for source: " + this.notificationSource + ". See section 13.3 of JSLEE 1.1 specs"); } tracer.unsetTraceLevel(); }
public void deactivate(ServiceID[] arg0) throws NullPointerException, InvalidArgumentException, UnrecognizedServiceException, InvalidStateException, ManagementException { if (arg0.length == 0) { throw new InvalidArgumentException("InvalidArgumentException"); } for (int i = 0; i < arg0.length; i++) { if (arg0[i] == null) { throw new InvalidArgumentException("InvalidArgumentException"); } } for (int i = 0; i < arg0.length - 1; i++) for (int j = i + 1; j < arg0.length; j++) if (arg0[i] == (arg0[j])) { throw new InvalidArgumentException( "InvalidArgumentException"); } try { for (int i = 0; i < arg0.length; i++) { deactivate(arg0[i]); } } catch (InvalidStateException ise) { throw ise; } catch (Exception ex) { throw new ManagementException("system exception starting service", ex); } }
public void setTracerLevel(TraceLevel lvl, String tracerName) throws InvalidArgumentException { // FIXME: JDOC of TraceMBean - description of class show example // that setTraceLevel creates tracer, we handle creation elswhere if (!isTracerDefined(tracerName)) { throw new InvalidArgumentException("No tracer definition with name: " + tracerName + ", for notification source: " + this.notificationSource + ". See section 13.3 of JSLEE 1.1 specs"); } TracerImpl tracer = this.tracers.get(tracerName); if (tracer.getParentTracerName() == null) { throw new InvalidArgumentException("Can not set root tracer level for source: " + this.notificationSource + ". See section 13.3 of JSLEE 1.1 specs"); } tracer.setTraceLevel(lvl); }
/** * Creates the usage param (and its mbean) for the specified name * * @param paramSetName * @throws NullPointerException * @throws InvalidArgumentException * @throws UsageParameterSetNameAlreadyExistsException * @throws ManagementException */ public void createUsageParameterSet(String paramSetName) throws NullPointerException, InvalidArgumentException, UsageParameterSetNameAlreadyExistsException, ManagementException { if (paramSetName == null) throw new NullPointerException("usage param set is null"); if (paramSetName.length() == 0) throw new InvalidArgumentException( "The lenght of the Usage Parameter Set Name is zero!"); if (!isValidUsageParameterName(paramSetName)) throw new InvalidArgumentException( "The lenght of the Usage Parameter Set Name is zero!"); _createUsageParameterSet(paramSetName); }
public TraceLevel getTracerLevel(String tracerName) throws InvalidArgumentException { if (!isTracerDefined(tracerName)) { throw new InvalidArgumentException("No tracer definition with name: " + tracerName + ", for notification source: " + this.notificationSource + ". See section 13.3 of JSLEE 1.1 specs"); } TracerImpl tracer = this.tracers.get(tracerName); return tracer.getTraceLevel(); }
public ObjectName getUsageParameterObjectName( SbbID sbbId, String name) throws UnrecognizedUsageParameterSetNameException, InvalidArgumentException { String key = Service.getUsageParametersPathName(serviceID,sbbId,name); if ( ! this.getAllUsageParameterNames().contains(name)) { //logger.debug("usageParamNames = " + usageParameterNames); throw new UnrecognizedUsageParameterSetNameException ("Illegal arg - param name not found for this service " + name); } if (this.usageParameterNames.get(sbbId.toString()) == null ) { throw new InvalidArgumentException ("no usage parameter found for this sbb"); } logger.debug("getUsageParameterObjectName: " + sbbId + " name = " + name + " key = " + key); return (ObjectName) this.usageParameterObjectNames.get(key); } /**
public void deactivateAndActivate(ServiceID arg0, ServiceID arg1) throws NullPointerException, InvalidArgumentException, UnrecognizedServiceException, InvalidStateException, ManagementException { if (logger.isInfoEnabled()) logger.debug("deactivateAndActivate (" + arg0 +" , "+ arg1 ); if (arg0 == arg1) throw new InvalidArgumentException("Activating and deactivating the same service!"); if ((arg0 == null) || (arg1 == null)) throw new InvalidArgumentException("The service(s) are null!"); try { deactivate(arg0); activate(arg1); } catch (InvalidStateException ise) { throw ise; }catch (Exception ex) { throw new ManagementException( "exception in deactivating/activating service ! "); } }
public void deactivateAndActivate(ServiceID arg0, ServiceID arg1) throws NullPointerException, InvalidArgumentException, UnrecognizedServiceException, InvalidStateException, ManagementException { if (logger.isInfoEnabled()) logger.debug("deactivateAndActivate (" + arg0 + " , " + arg1); if (arg0 == arg1) throw new InvalidArgumentException( "Activating and deactivating the same service!"); if ((arg0 == null) || (arg1 == null)) throw new InvalidArgumentException("The service(s) are null!"); try { ServiceComponent serviceToDeactivate = componentRepositoryImpl .getComponentByID(arg0); if (serviceToDeactivate == null) { throw new UnrecognizedServiceException(); } else { activate(arg1,arg0); deactivate(arg0); } } catch (InvalidStateException ise) { throw ise; } catch (Exception ex) { throw new ManagementException( "exception in deactivating/activating service ! "); } }
/** * @see ResourceManagementMBean#getResourceUsageMBean(String) */ public ObjectName getResourceUsageMBean(String entityName) throws NullPointerException, UnrecognizedResourceAdaptorEntityException, InvalidArgumentException { if (entityName == null) throw new NullPointerException("null entity name"); final ResourceAdaptorEntityImpl resourceAdaptorEntity = this.resourceAdaptorEntities .get(entityName); if (resourceAdaptorEntity == null) { throw new UnrecognizedResourceAdaptorEntityException(entityName); } else { ResourceUsageMBean mbean = resourceAdaptorEntity.getResourceUsageMBean(); if (mbean == null) { throw new InvalidArgumentException(" Resource Adaptor entity "+entityName+" related resource adaptor does not defines a usage paramters interface. See section 14.2 in SLEE 1.1 specs for more info"); } else { // ensure it is open mbean.open(); // return its object name return mbean.getObjectName(); } } }