All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.uiuc.ncsa.sas.client.ClientProvider Maven / Gradle / Ivy

There is a newer version: 5.4.3
Show newest version
package edu.uiuc.ncsa.sas.client;

import edu.uiuc.ncsa.sas.SASConstants;
import edu.uiuc.ncsa.security.core.IdentifiableProvider;
import edu.uiuc.ncsa.security.core.Identifier;
import edu.uiuc.ncsa.security.core.util.BasicIdentifier;
import edu.uiuc.ncsa.security.core.util.StringUtils;

import java.util.UUID;

/**
 * 

Created by Jeff Gaynor
* on 8/15/22 at 9:39 AM */ public class ClientProvider implements IdentifiableProvider, SASConstants { @Override public V get(boolean createNewIdentifier) { Identifier id = null; if(createNewIdentifier){ id = new BasicIdentifier(CLIENT_ID_HEAD + UUID.randomUUID() + "/" + System.currentTimeMillis()); } return (V) new SASClient(id); } @Override public V get() { return get(true); } public static boolean isClientID(String x){ if(StringUtils.isTrivial(x)) return false; return x.startsWith(CLIENT_ID_HEAD); } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy