fr.paris.lutece.plugins.contextinclude.service
Class ContextService

java.lang.Object
  extended by fr.paris.lutece.plugins.contextinclude.service.ContextService
All Implemented Interfaces:
IContextService

public class ContextService
extends java.lang.Object
implements IContextService

ContextService


Field Summary
static java.lang.String BEAN_SERVICE
          The Constant BEAN_SERVICE.
 
Constructor Summary
ContextService()
           
 
Method Summary
 void create(Context context)
          Create a new context
 void doReorderContexts()
          Reorder all demand types
 void doReorderContextsGreaterPriority(int nCurrentPriority)
          Reorder the contexts that are greater or equal to the nCurrentPriority.
 java.util.List<Context> findActiveContexts()
          Find active contexts
 java.util.List<Context> findAll()
          Find all contexts
 Context findByPrimaryKey(int nIdContext)
          Find context by its primary key
 java.util.List<Context> findByRelativePriority(OperatorEnum operator, int nPriority)
          Find by relative priority
 boolean isWellOrdered()
          Check if the list of contexts are well ordered
 void remove(int nIdContext)
          Remove a context
 void update(Context context)
          Update a context
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BEAN_SERVICE

public static final java.lang.String BEAN_SERVICE
The Constant BEAN_SERVICE.

See Also:
Constant Field Values
Constructor Detail

ContextService

public ContextService()
Method Detail

create

@Transactional(value="contextinclude.transactionManager")
public void create(Context context)
Create a new context

Specified by:
create in interface IContextService
Parameters:
context - the context

update

@Transactional(value="contextinclude.transactionManager")
public void update(Context context)
Update a context

Specified by:
update in interface IContextService
Parameters:
context - a context

remove

@Transactional(value="contextinclude.transactionManager")
public void remove(int nIdContext)
Remove a context

Specified by:
remove in interface IContextService
Parameters:
nIdContext - the id context

findByPrimaryKey

public Context findByPrimaryKey(int nIdContext)
Find context by its primary key

Specified by:
findByPrimaryKey in interface IContextService
Parameters:
nIdContext - the id context
Returns:
a Context

findAll

public java.util.List<Context> findAll()
Find all contexts

Specified by:
findAll in interface IContextService
Returns:
a list of Context

findActiveContexts

public java.util.List<Context> findActiveContexts()
Find active contexts

Specified by:
findActiveContexts in interface IContextService
Returns:
a list of Context

findByRelativePriority

public java.util.List<Context> findByRelativePriority(OperatorEnum operator,
                                                      int nPriority)
Find by relative priority

Specified by:
findByRelativePriority in interface IContextService
Parameters:
operator - the operator
nPriority - the priority to compare to
Returns:
a list of Context

isWellOrdered

public boolean isWellOrdered()
Check if the list of contexts are well ordered

Specified by:
isWellOrdered in interface IContextService
Returns:
true if it is well ordered, false otherwise

doReorderContexts

public void doReorderContexts()
Reorder all demand types

Specified by:
doReorderContexts in interface IContextService

doReorderContextsGreaterPriority

public void doReorderContextsGreaterPriority(int nCurrentPriority)
Reorder the contexts that are greater or equal to the nCurrentPriority.
Those context orders are move up by 1.

Specified by:
doReorderContextsGreaterPriority in interface IContextService
Parameters:
nCurrentPriority - the current priority


Copyright © 2012 Mairie de Paris. All Rights Reserved.