Package org.restlet.routing

Examples of org.restlet.routing.Router


   * Creates a root Restlet that will receive all incoming calls.
   */
  @Override
  public Restlet createInboundRoot() {
    // Routeur de base
    Router router = new Router(getContext());

    // Definition des collections
    router.attach("/chasses", ChassesResource.class);
    router.attach("/coordonnees", CoordonneesResource.class);
    router.attach("/durees", DureesResource.class);
    router.attach("/etapes", EtapesResource.class);
    router.attach("/evaluations", EvaluationsResource.class);
    router.attach("/lieux", LieuxResource.class);
    router.attach("/participations", ParticipationsResource.class);
    router.attach("/utilisateurs", UtilisateursResource.class);

    // Definition des elements
    router.attach("/chasses/{nom}", ChasseResource.class);
    router.attach("/coordonnees/{nom}", CoordonneeResource.class);
    router.attach("/durees/{nom}", DureeResource.class);
    router.attach("/etapes/{nom}", EtapeResource.class);
    router.attach("/etapes/{nom}/valider", EtapeValidationResource.class);
    router.attach("/evaluations/{nom}", EvaluationResource.class);
    router.attach("/lieux/{nom}", LieuResource.class);
    router.attach("/participations/{nom}", ParticipationResource.class);
    router.attach("/utilisateurs/{nom}", UtilisateurResource.class);

    return router;
  }
View Full Code Here


          java.util.logging.Logger.getLogger("org.restlet.Component.LogService").setLevel(java.util.logging.Level.OFF);
        }
        // Create a router Restlet that routes each call to a 
        // new instance of HelloWorldResource.
     
        Router router = new Router(getContext());

        // Might Want to add something in here for Trusted Routing (IP ADDRESS CAPTURE ETC)
       
        /*
         * All responses will be returned in either JSON or XML
         * format eg wt=json or wt=xml and will conform the
         * Lucene / Solr format
         *
         * all search function will act as a proxy to solr
         * which will run in a seperate tomcat process
         *
         * all requests must include a API key that is in the
         * form of guid eg api=__GUID__
         *
         * all posts will require authentication
         *
         * the remainder of the api will be modeled after flickr
         *
         */
       
        /***************************************************
         ** Authentication
         **
         ****************************************************/
       
// AUTHENTICATION       
       
        attach(router, "/auth/login",LoginInterface.class);
        attach(router, "/auth/login/{user}/{pass}", LoginInterface.class);
        attach(router, "/auth/login/admin/{user}/{pass}",LoginInterface.class);
        attach(router, "/auth/keepalive",LoginInterface.class);
        attach(router, "/auth/keepalive/admin",LoginInterface.class);
        attach(router, "/auth/logout",LoginInterface.class);
        attach(router, "/auth/logout/admin",LoginInterface.class);
        attach(router, "/auth/forgotpassword",LoginInterface.class);
        attach(router, "/auth/deactivate",LoginInterface.class);
       
        /***************************************************
        ** Define the knowledge search routes
        ** (we can either call this knowledge or search
        ** or something else that makes sense)
        ** also thinking about making the default the feeds
        ****************************************************/
       
// SOURCES:
       
        // we should not allow this api call, was just for testing
        //BETA NAMING
        router.attach("/knowledge/sources/{source}", SourceInterface.class);
        router.attach("/knowledge/sources/save/{communityid}/", SourceInterface.class);
        router.attach("/knowledge/sources/add/{sourceurl}/{sourcetitle}/{sourcedesc}/{extracttype}/{sourcetags}/{mediatype}/{communityid}", SourceInterface.class)
        router.attach("/knowledge/sources/approve/{source}/{communityid}/", SourceInterface.class);  
        router.attach("/knowledge/sources/decline/{source}/{communityid}",SourceInterface.class);
        router.attach("/knowledge/sources/good/{communityid}", SourceInterface.class)
        router.attach("/knowledge/sources/bad/{communityid}", SourceInterface.class)
        router.attach("/knowledge/sources/pending/{communityid}",SourceInterface.class);
        //VO NAMING
        attach(router, "/config/source/get/{sourceid}", SourceInterface.class);
        attach(router, "/config/source/save/{communityid}", SourceInterface.class);
        attach(router, "/config/source/add/{sourceurl}/{sourcetitle}/{sourcedesc}/{extracttype}/{sourcetags}/{mediatype}/{communityid}", SourceInterface.class)
        attach(router, "/config/source/approve/{sourceid}/{communityid}", SourceInterface.class);  
        attach(router, "/config/source/decline/{sourceid}/{communityid}",SourceInterface.class);
        attach(router, "/config/source/good/{communityid}", SourceInterface.class)
        attach(router, "/config/source/bad/{communityid}", SourceInterface.class)
        attach(router, "/config/source/pending/{communityid}",SourceInterface.class);
        attach(router, "/config/source/user", SourceInterface.class);
        attach(router, "/config/source/test",SourceInterface.class);
        attach(router, "/config/source/delete/{sourceid}/{communityid}",SourceInterface.class);
        attach(router, "/config/source/delete/docs/{sourceid}/{communityid}",SourceInterface.class);
        attach(router, "/config/source/suspend/{sourceid}/{communityid}/{shouldSuspend}",SourceInterface.class);
       
  //CUSTOM MAP REDUCE
        //BETA NAMING
        router.attach("/knowledge/mapreduce/schedulejob/{jobtitle}/{jobdesc}/{communityIds}/{jarURL}/{timeToRun}/{frequencyToRun}/{mapperClass}/{reducerClass}/{combinerClass}/{query}/{inputcollection}/{outputKey}/{outputValue}", CustomInterface.class);
        router.attach("/knowledge/mapreduce/getresults/{jobid}", CustomInterface.class);
        router.attach("/knowledge/mapreduce/getjobs", CustomInterface.class);
        //Remove this for security reasons, can access other collections from within reduce
        //router.attach("/knowledge/mapreduce/{inputcollection}/{map}/{reduce}/{query}", CustomInterface.class);         
        //VO NAMING
        // Map reduce:
        attach(router, "/custom/mapreduce/schedulejob/{jobtitle}/{jobdesc}/{communityIds}/{jarURL}/{timeToRun}/{frequencyToRun}/{mapperClass}/{reducerClass}/{combinerClass}/{query}/{inputcollection}/{outputKey}/{outputValue}/{appendResults}/{ageOutInDays}/{jobsToDependOn}", CustomInterface.class);
        attach(router, "/custom/mapreduce/updatejob/{jobid}/{jobtitle}/{jobdesc}/{communityIds}/{jarURL}/{timeToRun}/{frequencyToRun}/{mapperClass}/{reducerClass}/{combinerClass}/{query}/{inputcollection}/{outputKey}/{outputValue}/{appendResults}/{ageOutInDays}/{jobsToDependOn}", CustomInterface.class);
        attach(router, "/custom/mapreduce/schedulejob/{communityIds}/{jobsToDependOn}", CustomInterface.class); // (POST version)
        attach(router, "/custom/mapreduce/updatejob/{jobid}/{communityIds}/{jobsToDependOn}", CustomInterface.class); // (POST version)
        attach(router, "/custom/mapreduce/removejob/{jobid}", CustomInterface.class);
        attach(router, "/custom/mapreduce/getresults/{jobid}", CustomInterface.class);
        attach(router, "/custom/mapreduce/getjobs/{jobid}", CustomInterface.class);
        attach(router, "/custom/mapreduce/getjobs", CustomInterface.class);
        // Saved queries:
        attach(router, "/custom/savedquery/schedulejob/{jobtitle}/{jobdesc}/{communityIds}/{timeToRun}/{frequencyToRun}/{query}/{inputcollection}/{outputKey}/{outputValue}/{appendResults}/{ageOutInDays}/{jobsToDependOn}", CustomInterface.class);
        attach(router, "/custom/savedquery/updatejob/{jobid}/{jobtitle}/{jobdesc}/{communityIds}{timeToRun}/{frequencyToRun}/{query}/{inputcollection}/{outputKey}/{outputValue}/{appendResults}/{ageOutInDays}/{jobsToDependOn}", CustomInterface.class);
        attach(router, "/custom/savedquery/schedulejob/{communityIds}/{jobsToDependOn}", CustomInterface.class); // (POST version)
        attach(router, "/custom/savedquery/updatejob/{jobid}/{communityIds}/{jobsToDependOn}", CustomInterface.class); // (POST version)
        attach(router, "/custom/savedquery/removejob/{jobid}", CustomInterface.class);
        attach(router, "/custom/savedquery/getresults/{jobid}", CustomInterface.class);
        attach(router, "/custom/savedquery/getjobs/{jobid}", CustomInterface.class);
        attach(router, "/custom/savedquery/getjobs", CustomInterface.class);       
        // These two for backwards compatibility for a while:
        attach(router, "/custom/mapreduce/schedulejob/{jobtitle}/{jobdesc}/{communityIds}/{jarURL}/{timeToRun}/{frequencyToRun}/{mapperClass}/{reducerClass}/{combinerClass}/{query}/{inputcollection}/{outputKey}/{outputValue}", CustomInterface.class);
        attach(router, "/custom/mapreduce/updatejob/{jobid}/{jobtitle}/{jobdesc}/{communityIds}/{jarURL}/{timeToRun}/{frequencyToRun}/{mapperClass}/{reducerClass}/{combinerClass}/{query}/{inputcollection}/{outputKey}/{outputValue}", CustomInterface.class);
        //Remove this for security reasons, can access other collections from within reduce
        //attach(router, "/custom/mapreduce/{inputcollection}/{map}/{reduce}/{query}", CustomInterface.class);         
             
// SEARCHES:
        //BETA NAMING
        router.attach("/knowledge/searchSuggest/{term}/{communityids}",SearchInterface.class);
        router.attach("/knowledge/searchEventSuggest/{ent1}/{verb}/{ent2}/{field}/{communityids}",SearchInterface.class);          
        router.attach("/knowledge/aliasSuggest/{field}/{term}/{communityids}",SearchInterface.class);          
        router.attach("/knowledge/doc/{feedid}/{communityids}", DocumentInterface.class);
        router.attach("/knowledge/feed/{feedid}/{communityids}", DocumentInterface.class);
        //VO NAMING
        attach(router, "/knowledge/query/{communityids}",QueryInterface.class);
        attach(router, "/knowledge/feature/geoSuggest/{term}/{communityids}", SearchInterface.class); //UNTESTED
        attach(router, "/knowledge/feature/entitySuggest/{term}/{communityids}",SearchInterface.class);
        attach(router, "/knowledge/feature/aliasSuggest/{field}/{term}/{communityids}",SearchInterface.class);       
        attach(router, "/knowledge/document/get/{docid}", DocumentInterface.class)
        attach(router, "/knowledge/document/get/{sourcekey}/{url}", DocumentInterface.class)
      router.attach("/knowledge/document/file/get/{sourcekey}/", DocumentInterface.class, Template.MODE_STARTS_WITH);
        attach(router, "/knowledge/document/query/{communityids}",QueryInterface.class);   
        attach(router, "/knowledge/feature/eventSuggest/{ent1}/{verb}/{ent2}/{field}/{communityids}",SearchInterface.class);
          // (This is obsolete but leave in for another couple of releases)
        attach(router, "/knowledge/feature/assocSuggest/{ent1}/{verb}/{ent2}/{field}/{communityids}",SearchInterface.class);
       
     

// UISETUP:
       
        //BETA NAMING
        router.attach("/knowledge/uisetup/get/", UIInterface.class);  
        router.attach("/knowledge/uisetup/update/{modules}/{query}/{communityids}", UIInterface.class);  
        router.attach("/knowledge/uisetup/update/{modules}/{communityids}", UIInterface.class);   //POST version       
        router.attach("/knowledge/uisetup/modules/get/",UIInterface.class);  
        router.attach("/knowledge/uisetup/modules/user/get", UIInterface.class);  
        router.attach("/knowledge/uisetup/modules/user/set/{modules}",UIInterface.class)
        router.attach("/knowledge/uisetup/modules/search/{term}", UIInterface.class);  
        router.attach("/knowledge/uisetup/modules/install/",UIInterface.class); // (query is POSTed)  
        router.attach("/knowledge/uisetup/modules/delete/{modules}",UIInterface.class); // (actually {} is the module id, named group to make life simple in resource)  
        //V0 NAMING
        attach(router, "/social/gui/uisetup/get", UIInterface.class);  
        attach(router, "/social/gui/uisetup/update/{modules}/{query}/{communityids}", UIInterface.class);  
        attach(router, "/social/gui/uisetup/update/{modules}/{communityids}", UIInterface.class);   //POST version       
        attach(router, "/social/gui/modules/get",UIInterface.class);  
        attach(router, "/social/gui/modules/user/get", UIInterface.class);
        attach(router, "/social/gui/modules/user/set/{modules}",UIInterface.class)
        attach(router, "/social/gui/modules/search/{term}", UIInterface.class);  
        attach(router, "/social/gui/modules/install",UIInterface.class); // (query is POSTed)  
        attach(router, "/social/gui/modules/delete/{modules}",UIInterface.class); // (actually {} is the module id, named group to make life simple in resource)  
               
        /***************************************************
        ** Define the social routes
        ****************************************************/
               
// COMMUNITIES:
       
        // Get - list of communities
        //BETA NAMING
        router.attach("/community/get/{communityid}", CommunityInterface.class);  
        router.attach("/community/getall/", CommunityInterface.class);
        router.attach("/community/getsystem/", CommunityInterface.class);
        router.attach("/community/getpublic/", CommunityInterface.class);
        router.attach("/community/getprivate/", CommunityInterface.class);
        //V0 NAMING
        attach(router, "/social/community/get/{communityid}", CommunityInterface.class);  
        attach(router, "/social/community/getall", CommunityInterface.class);
        attach(router, "/social/community/getsystem", CommunityInterface.class);
        attach(router, "/social/community/getpublic", CommunityInterface.class);
        attach(router, "/social/community/getprivate", CommunityInterface.class);
       
        // Add/update/remove communities
        //BURCH changed the add community method to only allow a user adding it to himself, the
        //expanded function will be left in CommunityController for when we need to handle that
        //BETA NAMING
        router.attach("/community/add/{name}/{description}/{tags}/",CommunityInterface.class);
        router.attach("/community/add/{name}/{description}/{tags}/{parentid}/",CommunityInterface.class);
        router.attach("/community/remove/{id}",CommunityInterface.class);
        router.attach("/community/update/{communityid}/", CommunityInterface.class);
        //V0 NAMING
        attach(router, "/social/community/add/{name}/{description}/{tags}",CommunityInterface.class);
        attach(router, "/social/community/add/{name}/{description}/{tags}/{parentid}",CommunityInterface.class);
        attach(router, "/social/community/remove/{id}",CommunityInterface.class);
        attach(router, "/social/community/update/{communityid}", CommunityInterface.class);
       
        // Add/remove members, update their status or type
        //BETA NAMING
        router.attach("/community/member/update/status/{communityid}/{personid}/{userstatus}", CommunityInterface.class);
        router.attach("/community/member/update/type/{communityid}/{personid}/{usertype}", CommunityInterface.class);
        //V0 NAMING
        attach(router, "/social/community/member/update/status/{communityid}/{personid}/{userstatus}", CommunityInterface.class);
        attach(router, "/social/community/member/update/type/{communityid}/{personid}/{usertype}", CommunityInterface.class);
       
        // Join/leave a community, update community profile information
        //BETA NAMING
        router.attach("/community/member/join/{communityid}", CommunityInterface.class)
        router.attach("/community/member/leave/{communityid}", CommunityInterface.class);
        router.attach("/community/member/invite/{communityid}/{personid}", CommunityInterface.class);
        router.attach("/community/requestresponse/{requestid}/{response}", CommunityInterface.class);
        //V0 NAMING
        attach(router, "/social/community/member/join/{communityid}", CommunityInterface.class)
        attach(router, "/social/community/member/leave/{communityid}", CommunityInterface.class);
        attach(router, "/social/community/member/invite/{communityid}/{personid}", CommunityInterface.class);
        attach(router, "/social/community/requestresponse/{requestid}/{response}", CommunityInterface.class);

// PEOPLE/PERSON:
       
        // Person - Get
        //BETA NAMING
        router.attach("/person/get/", PersonInterface.class);
        router.attach("/person/get/{personid}", PersonInterface.class);
        router.attach("/person/list", PersonInterface.class);
        //V0 NAMING
        attach(router, "/social/person/get", PersonInterface.class);
        attach(router, "/social/person/get/{personid}", PersonInterface.class);
        attach(router, "/social/person/list", PersonInterface.class);

        //WORDPRESS CALLS, wordpress still calls the old /people/ but i now route thru personResource
        //BETA NAMING
        router.attach("/people/register/{wpuser}/{wpauth}", PersonInterface.class);  
        router.attach("/people/wpupdate/{wpuser}/{wpauth}", PersonInterface.class)
        router.attach("/people/register",PersonInterface.class);  
        router.attach("/people/wpupdate", PersonInterface.class);  
        //V0 NAMING
        attach(router, "/social/person/register/{wpuser}/{wpauth}", PersonInterface.class); //(REST version)
        attach(router, "/social/person/register", PersonInterface.class); // (POST version)  
        attach(router, "/social/person/wpupdate/{wpuser}/{wpauth}", PersonInterface.class); //(legacy REST version)
        attach(router, "/social/person/update/{wpuser}/{wpauth}", PersonInterface.class); //(REST version) 
        attach(router, "/social/person/update", PersonInterface.class)// (POST versions/URL params)
        attach(router, "/social/person/wpupdate", PersonInterface.class); // (URL params)
        attach(router, "/social/person/delete/{userid}", PersonInterface.class)// (GET)
        attach(router, "/social/person/update/password/{wpuser}/{wpauth}", PersonInterface.class)// (GET, user=userIdStr or WPUserID, wpauth=new password)
        attach(router, "/social/person/update/email/{wpuser}/{wpauth}", PersonInterface.class)// (GET, user=userIdStr or WPUserID, wpauth=new email)
        //END WORDPRESS CALLS  
       
        //////////////////////////////Shares //////////////////////////////
        // Add/Update Shares
        //BETA NAMING
        router.attach("/share/add/binary/{title}/{description}/", ShareInterface.class);
        router.attach("/share/add/json/{type}/{title}/{description}/", ShareInterface.class);
        router.attach("/share/update/json/{id}/{type}/{title}/{description}/", ShareInterface.class);
        router.attach("/share/update/binary/{id}/{title}/{description}",ShareInterface.class);
        router.attach("/share/update/binary/{id}/{title}/{description}/",ShareInterface.class);
        router.attach("/share/add/ref/{type}/{documentid}/{title}/{description}/", ShareInterface.class);
        router.attach("/share/update/ref/{id}/{type}/{documentid}/{title}/{description}/", ShareInterface.class);
        //V0 NAMING
        attach(router, "/social/share/add/binary/{title}/{description}", ShareInterface.class);
        attach(router, "/social/share/update/binary/{id}/{title}/{description}",ShareInterface.class);
        attach(router, "/social/share/save/json/{id}/{type}/{title}/{description}", ShareInterface.class);
        attach(router, "/social/share/add/json/{type}/{title}/{description}", ShareInterface.class);
        attach(router, "/social/share/update/json/{id}/{type}/{title}/{description}", ShareInterface.class);
        attach(router, "/social/share/add/ref/{type}/{documentloc}/{documentid}/{title}/{description}", ShareInterface.class);
        attach(router, "/social/share/update/ref/{id}/{type}/{documentloc}/{documentid}/{title}/{description}", ShareInterface.class);
       
        // Communities
        //BETA NAMING
        router.attach("/share/add/community/{shareid}/{comment}/{communityid}/", ShareInterface.class);
        attach(router, "/social/share/endorse/{shareid}/{communityid}/{isendorsed}", ShareInterface.class);
        //V0 NAMING
        attach(router, "/social/share/add/community/{shareid}/{comment}/{communityid}", ShareInterface.class);
        attach(router, "/social/share/remove/community/{shareid}/{communityid}", ShareInterface.class);
        attach(router, "/share/remove/community/{shareid}/{communityid}", ShareInterface.class);
       
        // Delete Share from DB
        //BETA NAMING
        router.attach("/share/remove/{shareid}/", ShareInterface.class);
        //V0 NAMING
        attach(router, "/social/share/remove/{shareid}", ShareInterface.class);
       
        // Get/Search for Shares
        //BETA NAMING
        // (NOTE THAT WE NEED TO PRESERVE THESE TWO GETS - THE UPLOADER JSPS NEED THEM AND IT'S HARD TO CHANGE AT THIS POINT)
        router.attach("/share/get/{id}", ShareInterface.class);
        router.attach("/share/get/{id}/", ShareInterface.class);
        router.attach("/share/search/", ShareInterface.class);
        //V0 NAMING
        attach(router, "/social/share/get/{id}", ShareInterface.class);
        attach(router, "/social/share/search", ShareInterface.class);
       
        //UPDATED SHARE FUNCTION FOR EASY CREATION
View Full Code Here

      intializeInfiniteConfig(getContext(), null);
     
        // Create a router Restlet that routes each call to a 
        // new instance of HelloWorldResource.
     
        Router router = new Router(getContext());

        setupActionHandlers(router);
        return router; 
    }
View Full Code Here

   */
  @Override
  public synchronized Restlet createInboundRoot() {
      getTunnelService().setEnabled(true);
      getTunnelService().setExtensionsTunnel(true);
      Router router = new Router(getContext());
      //router.getLogger().setLevel(Level.FINEST);
      // configs
      router.attach("/", APIInfoResource.class);
      router.attach("/" + AdminResource.PATH, AdminResource.class);
      router.attach("/" + AdminResource.PATH + "/{" + Params.CMD +
          "}", AdminResource.class);
      router.attach("/" + ConfResource.PATH, ConfResource.class);
      router.attach("/" + ConfResource.PATH + "/{"+ Params.CONF_ID +
          "}", ConfResource.class);
      router.attach("/" + ConfResource.PATH + "/{" + Params.CONF_ID +
          "}/{" + Params.PROP_NAME + "}", ConfResource.class);
      // db
      router.attach("/" + DbResource.PATH, DbResource.class);
      // jobs
      router.attach("/" + JobResource.PATH, JobResource.class);
      router.attach("/" + JobResource.PATH + "/{" + Params.JOB_ID + "}",
          JobResource.class);
      router.attach("/" + JobResource.PATH, JobResource.class);
      router.attach("/" + JobResource.PATH + "/{" + Params.JOB_ID + "}/{" +
          Params.CMD + "}", JobResource.class);
      return router;
  }
View Full Code Here

public class LearningSwitchWebRoutable implements RestletRoutable {

    @Override
    public Restlet getRestlet(Context context) {
        Router router = new Router(context);
        router.attach("/table/{switch}/json", LearningSwitchTable.class);
        return router;
    }
View Full Code Here

public class DebugEventRoutable implements RestletRoutable {

    @Override
    public Restlet getRestlet(Context context) {
        Router router = new Router(context);
        router.attach("/{param1}/{param2}/", DebugEventResource.class);
        router.attach("/{param1}/{param2}", DebugEventResource.class);
        router.attach("/{param1}/", DebugEventResource.class);
        router.attach("/{param1}", DebugEventResource.class);
        router.attach("/", DebugEventResource.class);
        return router;
    }
View Full Code Here

    this.repository = repository;
  }
 
  @Override
  public Restlet createInboundRoot() {
    Router router = new Router(getContext());
    // Add route for services description
    router.attach(SERVICE_LIST_ROUTE, ServicesList.class);
   
    // Add magic route for each service
    router.attach(SERVICE_LIST_ROUTE+"/{"+RestServiceFacade.CONTAINED_TYPE_ATTRIBUTE+"}/", RestServiceFacade.class);
    return router;
  }
View Full Code Here

  @Override
  public Restlet createInboundRoot() {
    GlobalConfig.fetchFromDatabase();
    GlobalConfig.set(WORKFLOW_TIME_OFFSET, "0");
   
    Router mainRouter = new Router(getContext());
    mainRouter.attach("/milestones", MilestonesResource.class);
    mainRouter.attach("/artifacts", ArtifactsResource.class);
   
    mainRouter.attach("/task/", NewTaskResource.class);
    mainRouter.attach("/task/{id}", TaskResource.class);

    return mainRouter;
  }
View Full Code Here

   * Creates a root Restlet that will receive all incoming calls.
   */
  @Override
  public synchronized Restlet createInboundRoot() {
   
    Router router = new Router(getContext());
   
    router.attach("/model/{modelId}/json", ModelEditorJsonRestResource.class);
    router.attach("/model/{modelId}/save", ModelSaveRestResource.class);
   
    router.attach("/editor", EditorRestResource.class);
    router.attach("/editor/plugins", PluginRestResource.class);
    router.attach("/editor/stencilset", StencilsetRestResource.class);
   
    return router;
  }
View Full Code Here

        }
      }
    };
    authenticator.setVerifier(verifier);
   
    Router router = new Router(getContext());

    router.attachDefault(DefaultResource.class);
   
    router.attach("/process-engine", ProcessEngineResource.class);
   
    router.attach("/login", LoginResource.class);
   
    router.attach("/user", UserCreateResource.class);
    router.attach("/user/{userId}", UserResource.class);
    router.attach("/user/{userId}/groups", UserGroupsResource.class);
    router.attach("/user/{userId}/groups/{groupId}", UserGroupsDeleteResource.class);
    router.attach("/user/{userId}/picture", UserPictureResource.class);
    router.attach("/users", UserSearchResource.class);

    router.attach("/group", GroupCreateResource.class);
    router.attach("/group/{groupId}", GroupResource.class);
    router.attach("/group/{groupId}/users/{userId}", UserGroupsDeleteResource.class);
    router.attach("/group/{groupId}/users", GroupUsersResource.class);
    router.attach("/groups", GroupSearchResource.class);
   
    router.attach("/process-definitions", ProcessDefinitionsResource.class);
    router.attach("/process-instances", ProcessInstancesResource.class);
    router.attach("/process-instance", StartProcessInstanceResource.class);
    router.attach("/process-instance/{processInstanceId}", ProcessInstanceResource.class);
    router.attach("/process-instance/{processInstanceId}/diagram", ProcessInstanceDiagramResource.class);
    router.attach("/process-instance/{processInstanceId}/tasks", ProcessInstanceTaskResource.class);
    router.attach("/process-instance/{processInstanceId}/signal", ProcessInstanceSignalExecutionResource.class);
    router.attach("/process-instance/{processInstanceId}/event/{signalName}", SignalEventSubscriptionResource.class);
    router.attach("/process-definition/{processDefinitionId}/form", ProcessDefinitionFormResource.class);
    router.attach("/process-definition/{processDefinitionId}/diagram", ProcessDefinitionDiagramResource.class);
    router.attach("/process-definition/{processDefinitionId}/properties", ProcessDefinitionPropertiesResource.class);
   
    router.attach("/tasks", TasksResource.class);
    router.attach("/tasks-summary", TasksSummaryResource.class);
    router.attach("/task", TaskAddResource.class);
    router.attach("/task/{taskId}", TaskResource.class);
    router.attach("/task/{taskId}/form", TaskFormResource.class);
    router.attach("/task/{taskId}/attachment", TaskAttachmentAddResource.class);
    router.attach("/task/{taskId}/url", TaskUrlAddResource.class);
    router.attach("/task/{taskId}/{operation}", TaskOperationResource.class);
   
    router.attach("/attachment/{attachmentId}", TaskAttachmentResource.class);
   
    router.attach("/form/{taskId}/properties", TaskPropertiesResource.class);
   
    router.attach("/deployments", DeploymentsResource.class);
    router.attach("/deployment", DeploymentUploadResource.class);
    router.attach("/deployments/delete", DeploymentsDeleteResource.class);
    router.attach("/deployment/{deploymentId}", DeploymentDeleteResource.class);
    router.attach("/deployment/{deploymentId}/resources", DeploymentArtifactsResource.class);
    router.attach("/deployment/{deploymentId}/resource/{resourceName}", DeploymentArtifactResource.class);
   
    router.attach("/management/jobs", JobsResource.class);
    router.attach("/management/job/{jobId}", JobResource.class);
    router.attach("/management/job/{jobId}/execute", JobExecuteResource.class);
    router.attach("/management/jobs/execute", JobsExecuteResource.class);
   
    router.attach("/management/tables", TablesResource.class);
    router.attach("/management/table/{tableName}", TableResource.class);
    router.attach("/management/table/{tableName}/data", TableDataResource.class);
   
    authenticator.setNext(router);
   
    return authenticator;
  }
View Full Code Here

TOP

Related Classes of org.restlet.routing.Router

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.