org.glassfish.paas.orchestrator.service.spi
Interface Service

All Known Subinterfaces:
ConfiguredService, ProvisionedService
All Known Implementing Classes:
ConfiguredServiceImpl

public interface Service

Generic representation of a Service which can be of types, managed or unmanaged.

Author:
Sivakumar Thyagarajan, Jagadish Ramu, Bhavanishankar S

Method Summary
 Map<Service,List<ServiceLogRecord>> collectLogs(ServiceLogType type, Level level, Date since)
          Collect the log records since the given time for a given level and type.
 Map<Service,List<ServiceLogRecord>> collectLogs(ServiceLogType type, Level level, long count)
          Collect the most recent requested number of log records for a given level and type.
 Set<Service> getChildServices()
          returns the list of Child Services for this Service
eg: GlassFish service is represented by multiple instances of a cluster.
 ServiceLogType getDefaultLogType()
          Get the default log type for the service.
 Set<ServiceLogType> getLogTypes()
          Get the available log types for the service.
 String getName()
          name of the service
 Properties getProperties()
          placeholder for extra-properties.
 ServiceDescription getServiceDescription()
          ServiceDescription pertaining to the service.
 Properties getServiceProperties()
          service specific properties that could be used to get service related information.
 ServiceType getServiceType()
          type of service
 

Method Detail

getServiceType

ServiceType getServiceType()
type of service

Returns:
ServiceType

getServiceDescription

ServiceDescription getServiceDescription()
ServiceDescription pertaining to the service.

Returns:
ServiceDescription

getServiceProperties

Properties getServiceProperties()
service specific properties that could be used to get service related information.

Returns:
Properties

getName

String getName()
name of the service

Returns:
String name

getChildServices

Set<Service> getChildServices()
returns the list of Child Services for this Service
eg: GlassFish service is represented by multiple instances of a cluster.

Returns:
Set

getProperties

Properties getProperties()
placeholder for extra-properties.

Returns:
Properties

collectLogs

Map<Service,List<ServiceLogRecord>> collectLogs(ServiceLogType type,
                                                Level level,
                                                Date since)
Collect the log records since the given time for a given level and type.

Some implementation considerations:

(a) Convert plain text file lines into ServiceLogRecord. (a) Map java.util.logging.Level to service specific log level. (b) Prefer service exposed transport over vm.executeOn(...) to collect logs. (c) If possible, decorate the log for isolating application usage in case of service being a shared service:

For example:

If app1 and app2 are both using the service, an external entity should be able to filter logs pertaining only to app1 (or app2). One way to achieve is by decorating the message being logged with application specific information. We need the underlying service to provide such capability and Plugin implementation must know how to configure it at the time of provisioning the service or at the time of associating the application with an existing provisioned (shared) service.

Parameters:
type - collect logs only for this type
level - collect logs only for this level
since - collect logs since this time till the latest
Returns:
service log records matching the input criteria. When the service has multiple nodes each node will have set of service records, otherwise the key for the map is this service itself.

collectLogs

Map<Service,List<ServiceLogRecord>> collectLogs(ServiceLogType type,
                                                Level level,
                                                long count)
Collect the most recent requested number of log records for a given level and type.

Parameters:
type - collect logs only for this type
level - collect logs only for this level
count - collect most recent given count of log records.
Returns:
service log records matching the input criteria. When the service has multiple nodes each node will have set of service records, otherwise the key for the map is this service itself.

getLogTypes

Set<ServiceLogType> getLogTypes()
Get the available log types for the service.

For example :

Java EE service might have logs for HTTP access info, debug logs, jvm logs, etc

Messaging service might contain MTA (message transfer agent) logs, Error logs, Message Store and Service logs.

Returns:
set of log types for the service.

getDefaultLogType

ServiceLogType getDefaultLogType()
Get the default log type for the service.

Returns:
default log type


Copyright © 2012. All Rights Reserved.