Package edu.indiana.extreme.gfac.external.impl

Examples of edu.indiana.extreme.gfac.external.impl.XregistryServiceWrapper


public class ExternalServiceFactory {
  private static Logger logger = Logger.getLogger(GFacConstants.LOGGER_NAME);
   public static RegistryService createRegistryService(String registryURL,ApplicationGlobalContext globalConfiguration) throws GfacException{
          try {
            logger.info("Registry URL: "+ registryURL);
                  return new XregistryServiceWrapper(registryURL,globalConfiguration);
              } catch (GfacException e) {
                e.printStackTrace();
              GfacException error = new GfacException("Failed to create registry Service client using " + registryURL,e,FaultCode.ErrorAtDependentService);
              error.addProperty(ErrorCodes.SERVICE_TYPE, ErrorCodes.ServiceType.Registry.toString());
              error.addProperty(ErrorCodes.URL_Name, registryURL);
View Full Code Here


      }
   public static RegistryService createRegistryService(String registryURL,String trustedCertFile,
               GSSCredential gssCredential) throws GfacException{
          try {
            logger.info("Registry URL: "+ registryURL);
                  return new XregistryServiceWrapper(registryURL,trustedCertFile, gssCredential);
              } catch (GfacException e) {
                e.printStackTrace();
              GfacException error = new GfacException("Failed to create registry Service client using " + registryURL,e,FaultCode.ErrorAtDependentService);
              error.addProperty(ErrorCodes.SERVICE_TYPE, ErrorCodes.ServiceType.Registry.toString());
              error.addProperty(ErrorCodes.URL_Name, registryURL);
View Full Code Here

         return ServiceConstants.EDIT_GROUP;
  }
  public CapabilityToken[] getCurrentCapabilities(String resourceID)
      throws GfacException {
    if (super.getContext().getRegService() instanceof XregistryServiceWrapper) {
      XregistryServiceWrapper xregistryServiceWrapper = (XregistryServiceWrapper) super
          .getContext().getRegService();
      return xregistryServiceWrapper.getCapability(resourceID, null,
          false, null);
    } else {
      throw new GfacException(
          "Capabilities are only avalible with xregistry",
          FaultCode.InvaliedLocalArgumnet);
View Full Code Here

   public static String updateCapability(ApplicationGlobalContext context,String resourceID) throws GfacException
   {
     HttpServletRequest request = (HttpServletRequest) (FacesContext.getCurrentInstance().getExternalContext().getRequest());
          
   if (context.getRegService() instanceof XregistryServiceWrapper) {
   XregistryServiceWrapper xregistryServiceWrapper =
   (XregistryServiceWrapper) context
   .getRegService();
             
   String actorsToAddStr = request.getParameter("actorsToAdd");
   String actorsToRemoveStr = request.getParameter("actorsToRemove");
 
   System.out.println("actorsToAddStr ="+actorsToAddStr);
   System.out.println("actorsToRemoveStr ="+actorsToRemoveStr);
             
   if(actorsToAddStr != null){
   if(resourceID == null){
   throw new
   GfacException("When capability update info is provided, resourceID must not be null",FaultCode.InvaliedLocalArgumnet);
   }
                 
   List<Capability> actorsToAdd = new ArrayList<Capability>();
                 
   String[] actorsToAddRaw = actorsToAddStr.split(ACTOR_SEPERATOR);
   for(String raw:actorsToAddRaw){
   if(raw != null && raw.trim().length() > 0){
   String[] data = raw.split(ACTOR_FILED_SEPERATOR);
   actorsToAdd.add(new Capability(data[0], data[1]));
   }
   }
 
   if(actorsToRemoveStr != null){
   String[] actorsToRemoveRaw = actorsToRemoveStr.split(ACTOR_SEPERATOR);
   for(String actor:actorsToRemoveRaw){
   if(actor != null && actor.trim().length() > 0){
   if(!hasCapabilityWithName(actorsToAdd,actor)){
   xregistryServiceWrapper.removeCapability(resourceID, actor);
   }else{
   removeCapabilitybyName(actorsToAdd, actor);
   }
   }
   }
   }
                 
   for(Capability capability:actorsToAdd){
   xregistryServiceWrapper.addCapability(resourceID, capability.actor,
   capability.isUser, capability.action);
   }
   return "Capability updated for resource "+resourceID;
   }else{
   return null;
View Full Code Here

   throw new
   GfacException("Capabilities are only avalible with xregistry",FaultCode.InvaliedLocalArgumnet);
   }
   }
   public static void makePublicRead(String resourceID, RegistryService registryService, String actor, boolean isUser) throws GfacException{
      XregistryServiceWrapper xregistryServiceWrapper = (XregistryServiceWrapper) registryService;
    //   resourceID = new QName(GFacConstants.GFAC_NAMESPACE, resourceID).toString();
       xregistryServiceWrapper.addCapability(resourceID, actor,isUser , ServiceConstants.USER_CREDENTIAL);
   }
View Full Code Here

       private static Logger log = Logger.getLogger(GFacConstants.LOGGER_NAME);
     public static ObjectResource[] search4Resources(RegistryService regService,String requestName,
              String type) throws GfacException {
          if (requestName != null && type != null) {
              if (regService instanceof XregistryServiceWrapper) {
                  XregistryServiceWrapper xregistryService = (XregistryServiceWrapper) regService;
                  ResourceData[] data = null;
                  //FIXME: Enhance it to handle Search Chars
                  if ("Service".equals(type)) {
                      data = xregistryService.xfindServiceDesc(requestName);
                  } else if ("Application".equals(type)) {
                      data = xregistryService.xfindAppDesc(requestName);
                  } else if ("Host".equals(type)) {
                      data = xregistryService.xfindHostDesc(requestName);
                  }
                 
                  if (data != null) {
                      ObjectResource[] resources = new ObjectResource[data.length];
                        for (int i = 0; i < data.length; i++) {
View Full Code Here

TOP

Related Classes of edu.indiana.extreme.gfac.external.impl.XregistryServiceWrapper

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.