Package com.google.appengine.api.capabilities

Examples of com.google.appengine.api.capabilities.CapabilityStatus


        LocalRpcService service = getService(packageName);
        if (service == null) {
          throw new CallNotFoundException(packageName, methodName);
        }
        LocalCapabilitiesEnvironment capEnv = context.getLocalCapabilitiesEnvironment();
        CapabilityStatus capabilityStatus = capEnv
            .getStatusFromMethodName(packageName, methodName);
        if (!CapabilityStatus.ENABLED.equals(capabilityStatus)) {
          throw new ApiProxy.CapabilityDisabledException(
              "Setup in local configuration.", packageName, methodName);
        }
View Full Code Here


    for (String capabilityName : properties.stringPropertyNames()) {
      if (!capabilityName.startsWith(KEY_PREFIX)) {
        continue;
      }
      String status = properties.getProperty(capabilityName);
      CapabilityStatus s = CapabilityStatus.valueOf(status);
      capabilitiesStatus.put(capabilityName, s);

    }
  }
View Full Code Here

   * @param capabilityName name fo the capability (for ex "datastore_v3")
   * @param methodName     RPC method name (for example "Get")
   * @return the capability status for the given method
   */
  public CapabilityStatus getStatusFromMethodName(String capabilityName, String methodName) {
    CapabilityStatus status;
    if (capabilityName.equals("datastore_v3")) {
      status = capabilitiesStatus.get(geCapabilityPropertyKey(capabilityName, "write"));
      if ((status != null) && (!status.equals(CapabilityStatus.ENABLED))) {
        if (DATASTORE_WRITE_RPCS.contains(methodName)) {
          return status;
        }
      }
    }
View Full Code Here

   * @param packageName    package Name  name fo the capability (for ex "datastore_v3")
   * @param capabilityName name fo the capability (for example, "write" or "*")
   * @return the capability status for the given capability
   */
  public CapabilityStatus getStatusFromCapabilityName(String packageName, String capabilityName) {
    CapabilityStatus status;

    status = capabilitiesStatus.get(geCapabilityPropertyKey(packageName, capabilityName));
    if (status != null) {
      return status;
    } else {
View Full Code Here

     * @return True for not disabled
     */
    protected final static boolean IsAvailable(Capability cap){

        CapabilityState state = GetState(cap);
        CapabilityStatus status = state.getStatus();
        switch(status){
        case DISABLED:
            return false;
        case ENABLED:
        case SCHEDULED_MAINTENANCE:
            return true;
        default:
            throw new IllegalStateException(status.name());
        }
    }
View Full Code Here

     * @return Null for not scheduled, or the planned maintenance date
     */
    protected final static java.util.Date GetScheduled(Capability cap){

        CapabilityState state = GetState(cap);
        CapabilityStatus status = state.getStatus();
        switch(status){
        case DISABLED:
        case ENABLED:
            return null;
        case SCHEDULED_MAINTENANCE:
            return state.getScheduledDate();
        default:
            throw new IllegalStateException(status.name());
        }
    }
View Full Code Here

     * @return True for not disabled
     */
    protected final static boolean IsAvailable(Capability cap){

        CapabilityState state = GetState(cap);
        CapabilityStatus status = state.getStatus();
        switch(status){
        case DISABLED:
            return false;
        case ENABLED:
        case SCHEDULED_MAINTENANCE:
            return true;
        default:
            throw new IllegalStateException(status.name());
        }
    }
View Full Code Here

     * @return Null for not scheduled, or the planned maintenance date
     */
    protected final static java.util.Date GetScheduled(Capability cap){

        CapabilityState state = GetState(cap);
        CapabilityStatus status = state.getStatus();
        switch(status){
        case DISABLED:
        case ENABLED:
            return null;
        case SCHEDULED_MAINTENANCE:
            return state.getScheduledDate();
        default:
            throw new IllegalStateException(status.name());
        }
    }
View Full Code Here

  public CapSummaryDTO loadCapSummary() {
    CapabilitiesService service = CapabilitiesServiceFactory.getCapabilitiesService();
   
    CapSummaryDTO result = new CapSummaryDTO();
    for (Capability cap : caps) {
      CapabilityStatus status = service.getStatus(cap).getStatus();
     
      switch(status) {
      case ENABLED:
        result.setStatus(cap.getPackageName(), cap.getName(), Status.ENABLED);
        break;
View Full Code Here

TOP

Related Classes of com.google.appengine.api.capabilities.CapabilityStatus

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.