org.gcube.messaging.accounting.system
Class SystemAccounting

java.lang.Object
  extended by org.gcube.messaging.accounting.system.SystemAccounting

public class SystemAccounting
extends Object

The class implements the System Accounting System accounting give the possibility to account custom information There is a restrictions on the type of the Parameters to send - java.lang.String - java.math.BigDecimal - java.lang.Boolean - java.lang.Integer - java.lang.Long - java.lang.Float - java.lang.Double - byte[] - java.sql.Date - java.sql.Time - java.sql.Timestamp - java.sql.Clob - java.sql.Blob - java.sql.Array - java.sql.Struct - java.sql.Ref

Author:
Andrea Manzi(CERN)

Constructor Summary
protected SystemAccounting()
           
 
Method Summary
 void sendSystemAccountingMessage(org.gcube.common.core.contexts.GCUBEServiceContext context, String type, HashMap<String,Object> parameters, org.gcube.common.core.scope.GCUBEScope... scope)
          The method create SystemAccountingMessages and send them to the D4science MessageBroker configured in the Infrastructure.
 void sendSystemAccountingMessage(String type, org.gcube.common.core.scope.GCUBEScope scope, String sourceGHN, HashMap<String,Object> parameters)
          The method creates a SystemAccoutingMessage and sends it to the D4science MessageBroker configured in the given scope This method is intended to be executed by clients using client GHN libraries
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SystemAccounting

protected SystemAccounting()
                    throws IOException,
                           org.gcube.common.core.scope.GCUBEScopeNotSupportedException
Throws:
IOException
org.gcube.common.core.scope.GCUBEScopeNotSupportedException
Method Detail

sendSystemAccountingMessage

public void sendSystemAccountingMessage(org.gcube.common.core.contexts.GCUBEServiceContext context,
                                        String type,
                                        HashMap<String,Object> parameters,
                                        org.gcube.common.core.scope.GCUBEScope... scope)
                                 throws org.gcube.messaging.accounting.system.SystemAccounting.GHNClientModeException,
                                        org.gcube.messaging.common.messages.SystemAccountingMessage.ReservedFieldException,
                                        IllegalArgumentException,
                                        Exception
The method create SystemAccountingMessages and send them to the D4science MessageBroker configured in the Infrastructure. This method is intended to be executed by Service running on a GHN container. The information about GCUBEScope, ServiceClass and ServiceName are automatically retrieved from the ServiceContext. By default a message for each service scope is generated, otherwise is it possible to specify the GCUBEScope as optional parameter.

Parameters:
context - the Service Context
type - The type of message
parameters - the map of parameters to send
scope, - if the service is running in more than one scope and we want to specify the caller scope, is it possible to use this optional parameters
Throws:
GHNClientModeException - the Exception is thrown when the method is invoked from a client
org.gcube.messaging.common.messages.SystemAccountingMessage.ReservedFieldException - if one or more parameters clash the ones already reserved by the system
IllegalArgumentException - if one or more parameters type are not supported by the system
Exception
org.gcube.messaging.accounting.system.SystemAccounting.GHNClientModeException

sendSystemAccountingMessage

public void sendSystemAccountingMessage(String type,
                                        org.gcube.common.core.scope.GCUBEScope scope,
                                        String sourceGHN,
                                        HashMap<String,Object> parameters)
                                 throws org.gcube.common.core.scope.GCUBEScopeNotSupportedException,
                                        org.gcube.messaging.common.messages.SystemAccountingMessage.ReservedFieldException,
                                        IllegalArgumentException,
                                        Exception
The method creates a SystemAccoutingMessage and sends it to the D4science MessageBroker configured in the given scope This method is intended to be executed by clients using client GHN libraries

Parameters:
type - The type of the message
scope - the GCUBEScope where the message will be published
sourceGHN - the GHN Source of the message
parameters - the map of parameters to send
Throws:
org.gcube.common.core.scope.GCUBEScopeNotSupportedException - the scope is not supported in the current GHN
org.gcube.messaging.common.messages.SystemAccountingMessage.ReservedFieldException - if one or more parameters clash the ones already reserved by the system
IllegalArgumentException - if one or more parameters type are not supported by the system
Exception


Copyright © 2013. All Rights Reserved.