org.glassfish.paas.orchestrator.service
Class ConfiguredServiceImpl

java.lang.Object
  extended by org.glassfish.paas.orchestrator.service.ConfiguredServiceImpl
All Implemented Interfaces:
ConfiguredService, Service

public class ConfiguredServiceImpl
extends Object
implements ConfiguredService

Author:
Jagadish Ramu

Constructor Summary
ConfiguredServiceImpl(String serviceName, ServiceType serviceType, ServiceDescription serviceDescription, Properties serviceProperties)
           
 
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
 void setProperties(Properties properties)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfiguredServiceImpl

public ConfiguredServiceImpl(String serviceName,
                             ServiceType serviceType,
                             ServiceDescription serviceDescription,
                             Properties serviceProperties)
Method Detail

getServiceType

public ServiceType getServiceType()
Description copied from interface: Service
type of service

Specified by:
getServiceType in interface Service
Returns:
ServiceType

getServiceDescription

public ServiceDescription getServiceDescription()
Description copied from interface: Service
ServiceDescription pertaining to the service.

Specified by:
getServiceDescription in interface Service
Returns:
ServiceDescription

getServiceProperties

public Properties getServiceProperties()
Description copied from interface: Service
service specific properties that could be used to get service related information.

Specified by:
getServiceProperties in interface Service
Returns:
Properties

getName

public String getName()
Description copied from interface: Service
name of the service

Specified by:
getName in interface Service
Returns:
String name

getChildServices

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

Specified by:
getChildServices in interface Service
Returns:
Set

getProperties

public Properties getProperties()
Description copied from interface: Service
placeholder for extra-properties.

Specified by:
getProperties in interface Service
Returns:
Properties

setProperties

public void setProperties(Properties properties)

collectLogs

public Map<Service,List<ServiceLogRecord>> collectLogs(ServiceLogType type,
                                                       Level level,
                                                       Date since)
Description copied from interface: Service
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.

Specified by:
collectLogs in interface 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

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

Specified by:
collectLogs in interface Service
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

public Set<ServiceLogType> getLogTypes()
Description copied from interface: Service
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.

Specified by:
getLogTypes in interface Service
Returns:
set of log types for the service.

getDefaultLogType

public ServiceLogType getDefaultLogType()
Description copied from interface: Service
Get the default log type for the service.

Specified by:
getDefaultLogType in interface Service
Returns:
default log type


Copyright © 2012. All Rights Reserved.