from interface AdminService
555358
public void getConfigInfo (AdminService.ConfigInfoListener arg1)
    {
        AdminMarshaller.ConfigInfoMarshaller listener1 = new AdminMarshaller.ConfigInfoMarshaller();
        listener1.listener = arg1;
        sendRequest(GET_CONFIG_INFO, new Object[] {
            listener1
        });
    }
497547
function endpointMatchDesiredInterface(endpoint) {
    var interfaceToUse = 'public';
    if (options.useInternal === true) {
      interfaceToUse = 'internal';
    } else if (options.useAdmin === true) {
      interfaceToUse = 'admin';
    }
    return endpoint['interface'] === interfaceToUse;
  }
463888
private function processAdministrator()
	{
		$sourceFolder = $this->getSourceFolder();
		$this->processComponents($sourceFolder . '/administrator/components', $this->target . '/administrator');
		$this->processLanguage($sourceFolder . '/administrator/language', $this->target . '/administrator');
		$this->processModules($sourceFolder . '/administrator/modules', $this->target . '/administrator/modules');
	}
920561
@SuppressWarnings("unchecked")
    @Override
    public <T> T onSingletonServiceInit(T service, Object context) {
        if (context == null) {
            return null;
        }
        Map<Class<?>, ManagedObject<?>> newContext = (Map<Class<?>, ManagedObject<?>>) (context);
        if (newContext.isEmpty()) {
            return null;
        }

        ManagedObject<?> managedObject = newContext.get(service.getClass());
        Object newServiceObject = null;
        if (managedObject == null) {
            newServiceObject = getInstanceFromManagedObject(service, context);
        } else {
            newServiceObject = managedObject.getObject();
        }
        return (T) newServiceObject;
    }
1306562
public function actionAdminLoad() {
		$response = $this->handle( $this->request, [''] );

		if ( ! $response instanceof ResponseInterface ) {
			return;
		}

		if ( ! headers_sent() ) {
			Response::sendHeaders( $response );
		}
	}
586294
function Plugin () {
  var seneca = this

  seneca.add('role:admin,cmd:home', (msg, done) => {
    done(null, {ok: true, message: 'please log in...'})
  })

  seneca.add('role:admin,cmd:logout', (msg, done) => {
    msg.request$.logout()

    done(null, {ok: true})
  })

  seneca.add('role:admin,cmd:profile', (msg, done) => {
    done(null, {ok: true, user: msg.args.user})
  })
}
610608
@CheckForNull
    public AdministrativeMonitor getAdministrativeMonitor(String id) {
        for (AdministrativeMonitor m : administrativeMonitors)
            if(m.id.equals(id))
                return m;
        return null;
    }
70307
public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
      throws RemoteException {
    // Get the NativeStyleService.
    NativeStyleServiceInterface nativeStyleService =
        adManagerServices.get(session, NativeStyleServiceInterface.class);

    String htmlSnippet = new StringBuilder()
        .append("<div id=\"adunit\" style=\"overflow: hidden;\">\n")
        .append("  <img src='[%Thirdpartyimpressiontracker%]' style='display:none'>\n")
        .append("  <div class='attribution'>Ad</div>\n")
        .append("  <div class='image'>\n")
        .append("    <a class='image-link' ")
        .append("href='%%CLICK_URL_UNESC%%[%Thirdpartyclicktracker%]%%DEST_URL%%' target='_top'>")
        .append("<img src=\"[%Image%]\"></a>\n")
        .append("  </div>\n")
        .append("  <div class='app-icon'><img src=\"[%Appicon%]\"/></div>\n")
        .append("  <div class='title'>\n")
        .append("    <a class='title-link' ")
        .append("href='%%CLICK_URL_UNESC%%[%Thirdpartyclicktracker%]%%DEST_URL%%' ")
        .append("target='_top'>[%Headline%]</a>\n")
        .append("  </div>\n")
        .append("  <div class='reviews'></div>\n")
        .append("  <div class='body'>\n")
        .append("    <a class='body-link' ")
        .append("href='%%CLICK_URL_UNESC%%[%Thirdpartyclicktracker%]%%DEST_URL%%' ")
        .append("target='_top'>[%Body%]</a>\n")
        .append("  </div>\n")
        .append("  <div class='price'>[%Price%]</div>\n")
        .append("  <div class='button'>\n")
        .append("    <a class='button-link' ")
        .append("href='%%CLICK_URL_UNESC%%[%Thirdpartyclicktracker%]%%DEST_URL%%' ")
        .append("target='_top'>[%Calltoaction%]</a>\n")
        .append("  </div>\n")
        .append("</div>\n")
        .toString();

    String cssSnippet = new StringBuilder()
        .append("body {")
        .append("    background-color: rgba(255, 255, 255, 1);")
        .append("    font-family: \"Roboto-Regular\", sans-serif;")
        .append("    font-weight: normal;")
        .append("    font-size: 12px;")
        .append("    line-height: 14px;")
        .append("}")
        .append(".attribution {")
        .append("    background-color: rgba(236, 182, 0, 1);")
        .append("    color: rgba(255, 255, 255, 1);")
        .append("    font-size: 13px;")
        .append("    display: table;")
        .append("    margin: 4px 8px;")
        .append("    padding: 0 3px;")
        .append("    border-radius: 2px;")
        .append("}")
        .append(".image {")
        .append("    text-align: center;")
        .append("    margin: 8px;")
        .append("}")
        .append(".image img,")
        .append(".image-link {")
        .append("    width: 100%;")
        .append("}")
        .append(".app-icon {")
        .append("    float: left;")
        .append("    margin: 0 8px 4px 8px;")
        .append("    height: 40px;")
        .append("    width: 40px;")
        .append("    background-color: transparent;")
        .append("}")
        .append(".app-icon img {")
        .append("    height: 100%;")
        .append("    width: 100%;")
        .append("    border-radius: 20%;")
        .append("}")
        .append(".title,")
        .append(".promo-headline {")
        .append("    font-weight: bold;")
        .append("    font-size: 14px;")
        .append("    line-height: 20px;")
        .append("    margin: 8px 8px 4px 8px;")
        .append("}")
        .append(".title a,")
        .append(".promo-headline {")
        .append("    color: rgba(112, 112, 112, 1);")
        .append("    text-decoration: none;")
        .append("}")
        .append(".reviews {")
        .append("    float: left;")
        .append("}")
        .append(".reviews svg {")
        .append("    fill: rgba(0, 0, 0, 0.7);")
        .append("}")
        .append(".body {")
        .append("    clear: left;")
        .append("    margin: 8px;")
        .append("}")
        .append(".body a {")
        .append("    color: rgba(110, 110, 110, 1);")
        .append("    text-decoration: none;")
        .append("}")
        .append(".price {")
        .append("    display: none;")
        .append("}")
        .append(".button {")
        .append("    font-size: 14px;")
        .append("    font-weight: bold;")
        .append("    float: right;")
        .append("    margin: 0px 16px 16px 0px;")
        .append("    white-space: nowrap;")
        .append("}")
        .append(".button a {")
        .append("    color: #2196F3;")
        .append("    text-decoration: none;")
        .append("}")
        .append(".button svg {")
        .append("    display: none;")
        .append("}")
        .toString();

    // This is the creative template ID for the system-defined native app
    // install ad format, which we will create the native style from. Use
    // CreativeTemplateService.getCreativeTemplatesByStatement() and
    // CreativeTemplate.isNativeEligible to get other native ad formats
    // available in your network.
    long nativeAppInstallTemplateId = 10004400L;

    // Set the size for the native style.
    Size size = new Size();
    size.setWidth(300);
    size.setHeight(250);
    size.setIsAspectRatio(false);

    // Create a style for native app install ads.
    NativeStyle nativeStyle = new NativeStyle();
    nativeStyle.setName("Native style #" + new Random().nextInt(Integer.MAX_VALUE));
    nativeStyle.setCreativeTemplateId(nativeAppInstallTemplateId);
    nativeStyle.setSize(size);
    nativeStyle.setHtmlSnippet(htmlSnippet);
    nativeStyle.setCssSnippet(cssSnippet);

    // Create the native style on the server.
    NativeStyle[] nativeStyles =
        nativeStyleService.createNativeStyles(new NativeStyle[] {nativeStyle});

    for (NativeStyle createdNativeStyle : nativeStyles) {
      System.out.printf("A native style with ID %d and name '%s' was created.%n",
          createdNativeStyle.getId(),
          createdNativeStyle.getName());
    }
  }
1285049
private String findAdminObject(String className, Connector connector)
   {
      for (org.ironjacamar.common.api.metadata.spec.AdminObject ao :
              connector.getResourceadapter().getAdminObjects())
      {
         if (className.equals(ao.getAdminobjectClass().getValue()) ||
             className.equals(ao.getAdminobjectInterface().getValue()))
            return ao.getAdminobjectClass().getValue();
      }
      return className;
   }
278594
@Override
	protected Class<?>[] getHandlerInterfaces(String serviceName) {
		Class<?> remoteInterface = interfaceMap.get(serviceName);
		if (remoteInterface != null) {
			return new Class<?>[]{remoteInterface};
		} else if (Proxy.isProxyClass(getHandler(serviceName).getClass())) {
			return getHandler(serviceName).getClass().getInterfaces();
		} else {
			return new Class<?>[]{getHandler(serviceName).getClass()};
		}
	}
309617
function (jid, service) {
        var that = this._connection;
        if (service === undefined) {
            service = jid;
            jid = undefined;
        }
        this.jid = jid || that.jid;
        this.service = service || null;
        this._autoService = false;
    }
9732
private void doGetDatasource() throws PageException {

	String name = getString("admin", action, "name");
	Map ds = config.getDataSourcesAsMap();
	Iterator it = ds.keySet().iterator();

	while (it.hasNext()) {
	    String key = (String) it.next();
	    if (key.equalsIgnoreCase(name)) {
		DataSource d = (DataSource) ds.get(key);
		Struct sct = new StructImpl();
		ClassDefinition cd = d.getClassDefinition();

		sct.setEL(KeyConstants._name, key);
		sct.setEL(KeyConstants._host, d.getHost());
		sct.setEL("classname", cd.getClassName());
		sct.setEL("class", cd.getClassName());
		sct.setEL("bundleName", cd.getName());
		sct.setEL("bundleVersion", cd.getVersionAsString());
		sct.setEL("dsn", d.getDsnOriginal());
		sct.setEL("database", d.getDatabase());
		sct.setEL("port", d.getPort() < 1 ? "" : Caster.toString(d.getPort()));
		sct.setEL("dsnTranslated", d.getDsnTranslated());
		sct.setEL("timezone", toStringTimeZone(d.getTimeZone()));
		sct.setEL("password", d.getPassword());
		sct.setEL("passwordEncrypted", ConfigWebUtil.encrypt(d.getPassword()));
		sct.setEL("username", d.getUsername());
		sct.setEL("readonly", Caster.toBoolean(d.isReadOnly()));
		sct.setEL("select", Boolean.valueOf(d.hasAllow(DataSource.ALLOW_SELECT)));
		sct.setEL("delete", Boolean.valueOf(d.hasAllow(DataSource.ALLOW_DELETE)));
		sct.setEL("update", Boolean.valueOf(d.hasAllow(DataSource.ALLOW_UPDATE)));
		sct.setEL("insert", Boolean.valueOf(d.hasAllow(DataSource.ALLOW_INSERT)));
		sct.setEL("create", Boolean.valueOf(d.hasAllow(DataSource.ALLOW_CREATE)));
		sct.setEL("insert", Boolean.valueOf(d.hasAllow(DataSource.ALLOW_INSERT)));
		sct.setEL("drop", Boolean.valueOf(d.hasAllow(DataSource.ALLOW_DROP)));
		sct.setEL("grant", Boolean.valueOf(d.hasAllow(DataSource.ALLOW_GRANT)));
		sct.setEL("revoke", Boolean.valueOf(d.hasAllow(DataSource.ALLOW_REVOKE)));
		sct.setEL("alter", Boolean.valueOf(d.hasAllow(DataSource.ALLOW_ALTER)));

		sct.setEL("connectionLimit", d.getConnectionLimit() < 1 ? "-1" : Caster.toString(d.getConnectionLimit()));
		sct.setEL("connectionTimeout", d.getConnectionTimeout() < 1 ? "" : Caster.toString(d.getConnectionTimeout()));
		sct.setEL("metaCacheTimeout", Caster.toDouble(d.getMetaCacheTimeout()));
		sct.setEL("custom", d.getCustoms());
		sct.setEL("blob", Boolean.valueOf(d.isBlob()));
		sct.setEL("clob", Boolean.valueOf(d.isClob()));
		sct.setEL("validate", Boolean.valueOf(d.validate()));
		sct.setEL("storage", Boolean.valueOf(d.isStorage()));
		if (d instanceof DataSourceImpl) {
		    DataSourceImpl di = ((DataSourceImpl) d);
		    sct.setEL("literalTimestampWithTSOffset", Boolean.valueOf(di.getLiteralTimestampWithTSOffset()));
		    sct.setEL("alwaysSetTimeout", Boolean.valueOf(di.getAlwaysSetTimeout()));

		    sct.setEL("dbdriver", Caster.toString(di.getDbDriver(), ""));
		}
		pageContext.setVariable(getString("admin", action, "returnVariable"), sct);
		return;
	    }
	}
	throw new ApplicationException("there is no datasource with name [" + name + "]");
    }
142061
public void init() {

        // the current user name
        String userName = getSettings().getUser().getName();

        if (m_typesLocalized[0] == null) {
            m_typesLocalized[0] = key(Messages.GUI_LABEL_GROUP_0);
            m_typesLocalized[1] = key(Messages.GUI_LABEL_USER_0);
            m_typesLocalized[2] = key(Messages.GUI_LABEL_ROLE_0);
            m_typesLocalized[3] = key(Messages.GUI_LABEL_ALLOTHERS_0);
            m_typesLocalized[4] = key(Messages.GUI_LABEL_OVERWRITEALL_0);
        }

        // set flags to show editable or non editable entries
        setEditable(false);
        setInheritOption(false);
        String resName = getParamResource();

        try {
            // get the current users' permissions
            setCurPermissions(getCms().getPermissions(getParamResource(), userName));

            // check if the current resource is a folder
            CmsResource resource = getCms().readResource(getParamResource(), CmsResourceFilter.ALL);
            if (resource.isFolder()) {
                // only folders have the inherit option activated
                setInheritOption(true);
                if (!resName.endsWith("/")) {
                    // append manually a "/" to folder name to avoid issues with check if resource is in project
                    resName += "/";
                }
            }
        } catch (CmsException e) {
            // can usually be ignored
            if (LOG.isInfoEnabled()) {
                LOG.info(e.getLocalizedMessage());
            }
        }

        // check the current users permission to change access control entries
        if ((!getCms().getRequestContext().getCurrentProject().isOnlineProject()
            && getCms().isInsideCurrentProject(resName))
            && (OpenCms.getRoleManager().hasRole(getCms(), CmsRole.VFS_MANAGER)
                || (((m_curPermissions.getAllowedPermissions() & CmsPermissionSet.PERMISSION_CONTROL) > 0)
                    && !((m_curPermissions.getDeniedPermissions() & CmsPermissionSet.PERMISSION_CONTROL) > 0)))) {
            if (isBlockingLocked()) {
                m_errorMessages.add(key(Messages.ERR_PERMISSION_BLOCKING_LOCKS_0));
            } else {
                setEditable(true);
            }
        }
    }
613383
def connectWithAdminInfo(path=None):
    """"""

    if path is None:
        path = os.path.expanduser('~/.cjdnsadmin')
    try:
        with open(path, 'r') as adminInfo:
            data = json.load(adminInfo)
    except IOError:
        logger.info('~/.cjdnsadmin not found; using default credentials', file=sys.stderr)
        data = {
            'password': 'NONE',
            'addr': '127.0.0.1',
            'port': 11234,
        }

    return connect(data['addr'], data['port'], data['password'])
1062528
public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
      throws RemoteException {
    LabelServiceInterface labelService =
        adManagerServices.get(session, LabelServiceInterface.class);

    // Create a statement to select labels.
    StatementBuilder statementBuilder =
        new StatementBuilder()
            .where("isActive = :isActive")
            .orderBy("id ASC")
            .limit(StatementBuilder.SUGGESTED_PAGE_LIMIT)
            .withBindVariableValue("isActive", true);

    // Retrieve a small amount of labels at a time, paging through
    // until all labels have been retrieved.
    int totalResultSetSize = 0;
    do {
      LabelPage page = labelService.getLabelsByStatement(statementBuilder.toStatement());

      if (page.getResults() != null) {
        // Print out some information for each label.
        totalResultSetSize = page.getTotalResultSetSize();
        int i = page.getStartIndex();
        for (Label label : page.getResults()) {
          System.out.printf(
              "%d) Label with ID %d and name '%s' was found.%n",
              i++, label.getId(), label.getName());
        }
      }

      statementBuilder.increaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT);
    } while (statementBuilder.getOffset() < totalResultSetSize);

    System.out.printf("Number of results found: %d%n", totalResultSetSize);
  }
742868
def check_is_admin(context):
    """"""
    init()
    credentials = context.to_policy_values()
    target = credentials
    return _ENFORCER.authorize('admin_required', target, credentials)
902394
protected synchronized void removeAdminObjectService(ServiceReference<AdminObjectService> reference) {
        String id = (String) reference.getProperty(ADMIN_OBJECT_CFG_ID);
        if (id != null) {
            removeAdminObjectService(reference, id, false);

            String jndiName = (String) reference.getProperty(ADMIN_OBJECT_CFG_JNDI_NAME);
            if (jndiName != null && !jndiName.equals(id)) {
                removeAdminObjectService(reference, jndiName, true);
            }
        }
    }