|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.knowhowlab.osgi.monitoradmin.MonitorAdminCommon
public class MonitorAdminCommon
MonitorAdmin common actions that are not related on Permissions
| Field Summary | |
|---|---|
static java.lang.String |
PATH_PATERN
|
| Constructor Summary | |
|---|---|
MonitorAdminCommon(OsgiVisitor osgiVisitor,
LogVisitor logVisitor)
|
|
| Method Summary | |
|---|---|
void |
addJob(AbstractMonitoringJob job)
Add a new MonitoringJob to the list |
void |
cancelAllJobs()
Cancel all jobs and clear the list |
void |
cancelJob(AbstractMonitoringJob job)
Cancel Job and remove it from jobs list |
org.osgi.framework.ServiceReference |
findMonitorableReferenceById(java.lang.String monitorableId)
Find Monitorable service reference by monitorable Id. |
void |
fireEvent(java.lang.String monitorableId,
StatusVariable statusVariable,
java.lang.String initiator)
Fire StatusVariable update event |
java.lang.String |
getDescription(org.osgi.framework.ServiceReference serviceReference,
java.lang.String statusVariableId)
Returns a StatusVariable description addressed by
Monitorable service reference and its id. |
java.lang.String[] |
getDisabledNotificationPaths()
Get array with paths that are disabled for notificatios with switchEvents() method |
org.osgi.framework.ServiceReference[] |
getMonitorableReferences()
Returns array of the Monitorable ServiceReferences that are
currently registered. |
org.osgi.framework.ServiceReference[] |
getMonitorableReferences(java.lang.String monitorableIdFilter)
Returns array of the Monitorable ServiceReferences that are
currently registered. |
java.util.List<MonitoringJob> |
getRunningJobs()
Get list of all running MonitoringJobs |
StatusVariable |
getStatusVariable(org.osgi.framework.ServiceReference serviceReference,
java.lang.String statusVariableId)
Returns a StatusVariable addressed by Monitorable service reference and its id. |
StatusVariable |
getStatusVariable(java.lang.String path)
Returns a StatusVariable addressed by its full path. |
java.lang.String[] |
getStatusVariableNames(java.lang.String monitorableId)
Returns the list of StatusVariable names published by a
Monitorable instance. |
static boolean |
isValidId(java.lang.String id)
Validate Monitorable Id or StatusVariable name |
boolean |
notifiesOnChange(org.osgi.framework.ServiceReference serviceReference,
java.lang.String statusVariableId)
Returns a StatusVariable notification flag addressed by
Monitorable service reference and its id. |
boolean |
resetStatusVariable(org.osgi.framework.ServiceReference serviceReference,
java.lang.String statusVariableId)
Reset StatusVariable description addressed by
Monitorable service reference and its id. |
void |
switchEvents(java.util.Set<java.lang.String> paths,
boolean on)
Switch on/off events |
void |
updated(java.lang.String monitorableId,
StatusVariable statusVariable)
Callback for notification of a StatusVariable change. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PATH_PATERN
| Constructor Detail |
|---|
public MonitorAdminCommon(OsgiVisitor osgiVisitor,
LogVisitor logVisitor)
| Method Detail |
|---|
public void updated(java.lang.String monitorableId,
StatusVariable statusVariable)
throws java.lang.IllegalArgumentException
StatusVariable change.
updated in interface MonitorListenermonitorableId - the identifier of the Monitorable
instance reporting the changestatusVariable - the StatusVariable that has changed
java.lang.IllegalArgumentException - if the specified monitorable
ID is invalid (null, empty, or contains illegal
characters) or points to a non-existing Monitorable,
or if statusVariable is nullpublic java.lang.String[] getDisabledNotificationPaths()
public org.osgi.framework.ServiceReference findMonitorableReferenceById(java.lang.String monitorableId)
throws java.lang.IllegalArgumentException
monitorableId - id that is userd to filter services
java.lang.IllegalArgumentException - monitorableId is null or monitorableId points
to non-existing service or monitorableId is invalidpublic org.osgi.framework.ServiceReference[] getMonitorableReferences()
Monitorable ServiceReferences that are
currently registered.
The returned array contains the ServiceTeferences in alphabetical order by service PID.
It cannot be null, an empty array is returned if no
Monitorable services are registered.
Monitorable namespublic org.osgi.framework.ServiceReference[] getMonitorableReferences(java.lang.String monitorableIdFilter)
Monitorable ServiceReferences that are
currently registered.
The returned array contains the ServiceTeferences in alphabetical order by service PID.
It cannot be null, an empty array is returned if no
Monitorable services are registered.
monitorableIdFilter - Monitorable SERVICE_PID filter
Monitorable namespublic void addJob(AbstractMonitoringJob job)
MonitoringJob to the list
job - MonitoringJobpublic java.util.List<MonitoringJob> getRunningJobs()
MonitoringJobs
public StatusVariable getStatusVariable(java.lang.String path)
throws java.lang.IllegalArgumentException
StatusVariable addressed by its full path.
getStatusVariable in interface MonitoringJobVisitorpath - the full path of the StatusVariable in
[Monitorable_ID]/[StatusVariable_ID] format
StatusVariable object
java.lang.IllegalArgumentException - if path is
null or otherwise invalid, or points to a
non-existing StatusVariableMonitorable.getStatusVariable(String)
public StatusVariable getStatusVariable(org.osgi.framework.ServiceReference serviceReference,
java.lang.String statusVariableId)
StatusVariable addressed by Monitorable service reference and its id.
serviceReference - Monitorable service referencestatusVariableId - StatusVariable id
StatusVariable object
java.lang.IllegalArgumentException - if points to a
non-existing StatusVariable
public java.lang.String getDescription(org.osgi.framework.ServiceReference serviceReference,
java.lang.String statusVariableId)
StatusVariable description addressed by
Monitorable service reference and its id.
serviceReference - Monitorable service referencestatusVariableId - StatusVariable id
StatusVariable description
java.lang.IllegalArgumentException - if points to a
non-existing StatusVariable
public boolean notifiesOnChange(org.osgi.framework.ServiceReference serviceReference,
java.lang.String statusVariableId)
StatusVariable notification flag addressed by
Monitorable service reference and its id.
serviceReference - Monitorable service referencestatusVariableId - StatusVariable id
StatusVariable notification flag
java.lang.IllegalArgumentException - if points to a
non-existing StatusVariable
public boolean resetStatusVariable(org.osgi.framework.ServiceReference serviceReference,
java.lang.String statusVariableId)
StatusVariable description addressed by
Monitorable service reference and its id.
serviceReference - Monitorable service referencestatusVariableId - StatusVariable id
StatusVariable description
java.lang.IllegalArgumentException - if points to a
non-existing StatusVariablepublic void cancelJob(AbstractMonitoringJob job)
cancelJob in interface MonitoringJobVisitorjob - job to cancelpublic void cancelAllJobs()
public void fireEvent(java.lang.String monitorableId,
StatusVariable statusVariable,
java.lang.String initiator)
fireEvent in interface MonitoringJobVisitormonitorableId - monitorableIdstatusVariable - status variableinitiator - initiator. if null - is not added to event
public void switchEvents(java.util.Set<java.lang.String> paths,
boolean on)
paths - StatusVariable pathson - false if event sending should be switched off,
true if it should be switched on for the given pathpublic java.lang.String[] getStatusVariableNames(java.lang.String monitorableId)
StatusVariable names published by a
Monitorable instance. Only those status variables are
listed where the following two conditions are met:
Monitorable holds a
MonitorPermission for the status variable with the
publish action present
MonitorPermission for
the status variable with the read action present
null, an empty array is
returned if no (authorized and readable) Status Variables are provided
by the given Monitorable.
monitorableId - the identifier of a Monitorable
instance
StatusVariable objects names
published by the specified Monitorable
java.lang.IllegalArgumentException - if monitorableId
is null or otherwise invalid, or points to a
non-existing Monitorablepublic static boolean isValidId(java.lang.String id)
Monitorable Id or StatusVariable name
id - id
false - id is invalid, otherwise - true
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||