public final class Service extends Object
Modifier and Type | Method and Description |
---|---|
void |
configure(String name,
String group,
String description,
boolean notifyWhenOffline)
Configures the service instance.
|
void |
configure(String name,
String group,
String description,
boolean notifyWhenOffline,
String instanceIdentifier)
Configures the service instance.
|
String |
getDedicatedServerName()
Gets the instance dedicated server name.
|
String |
getDescription()
Gets the instance description.
|
String |
getGroup()
Gets the instance group.
|
static Service |
getInstance()
Gets the service single instance.
|
String |
getInstanceIdentifier()
Gets the instance identifier.
|
String |
getName()
Gets the instance name.
|
String |
getUsername()
Gets the instance username.
|
boolean |
isStarted()
Gets the state of the service instance.
|
void |
sendNotificationToAllDevices(String message,
NotificationPriority priority)
Sends a notification to all devices.
|
void |
setCommandReceivedHandler(CommandReceivedHandler handler)
Sets the handler for received commands.
|
void |
setDescription(String description)
Sets the instance description.
|
void |
setDetails(Groups instanceDetails)
Sets the instance details.
|
void |
setDetailsRequestHandler(DetailsRequestHandler handler)
Sets the handler for details request
|
void |
setExceptionOccurredHandler(ExceptionOccurredHandler handler)
Sets the handler for occurred exceptions.
|
void |
setInputValueChangedHandler(InputValueChangedHandler handler)
Sets the handler for received page request.
|
void |
setPageCommandReceivedHandler(PageCommandReceivedHandler handler)
Sets the handler for received page command.
|
void |
setPageDetails(int pageId,
Groups pageDetails)
Sets the page details.
|
void |
setPageRequestHandler(PageRequestHandler handler)
Sets the handler for received page request.
|
void |
start(String username,
String password,
String apiKey)
Starts the service instance.
|
void |
start(String username,
String password,
String apiKey,
String dedicatedServerName)
Starts the service instance.
|
void |
stop()
Stops the service instance.
|
public static final Service getInstance()
public final void configure(String name, String group, String description, boolean notifyWhenOffline)
name
- Instance name.group
- Instance group.description
- Instance description.notifyWhenOffline
- Indicates if a notification will be send if the instance is
offline.RuntimeException
- if service is startedpublic final void configure(String name, String group, String description, boolean notifyWhenOffline, String instanceIdentifier)
name
- Instance name.group
- Instance group.description
- Instance description.notifyWhenOffline
- Indicates if a notification will be send if the instance is
offline.instanceIdentifier
- Instance identifier.RuntimeException
- if service is startedpublic final void start(String username, String password, String apiKey)
username
- Pulseway account username.password
- Pulseway account password.apiKey
- Pulseway account API key.public void start(String username, String password, String apiKey, String dedicatedServerName)
username
- Pulseway account username.password
- Pulseway account password.apiKey
- Pulseway account API key.dedicatedServerName
- Pulseway dedicated server name.public final void stop()
public void setExceptionOccurredHandler(ExceptionOccurredHandler handler)
handler
- the handler to setpublic final void setDetailsRequestHandler(DetailsRequestHandler handler)
handler
- the handler to setpublic final void setCommandReceivedHandler(CommandReceivedHandler handler)
handler
- the handler to setpublic final void setPageCommandReceivedHandler(PageCommandReceivedHandler handler)
handler
- the handler to setpublic final void setPageRequestHandler(PageRequestHandler handler)
handler
- the handler to setpublic final void setInputValueChangedHandler(InputValueChangedHandler handler)
handler
- the handler to setpublic final boolean isStarted()
public final String getDescription()
public final void setDescription(String description)
description
- the description to setpublic final String getName()
public final String getGroup()
public final String getUsername()
public final String getDedicatedServerName()
public final void setDetails(Groups instanceDetails)
instanceDetails
- the instance details to setpublic final void setPageDetails(int pageId, Groups pageDetails)
pageId
- page idpageDetails
- page details to setpublic void sendNotificationToAllDevices(String message, NotificationPriority priority)
message
- Notification message.priority
- Notification priority.public final String getInstanceIdentifier()
Copyright © 2015 MMSOFT Design. All Rights Reserved.