fr.cnes.sitools.common.application
Class SitoolsApplication

java.lang.Object
  extended by ExtendedWadlApplication
      extended by fr.cnes.sitools.common.application.SitoolsApplication
Direct Known Subclasses:
AbstractDimensionApplication, AbstractInscriptionApplication, AbstractOrderApplication, ApplicationPluginApplication, AppRegistryApplication, AuthorizationApplication, CollectionsApplication, ConceptTemplateAdministration, ConverterApplication, ConverterPluginsApplication, DatasetViewApplication, DBExplorerApplication, DictionaryAdministration, FeedsApplication, FilterApplication, FilterClassPluginApplication, FilterPluginApplication, FilterPluginsApplication, FormApplication, FormComponentsApplication, FormProjectApplication, GuiServiceApplication, GuiServicePluginApplication, JDBCDataSourceAdministration, MailAdministration, MongoDBDataSourceAdministration, MongoDBExplorerApplication, MultiDsOsApplication, NotificationApplication, OpenSearchApplication, OrdersFilesApplication, PortalApplication, ProjectModuleApplication, ResourceClassPluginApplication, ResourcePluginApplication, RoleApplication, ServiceApplication, SitoolsParameterizedApplication, SolrApplication, StaticWebApplication, StorageAdministration, StorageApplication, TaskApplication, TemporaryFolderApplication, UnitsApplication, UploadApplication, UsersAndGroupsAdministration, UserStorageApplication, UserStorageManagement

public abstract class SitoolsApplication
extends ExtendedWadlApplication

Root abstract class for SITools applications.

Author:
jp.boignard (AKKA Technologies)

Constructor Summary
SitoolsApplication()
          Default constructor.
SitoolsApplication(org.restlet.Context context)
          Constructor with context.
SitoolsApplication(org.restlet.Context arg0, org.restlet.representation.Representation arg1)
          Constructor with context and representation of the application configuration.
 
Method Summary
 org.restlet.Restlet addSecurity(org.restlet.Restlet restlet, java.lang.String userRequestAttribute, java.util.List<org.restlet.data.Method> methodsForPublic)
          Authorization management with URI ...
 org.restlet.Restlet addSecurity(SitoolsApplication application)
          Setting security.
 org.restlet.Restlet addSecurityFilter(org.restlet.Context context, org.restlet.Restlet restlet)
          Add Security filter in front of the Restlet
 void defaultDescribe()
          Default description.
 org.restlet.ext.wadl.ApplicationInfo getApplicationInfo(org.restlet.Request request, org.restlet.Response response)
           
 java.lang.String getAttachementRef()
          Gets the attachementRef value
 SitoolsRealm getAuthenticationRealm()
          Get authentication Realm
 org.restlet.security.Authorizer getAuthorizer()
          Gets the authorizer value
 DelegatedAuthorizer getAuthorizer(org.restlet.Context context, java.util.concurrent.ConcurrentHashMap<java.lang.String,org.restlet.security.Role> reference)
          Gets authorizer for an application.
 DelegatedAuthorizer getAuthorizer(java.lang.String objectUUID)
          Gets authorizer for an object in context application.
 Category getCategory()
          Gets the category value
 java.lang.String getId()
          Gets the id value.
 java.lang.String getPublicBaseRef(org.restlet.Request request)
          Gets the publicBaseRef value
 java.util.ArrayList<java.lang.String> getRepresentationInfoReferences()
          Method to get the list of representation info references
 org.restlet.Restlet getSecure()
          Get the secured application by default
 SitoolsSettings getSettings()
          Gets the settings value
 SitoolsApplicationInfo getSitoolsApplicationInfo()
          Gets the sitoolsApplicationInfo value
 java.lang.String getType()
          Gets the type value
 org.restlet.security.Authorizer getUserAuthorizer(org.restlet.Context context, java.util.concurrent.ConcurrentHashMap<java.lang.String,org.restlet.security.Role> reference, java.lang.String userRequestAttribute, org.restlet.Application application, java.util.List<org.restlet.data.Method> methodsForPublic)
          Gets authorizer for an application.
 boolean isAuthorizationSecure()
          Gets the authorizationSecure value.
 boolean isUserAuthenticationNeeded()
          Gets the isUserAuthenticationNeeded value
 void register()
          Application registration.
 void setAutoRegistration(boolean autoRegister)
          Set the fact that the application is auto registering
 void setCategory(Category category)
          Sets the value of category
 void setId(java.lang.String idd)
          Sets the value of id.
 void setSitoolsApplicationInfo(SitoolsApplicationInfo sitoolsApplicationInfo)
          Sets the value of sitoolsApplicationInfo
 void setType(java.lang.String type)
          Sets the value of type
 void setUserAuthenticationNeeded(boolean isUserAuthenticationNeeded)
          Sets the value of isUserAuthenticationNeeded
abstract  void sitoolsDescribe()
          Abstract method for thinking about implementing it for each concrete application describe is the RESTlet method, but overriding, prevents the self-describing functionality.
 void start()
           
 void stop()
           
 void unregister()
          Application registration.
 Resource wrapToResource()
          Resource Representation of the application.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SitoolsApplication

public SitoolsApplication()
Default constructor.


SitoolsApplication

public SitoolsApplication(org.restlet.Context context)
Constructor with context.

Parameters:
context - Restlet host context

SitoolsApplication

public SitoolsApplication(org.restlet.Context arg0,
                          org.restlet.representation.Representation arg1)
Constructor with context and representation of the application configuration.

Parameters:
arg0 - Restlet context
arg1 - wadl representation
Method Detail

sitoolsDescribe

public abstract void sitoolsDescribe()
Abstract method for thinking about implementing it for each concrete application describe is the RESTlet method, but overriding, prevents the self-describing functionality.


defaultDescribe

public final void defaultDescribe()
Default description.


register

public final void register()
Application registration.


unregister

public final void unregister()
Application registration.


getAuthorizer

public final DelegatedAuthorizer getAuthorizer(java.lang.String objectUUID)
Gets authorizer for an object in context application.

Parameters:
objectUUID - unique identifier for object
Returns:
Authorizer

getAuthorizer

public final DelegatedAuthorizer getAuthorizer(org.restlet.Context context,
                                               java.util.concurrent.ConcurrentHashMap<java.lang.String,org.restlet.security.Role> reference)
Gets authorizer for an application.

Parameters:
context - RESTlet application context
reference - ConcurrentHashMap of Role objects to be used in the Authorizer.
Returns:
Authorizer

addSecurity

public final org.restlet.Restlet addSecurity(org.restlet.Restlet restlet,
                                             java.lang.String userRequestAttribute,
                                             java.util.List<org.restlet.data.Method> methodsForPublic)
Authorization management with URI ...

Parameters:
restlet - internal router
userRequestAttribute - user request attribute
methodsForPublic - the List of methods allowed for public user
Returns:
RESTlet with security

getUserAuthorizer

public final org.restlet.security.Authorizer getUserAuthorizer(org.restlet.Context context,
                                                               java.util.concurrent.ConcurrentHashMap<java.lang.String,org.restlet.security.Role> reference,
                                                               java.lang.String userRequestAttribute,
                                                               org.restlet.Application application,
                                                               java.util.List<org.restlet.data.Method> methodsForPublic)
Gets authorizer for an application.

Parameters:
application - the application
context - RESTlet application context
reference - ConcurrentHashMap of Role objects to be used in the Authorizer.
userRequestAttribute - user request attribute
methodsForPublic - the List of methods allowed for public user
Returns:
Authorizer

start

public void start()
           throws java.lang.Exception
Throws:
java.lang.Exception

stop

public void stop()
          throws java.lang.Exception
Throws:
java.lang.Exception

getAttachementRef

public final java.lang.String getAttachementRef()
Gets the attachementRef value

Returns:
the attachementRef

getPublicBaseRef

public final java.lang.String getPublicBaseRef(org.restlet.Request request)
Gets the publicBaseRef value

Parameters:
request - the request sent
Returns:
the publicBaseRef

wrapToResource

public final Resource wrapToResource()
Resource Representation of the application.

Returns:
Resource definition of the application

addSecurityFilter

public final org.restlet.Restlet addSecurityFilter(org.restlet.Context context,
                                                   org.restlet.Restlet restlet)
Add Security filter in front of the Restlet

Parameters:
context - Restlet context
restlet - Restlet to be secured
Returns:
a new instance of Security Filter securing the original Restlet

addSecurity

public final org.restlet.Restlet addSecurity(SitoolsApplication application)
Setting security.

Parameters:
application - Application router to be attached with the authenticator/authorizer
Returns:
Restlet

getSecure

public org.restlet.Restlet getSecure()
Get the secured application by default

Returns:
secured application according to the defined security.Authorizations for the application.

isAuthorizationSecure

public final boolean isAuthorizationSecure()
Gets the authorizationSecure value.

Returns:
the authorizationSecure

getId

public final java.lang.String getId()
Gets the id value.

Returns:
the id

setId

public final void setId(java.lang.String idd)
Sets the value of id.

Parameters:
idd - the id to set

getAuthorizer

public final org.restlet.security.Authorizer getAuthorizer()
Gets the authorizer value

Returns:
the authorizer

getType

public final java.lang.String getType()
Gets the type value

Returns:
the type

setType

public final void setType(java.lang.String type)
Sets the value of type

Parameters:
type - the type to set

getCategory

public final Category getCategory()
Gets the category value

Returns:
the category

setCategory

public final void setCategory(Category category)
Sets the value of category

Parameters:
category - the category to set

getSettings

public final SitoolsSettings getSettings()
Gets the settings value

Returns:
the settings

getSitoolsApplicationInfo

public final SitoolsApplicationInfo getSitoolsApplicationInfo()
Gets the sitoolsApplicationInfo value

Returns:
the sitoolsApplicationInfo

setAutoRegistration

public final void setAutoRegistration(boolean autoRegister)
Set the fact that the application is auto registering

Parameters:
autoRegister - true to set that the application is autoRegistering

getAuthenticationRealm

public final SitoolsRealm getAuthenticationRealm()
Get authentication Realm

Returns:
the authentication realm

setSitoolsApplicationInfo

public final void setSitoolsApplicationInfo(SitoolsApplicationInfo sitoolsApplicationInfo)
Sets the value of sitoolsApplicationInfo

Parameters:
sitoolsApplicationInfo - the sitoolsApplicationInfo to set

getApplicationInfo

public org.restlet.ext.wadl.ApplicationInfo getApplicationInfo(org.restlet.Request request,
                                                               org.restlet.Response response)

getRepresentationInfoReferences

public final java.util.ArrayList<java.lang.String> getRepresentationInfoReferences()
Method to get the list of representation info references

Returns:
the list of representation info references

isUserAuthenticationNeeded

public boolean isUserAuthenticationNeeded()
Gets the isUserAuthenticationNeeded value

Returns:
the isUserAuthenticationNeeded

setUserAuthenticationNeeded

public void setUserAuthenticationNeeded(boolean isUserAuthenticationNeeded)
Sets the value of isUserAuthenticationNeeded

Parameters:
isUserAuthenticationNeeded - the isUserAuthenticationNeeded to set


Copyright © 2010-2013 CNES. All Rights Reserved.